Low-field NMR relaxation time correlation spectrum reconstruction method based on deep learning
By using a deep neural network model developed through deep learning, the problem of overlapping relaxation time spectra in the analysis of complex sample components in LF-NMR technology has been solved, achieving high-precision reconstruction of two-dimensional relaxation time correlation spectra, improving detection efficiency and the accuracy of results, and making it suitable for real-time monitoring in industries such as food, pharmaceuticals, petroleum, and chemicals.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-18
- Publication Date
- 2026-03-13
AI Technical Summary
Existing low-field nuclear magnetic resonance (LF-NMR) techniques suffer from severe overlap of relaxation time spectra and difficulty in resolution when analyzing the composition of complex samples. In particular, the reconstruction of two-dimensional relaxation spectra is poor under low signal-to-noise ratio conditions, and the accumulation of multiple scans leads to low experimental efficiency, making it difficult to meet the needs of real-time detection.
A deep learning-based approach is employed, constructing a deep neural network model that includes a convolutional denoising module and a GViT inversion module. A total loss function combining denoising loss, inversion loss, and forward modeling loss is used to achieve robust reconstruction of two-dimensional TD-NMR signals. This model utilizes convolutional layers to suppress noise interference, introduces a distance-aware attention mechanism to enhance feature extraction, and ensures the reasonableness of the reconstructed spectrum through physical constraints.
It achieves high-precision reconstruction of two-dimensional NMR relaxation time correlation spectrum under low signal-to-noise ratio conditions, improves data acquisition efficiency, reduces computational cost and time, is suitable for rapid analysis, and enhances its application value in real industrial scenarios.
Smart Images

