1 Introduction

NMR logging directly measures the signal from protons in the fluid in formation of pores. Its applications include fluid typing, porosity calculation, permeability estimation, fluid saturation determination, and bound water estimation. NMR logging interpretation is based on the inverted T2 distributions from acquired echo trains. NMR T2 inversion is an ill-posed problem, so it is critical to choose a robust and efficient inversion method to obtain credible NMR spectra. For NMR T2 inversion, scholars have proposed many kinds of inversion methods. Butler, Reeds, and Dawson (BRD) proposed a method to solve norm smoothing with a non-negative constraint of solution (Butler et al. 1981). Dunn et al. (1994) proposed another method for solving norm smoothing with a non-negative constraint of solution. Prammer (1994) used the singular value decomposition (SVD) method for NMR T2 inversion, and adopted a series of measures to improve the inversion speed for the purpose of real-time processing. Borgia et al. (1998) put forward a complex curvature smoothing method which is called uniform-penalty (UPEN) method, and then made further modifications to the method which allows the regularization parameter to be a variable in the iterative process (Borgia et al. 2000). The SVD method implements the non-negative constraint of solution by singular value truncation which decreases the accuracy of the solution (Prammer 1994; Ge et al. 2016). For the SVD method, the low signal-to-noise ratio of NMR logging data leads to a large cutoff of singular value, which seriously decreases the accuracy of the solution. Norm smoothing and curvature smoothing can usually obtain more satisfactory solutions than the SVD method.

The critical issue of norm smoothing and curvature smoothing methods (Dunn et al. 1994) is to determine the optimal regularization parameter. The different optimal regularization parameters selected by different regularization parameter selection methods will cause slightly different inversion results. The published literature mainly used the BRD (Butler et al. 1981) and S-curve (Sezginer 1994; Song et al. 2002) methods to select the regularization parameter for NMR T2 inversion. Compared with BRD method, the S-curve method does not need to know the noise level. Except for the above two methods, the generalized cross-validation (GCV) (Golub et al. 1979) and L-curve (Hansen 1992) methods are often widely used to select the regularization parameter for data inversion in many fields. But every regularization parameter selection method has its own advantages and disadvantages. For different inversion problems, we need to comprehensively account for both the amount of calculation and the accuracy of inversion result to determine the most satisfactory parameter selection method for the studied inverse problem. For NMR logging T2 inversion, we implement the inversion procedure at each well-logging depth point, so inversion speed should also be an important consideration. This paper implemented norm smoothing and curvature smoothing methods for NMR T2 inversion, and compared the inversion results with respect to the optimal regularization parameters which were selected by the DP, GCV, S-curve, L-curve, and the slope of L-curve methods, respectively.

2 NMR T2 inversion

The measured echo amplitude of NMR logging using a Carr–Purcell–Meiboom–Gill (CPMG) pulse sequence with sufficient polarization time has the following equation:

$$b(t) = \int f ({\text{T}}_{2} )\exp \left( { - t/{\text{T}}_{2} } \right){\text{dT}}_{2} + \varepsilon ,$$
(1)

where b(t) is the echo amplitude at time t, T2 is the transverse relaxation time, exp(−t/T2) is the kernel function, f(T2) is the amplitude of T2 distribution, and ε is noise.

The discrete form of Eq. (1) is

$$A_{m \times n} f_{n \times 1} = b_{m \times 1} + \varepsilon_{m \times 1} ,$$
(2)

where A m×n is kernel matrix, f n×1 = [f(T2,1), …, f(T2,n )]T, b m×1 = [b(t 1), …, b(t m )]T.

As is known, NMR T2 inversion is an ill-posed problem, so regularization terms are needed to be added. The most common form of regularization is the Tikhonov regularization, which has the following objective function:

$$\hbox{min} \left\{ {\phi (f) =\frac{1}{2} \left\| {W (Af - b )} \right\|^{2}\,+\,\frac{\alpha}{2} \left\| {Lf} \right\|^{2} } \right\},$$
(3)

