Abstract The quality factor (Q) is a parameter reflecting the physical properties of reservoirs. Accurate estimation of the quality factor plays an important role in improving the resolution of seismic data. Spectral-ratio method is a widely used traditional method based on the linear least-squares fitting to extract the quality factor, but is sensitive to noise. This is the main reason preventing this method from being widely used. Some supervised deep-learning methods are proposed to extract Q in which the construction of training labels is a key link. The proposed method is based on the spectral-ratio method to create training labels, avoiding errors in generating them. In contrast to the least-squares method, this paper proposes to use a nonlinear regression algorithm based on a fully connected network to fit the spectral logarithmic ratio and frequency. Meanwhile, the empirical equation is applied to constrain prediction results. The proposed method can effectively overcome the influence of noise and improve the accuracy of prediction results. Tests on the synthesized data of vertical seismic profile and common middle profile show that the proposed method has better generalization ability than the spectral-ratio method. Applying the method to the field vertical seismic profile data successfully extracts the quality factor, which can provide effective information for dividing stratigraphic layers.