Nuclear magnetic resonance logging echo signal denoising algorithm
By combining maximum likelihood estimation and total variational denoising algorithm with gradient descent optimization method, the problem of noise affecting nuclear magnetic resonance logging signals under low signal-to-noise ratio was solved, and effective denoising of the signal and accurate determination of T2 spectrum were achieved.
Patent Information
- Application Number
- CN202410472664.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-19
- Publication Date
- 2025-10-24
AI Technical Summary
Existing technologies struggle to effectively suppress noise under low signal-to-noise ratio conditions, leading to inaccurate inversion results from nuclear magnetic resonance logging echo signals. In particular, noise can overwhelm clean signals at lower signal-to-noise ratios, affecting data quality.
A denoising algorithm based on maximum likelihood estimation and total variation denoising is adopted. By constructing an objective function and gradient descent optimization method, combined with adaptive learning rate to update parameters, noise is removed iteratively and the signal is reconstructed step by step.
Effective signal denoising was achieved at a low signal-to-noise ratio, which improved the signal-to-noise ratio of nuclear magnetic resonance logging data and ensured the accurate measurement of the T2 spectrum with an error of less than 5%.
Smart Images

Figure CN120831723A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of signal processing, in particular to a nuclear magnetic resonance logging echo signal denoising algorithm. BACKGROUND
[0002] The downhole instrument working environment has the characteristics of high temperature, vibration and high pressure, and various factors inevitably cause large noise and small signal-to-noise ratio. The signal-to-noise ratio (SNR) of the data detected by the nuclear magnetic resonance instrument is usually low, which undoubtedly affects the subsequent nuclear magnetic resonance data processing and interpretation work. First, the logging instrument is based on the interaction of hydrogen nuclei and an external magnetic field, and uses the magnetic field generated by a permanent magnet to magnetize hydrogen nuclei at a certain research depth to perform observation. Since the magnetic field is very weak and will change with the surrounding environment, the observation signal amplitude is low. Second, the porosity and permeability of unconventional reservoirs are low, resulting in low signal amplitude. When the data signal-to-noise ratio is low, the data quantity is usually increased to obtain the average value to meet the requirements of NMR data processing and interpretation. Although various inversion methods have appeared, the noise in the nuclear magnetic resonance signal still seriously affects the accuracy of the inversion result. Therefore, it is necessary to effectively suppress the noise introduced by the instrument and the surrounding environment to further improve the signal-to-noise ratio of the original echo data.
[0003] The slight interference of noise in the echo data will cause the deviation of the inversion result. In addition, using machine learning methods to directly invert the echo data, suppressing the uncertainty of the numerical solution, and improving the resolution of one-dimensional or two-dimensional distribution are new research directions of nuclear magnetic resonance data processing. However, the artificial network method needs a large number of labeled data sets to train the model, and in addition, the sparse Bayesian learning method needs prior knowledge of the initial inversion result of the echo data to provide overlapping information of the two-dimensional distribution.
[0004] The above existing denoising methods generally transform the signal to separate the noise by using its sparsity, such as wavelet transform, SVD, DWT, etc. There are certain application limitations, such as in a low signal-to-noise ratio, noise will affect or even drown out the clean signal. Therefore, when solving the ill-posed equation set in the inversion process, in order to avoid the influence of noise, it is necessary to explore a suitable signal reconstruction denoising algorithm. SUMMARY
[0005] Based on the problems existing in the prior art, the present application aims to solve the technical problem that the signal denoising in the prior art will affect or even drown out the clean signal in a low signal-to-noise ratio.
[0006] The present application provides a nuclear magnetic resonance logging echo signal denoising algorithm, which comprises the following steps:
[0007] S1: obtaining original echo signals y(t) of a nuclear magnetic resonance logging, and obtaining effective echo signals s(t) and a kernel function exp(-t / T2) from the original echo signals, where t is a sampling time, and T2 is a transverse relaxation time;
[0008] S2: calculating a denoising simulation signal z(t) based on the kernel function exp(-t / T2);
[0009] S3: calculating a gradient value g of noise based on the denoising simulation signal z(t) and the effective echo signals s(t) t , to update a weight of the kernel function exp(-t / T2) in the denoising simulation signal z(t);
[0010] S4: constructing a target function obj t based on a maximum likelihood estimation and a total variation denoising algorithm and using the denoising simulation signal z(t) and the effective echo signals s(t);
[0011] S5: obtaining a residual error ΔError by subtracting a value of the target function obj t at this time from a value at a previous time;
[0012] S6: setting a convergence threshold e, and judging whether the residual error ΔError is greater than the convergence threshold e, if yes, returning to step S2 to continue iteration; otherwise, outputting the denoising simulation signal z(t) at this time.
[0013] According to an embodiment of the present application, the step S4 of constructing the target function obj t based on the maximum likelihood estimation and the total variation denoising algorithm and using the denoising simulation signal z(t) and the effective echo signals s(t) includes:
[0014] discretizing the original echo signals y(t) to obtain N original single echo signals y1, y2,..., y i ,..., y N , and then constructing a first target function based on a joint probability density function of the N original single echo signals;
[0015] transforming the first target function into a target function obj t with a regularization term based on a total variation denoising algorithm model.
[0016] According to an embodiment of the present application, the first target function is:
[0017]
[0018] wherein μ is a mean value of noise, and σ 2is the variance of noise, N represents the total number of original single echo signals in the original echo signal y(t), s i is the single effective echo signal in the i-th single original echo signal y i .
[0019] According to an embodiment of the present application, the formula of the objective function obj t in step S4 is:
[0020]
[0021] Wherein, λ1 and λ2 are regularization parameters, N represents the total number of original single echo signals in the original echo signal y(t), f i represents the echo amplitude in the T2 spectrum inversion of the single original echo signal y i ; i represents the serial number of echo interval, σ 2 is the variance of noise, s i is the single effective echo signal in the i-th single original echo signal y i .
[0022] According to an embodiment of the present application, the formula of calculating the de-noised simulation signal z(t) in step S2 is:
[0023]
[0024] Wherein, i represents the serial number of echo interval, j represents the serial number of original echo signal, m represents the total number of original echo signals, W tj is the weight of the kernel function exp(-t / T2).
[0025] According to an embodiment of the present application, the formula of calculating the gradient value g t in step S3 is:
[0026]
[0027] Wherein, W TV is the hyperparameter of total variation de-noising.
[0028] According to an embodiment of the present application, between step S5 and S6, it further comprises updating the iteration number Iter; and step S6 further comprises:
[0029] When the residual error ΔError is greater than the convergence threshold e, it is judged whether the current iteration number is less than the maximum iteration number Iter Max , if yes, it continues iteration; otherwise, the de-noised simulation signal z(t) at this time is outputted.
[0030] According to an embodiment of the present application, the maximum iteration number Iter Max is 2000.
[0031] The present application has the following beneficial effects:
[0032] The echo signal denoising algorithm for nuclear magnetic resonance logging provided by the present application can obtain better denoising effect under lower signal-to-noise ratio, so that the T2 spectrum of the original formation characteristics can be determined more accurately. BRIEF DESCRIPTION OF DRAWINGS
[0033] In order to more clearly illustrate the technical solutions in the embodiments or the prior art, the drawings needed to be used in the following embodiment or prior art description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can also be obtained by those skilled in the art without any creative effort.
[0034] Figure 1 is a flowchart of the echo signal denoising algorithm for nuclear magnetic resonance logging provided by the present application;
[0035] Figure 2 is a single-peak echo curve graph without noise in the embodiment of the present application;
[0036] Figure 3 is a double-peak echo curve graph without noise in the embodiment of the present application;
[0037] Figure 4 is a T2 spectrum curve graph obtained by inverting the single-peak echo curve without noise in the embodiment of the present application;
[0038] Figure 5 is a T2 spectrum curve graph obtained by inverting the double-peak echo curve without noise in the embodiment of the present application;
[0039] Figure 6 is a single-peak echo curve graph with σ=1 intensity noise in the embodiment of the present application;
[0040] Figure 7 is a double-peak echo curve graph with σ=1 intensity noise in the embodiment of the present application;
[0041] Figure 8 is a T2 spectrum curve graph obtained by inverting the single-peak echo curve with σ=1 intensity noise in the embodiment of the present application;
[0042] Figure 9 is a T2 spectrum curve graph obtained by inverting the double-peak echo curve with σ=1 intensity noise in the embodiment of the present application;
[0043] Figure 10 is a single-peak echo curve graph with σ=10 intensity noise in the embodiment of the present application;
[0044] Figure 11is a double-peak echo curve graph with σ = 10 intensity noise in an embodiment of the present application;
[0045] Figure 12 is a T2 spectrum curve graph obtained by inverting a single-peak echo curve with σ = 10 intensity noise in an embodiment of the present application;
[0046] Figure 13 is a T2 spectrum curve graph obtained by inverting a single-peak echo curve with σ = 10 intensity noise in an embodiment of the present application. DETAILED DESCRIPTION
[0047] The following description of the embodiments is made with reference to the accompanying drawings, which illustrate specific embodiments in which the present application can be practiced.
[0048] The present application provides a denoising algorithm for echo signals of nuclear magnetic resonance logging, and a main flow thereof is as shown in Figure 1 , which comprises:
[0049] 1. A CPMG pulse sequence is transmitted, and an original echo signal y(t) is acquired by using a nuclear magnetic resonance logging instrument, and an effective echo signal s(t) is read therefrom, so that y(t) = s(t) + ε(t), wherein ε(t) is a noise signal. The original echo signal of nuclear magnetic resonance logging meets a first Fredholm integral equation:
[0050]
[0051] wherein a transverse relaxation time spectrum f(T2) is an amplitude value corresponding to a transverse relaxation time T2, and f(T2) is a non-negative value according to physical meaning; exp(-t / T2) is a kernel function, T2min is the shortest relaxation time that can be distinguished by an observed decay signal, and T2max is the longest relaxation time. Formula (1) is discretized, and the measured signal y(t) is a superposition of a series of echo signals meeting exponential decay characteristics, that is: i
[0052]
[0053] wherein m is the number of measured echoes, i represents the serial number of echo intervals, N is the number of transverse relaxation time T2 distributions, t i is an acquisition time controlled by an echo interval TE, f j represents a contribution value of a T 2j component zero-time signal amplitude, that is, an echo amplitude measured at t j when T2 spectrum inversion is performed.
[0054] A calculation formula of a denoising simulation signal is designed on the basis of formula (2):
[0055]
[0056] where W tj is the weight of the kernel function exp(-t / T2), W tj is initialized to 0.
[0057] 2. Constructing the objective function
[0058] Assuming that the echo noise is Gaussian distributed, the noise can be analyzed by maximum likelihood estimation, i.e. for a given observation data, find the parameters that can generate the observation data with the maximum probability as the estimation result. Let the mean of the noise ε(t) be μ = 0 and the variance be σ 2 , in this embodiment, set σ 2 = 0.25, then the probability density function of the noise is:
[0059]
[0060] where n is the input variable. Since s(t) and ε(t) are independent, μ = 0, the probability density function can be expressed as:
[0061]
[0062] Assuming that there are N observation data signals y1, y2,..., y i ,..., y N , the joint probability density function of them is:
[0063]
[0064] Taking the logarithm of both sides, we can get
[0065]
[0066] The goal of maximum likelihood estimation is to find the values of μ and σ 2 so that the above formula reaches the maximum. Therefore, the denoising problem is equivalent to solving the optimization problem of the first objective function shown below:
[0067]
[0068] According to the idea of the total variation denoising algorithm, the denoised signal is recovered from the noisy signal, then a noise correlation model is established, and the recovered signal is gradually close to the ideal denoised signal in the method of continuous iteration according to the optimization algorithm. The mathematical model is an optimization problem, and its objective function is composed of two parts: one part is the data fidelity term, which is used to measure the difference between the recovered signal and the original signal, and the other part is the regularization term, which is used to measure the smoothness of the signal. The data fidelity term usually uses the Euclidean distance or Kullback-Leibler divergence as the metric, and the regularization term uses the L1 norm of the gradient of the signal, that is:
[0069] min u TV(u)+λ|u-p| 2 (9)
[0070] Where p is the noisy signal, λ is the regularization parameter, which is a parameter for balancing the regularization term and the fidelity term, and |u-f| is the L1 norm.
[0071] The meaning of the objective function is to keep the signal smooth while making the denoised signal as close to the original signal as possible. The scheme refers to the structure of the objective function, and adds a balance regularization term in the signal reconstruction process, so that the denoised signal is as close to the original signal as possible.
[0072] To simplify the parameters, the initial values of the variance σ, the regularization parameters λ1 and λ2 are set according to the characteristics of the signal, the parameters of the signal are estimated by maximum likelihood, the noise is removed from the signal, and the regularization term and the smoothing term are added to the signal. Fit the real function. Combine equation (8) with equation (9) to get the objective function of the denoising problem:
[0073]
[0074] The above formula is used to convert the optimization problem of the first objective function into the solution problem of the objective function, and thus the denoising problem can be converted into the optimization problem of the objective function obj t .
[0075] The parameter estimation of μ and σ 2 can be realized by taking the partial derivative of μ and σ 2 in equation (8) respectively, and setting the partial derivative to zero, we get:
[0076]
[0077]
[0078] After sorting, we get:
[0079]
[0080]
[0081] The maximum likelihood estimate of the Gaussian noise is:
[0082]
[0083]
[0084] The signal s can be represented as:
[0085]
[0086] The total variation value function TV is:
[0087]
[0088] The regularization term is:
[0089]
[0090] Solving this optimization objective is similar to deep learning, where the noise model is like the loss function, and by continuously optimizing the training, the difference between the recovered signal and the ideal signal becomes smaller and smaller, and the gradient descent method is used to quickly obtain the optimal solution.
[0091] 3. Update parameters
[0092] To achieve fast convergence and reduce search time, the adaptive optimization algorithm based on gradient descent is used, which adjusts the learning rate of each parameter adaptively according to the historical gradient and update of each parameter in the training process. The specific implementation is as follows:
[0093] First, calculate the gradient value of the noise:
[0094]
[0095] where W TV is the hyperparameter of total variation denoising.
[0096] Secondly, calculate the moving average gradient and moving average square gradient in each time step, and use them to update the model parameters.
[0097] m t = β1m t-1 +(1-β1)g t
[0098]
[0099] Equation (18) defines two exponentially weighted averages, where m t is the exponentially weighted average of the gradient, and v tis the exponential weighted average of the square of the gradient, specifically, m0=0, v0=0. These two exponential weighted averages are used to adjust the learning rate of each parameter, so as to achieve the effect of adaptive learning rate. g t is the gradient of the parameter, and β1 and β2 are the decay coefficients of the two exponential weighted averages.
[0100] The corresponding estimated value is
[0101]
[0102]
[0103] wherein, and is the moving average of the deviation correction of the gradient, W t+1 is the updated parameter.
[0104] In the parameter initialization process of the scheme, e is a very small constant, which is used to avoid division by zero; α is the learning rate, Iter Max is used to control the maximum number of iterations, specifically, in this embodiment, e is set to 10 -6 , α is set to 0, and the maximum number of iterations Iter Max is 2000 times.
[0105] 4. Convergence condition
[0106] The current objective function obj t is subtracted from the previous time to obtain the residual:
[0107] ΔError = Obj t - Obj t-1 (20)
[0108] It is judged whether the residual ΔError is greater than the set error e, if it is satisfied, and is within the maximum number of iterations Iter Max , the updated parameter is used for the next calculation, until the convergence result is reached, otherwise the current denoising simulation signal z(t) is output.
[0109] To verify the signal reconstruction and denoising effect under different noise intensities, the algorithm of the scheme is tested with reference to the calibration tank echo signal. In the laboratory environment, the water tank is filled with copper sulfate solution with a concentration of 7.5×10-3mol / L. The antenna around the magnetic core is used as a magnetic field transmitting device, which transmits CPMG pulse sequence to the outside through the probe. The circuit receives the original echo signal and performs preprocessing and calibration.
[0110] Specifically, the parameters are set to NE = 1000 and TE = 0.6 ms. The transverse relaxation time T2 is logarithmically distributed in the range of 0.6 ms to 6000 ms, with a total of 10 points. The standard water tank echo is obtained by processing multiple echoes in an interference-free environment. The porosity after inversion is 100% as the original simulation data, and the default temperature compensation coefficient K = 1. This example compares the signal denoising effects of three cases: no noise, noise intensity of σ = 1, and noise intensity of σ = 10.
[0111] (1) No noise added
[0112] The single-peak and double-peak echo curves without noise are as follows Figure 2 and Figure 3 As shown, the black curve is the measured echo signal. The red curve is obtained by denoising and reconstructing the signal. It can be seen that the overlap is high.
[0113] respectively Figure 2 The two echo curves (i.e. black + red curves) and Figure 3 Invert the two echo curves in the image to get the T2 spectrum as Figure 4 and Figure 5 As shown, it can be observed that the curves completely overlap when no noise is added.
[0114] (2) Add intensity noise with σ = 1
[0115] Add noise with intensity σ=1 to the black original echo signal to construct a blue noisy signal, and perform signal reconstruction and denoising on the noisy signal to obtain a red denoised signal. The result is as follows Figure 6 and Figure 7 As shown, a high degree of overlap can be observed.
[0116] respectively Figure 6 The three echo curves (i.e. black + blue + red curves) and Figure 7 Invert the three echo curves in the image to get the T2 spectrum as shown in Figure 8 and Figure 9 As shown in the figure, it can be observed that the yellow denoised T2 spectrum curve is basically consistent with the blue clean T2 spectrum curve with a small error, while the green noisy signal deviates greatly from the first two curves, proving that the denoising effect is obvious.
[0117] (3) Add intensity noise of σ = 10
[0118] When the noise intensity increases to σ=10, the blue noisy signal is close to drowning the black original echo signal and the red denoised signal is obtained after signal reconstruction and denoising. The results are as follows Figure 10 and Figure 11 As shown, a high degree of overlap can be observed.
[0119] respectivelyFigure 10 three echo curves (i.e. black+blue+red curves) in Fig. 3 and Figure 11 Figure 12 Figure 13 As shown in Fig. 4 and Fig. 5, it can be observed that the blue clean T2 spectrum curve and the yellow denoised T2 spectrum curve basically fit, indicating that there is a certain error, and the green noisy signal deviates greatly from the former two curves, proving that the signal denoising reconstruction is still effective.
[0120] Table 1 Signal denoising porosity comparison of different noise intensities
[0121]
[0122] Table 1 shows the signal denoising porosity comparison results of different noise intensities of the present scheme. It can be seen that under the conditions of no noise and high signal-to-noise ratio (σ=1), the relative errors of the denoised T2 spectrum and the original T2 spectrum are 3.66% and 0.74%; under the condition of low signal-to-noise ratio (σ=10), the relative errors of the denoised T2 spectrum and the original T2 spectrum are 4.66% and 4.64%, and the maximum relative error of the signal reconstruction result is less than 5%, and the stability is good. Different types of T2 spectrum curves and different noise levels have different degrees of optimization, especially for the case of low signal-to-noise ratio, the deviation of the noisy inversion result is too large, and the optimization efficiency is very significant.
[0123] In summary, the echo signal denoising algorithm for nuclear magnetic resonance logging provided by the present application can obtain good denoising effect under low signal-to-noise ratio, so as to better and more accurately determine the T2 spectrum of the original formation characteristics.
[0124] It should be noted that although the present application is disclosed as above with specific embodiments, the above embodiments are not used to limit the present application, and those skilled in the art can make various changes and modifications without departing from the spirit and scope of the present application, therefore the protection scope of the present application is defined by the scope of the claims.
Claims
1. A de-noising algorithm for echo signals of a nuclear magnetic resonance well logging, characterized in that, The method comprises the following steps: S1: obtaining a raw echo signal y(t) of a nuclear magnetic resonance logging, and obtaining an effective echo signal s(t) and a kernel function exp(-t / T2) from the raw echo signal y(t), wherein t is a sampling time, and T2 is a transverse relaxation time; S2: calculating a denoising simulation signal z(t) based on the kernel function exp(-t / T2); S3: calculating a gradient value g of the noise based on the de-noised analog signal z(t) and the effective echo signal s(t) t to update the weight of the kernel function exp(-t / T2) in the de-noised analog signal z(t); S4: Constructing an objective function obj based on maximum likelihood estimation and total variation denoising algorithm and using the denoised analog signal z(t) and the effective echo signal s(t) t ; S5: The objective function obj t The difference between the value of and the value of the previous moment is the residual ΔError; S6: setting a convergence threshold e, and judging whether the residual error ΔError is greater than the convergence threshold e, if yes, returning to step S2 for iteration; otherwise, outputting the denoising simulation signal z(t) at this time.
2. The echo signal denoising algorithm of nuclear magnetic resonance well logging according to claim 1, characterized in that, In step S4, a target function obj is constructed based on a maximum likelihood estimation and a total variation denoising algorithm and using the denoised analog signal z(t) and the effective echo signal s(t) t , comprising: The original echo signal y(t) is discretely processed to obtain N original single-echo signals y1, y2,..., yN. i ,...,y N Then, a first target function is constructed based on a joint probability density function of the N original single-echo signals. Based on the total variation denoising algorithm model, the first objective function is converted into an objective function with a regularization term obj t .
3. The echo signal denoising algorithm of nuclear magnetic resonance well logging according to claim 2, characterized in that, The first target function is: where μ is the mean of the noise, σ 2 is the variance of the noise, N represents the total number of original single echo signals in the original echo signal y(t), s i is the single effective echo signal in the ith original single echo signal y i .
4. A denoising algorithm for NMR logging echo signals according to any of claims 2 or 3, characterized in that, The objective function obj in step S4 t The formula is: wherein λ1 and λ2 are regularization parameters, N represents the total number of single raw echo signals in the original echo signal y(t), f i represents the echo amplitude in the T2 spectrum inversion of a single raw echo signal y i ; i represents the serial number of the echo interval, σ 2 is the variance of the noise, s i is a single effective echo signal in the ith single raw echo signal y i .
5. The echo signal denoising algorithm of claim 1, wherein, The formula for calculating the denoising simulation signal z(t) in step S2 is: where i represents the sequence number of echo interval, j represents the sequence number of original echo signal, m represents the total number of original echo signals, W tj is the weight of the kernel function exp(-t / T2).
6. The echo signal denoising algorithm of claim 1, wherein, The gradient value g in step S3 t The calculation formula is: where W TV is the hyperparameter of total variation denoising.
7. The echo signal denoising algorithm of claim 1, wherein, Between steps S5 and S6, the iteration number Iter is also updated; and step S6 further comprises: When the residual error ΔError is greater than the convergence threshold e, it is determined whether the current iteration number is less than the maximum iteration number Iter Max If yes, the iteration is continued; otherwise, the de-noised simulation signal z(t) at this time is output.
8. The echo signal denoising algorithm of claim 7, wherein, The maximum number of iterations Iter Max is 2000.