where ||·|| means Euclidean norm and W is a weighted matrix whose diagonal elements equal to the reciprocal of the noise level. If the noise level of data is a constant, W can be an identity matrix. L is the regularization matrix, can be a zero-, or first-, or second-derivative operator which corresponds to norm smoothing, slope smoothing, and curvature smoothing (Dunn et al. 1994). α is the regularization parameter.

To obtain the non-negative constraint of solution, the iterative solution is commonly made by eliminating the columns of kernel matrix corresponding to the negative components in the solution or replacing them with large constants. Unlike the above-mentioned methods, we use a variable substitution method to obtain a non-negative constraint of solution, in which the solution is substituted by a non-negative expression. For example, set f = exp(x) or x 2, the above objective function of Eq. (3) can be rewritten as

$$\hbox{min} \left\{ {\phi (x) = \frac{1}{2}\left\| {W\left( {A\exp (x) - b} \right)} \right\|^{2}\,+\, \frac{\alpha}{2} \left\| {L\exp (x)} \right\|^{2} } \right\},$$
(4a)

or

$$\hbox{min} \left\{ {\phi (x) =\frac{1}{2} \left\| {W(Ax^{2} - b)} \right\|^{2}\,+\,\frac{\alpha}{2} \left\| {Lx^{2} } \right\|^{2} } \right\}.$$
(4b)

The objective functions of Eqs. (4a) and (4b) without constraint conditions can be solved by the Levenberg–Marquardt method, an iterative method. The new solution x new is updated by the following equations (Madsen and Nielsen 2010):

$$(\phi^{{\prime \prime }} + \mu I)\Updelta x = - \phi^{{\prime }} ,$$
(5)
$$x_{\text{new}} = x_{\text{old}} +\Updelta x,$$
(6)

where I is an identity matrix, \(\phi^{{\prime }}\) is the gradient of objective function, \(\phi^{{\prime \prime }}\) is the Hessian matrix of objective function, μ is a parameter that can be updated in every iteration by the updating strategy of Madsen and Nielsen (Madsen and Nielsen 2010).

By calculating the partial derivatives of the objective functions of Eqs. (4a) and (4b) with respect to x, we can obtain the gradients \(\phi^{{\prime }}\) and approximate symmetric positive definite Hessian matrices \(\phi^{{\prime \prime }}\) of the objective functions of Eqs. (4a) and (4b), respectively.

For f = exp(x),

$$\phi^{{\prime }} = \left( {W \cdot A \cdot {\text{diag}}\left( {\text{exp}(x)} \right)} \right)^{\text{T}} \left( {W \cdot A \cdot {\text{exp(}}x )- W \cdot b} \right) + \alpha \left( {L \cdot {\text{diag(exp(}}x ) )} \right)^{\text{T}} \left( {{L} \cdot {\text{exp(}}x )} \right),$$
(7a)
$$\phi^{{\prime \prime }} \approx \left( {W \cdot A \cdot {\text{diag}}\left( {{\text{exp(}}x )} \right)} \right)^{\text{T}} \left( {W \cdot A \cdot {\text{diag}}\left( {{\text{exp(}}x )} \right)} \right) + \alpha \left( {L \cdot {\text{diag}}\left( {{\text{exp(}}x )} \right)} \right)^{\text{T}} \left( {L \cdot {\text{diag}}\left( {{\text{exp(}}x )} \right)} \right).$$
(7b)

For f = x 2,