Figure CN121661201A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of nuclear magnetic resonance technology, specifically relating to a method for reconstructing low-field NMR relaxation time correlation spectra based on deep learning. Background Technology
[0002] Low-field nuclear magnetic resonance (LF-NMR) technology is an important branch of nuclear magnetic resonance (NMR) technology. By detecting changes in the spin state of atomic nuclei in a sample, it can effectively obtain information related to the physical and chemical properties of the sample. The most significant feature of this technology is the use of permanent magnets, resulting in lower equipment manufacturing costs, a compact size for easy movement and installation, low energy consumption, and simple operation, making it suitable for both on-site and online detection scenarios. These characteristics have led to its widespread application in various industries such as food, pharmaceuticals, petroleum, and chemicals. Furthermore, LF-NMR technology exhibits excellent cost-effectiveness and high flexibility, making it particularly suitable for real-time monitoring and rapid analysis, with a very broad application prospect.
[0003] In low-field nuclear magnetic resonance (LF-NMR) technology, magnetic resonance relaxation time spectroscopy is widely used to detect the composition, structure, and kinetic properties of substances. Depending on the measurement parameters used, commonly used relaxation time spectra include... Spectrum (lateral relaxation time spectrum) Spectrum (Longitudinal relaxation time spectrum) The spectrum (diffusion coefficient spectrum) and the multidimensional spectrum composed of these parameters. These relaxation time spectra are not directly acquired by the magnetic resonance instrument, but are obtained by mathematical inversion and reconstruction of the acquired raw TD-NMR (time-domain NMR) signal. This process is called nuclear magnetic resonance relaxation spectrum reconstruction.
[0004] In low-field nuclear magnetic resonance (LF-NMR) techniques, one-dimensional relaxation spectra (such as...) , or One-dimensional spectroscopy is the most commonly used method. However, it cannot meet the needs of component analysis of complex samples. Its relaxation time components are numerous and complex, and overlap is prone to occur. The closer the peak positions are, the more severe the overlap, leading to difficulties in resolution and decreased discriminative ability. To solve this problem, relaxation time correlation spectroscopy has emerged. By introducing more dimensions of relaxation time information, it significantly improves the resolution and reliability of sample components. Therefore, it has attracted increasing attention from researchers in recent years and has become an important direction in the development of LF-NMR methods.
[0005] Research on relaxation time correlation spectrum reconstruction methods has mainly focused on two-dimensional systems. This method extends relaxation information to two dimensions, typically representing the transverse relaxation time in one dimension. Another dimension represents the longitudinal relaxation time ( This allows for a clearer distinction between different components in the sample and enables accurate quantitative analysis of various components.
[0006] Dimensional expansion typically introduces more significant noise. Conventional relaxation time inversion reconstruction is essentially an inverse problem with severe ill-conditioning; even minor noise interference can lead to significant deviations in the solution. Reconstructing high-precision relaxation time correlation spectra relies on time-domain nuclear magnetic resonance (TD-NMR) signals with high signal-to-noise ratios. Currently, multiple scans to accumulate the signal are commonly used to improve the SNR, but this significantly prolongs sampling time, reduces experimental efficiency, and limits its application in real-time or rapid detection scenarios. Therefore, developing methods that can achieve stable and accurate two-dimensional relaxation spectrum reconstruction under low SNR conditions has become a critical problem urgently needing to be solved in this field. Summary of the Invention
[0007] The purpose of this invention is to address the shortcomings of existing technologies by providing a deep learning-based method for reconstructing the relaxation time correlation spectrum of low-field NMR.
[0008] The above-mentioned objective of this invention is achieved through the following technical solution:
[0009] A deep learning-based method for reconstructing the relaxation time correlation spectrum of low-field NMR includes the following steps:
[0010] Step 1: Obtain the sample pair dataset. Each sample pair in the dataset includes the original TD-NMR data, the corresponding noiseless TD-NMR data, and the NMR relaxation time correlation spectral label.
[0011] Step 2: Build a deep neural network model, which includes a convolutional denoising module and a GViT inversion module.
[0012] Step 3: Construct the total loss function, which includes denoising loss, inversion loss, and forward modeling loss;
[0013] Step 4: Train the deep neural network model using the sample dataset;
[0014] Step 5: Input the original TD-NMR data to be inverted into the trained deep neural network model for prediction, and output the corresponding predicted NMR relaxation time correlation spectrum.
[0015] As described above, step 1 includes the following steps:
[0016] Step 1.1: Predefine the sampling parameters of the pulse sequence corresponding to the original TD-NMR data and the parameters of the NMR relaxation time correlation spectral label; based on the sampling parameters of the pulse sequence and the number and range of points of the NMR relaxation time correlation spectral label, construct the corresponding first inversion kernel and second inversion kernel;
[0017] Step 1.2: Determine the number of spectral peaks in the NMR relaxation time correlation spectral labels, and generate corresponding logarithmic peak coordinate values based on the determined number of peaks; based on the obtained peak coordinate values, generate simulated NMR relaxation time correlation spectral labels with a fixed half-width at half-maximum and random relative amplitudes in the two-dimensional logarithmic domain. ;
[0018] Step 1.3: Based on the simulated NMR relaxation time correlation spectral labels The noise-free TD-NMR data is obtained by performing forward modeling using the first inversion kernel and the second inversion kernel constructed in step 1.1. Simulated noise is then added to the noise-free TD-NMR data to obtain the simulated original TD-NMR data.
[0019] Step 1.4, the Each sample pair is denoted as , No. The raw TD-NMR data in each sample pair are denoted as follows: , No. The noiseless TD-NMR data in each sample pair are denoted as follows: , No. The NMR relaxation time correlation spectral labels in each sample pair are denoted as . .
[0020] When the pulse sequence corresponding to the original TD-NMR data acquired as described above is an IR-CPMG pulse sequence, the corresponding first and second inversion kernels are constructed according to the following formula:
[0021] ,
[0022] ,
[0023] in, Indicates the recovery time. Indicates the echo time. Indicates the longitudinal relaxation time. Indicates the lateral relaxation time. This represents the first inversion kernel, which belongs to the inversion kernel of the IR pulse sequence. This indicates the second inversion kernel, which belongs to the inversion kernel of the CPMG pulse sequence.
[0024] As described above, the convolutional denoising module includes m convolutional layers, where m ≥ 2. The output of the last convolutional layer in the convolutional denoising module is added element-wise to the input of the first convolutional layer, and the result is used as the output of the convolutional denoising module and input to the GViT inversion module.
[0025] As described above, the GViT inversion module sequentially includes a data block embedding module, a GViT encoder, and a converter:
[0026] The data block embedding module consists of a data segmentation module, a linear layer, and a location embedding module. The input to the data block embedding module is the raw TD-NMR data. The denoised NMR two-dimensional relaxation signal obtained after denoising by the convolution denoising module is the embedding vector output by the position embedding module.
[0027] The GViT encoder includes one or more GVT coding modules, each of which sequentially includes a Gaussian multi-head self-attention mechanism module (GMHSA) and a feedforward neural layer (FFN).
[0028] The Gaussian multi-head self-attention mechanism module GMHSA includes an attention mechanism layer and a linear transformation layer. The attention mechanism of the attention mechanism layer is as follows:
[0029] ;
[0030] in, , , The first The feature matrices corresponding to each attention head are denoted as feature matrices. The feature matrix of the first GVT coding module , , Obtained from the embedding vector; Scale factor; This represents the result of the Gaussian kernel function operation; intermediate quantities obtained from the calculation of each attention head. After being concatenated, the input is fed into the linear transformation layer of the current Gaussian multi-head self-attention mechanism module GMHSA;
[0031] The feedforward neural layer FFN sequentially includes a regularization layer and multiple linear transformation layers. Activation functions are set between the linear transformation layers in the feedforward neural layer FFN, and the output of the last linear transformation layer is the output of the feedforward neural layer FFN.
[0032] The converter sequentially includes a mean pooling layer, a regularization layer, a linear transformation layer, and a reconstruction deformation module.
[0033] In each GVT coding module as described above, the input and output of the Gaussian multi-head self-attention mechanism module GMHSA are added element-wise to obtain the input of the corresponding feedforward neural layer FFN, and the input and output of the feedforward neural layer FFN are added element-wise to obtain the output of the current GVT coding module.
[0034] As mentioned above, the total loss function is:
[0035] ,
[0036] in, , , These are the weight values for denoising loss, inversion loss, and forward loss, respectively, all set within the range of [0,1].
[0037] For noise reduction loss:
[0038] ,
[0039] It is the size of the learning batch. It is the L2 norm. The index of the sample pair. These are the neural network parameters of the denoising module; This represents the mapping relationship between the input raw TD-NMR data and the denoised NMR two-dimensional relaxation signal;
[0040] For inversion loss:
[0041] ,
[0042] in, Indicates the first Each sample pair corresponds to the denoised two-dimensional NMR relaxation signal. ; This represents the network parameters of the GViT inversion module;
[0043] Indicates forward modeling loss:
[0044] ,
[0045] in, To predict NMR relaxation time correlation spectra; and These are the first inversion nucleus and the second inversion nucleus, respectively.
[0046] As mentioned above, the weight values of the inversion loss Not less than half of the total weight, and the total weight is equal to .
[0047] A computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement steps 2-5 of any of the deep learning-based low-field NMR relaxation time correlation spectrum reconstruction methods described in the present invention.
[0048] A computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements steps 2-5 of any of the deep learning-based low-field NMR relaxation time-correlation spectrum reconstruction methods described in the present invention.
[0049] Compared with the prior art, the present invention has the following advantages:
[0050] This invention proposes a deep neural network model for processing two-dimensional time-domain nuclear magnetic resonance (TD-NMR) signals. This deep neural network model integrates a multi-layer convolutional structure with a Transformer module using distance-aware attention as its kernel. This design effectively suppresses noise interference through residual learning in the convolutional layers; simultaneously, the distance-aware attention mechanism enhances the understanding of the relaxation spectrum in... The ability to extract local correlation characteristics within space enables more accurate multi-level feature extraction. Based on this, physical constraints are introduced to ensure the rationality of the reconstructed relaxation time correlation spectrum. This method ultimately achieves robust reconstruction of high-precision two-dimensional NMR relaxation time correlation spectra from raw TD-NMR data with low signal-to-noise ratio. This method effectively solves the problems of high computational cost, long processing time, and poor two-dimensional reconstruction results for low signal-to-noise ratio TD-NMR data in traditional inversion techniques.
[0051] Furthermore, since this method establishes a direct mapping between raw TD-NMR data and relaxation time-correlation spectra characterizing fluid information, all parameters are automatically acquired through data-driven processes, without relying on operator experience or complex prior settings, thus ensuring the standardization of the analysis process and the objectivity of the results.
[0052] Because this method enables high-precision inversion and reconstruction of time-domain nuclear magnetic resonance (TD-NMR) signals with low signal-to-noise ratio, it can complete the analysis task that traditionally relies on hundreds of accumulations with only "extremely low sampling" (dozens of times), improving data acquisition efficiency by an order of magnitude and providing a technical basis for rapid analysis and processing of massive samples.
[0053] Because this method introduces a forward loss function as a physical constraint into the loss function, the network can still have a relatively accurate inversion effect even when the dataset is small or the data is not well fitted (such as actual experimental data), which greatly enhances its practical value in real industrial scenarios. Attached Figure Description
[0054] Figure 1This is a schematic block diagram of the deep neural network model constructed in this invention; where Conv represents a convolutional layer, PReLU is a positive linear function; GK represents the result of Gaussian kernel function operation; GMHSA represents the Gaussian multi-head self-attention mechanism module GMHSA; and FFN is the feedforward neural layer. For longitudinal relaxation time, For the lateral relaxation time, For the recovery time, Echo time; For noise reduction loss, Indicates orthogonal loss, For inversion loss, , , These represent the weights for denoising loss, inversion loss, and forward modeling loss, respectively; MSE represents mean squared error; and Forward Modeling represents forward evolution. This indicates element-wise addition; This indicates multiplication; Q, K, and V are characteristic matrices.
[0055] Figure 2 These are simulated two-component 2D TD-NMR data with a signal-to-noise ratio of 20 and an intensity ratio of 1:2; where Amp represents the normalized signal intensity and ms represents milliseconds.
[0056] Figure 3 For input Figure 2 Comparison of two-dimensional predicted NMR relaxation time correlation spectra and NMR relaxation time correlation spectrum labels obtained from the reconstruction of two-component 2D TD-NMR data;
[0057] (a) NMR relaxation time correlation spectrum labels; (b) predicted NMR relaxation time correlation spectrum; (c) dimensionality breakdown. Comparison results of relaxation time; (d) shows the subdimensions. Comparison results of relaxation time;
[0058] Where ms represents milliseconds; the solid red line represents the label, and the dashed black line represents the prediction result; spectrum of label is the label of the NMR relaxation time correlation spectrum; spectrum of CRGVT is the predicted NMR relaxation time correlation spectrum; T1projection comparison is the dimensionality comparison. The comparison results of relaxation time, T2 projection comparison is dimensional. The comparison results of relaxation times show that when the difference between the predicted NMR relaxation time correlation spectrum and the NMR relaxation time correlation spectrum label is less than the preset value, it indicates that the network prediction effect is good.
[0059] Figure 4 Simulated three-component 2D TD-NMR data with an intensity ratio of 1:1:1 and a signal-to-noise ratio of 20.
[0060] Figure 5 enter Figure 4 Comparison of predicted NMR relaxation time correlation spectra and NMR relaxation time correlation spectrum labels obtained from the reconstruction of three-component 2D TD-NMR data;
[0061] (a) NMR relaxation time correlation spectrum labels, (b) predicted NMR relaxation time correlation spectrum, (c) dimensionality breakdown. Comparison results of relaxation time; (d) shows the subdimensions. Comparison results of relaxation time;
[0062] Wherein, spectrum of label is the NMR relaxation time correlation spectrum label; spectrum of CRGVT is the predicted NMR relaxation time correlation spectrum; T1 projection comparison is the dimensionality comparison. The comparison results of relaxation time, T2projection comparison is dimensional. Comparison of relaxation time; solid red line represents the label, and dashed black line represents the prediction result. Detailed Implementation
[0063] To facilitate understanding and implementation of the present invention by those skilled in the art, the present invention will be further described in detail below with reference to embodiments. It should be understood that the embodiments described herein are for illustration and explanation only and are not intended to limit the present invention.
[0064] Example 1:
[0065] Relaxation time correlation spectrum includes Spectrum Spectrum For spectra, this embodiment uses a conventional IR-CPMG pulse sequence (for...). The relaxation time correlation spectrum can also be obtained by using two-dimensional raw TD-NMR data acquired from SR-CPMG pulse sequences, followed by 2D inversion reconstruction. Relaxation time correlation spectrum. Because in multidimensional time spectrum reconstruction methods, the IR-CPMG pulse sequence and... The relaxation time correlation spectrum is the most common method.
[0066] The evolution process of the IR-CPMG pulse sequence used in this embodiment is divided into: Evolutionary stages and Evolutionary stage, in order to achieve the sample and Relaxation time correlation measurement. The IR-CPMG pulse sequence contains two independent variables: the recovery time. and echo time The signal acquired by the IR-CPMG pulse sequence can be written as a two-dimensional array. During recovery time Previously, spin magnetization decayed longitudinally along the z-axis (i.e., the direction of the static magnetic field B0), a process caused by... Relaxation is dominant. And at the echo time... Previously, signal attenuation was mainly caused by Relaxation dominates. At this point, the signal passes through the integral and the longitudinal relaxation time. and lateral relaxation time The probability density is related to it, and its mathematical model is shown in formula (1):
[0067] Formula (1)
[0068] In the formula, This is the magnetization vector at full polarization. Echo time. , This represents a product, such as the echo time corresponding to the acquisition of the first echo data. Collect the echo time corresponding to the second echo data. , collect the first The echo time corresponding to each echo data point echo number , Echo time This represents the total number of echoes for each CPMG echo train. For the inversion kernel of IR pulse sequences, It serves as the inversion kernel for the CPMG pulse sequence. Longitudinal relaxation time And lateral relaxation time The content of sample components is denoted as relaxation time correlation spectrum. , This is to account for noise interference during the sampling process. To simplify the equations, the longitudinal relaxation time is... and lateral relaxation time Discretization, making two-dimensional TD-NMR data The first inversion kernel is the inversion kernel of the IR pulse sequence. The second inversion kernel is the inversion kernel of the CPMG pulse sequence. Formula (1) can be transformed into the following matrix form:
[0069] Formula (2)
[0070] Due to the first inversion nucleus Second inversion nucleus The mutual independence can be achieved by using the Kronecker product to transform the first inversion kernel. Second inversion nucleus Combined into one core, the calculation form is further simplified as follows:
[0071] Formula (3)
[0072] Among them, the comprehensive inversion kernel , This represents the Kronecker product of the two inversion kernels. At this point, the two-dimensional inversion problem has been transformed into a given two-dimensional TD-NMR dataset. and integrated inversion nuclei Solve the relaxation time correlation spectrum The linear inverse problem.
[0073] To make the input two-dimensional TD-NMR data The relaxation time correlation spectrum can be obtained through network transformation. That is, it is necessary to solve the two-dimensional TD-NMR data. Relaxation time correlation spectrum Nonlinear mapping relationship between As shown in formula (4):
[0074] Formula (4)
[0075] These are the parameters of the nonlinear mapping model.
[0076] The reconstruction method proposed in this invention is achieved through a supervised deep neural network model, which can be expressed as the following formula (5):
[0077] Formula (5)
[0078] As can be seen from formula (5), the deep neural network model mainly consists of two parts: a denoising module and an inversion module. Two-dimensional TD-NMR data As input to a deep neural network model, it first enters the network's denoising module for processing, where... These are the neural network parameters for the denoising module. This represents the mapping relationship between the input raw TD-NMR data and the denoised NMR two-dimensional relaxation signal. The resulting denoised signal... The parameters are then input into the neural network. The relaxation time correlation spectrum is inverted in the GViT inversion module. This refers to the mapping relationship between the denoised NMR two-dimensional relaxation signal and the output predicted NMR relaxation time correlation spectrum. The final output is... Relaxation time correlation spectrum .
[0079] A deep learning-based method for reconstructing NMR relaxation time-correlation spectra includes the following steps:
[0080] Step 1: Sample pair dataset preparation.
[0081] Obtain the sample pair dataset. Each sample pair in the dataset includes the original TD-NMR data, the corresponding noiseless TD-NMR data, and the NMR relaxation time correlation spectral label.
[0082] In this embodiment, the method for constructing the sample pair dataset required for network training is the forward simulation method. The process mainly consists of four steps, which will be described in detail below:
[0083] Step 1.1: Predefine experimental parameters and construct the inversion kernel:
[0084] The sampling parameters of the pulse sequence corresponding to the original TD-NMR data and the number and range of NMR relaxation time correlation spectral labels are predefined; based on the sampling parameters of the pulse sequence and the parameters of the NMR relaxation time correlation spectral labels, the corresponding first inversion kernel and second inversion kernel are constructed.
[0085] This embodiment predefines the sampling parameters of the IR-CPMG pulse sequence, specifically as follows: The array has 32 arrays, and the array range is a logarithmic distribution from 0.01ms to 1200ms. The number of sampling time points for the echo is 1500, and the interval (TE) between the sampling time points of two adjacent echo signals is 0.14ms;
[0086] Predefined parameters for NMR relaxation time correlation spectral labels: In this example, they are... Taking the relaxation time-related spectral label as an example, in and All dimensions use a placement number of 100, with the placement range being a logarithmic range from 0.1ms to 1000ms.
[0087] Based on the experimental parameters set above, the corresponding first inversion kernel is constructed according to formula (1). Second inversion nucleus .
[0088] Step 1.2. Simulate and generate NMR relaxation time-correlation spectrum labels:
[0089] The number of spectral peaks in the NMR relaxation time correlation spectral labels is determined, and corresponding logarithmic peak coordinate values are generated based on the determined number of peaks. Based on the obtained peak coordinate values, simulated NMR relaxation time correlation spectral labels with a fixed half-width at half-maximum and random relative amplitudes are generated in the two-dimensional logarithmic domain. .
[0090] This embodiment simulates the generation Relaxation time-related spectrum labels: First determine The number of spectral peaks in the relaxation time-related spectral label is randomly generated from 1 to 3. Then, a corresponding logarithm is generated based on the determined number of peaks. Spectral peak coordinates. Based on the obtained spectral peak coordinates, a continuous simulation with a fixed half-width and random relative amplitude is generated in the two-dimensional logarithmic domain. Relaxation time-related spectral tags The full width at half maximum (FWHM) of the spectral peak is fixed at 0.12, and the coordinate values of the spectral peak are within the range defined above. The range of points in the relaxation time correlation spectrum. The amplitude of the spectral peaks will be randomly selected between 0.1 and 1.
[0091] Step 1.3. Add simulated noise to simulate the original attenuated signal:
[0092] Based on the simulated NMR relaxation time correlation spectral labels Noise-free TD-NMR data were obtained by performing forward modeling using the inversion kernel constructed in step 1.1. To noiseless TD-NMR data By adding simulated noise, we obtain the simulated raw TD-NMR data. , This is the sequence number of the sample pair.
[0093] This embodiment completes the construction of the inversion kernel and - After generating the relaxation time correlation spectrum labels, based on the generated... Relaxation time-correlation spectral labels, through forward modeling using the first and second inversion kernels, yield noise-free TD-NMR data. Based on this, simulated Ricean noise is added, with the signal-to-noise ratio of the simulated Ricean noise randomly generated between 5 and 50, thus obtaining the simulated raw TD-NMR data. .
[0094] Step 1.4. Construct the sample pair dataset:
[0095] make The index of the sample pair, the first Each sample pair is denoted as , including the One raw TD-NMR data The corresponding first Noise-free TD-NMR data and the NMR relaxation time correlation spectrum .
[0096] In this embodiment, it is recorded For the first indivual Relaxation time correlation spectrum, recorded For the corresponding number One noiseless TD-NMR data point, recorded For the corresponding number The first input is raw TD-NMR data. (From the first...) Input raw TD-NMR data The corresponding first Noise-free TD-NMR data and the indivual Relaxation time correlation spectrum Composition of the first a sample pair L represents the total number of pairs of samples in the dataset. In this embodiment, the total number of pairs of samples is 160,000.
[0097] Step 2: Build a deep neural network model.
[0098] The deep neural network model built in this embodiment includes a convolutional denoising module and a GViT inversion module. For example... Figure 1 As shown. Raw TD-NMR data. The NMR two-dimensional relaxation signal is obtained by denoising through the convolution denoising module. The NMR two-dimensional relaxation signal is then inverted by the GViT inversion module to obtain the corresponding predicted NMR relaxation time correlation spectrum.
[0099] Convolutional denoising module:
[0100] The convolutional denoising module includes m convolutional layers, where m ≥ 2. The output of the last convolutional layer in the convolutional denoising module is added element-wise to the input of the first convolutional layer, and the result is used as the output of the convolutional denoising module and input to the GViT inversion module.
[0101] In this embodiment, the convolutional denoising module is implemented based on a three-layer convolutional structure. Each convolutional layer uses a 3×3 kernel with padding of 1 and a stride of 1 to ensure that the spatial dimensions of the input signal remain unchanged during convolution, while effectively extracting local features. The activation function of each convolutional layer uses a parameterized corrected linear function (PReLU) to appropriately preserve negative information in the original signal according to the signal features. Through multi-layer convolution, the feature channels are transformed, with the number of feature channels of the signal successively expanded from 1 to 16, then compressed to 8, and finally restored to 1. This process completes the feature mapping from low dimension to high dimension and then back to low dimension, which helps to extract multi-scale feature representations. In addition, the convolutional denoising module also introduces a residual learning mechanism, not directly using the output of the last convolutional layer as the final denoising result, but using the output of the last convolutional layer and the original input signal (i.e., the original TD-NMR data) as the denoising result. The input signal is added element-wise, and residual propagation is achieved through skip connections. This design helps to preserve the structural characteristics of the input signal, especially in the tail or edge regions of the signal, and can effectively suppress information divergence and distortion, thereby improving the stability and reliability of the denoising results.
[0102] GViT Inversion Module:
[0103] The GViT inversion module adopts the classic ViT (Vision Transformer) framework and further incorporates an improved Gaussian kernel attention mechanism, giving it stronger feature modeling capabilities and robustness. Its specific structure includes the following parts:
[0104] 1. Data block embedding module:
[0105] The data block embedding module is used to convert the denoised NMR two-dimensional relaxation signal (which is two-dimensional data) into sequential data that can be processed by the Transformer structure. Specifically, it includes a data segmentation module, a linear transformation layer, and a position embedding module. The input to the data block embedding module is the original TD-NMR data. The denoised NMR two-dimensional relaxation signal obtained after denoising by the convolution denoising module is the embedding vector output by the position embedding module.
[0106] In this embodiment, the denoised NMR two-dimensional relaxation signal is first processed by the data segmentation module, dividing it into 16 non-overlapping data blocks of the same size. Then, a linear transformation layer flattens and linearly maps the data blocks, converting them into a corresponding number of one-dimensional vectors with a depth of 1024. Subsequently, the position embedding module performs a position embedding operation, adding the calculated position features to the one-dimensional vectors to obtain the embedding vector, thus preserving the spatial structure of the data and improving the Transformer's ability to extract multi-dimensional feature information and interpret physical information related to the relaxation process when processing two-dimensional data. The position features are calculated using sine and cosine coding formulas, as shown in formula (6). This indicates the position of the data block within the sequence of the denoised NMR two-dimensional relaxation signal. The index in the embedded dimension (starting from 0). This represents the total dimension of the embedded vector.
[0107] Formula (6)
[0108] in, Sine coding representing location features, Cosine coding representing positional features.
[0109] 2. GViT encoder:
[0110] The GViT encoder is the core component of the GViT inversion module. It comprises one or more GVT encoding modules, each of which includes a Gaussian multi-head self-attention (GMHSA) module and a feedforward neural network (FFN). This aims to perform multi-level feature extraction and nonlinear modeling on the sequence of embedded vectors after data block embedding, thereby improving the model's ability to express the denoised NMR two-dimensional relaxation signal and its inversion accuracy. In this embodiment, the GViT encoder is structurally composed of 10 stacked GVT encoding modules.
[0111] The Gaussian multi-head self-attention mechanism module GMHSA includes an attention mechanism layer and a linear transformation layer. GMHSA is a novel and improved attention mechanism proposed in this invention, which integrates Gaussian kernel computation based on the multi-head attention mechanism. The mathematical expression of the attention mechanism in the attention mechanism layer is shown in formula (7):
[0112] Formula (7)
[0113] , , The first The feature matrices corresponding to each attention head are denoted as feature matrices. , , ; This is a scaling factor used to control the scope of attention; it is set as a trainable parameter during training. This represents the result of the Gaussian kernel function operation; intermediate quantities obtained from the calculation of each attention head. After being concatenated, the data is input to the linear transformation layer of the current Gaussian multi-head self-attention mechanism module GMHSA, and then enters the corresponding feedforward neural layer FFN.
[0114] Among them, the feature matrix , , The feature vector output from the previous module of the current GVT encoding module is first normalized and then mapped to a sum of three matrices (Q, K, and V) through a linear transformation layer. The sum of three matrices is then divided into feature matrices Q, K, and V in the last dimension. Subsequently, according to the preset number of attention heads (10 in this embodiment), the feature matrices Q, K, and V are further divided to form feature matrices corresponding to each attention head. , , For the first GVT coding module, the feature vector output by the previous module is the embedding vector obtained after processing by the data block embedding module; for subsequent GVT coding modules, the feature vector output by the previous module is the feature vector output by the feedforward neural layer FFN of the previous GVT coding module.
[0115] In this embodiment, the number of attention heads in the Gaussian Multi-Head Self-Attention (GMHSA) module is set to 10.
[0116] This invention proposes a distance-aware attention mechanism. In multi-head attention mechanisms, the similarity calculation between feature matrix Q (belonging to the query matrix) and feature matrix K (belonging to the key matrix) is replaced by a Gaussian kernel function based on Euclidean distance, instead of a dot product. This makes the model naturally inclined to respond to changes in local features. This feature conforms to the NMR two-dimensional relaxation components in... The spatially correlated, globally sparsity distribution characteristics enable more effective characterization of fluid components, thus significantly improving the accuracy of the inversion results. Other computations still employ traditional matrix multiplication methods, ensuring the attention mechanism retains its global awareness and exhibits better robustness against noise and outliers. The two-dimensional relaxation signal of NMR shows stronger correlation in local features, eliminating the need for overly complex feature extraction calculations; therefore, only one adjustable scale factor is used. While participating in the computation, the computational complexity is also kept within a certain range. The Gaussian multi-head self-attention mechanism module GMHSA is more consistent with the signal characteristics of NMR two-dimensional relaxation signals in principle, and its calculation method is also simpler. This improvement effectively enhances the model's ability to perceive the structure of relaxation signals and strengthens the discriminativeness of feature representations, thereby significantly enhancing the model's robustness to noise and outliers while improving reconstruction accuracy.
[0117] The feedforward neural network (FFN) consists of a regularization layer and multiple linear transformation layers, with activation functions set between the linear transformation layers. In this embodiment, the FFN includes one regularization layer and two linear transformation layers. The output of the last linear transformation layer is the output of the FFN. The first linear transformation layer has 2048 neurons, and the second linear transformation layer has 1024 neurons. The activation function between the two linear transformation layers is the GELU activation function.
[0118] In addition, to ensure that the GViT encoder can fully extract and learn feature information, this invention introduces a residual connection mechanism within each GVT encoding module and across GVT encoding modules. In each GVT encoding module, the input and output of the Gaussian Multi-Head Self-Attention (GMHSA) module are element-wise added to serve as the input to the corresponding feedforward neural network (FFN). The input and output of the feedforward neural network (FFN) are then element-wise added to serve as the output of the current GVT encoding module, which is then passed to subsequent processing stages. This structure not only effectively alleviates the gradient explosion problem in deep networks but also helps mitigate the gradient vanishing phenomenon, thus maintaining stable gradient propagation during training. Simultaneously, residual connections significantly reduce the loss of feature information during processing, ensuring the integrity of key features and further enhancing the network's stability and convergence performance.
[0119] 3. Converter:
[0120] The main function of the converter is to map and reconstruct the one-dimensional feature vector obtained by the GViT encoder, and finally output a predicted NMR relaxation time correlation spectrum with the same dimension as the NMR relaxation time correlation spectrum label. It includes an average pooling layer, a regularization layer, a linear transformation layer, and a reconstruction deformation module. The linear transformation layer in the converter has 10,000 neurons, corresponding to the two-dimensional relaxation spectrum in the dataset used in this embodiment. Number of points and Multiply the number of points.
[0121] Step 3: Construct the total loss function.
[0122] Based on the deep neural network model we built in this embodiment, the total loss function we designed is a joint loss function, which includes three parts: denoising loss, inversion loss, and forward loss.
[0123] The denoising loss is calculated from the difference between the denoised NMR two-dimensional relaxed signal after processing by the convolutional denoising module and the noiseless TD-NMR data. It is used to constrain the denoising direction of the convolutional denoising module to ensure that the convolutional denoising module effectively learns noise suppression and signal recovery. The specific calculation method of this loss term is shown in formula (8).
[0124] Formula (8)
[0125] in, It is the size of the learning batch. It is the L2 norm. For the first Raw TD-NMR data from the sample pair For the first Noise-free TD-NMR data in the sample pairs The index of the sample pair. These are the neural network parameters for the denoising module. This represents the mapping relationship between the input raw TD-NMR data and the denoised NMR two-dimensional relaxation signal.
[0126] The inversion loss is calculated by comparing the NMR relaxation time correlation spectrum predicted by the final output of the network with the NMR relaxation time correlation spectrum label. It is used to provide data supervision constraints for the GViT inversion module. The calculation method is shown in formula (9).
[0127] Formula (9)
[0128] in, Indicates the first The sample pairs correspond to the denoised two-dimensional NMR relaxation signals. , This represents the network parameters of the GViT inversion module. For the first NMR relaxation time-correlation spectral labels in each sample pair.
[0129] The forward modeling loss is obtained by comparing the predicted NMR relaxation time correlation spectrum with the noiseless TD-NMR data after a forward kernel transformation and calculating the difference. This loss term aims to introduce physical constraints to the inversion module, ensuring that its output is physically reasonable. Even when the training dataset fails to fully cover complex real-world situations, the forward modeling loss helps improve the model's generalization ability to insufficiently simulated data, enhancing the reliability and robustness of the inversion results. The calculation method of the forward modeling loss is shown in Equation (10), where the predicted NMR relaxation time correlation spectrum... = .
[0130] Formula (10)
[0131] and These are the first inversion nucleus and the second inversion nucleus, respectively.
[0132] Finally, the three loss terms are combined by different weight ratios to obtain the overall network loss function as shown in formula (11).
[0133] Formula (11)
[0134] , , These are the weight values for the denoising loss, the inversion loss, and the forward loss, respectively, all set within the range [0,1]. The inversion loss... As the dominant optimization objective, its inversion loss weight values It is usually not less than half of the total weight, and the value of the total weight is equal to... In this embodiment, the weight values of the inversion loss are... Set to 0.7. Noise reduction loss. This is used to constrain the denoising performance of the denoising module on the input signal, and its weight is generally set to 0.3. This value can be adjusted appropriately according to the noise level of the dataset. Forward modeling loss Its main function is auxiliary regularization; while providing physical constraints, its introduction can also exacerbate the ill-conditioned nature of the inversion problem to some extent. If the training dataset can sufficiently cover the real-world scenario, this weight can be set to 0. When the dataset of training sample pairs is limited, but the ability to reconstruct multiple sample pairs needs to be enhanced, this weight can be appropriately increased, but it is generally recommended to keep it below 0.3. For all sample pairs in the dataset used for training, the optimal mapping relationship is obtained when the loss function value reaches its minimum.
[0135] Step 4: Training the deep neural network model.
[0136] To effectively train a supervised deep neural network model, the sample pairs prepared in step 1 are first processed into a dataset. ( The sample pairs in the dataset (i.e., 1, 2, 3…160000) are shuffled, and 144,000 sample pairs are randomly selected as the training dataset to train a deep neural network model. This training aims to minimize the loss function and obtain the optimal mapping between the original TD-NMR data and the NMR relaxation time-correlation spectral labels. The remaining 16,000 data points serve as the validation dataset, used to evaluate the deep neural network model during training and to fine-tune the hyperparameters of the supervised neural network model to improve its generalization ability. The optimal mapping between the original TD-NMR data and the corresponding NMR relaxation time-correlation spectral labels constitutes the prediction model, termed the CRGVT-InvNet model.
[0137] In this embodiment, the hyperparameters of the deep neural network model are set as follows before training: the initial bias vectors of each convolutional layer, linear transformation layer, and regularization layer are all zero; the number of epochs is 300; and the batch size is 50. The iterative optimization algorithm used is the root mean square propagation algorithm (RMSprop), with a learning rate of 1e-4.
[0138] Step 5: Predictive Reconstruction.
[0139] The original TD-NMR data to be inverted is input into the deep neural network model (CRGVT-InvNet model) trained in step 4 for prediction, and the corresponding predicted NMR relaxation time correlation spectrum is output.
[0140] When the original TD-NMR data is simulated two-component 2D TD-NMR data with an intensity ratio of 1:2 and a signal-to-noise ratio of 20, such as... Figure 2 As shown; the comparison results of the predicted NMR relaxation time correlation spectrum and the NMR relaxation time correlation spectrum labels obtained from the corresponding reconstruction, as well as the dimensional comparison results, are as follows. Figure 3 As shown.
[0141] When the original TD-NMR data is simulated three-component 2D TD-NMR data with an intensity ratio of 1:1:1 and a signal-to-noise ratio of 20, such as... Figure 4 As shown, the comparison results of the predicted NMR relaxation time correlation spectrum and the NMR relaxation time correlation spectrum labels obtained from the corresponding reconstruction, as well as the dimensional comparison results, are as follows: Figure 5 As shown.
[0142] Example 2:
[0143] A deep learning-based low-field NMR relaxation time-correlation spectrum reconstruction device, implementing the deep learning-based low-field NMR relaxation time-correlation spectrum reconstruction method described in Example 1, includes:
[0144] The model building module is used to construct the deep neural network model in step 2 of embodiment 1.
[0145] A loss function construction module is used to implement the total loss function in step 3 of embodiment 1;
[0146] The training module is used to implement step 4 of embodiment 1, which trains the deep neural network model based on the sample pair dataset;
[0147] The application module is used to implement step 5 of embodiment 1, inputting the original TD-NMR data to be inverted into the trained deep neural network model for prediction, and outputting the corresponding predicted NMR relaxation time correlation spectrum.
[0148] Example 3:
[0149] A computer device includes a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement steps 2-5 in Embodiment 1 above.
[0150] Example 4:
[0151] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements steps 2-5 in Embodiment 1 above.
[0152] Example 5:
[0153] A computer program product includes a computer program that, when executed by a processor, implements steps 2-5 in Embodiment 1 above.
[0154] The specific embodiments described herein are merely illustrative of the spirit of the invention. Those skilled in the art to which this invention pertains may make various modifications or additions to the described specific embodiments or use similar methods to substitute them, without departing from the spirit of the invention or exceeding the scope defined by the appended claims.
Claims
1. A method for reconstructing the relaxation time correlation spectrum of low-field NMR based on deep learning, characterized in that, Includes the following steps: Step 1: Obtain the sample pair dataset. Each sample pair in the dataset includes the original TD-NMR data, the corresponding noiseless TD-NMR data, and the NMR relaxation time correlation spectral label. Step 2: Build a deep neural network model, which includes a convolutional denoising module and a GViT inversion module. Step 3: Construct the total loss function, which includes denoising loss, inversion loss, and forward modeling loss; Step 4: Train the deep neural network model using the sample dataset; Step 5: Input the original TD-NMR data to be inverted into the trained deep neural network model for prediction, and output the corresponding predicted NMR relaxation time correlation spectrum.
2. The method for reconstructing low-field NMR relaxation time correlation spectrum based on deep learning according to claim 1, characterized in that, Step 1 includes the following steps: Step 1.1: Predefine the sampling parameters of the pulse sequence corresponding to the original TD-NMR data and the parameters of the NMR relaxation time correlation spectral label; based on the sampling parameters of the pulse sequence and the number and range of points of the NMR relaxation time correlation spectral label, construct the corresponding first inversion kernel and second inversion kernel; Step 1.2: Determine the number of spectral peaks in the NMR relaxation time correlation spectral labels, and generate corresponding logarithmic peak coordinate values based on the determined number of peaks; based on the obtained peak coordinate values, generate simulated NMR relaxation time correlation spectral labels with a fixed half-width at half-maximum and random relative amplitudes in the two-dimensional logarithmic domain. ; Step 1.3: Based on the simulated NMR relaxation time correlation spectral labels The noise-free TD-NMR data is obtained by performing forward modeling using the first inversion kernel and the second inversion kernel constructed in step 1.
1. Simulated noise is then added to the noise-free TD-NMR data to obtain the simulated original TD-NMR data. Step 1.4, the Each sample pair is denoted as , No. The raw TD-NMR data in each sample pair are denoted as follows: , No. The noiseless TD-NMR data in each sample pair are denoted as follows: , No. The NMR relaxation time correlation spectral labels in each sample pair are denoted as . .
3. The method for reconstructing low-field NMR relaxation time correlation spectrum based on deep learning according to claim 2, characterized in that, When the pulse sequence corresponding to the acquired raw TD-NMR data is an IR-CPMG pulse sequence, the corresponding first and second inversion kernels are constructed according to the following formula: , , in, Indicates the recovery time. Indicates the echo time. Indicates the longitudinal relaxation time. Indicates the lateral relaxation time. This represents the first inversion kernel, which belongs to the inversion kernel of the IR pulse sequence. This indicates the second inversion kernel, which belongs to the inversion kernel of the CPMG pulse sequence.
4. The method for reconstructing low-field NMR relaxation time correlation spectrum based on deep learning according to claim 1, characterized in that, The convolutional denoising module includes m convolutional layers, where m ≥ 2. The output of the last convolutional layer in the convolutional denoising module is added element-wise to the input of the first convolutional layer, and the result is used as the output of the convolutional denoising module and input to the GViT inversion module.
5. The method for reconstructing low-field NMR relaxation time correlation spectrum based on deep learning according to claim 1, characterized in that, The GViT inversion module includes, in sequence, a data block embedding module, a GViT encoder, and a converter: The data block embedding module consists of a data segmentation module, a linear layer, and a location embedding module. The input to the data block embedding module is the raw TD-NMR data. The denoised NMR two-dimensional relaxation signal obtained after denoising by the convolution denoising module is the embedding vector output by the position embedding module. The GViT encoder includes one or more GVT coding modules, each of which sequentially includes a Gaussian multi-head self-attention mechanism module (GMHSA) and a feedforward neural layer (FFN). The Gaussian multi-head self-attention mechanism module GMHSA includes an attention mechanism layer and a linear transformation layer. The attention mechanism of the attention mechanism layer is as follows: ; in, , , The first The feature matrices corresponding to each attention head are denoted as feature matrices. The feature matrix of the first GVT coding module , , Obtained from the embedding vector; Scale factor; This represents the result of the Gaussian kernel function operation; intermediate quantities obtained from the calculation of each attention head. After being concatenated, the input is fed into the linear transformation layer of the current Gaussian multi-head self-attention mechanism module GMHSA; The feedforward neural layer FFN sequentially includes a regularization layer and multiple linear transformation layers. Activation functions are set between the linear transformation layers in the feedforward neural layer FFN, and the output of the last linear transformation layer is the output of the feedforward neural layer FFN. The converter sequentially includes a mean pooling layer, a regularization layer, a linear transformation layer, and a reconstruction deformation module.
6. The method for reconstructing low-field NMR relaxation time correlation spectrum based on deep learning according to claim 5, characterized in that, In each GVT coding module, the input and output of the Gaussian multi-head self-attention mechanism module GMHSA are added element-wise to obtain the input of the corresponding feedforward neural layer FFN, and the input and output of the feedforward neural layer FFN are added element-wise to obtain the output of the current GVT coding module.
7. The method for reconstructing low-field NMR relaxation time correlation spectrum based on deep learning according to claim 2, characterized in that, The total loss function is: , in, , , These are the weight values for denoising loss, inversion loss, and forward loss, respectively, all set within the range of [0,1]. For noise reduction loss: , It is the size of the learning batch. It is the L2 norm. The index of the sample pair. These are the neural network parameters of the denoising module; This represents the mapping relationship between the input raw TD-NMR data and the denoised NMR two-dimensional relaxation signal; For inversion loss: , in, Indicates the first Each sample pair corresponds to the denoised two-dimensional NMR relaxation signal. ; This represents the network parameters of the GViT inversion module; Indicates forward modeling loss: , in, To predict NMR relaxation time correlation spectra; and These are the first inversion nucleus and the second inversion nucleus, respectively.
8. The method for reconstructing low-field NMR relaxation time correlation spectrum based on deep learning according to claim 1, characterized in that, The weight values of the inversion loss Not less than half of the total weight, and the total weight is equal to .
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements steps 2-5 of the deep learning-based low-field NMR relaxation time correlation spectrum reconstruction method according to any one of claims 1 to 8.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements steps 2-5 of the deep learning-based low-field NMR relaxation time correlation spectrum reconstruction method according to any one of claims 1 to 8.