$$\phi^{{\prime }} = 2.0 \cdot \left( {W \cdot A \cdot {\text{diag(}}x )} \right)^{\text{T}} \left( {W \cdot A \cdot x^{2} - W \cdot b} \right) + 2.0 \cdot \alpha \left( {L \cdot {\text{diag(}}x )} \right)^{\text{T}} (L \cdot x^{2} ),$$
(8a)
$$\phi^{{\prime \prime }} \approx 4.0 \cdot \left( {W \cdot A \cdot {\text{diag(}}x )} \right)^{\text{T}} \left( {W \cdot A \cdot {\text{diag(}}x )} \right) + 4.0 \cdot \alpha \left( {L \cdot {\text{diag(}}x )} \right)^{\text{T}} \left( {L \cdot {\text{diag(}}x )} \right),$$
(8b)

where diag(exp(x)) and diag(x) are diagonal matrices which are generated by vectors exp(x) and x, respectively.

3 Regularization parameter selection

Since a too small or too large regularization parameter can result in an undersmoothed or oversmoothed solution, it is critical to choose an optimal regularization parameter (α opt). The commonly used regularization parameter selection methods include the DP, GCV, S-curve, and L-curve methods (Morozov 1966; Golub et al. 1979; Sezginer 1994; Hansen 1992).

3.1 Discrepancy principle (DP)

If the noise level σ is known, the DP (Morozov 1966) suggests that the α opt should be chosen to satisfy the following equation:

$$\zeta (\alpha ) = \left\| {Af - b} \right\|^{2} = \tau m\sigma^{2} ,$$
(9)

where m is the number of the echoes of the echo train b. τ ≥ 1 is a predetermined real number, typically τ = 1.

Figure 1 shows the typical “S” shape curves of the variation of regularization parameter (α) with residual norm (ζ(α)) for norm smoothing and curvature smoothing. This method needs to know the noise level σ, but sometimes it is difficult to estimate an accurate σ.

Fig. 1
figure 1

The variation of residual norm with regularization parameter. a Norm smoothing, b curvature smoothing

3.2 Generalized cross-validation (GCV)

The GCV method was proposed by Golub et al. (1979) to find the α opt that minimizes the GCV function. For Tikhonov regularization, the GCV function is

$$G(\alpha ) = \frac{{\left\| {b - Af_{\alpha } } \right\|^{2} }}{{{\text{trace}}\left( {{{I}} - AA^{{{\# }}} } \right)^{2} }},$$
(10)

where I is an identity matrix, A # denotes the regularized pseudo-inverse of A, f α  = A # b. For Tikhonov regularization, \(A^{\# } = (A^{\text{T}} A + \alpha L^{\text{T}} L)^{ - 1} A^{\text{T}} .\)

Figure 2 shows the variation of the GCV function value with a regularization parameter (α) for norm smoothing and curvature smoothing. As shown in Fig. 2, as α increases, the GCV function value first decreases and then increases.

Fig. 2
figure 2

The variation of GCV function value with regularization parameter. a Norm smoothing, b curvature smoothing

3.3 S-curve

The S-curve method (Sezginer 1994; Song et al. 2002) finds the minimum α as α opt that satisfies

$$\frac{{{\text{d}}\log \zeta }}{{2{\text{d}}\log \alpha }} = tol,$$
(11)

where 0 < tol < 1 is a predetermined constant, typically tol = 0.1.

This method uses the slope of the S-curve as the criterion of α opt selection. Eq. (21) in Appendix shows the specific formula of the slope of S-curve. The heel of the S-curve is selected as α opt, which balances the residual and known noise variance (Song et al. 2002).

Figure 3 shows the variation of slope of S-curve with regularization parameter (α). Typically, the slope of the S-curve gradually increases at first, then remains at a large value, and finally gradually decreases. We choose the smallest α that satisfies the Eq. (11) as α opt.

Fig. 3
figure 3

The variation of slope of the S-curve with regularization parameter. a Norm smoothing, b curvature smoothing

3.4 L-curve

As α increases, solution norm η(α) = ||Lf||2 decreases, while residual norm ζ(α) increases. In the log–log scale, the curve formed by η(α) versus ζ(α) for each of a set of α has an “L” shape, so it is called the L-curve. The method was proposed by Lawson and popularized by Hansen (Hansen 1992).

Figure 4 shows the typical L-curves of norm smoothing and curvature smoothing. Intuitively, α opt should lie on the “corner” of the L-curve, for values higher than this “corner”, ζ(α) increases without reducing η(α) too much, while for values smaller than this “corner”, ζ(α) decreases little but with a rapid increase of η(α).

Fig. 4
figure 4

L-curve. a Norm smoothing, b curvature smoothing

People have proposed many kinds of methods to locate the “corner” (the point of maximum curvature) of the L-curve. Castellanos et al. (2002) analyzed the drawbacks of three methods for finding the corner of L-curve (Kaufman and Neumaier 1996; Hansen 1998; Guerra and Hernandez 2001), and proposed a robust triangle method. Hansen et al. (2007) proposed an adaptive pruning algorithm, which first calculates the corner candidates at different scales or resolutions and then selects the overall optimal corner from the candidates. The above-mentioned methods are indirect methods to calculate the corner of L-curve. However, indirect methods cannot guarantee correct results in all cases. This article gives an Eq. (27) for directly calculating the curvature of the L-curve of single-parameter Tikhonov regularization, and the specific derivation is shown in Appendix. Figure 5 shows the variation of the curvature of L-curve with regularization parameter (α).

Fig. 5
figure 5

The variation of the curvature of L-curve with regularization parameter. a Norm smoothing, b curvature smoothing

3.5 The slope of the L-curve

Comparing the S-curve (Fig. 1) with the L-curve (Fig. 4), we can see that the two types of curves have similar shapes. If we exchange the horizontal and vertical coordinates of the L-curve, the resulting curve is the mirror image of the S-curve. It naturally refers us to the S-curve method, so we can use the slope of the L-curve to select the regularization parameter. According to Eq. (24), the slope of the L-curve has a simple formula and can avoid the matrix inversion of the S-curve method (see Eq. (21)). Figure 6 shows the variation of the reciprocal of the absolute value of the slope of the L-curve with regularization parameter (α). Comparing Fig. 6 with Fig. 3, it can be found that the two types of curves have striking similarities. So, we attempt to use the slope of the L-curve criterion to select the regularization parameter, and compare its results with those of the other methods. The threshold of the reciprocal of the absolute value of the slope of the L-curve can be selected in the interval [0.1, 10]. Here we choose the threshold values of 5 and 0.25 for norm smoothing and curvature smoothing methods, respectively.

Fig. 6
figure 6

The variation of the reciprocal of the absolute value of the slope of L-curve with regularization parameter. a Norm smoothing, b curvature smoothing

4 Numerical results

A bimodal T2 distribution model is constructed as shown in Fig. 7, where 64 T2 components are preselected between 0.1 and 10,000 ms. Using this T2 distribution model, we generated echo trains with 500 echoes, where echo spacing is 0.9 ms. Different level Gaussian random noise was applied, as shown in Fig. 8. The red line represents the echo train without noise, and the green, blue, magenta, and black lines show the echo trains with noise levels of 0.25, 0.5, 1.0, and 2.0 porosity unit (pu), respectively.

Fig. 7
figure 7

The T2 distribution model

Fig. 8
figure 8

The computed echo trains from T2 distribution model with different noise levels

To improve the inversion speed of NMR echo data, the echo trains are usually compressed before inversion (Sezginer 1994; Dunn and LaTorraca 1999; Venkataramanan et al. 2002; Zou and Xie 2015). Here, we compress the NMR echo data with the SVD method (Sezginer 1994; Zou and Xie 2015). After compression, echoes in each echo train shown in Fig. 8 are all compressed to 20 data points for NMR T2 inversion.

We select optimal regularization parameters (α opt) by the DP, GCV, S-curve, L-curve, and the slope of L-curve methods, respectively, and compare the NMR T2 inversion results from different regularization parameter selection methods. Figure 9 shows the NMR T2 inversion results of norm smoothing and curvature smoothing methods with respect to noise levels of 0.25, 0.5, 1.0, and 2.0 pu. The black line is the T2 distribution model, and the green, blue, magenta, red, and cyan lines are the T2 distribution inversion results according to the DP, GCV, S-curve, L-curve, and the slope of L-curve methods, respectively. As shown in Fig. 9, the selected α opt from the DP method is sometimes small or large (because of the underestimated or overestimated echo data noise level) that leads to an undersmoothed or oversmoothed solution. The α opt selected by L-curve method is occasionally small or large which leads to an undersmoothed or oversmoothed T2 distribution. The inversion results from the GCV, S-curve, and the slope of L-curve methods are close and satisfactory. Curvature smoothing can better suppress the oscillation caused by noise than norm smoothing, and can obtain a smoother solution than norm smoothing. The curvature smoothing makes the inverted T2 distribution prone to show single peak shape than norm smoothing when the noise level is high. Table 1 shows the porosity errors of different regularization parameter selection methods, and finds that the DP method occasionally obtains a large porosity error, and the porosity errors of the GCV, S-curve, L-curve, and slope of L-curve methods are close.

Fig. 9
figure 9figure 9

The inversion results from different regularization parameter selection methods. i Noise level is 0.25 pu. a norm smoothing; b curvature smoothing. ii Noise level is 0.5 pu. a norm smoothing; b curvature smoothing. iii Noise level is 1.0 pu. a norm smoothing; b curvature smoothing. iv Noise level is 2.0 pu. a norm smoothing; b curvature smoothing

Table 1 Porosity errors obtained from different regularization parameter selection methods (unit: pu)

5 Well data processing results

Well A is in a tight sandstone reservoir with low porosity. The signal-to-noise ratio (SNR) of the NMR logging data is low. Figure 10 shows the inverted T2 distributions of norm smoothing, where the fourth track represents the inverted T2 distributions of the SVD method, the fifth to ninth tracks represent the inversion results of the DP, GCV, S-curve, L-curve, and slope of L-curve methods, respectively. As shown in Fig. 10, the inverted T2 distributions of the SVD method, usually with single peak shapes, are oversmoothed. The inverted T2 distributions of norm smoothing are satisfactory. The inverted T2 distributions from the DP and L-curve methods are slightly oversmoothed. However, the inverted T2 distributions from the GCV and S-curve methods are slightly undersmoothed. The inverted T2 distributions from the slope of L-curve method are relatively more satisfactory than those from other methods.

Fig. 10
figure 10

The inversion results of NMR logging data

6 Conclusions

This paper uses the Tikhonov regularization with a non-negative constraint of solution for NMR T2 inversion. The non-negative constraint of solution is implemented by variable substitution, and then the modified objective function is solved by the Levenberg–Marquardt method. The optimal regularization parameters (α opt) from norm smoothing and curvature smoothing methods are selected by the DP, GCV, S-curve, L-curve, and the slope of L-curve methods, respectively. The following conclusions are obtained.

  1. (1)

    The inverted NMR T2 distributions from the DP method depend on the estimated noise level which is difficult to estimate accurately. The inversion results from the GCV, S-curve, and the slope of L-curve methods are satisfactory. The small or large α opt selected by the L-curve method leads to an oscillation or oversmoothed T2 distribution. When the noise level is high, norm smoothing can more effectively than curvature smoothing avoid the bimodal T2 distribution being converted to a single peak distribution. The inverted T2 distribution of norm smoothing is better than that of curvature smoothing.

  2. (2)

    The GCV and L-curve methods need to calculate the solution of the regularization parameter over a wide range, which needs a large amount of calculation. The S-curve and the slope of L-curve methods can quickly find the α opt by iteration, suitable for norm smoothing and curvature smoothing. The slope of L-curve method needs less calculation than the S-curve method does, but the T2 inversion results from these two methods are close. So, the slope of the L-curve method can be an efficient alternative to the S-curve method.