Nuclear magnetic resonance free induction decay signal reconstruction method based on diffusion probability model
By constructing the forward diffusion and inverse denoising modules of the diffusion probability model and combining multi-scale convolution and spatiotemporal attention residual units, the problems of high computational complexity and noise sensitivity in MRI signal reconstruction are solved, efficient and reliable signal reconstruction is achieved, and the influence of undersampling artifacts is avoided.
Patent Information
- Application Number
- CN202510737522.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-04
- Publication Date
- 2025-09-19
AI Technical Summary
Existing technologies for nuclear magnetic resonance signal reconstruction have problems such as high computational complexity, long reconstruction time, sensitivity to noise, and reliance on manual parameter adjustment. In addition, frequency domain reconstruction has difficulty distinguishing weak peaks and undersampling artifacts, which affects the reconstruction quality.
A reconstruction method based on the diffusion probability model is adopted. By constructing a forward diffusion module and a reverse denoising module, Poisson gap non-uniform sampling and simulated signal datasets are used for training. Multi-scale convolution, diffusion process embedding, auxiliary information embedding and spatiotemporal attention residual units are combined. Gaussian noise is gradually added and the error value is estimated. The model parameters are iteratively optimized to achieve high-precision reconstruction of the signal.
With the reduction of sampling points, the accuracy and robustness of signal reconstruction are improved, the experimental time is shortened, the reliability and stability of the reconstruction results are ensured, and the interference of undersampling artifacts is avoided.
Smart Images

Figure CN120671073A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of magnetic resonance spectroscopy, and in particular to a nuclear magnetic resonance free induction decay signal reconstruction method based on a diffusion probability model. Background Art
[0002] Nuclear Magnetic Resonance (NMR) is a versatile analytical technique in chemistry, pharmacology, and biology, enabling users to extract rich structural information from samples. The signal obtained in an NMR experiment is called the free induction decay (FID) signal. When certain atomic nuclei are excited, they induce a current in the radio frequency coil of the NMR instrument, generating a signal. As these excited nuclear spins relax, their signal intensity decreases, eventually decaying to zero. This gradual decay of the signal over time is known as free induction decay.
[0003] To ensure that the acquired FID signal can be used for discrete Fourier transform analysis, the sampling interval of samples in the time domain must be uniform. However, in the actual multidimensional spectrum acquisition process, the experimental time increases exponentially with the increase in dimensionality, making uniform sampling extremely time-consuming. According to compressed sensing (CS) theory, if the signal is sparse in the transform domain, non-uniform sampling (NUS) can be used to effectively recover the signal with fewer sampling points, significantly reducing the required sampling time while ensuring the quality of the reconstructed signal.
[0004] Because non-uniformly sampled signals cannot be directly applied to standard frequency-domain transformation techniques, such as the Fast Fourier Transform (FFT), numerous reconstruction algorithms and techniques have been developed to extract and analyze effective information from non-uniformly sampled data. These methods typically exploit prior properties of the signal, such as its sparsity in a certain transform domain or the low-rank nature of a certain structure, to complete missing points and reconstruct the fully sampled signal. Representative traditional algorithms include compressed sensing (CS) reconstruction methods and low-rank (LR) reconstruction algorithms. However, when the data volume is large, traditional algorithms are limited by computational complexity and require long reconstruction times. Furthermore, traditional algorithms rely on complex mathematical models and optimization algorithms, require multiple iterations, are sensitive to noise, and require manual tuning of key parameters, limiting their performance in practical applications.
[0005] With the development of deep learning, many neural network frameworks have been widely used in fields such as machine translation, computer vision, medical imaging, and MRI data processing. Currently, mainstream deep learning methods primarily perform undersampling reconstruction in the frequency domain. This technical approach continues the reliance of classic methods such as compressed sensing on the sparse nature of the frequency domain, learning sparse representation patterns in the frequency domain through a data-driven approach to achieve signal reconstruction. However, frequency domain reconstruction cannot distinguish between weak peaks and undersampling artifacts. Furthermore, if a single frequency component in the frequency domain is incorrectly reconstructed, it may cause oscillation distortion in the time domain signal. Furthermore, overlapping peaks in the spectrum can also affect the reconstruction results. Summary of the Invention
[0006] In order to solve the above problems, the present invention proposes a nuclear magnetic resonance free induction decay signal reconstruction method based on the diffusion probability model. By constructing a reconstruction method based on the diffusion probability model and utilizing Poisson gap non-uniform sampling and simulation signal data sets for training and optimization, high-precision and efficient reconstruction of the nuclear magnetic resonance free induction decay signal and improved reliability of the results are achieved.
[0007] The specific plan is as follows:
[0008] On the one hand, a nuclear magnetic resonance free induction decay signal reconstruction method based on a diffusion probability model includes:
[0009] S1, constructing a simulation data set based on the mathematical model of nuclear magnetic resonance free induction decay signal, dividing the simulation data set into a simulation training set, a simulation verification set, and a simulation test set, sampling the simulation data set by constructing a Poisson gap non-uniform sampling template, and obtaining the sampled training set, verification set, and test set;
[0010] S2, constructing a diffusion probability model, which includes a forward diffusion module and a reverse denoising module. Gaussian noise is added to the sampled training set data through the forward diffusion module to obtain noisy training set data. The error value is estimated through the reverse denoising module. Based on the estimated error value and the sampled training set, a training set reconstruction result is obtained. The difference loss value between the noisy training set data and the training set reconstruction result is calculated. The difference loss value is averaged over multiple iterations to obtain a difference loss value for a training run. Backpropagation is performed based on the difference loss value for a training run to obtain a gradient. The network parameters of the diffusion probability model are updated based on the gradient to obtain an updated diffusion probability model.
[0011] S3, setting the number of iterative training times, iteratively training the updated diffusion probability model based on the number of iterative training times, obtaining the diffusion probability model after iterative training, and after reaching the specified number of iterative training times, performing a performance score on the diffusion probability model after iterative training using the sampled validation set data, and selecting the diffusion probability model with the highest performance score as the final diffusion probability model;
[0012] S4, the sampled test set data is input into the final diffusion probability model multiple times to reconstruct the nuclear magnetic resonance free induction decay signal to obtain multiple reconstruction results, the median of the multiple reconstruction results is taken in the time domain as the final reconstruction result, the preset interval of the multiple reconstruction results is taken as the confidence interval of the reconstruction result, and the reconstructed free induction decay signal and the uncertainty estimation of the reconstruction result are obtained based on the final reconstruction result and the confidence interval.
[0013] Furthermore, in S1, a simulation data set is constructed based on the mathematical model of the nuclear magnetic resonance free induction decay signal, and the simulation data set is sampled using a Poisson gap non-uniform sampling template. The calculation formula is as follows:
[0014]
[0015] Where FID(t) represents the free induction decay signal data set after sampling; N is the total number of spectral peak components in a single free induction decay signal; A i and Represents the amplitude and relaxation rate of the i-th spectral peak. For each spectral peak component, A i Set to a random number between 0 and 2, Set to a random number between 5 and 60; j represents the imaginary unit; t represents the evolution time, t = [0:L-1] / F S , where F S is the bandwidth, set to a random number between 750 and 1500, L is the time series length, set to 128; Δf i For digital frequency, set from 0 to F S Random numbers between; NUS(t) represents the template of Poisson gap non-uniform sampling, specifically:
[0016]
[0017] Where t′ s Indicates the coordinate time corresponding to the s-th sampling point.
[0018] Furthermore, in S2, the forward diffusion module adds Gaussian noise to the training set data of the sampled free induction decay signal data using the following calculation formula:
[0019]
[0020] Where k represents the number of iteration steps; R k represents the noise data of the kth step; ∈ represents Gaussian noise with a variance of 1; β irepresents the i-th constant representing the noise level in a vector of preset length T; T is the diffusion step length; R0 represents the initial data, that is, the ideal fully sampled free induction decay signal.
[0021] Furthermore, in S2, the inverse denoising module includes a multi-scale convolution unit, a diffusion process embedding unit, an auxiliary information embedding unit and a spatiotemporal attention residual unit;
[0022] The multi-scale convolution unit is used to use four parallel one-dimensional convolution paths, each of which is set with a convolution kernel of a different size. Based on the convolution kernels of different sizes, a multi-receptive field structure is constructed. The receptive field structure captures the local details and global change characteristics of the noisy training set data to obtain enhanced signal characteristics;
[0023] The diffusion process embedding unit is used to convert the noisy training set data into a fixed-length vector based on a given number of diffusion steps, input the fixed-length vector into the first fully connected layer and the second fully connected layer for nonlinear projection, and obtain the projected signal features;
[0024] The auxiliary information embedding unit is used to convert the noisy training set data into a time vector and a feature vector of fixed length based on a given number of time steps and feature steps, and to splice the time vector, the feature vector and the sampling template as auxiliary information to obtain the signal characteristics of the auxiliary information;
[0025] The spatiotemporal attention residual unit is used to add the enhanced signal features and the projected signal features to obtain fused signal features. The time- and feature-based Transformer encoder captures the dependencies of the fused signal features in the time and feature dimensions to obtain higher-dimensional signal features, and the higher-dimensional signal features include global dependencies and contextual information in the time and feature dimensions. The obtained higher-dimensional signal features and the signal features of the auxiliary information are added after the receptive field is expanded by dilated convolution to obtain enhanced high-dimensional signal features. The enhanced high-dimensional signal features are passed through a gated activation unit and dilated convolution and are further input into the spatiotemporal attention residual unit. The enhanced signal features pass through a total of four spatiotemporal attention residual units, and the outputs of the four spatiotemporal attention residual units are spliced and merged using jump connections, and then passed through dilated convolution to obtain an estimated error value.
[0026] Furthermore, in S2, the calculation formula of the difference loss value is as follows:
[0027]
[0028] in, Represents the difference loss value; N represents the number of data samples involved in the difference loss value calculation; θ represents the network parameter; ∈ (i)Represents the Gaussian noise of the i-th data; ∈ θ represents the noise prediction function; k represents the number of iteration steps; represents the noised data of the i-th data at the k-th step; represents the data point sampled in the i-th data; ||·||2 represents the L2 norm; NUS represents the template of Poisson gap non-uniform sampling.
[0029] Furthermore, in S2, the iteration is repeated multiple times, and multiple difference loss values are averaged to obtain a difference loss value for one training, specifically including:
[0030] The forward diffusion module and the reverse denoising module are iterated T times, where T is the pre-set diffusion step size. The difference loss value is calculated in each iteration, and T difference loss values are obtained. The T difference loss values are averaged to finally obtain the difference loss value of one training.
[0031] Furthermore, the S4 specifically includes:
[0032] Perform M independent reconstructions on the test samples in the same test set data. Each reconstruction is based on the final diffusion probability model selected from the sampled validation set data. Gaussian noise is added to the sampled test set data through the forward diffusion module to obtain the noisy test set data. The error value is estimated through the inverse denoising module. According to the estimated error value, combined with the sampled test set, it is iterated T times to obtain a test set reconstruction result. A total of M independent reconstructions are performed M times to obtain M time domain reconstruction results. The median of the M time domain signals is taken as the final time domain reconstruction result; the preset interval of the M time domain reconstruction results is taken as the confidence interval of the test sample time domain signal; the M time domain reconstruction results are Fourier transformed to obtain M frequency spectra, and the median of each frequency point on these M spectra is taken as the final frequency domain reconstruction result; and the preset interval on each frequency point is taken as the confidence interval of the spectrum;
[0033] A reconstructed free induction decay signal is obtained based on the final reconstruction result in the time domain, the final reconstruction result in the frequency domain, and the confidence interval; the final reconstruction result includes the final reconstruction result in the time domain and the final reconstruction result in the frequency domain.
[0034] The present invention adopts the above technical solution and has the following beneficial effects:
[0035] (1) The present invention samples the simulation data set constructed based on the mathematical model of free induction decay signal through the Poisson gap non-uniform sampling strategy, which allows to retain the key information of the signal while reducing the sampling points, effectively simulating the undersampling situation in practice, not only shortening the experimental time, but also ensuring the quality of the reconstructed signal, overcoming the problem of long time consumption of the traditional uniform sampling method;
[0036] (2) The present invention constructs a forward diffusion module and a reverse denoising module of the diffusion probability model, gradually adds Gaussian noise to generate noisy samples, and recovers the original signal from the noise, so that the model can capture both the local details and the global features of the signal, thereby improving the accuracy and robustness of the reconstructed signal;
[0037] (3) The present invention further ensures the reliability and stability of the reconstruction results by performing multiple iterations on the same test set data to obtain a preset confidence interval for the reconstruction result. This method effectively reduces noise interference and improves the quality of the final reconstructed signal. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 This is a flow chart of a method for reconstructing a nuclear magnetic resonance free induction decay signal based on a diffusion probability model according to an embodiment of the present invention;
[0039] Figure 2 Schematic diagram of the noise addition and denoising process according to an embodiment of the present invention;
[0040] Figure 3 This is a diagram of the overall architecture of the deep learning network model built in an embodiment of the present invention;
[0041] Figure 4 This is a time domain diagram of the result of 25% non-uniform sampling and reconstruction of 128-length test data by the deep learning network model trained in an embodiment of the present invention;
[0042] Figure 5 This is a frequency domain diagram corresponding to the result of 25% non-uniform sampling reconstruction of 128-byte length test data according to an embodiment of the present invention;
[0043] Figure 6 This is a time domain diagram of the result of 20% non-uniform sampling and reconstruction of 256-length test data by the deep learning network model trained in an embodiment of the present invention;
[0044] Figure 7 This is a frequency domain diagram corresponding to the reconstruction result of 20% non-uniform sampling of 256-length test data according to an embodiment of the present invention. DETAILED DESCRIPTION
[0045] The present invention will be described in further detail below with reference to the embodiments and drawings, but the embodiments of the present invention are not limited thereto.
[0046] For the convenience of description, the relevant professional terms appearing in the specific implementation methods are first explained:
[0047] NMR (Nuclear Magnetic Resonance): Nuclear magnetic resonance;
[0048] FID (Free Induction Decay): Free Induction Decay;
[0049] NUS (Non-Uniform Sampling): non-uniform sampling;
[0050] ReLU (Rectified Linear Unit): nonlinear activation function;
[0051] SiLU (Sigmoid Linear Unit): Sigmoid linear unit activation function;
[0052] GELU (Gaussian Error Linear Unit): Gaussian error linear unit activation function;
[0053] Adam parameter optimization algorithm: Adaptive Moment Estimation;
[0054] RLNE (Relative L2-norm error): relative L2-norm error;
[0055] In this embodiment, the model was trained by generating simulated data. During simulation, the parameters were set as follows: the number of spectral peaks was a random number between 6 and 15, the amplitude of each spectral peak was a random number between 0 and 2, the relaxation rate of each spectral peak was a random number between 5 and 60, and the bandwidth was a random number between 750 and 1500. The sample size was 10,000, of which 80% was used as the training set (8,000 data points), 10% was used as the validation set (1,000 data points), and 10% was used as the test set (1,000 data points). Because the FID signal is a complex signal containing multiple frequency components and represented as a time-varying complex exponential function, the real and imaginary parts were separated and treated as two features to input into the network. The network ultimately outputs the reconstruction results of the real and imaginary parts. The network has good versatility. When reconstructing real data, there are no restrictions on parameters such as the number of spectral peaks. Different Poisson sampling templates also have good generalization effects. Different sampling rates and different data lengths also have certain effects.
[0056] like Figure 1 As shown, the nuclear magnetic resonance free induction decay signal reconstruction method based on the diffusion probability model of the present invention includes:
[0057] S1, construct a simulation data set based on the mathematical model of nuclear magnetic resonance free induction decay signal, divide the simulation data set into simulation training set, simulation verification set and simulation test set, sample the simulation data set by constructing a Poisson gap non-uniform sampling template, and obtain the training set, verification set and test set of the sampled free induction decay signal data.
[0058] Specifically, a simulation data set is constructed based on the mathematical model of the nuclear magnetic resonance free induction decay signal, and the simulation data set is sampled using a Poisson gap non-uniform sampling template. The calculation formula is as follows:
[0059]
[0060] Where FID(t) represents the free induction decay signal data set after sampling; N is the total number of spectral peak components in a single free induction decay signal; A i and Represents the amplitude and relaxation rate of the i-th spectral peak. For each spectral peak component, A i Set to a random number between 0 and 2, Set to a random number between 5 and 60; j represents the imaginary unit; t represents the evolution time, t = [0:L-1] / F S , where F S is the bandwidth, set to a random number between 750 and 1500, L is the time series length, set to 128; Δf i For digital frequency, set from 0 to F S Random numbers between; NUS(t) represents the template of Poisson gap non-uniform sampling, specifically:
[0061]
[0062] Where t′ s Indicates the coordinate time corresponding to the s-th sampling point.
[0063] Specifically, in this embodiment, the total number of spectral peak components N is set to a random integer between 6 and 15, and the amplitude A i is a random number between 0 and 2, and the bandwidth F S is a random number between 750 and 1500, L is 128 in length, Δf i It is from 0 to F S Random number, relaxation rate A random number between 5 and 60.
[0064] S2. Construct a diffusion probability model. The diffusion probability model includes a forward diffusion module and a reverse denoising module. Gaussian noise is added to the training set data of the sampled free induction decay signal data through the forward diffusion module to obtain the noisy training set data. The error value is estimated through the reverse denoising module. According to the estimated error value, combined with the sampled training set, the training set reconstruction result is obtained. The difference loss value between the noisy training set data and the training set reconstruction result is calculated. It is iterated multiple times and the multiple difference loss values are averaged to obtain the difference loss value of one training. Backpropagation is performed based on the difference loss value of one training to obtain the gradient. The network parameters of the diffusion probability model are updated based on the gradient to obtain an updated diffusion probability model.
[0065] Specifically, the forward diffusion module adds Gaussian noise to the training set data of the sampled free induction decay signal data as follows:
[0066]
[0067] Where k represents the number of iteration steps; R k represents the noise data of the kth step; ∈ represents Gaussian noise with a variance of 1; β i represents the i-th constant representing the noise level in a vector of preset length T; T is the diffusion step length; R0 represents the initial data, that is, the ideal fully sampled free induction decay signal.
[0068] Specifically, the inverse denoising module includes a multi-scale convolution unit, a diffusion process embedding unit, an auxiliary information embedding unit and a spatiotemporal attention residual unit;
[0069] The multi-scale convolution unit is used to use four parallel one-dimensional convolution paths, each of which is set with a convolution kernel of a different size. Based on the convolution kernels of different sizes, a multi-receptive field structure is constructed. The receptive field structure captures the local details and global change characteristics of the noisy training set data to obtain enhanced signal characteristics;
[0070] The diffusion process embedding unit is used to convert the noisy training set data into a fixed-length vector based on a given number of diffusion steps, input the fixed-length vector into the first fully connected layer and the second fully connected layer for nonlinear projection, and obtain the projected signal features;
[0071] The auxiliary information embedding unit is used to convert the noisy training set data into a time vector and a feature vector of fixed length based on a given number of time steps and feature steps, and to splice the time vector, the feature vector and the sampling template as auxiliary information to obtain the signal characteristics of the auxiliary information;
[0072] The spatiotemporal attention residual unit is used to add the enhanced signal features and the projected signal features to obtain fused signal features. The time- and feature-based Transformer encoder captures the dependencies of the fused signal features in the time and feature dimensions to obtain higher-dimensional signal features, and the higher-dimensional signal features include global dependencies and contextual information in the time and feature dimensions. The obtained higher-dimensional signal features and the signal features of the auxiliary information are added after the receptive field is expanded by dilated convolution to obtain enhanced high-dimensional signal features. The enhanced high-dimensional signal features are passed through a gated activation unit and dilated convolution and are further input into the spatiotemporal attention residual unit. The enhanced signal features pass through a total of four spatiotemporal attention residual units, and the outputs of the four spatiotemporal attention residual units are spliced and merged using jump connections, and then passed through dilated convolution to obtain an estimated error value.
[0073] Specifically, the calculation formula of the difference loss value is as follows:
[0074]
[0075] in, Represents the difference loss value; N represents the number of data samples involved in the difference loss value calculation; θ represents the network parameter; ∈ (i) Represents the Gaussian noise of the i-th data; ∈ θ represents the noise prediction function; k represents the number of iteration steps; represents the noised data of the kth step of the i-th data; represents the data point sampled in the i-th data; ||·||2 represents the L2 norm; NUS represents the template of Poisson gap non-uniform sampling.
[0076] Specifically, the iteration is repeated multiple times, and multiple difference loss values are averaged to obtain a difference loss value for one training, specifically including:
[0077] The forward diffusion module and the reverse denoising module are iterated T times, where T is a pre-set diffusion step size. In this embodiment, the diffusion step size T=50 is set. The difference loss value is calculated in each iteration to obtain T difference loss values. The T difference loss values are averaged to finally obtain the difference loss value of one training.
[0078] Specifically, in this embodiment, the diffusion probability model is constructed, and in the forward diffusion process, noise is gradually added to the data to generate a sample sequence. In the reverse denoising process, the generated data is judged, and the loss value is calculated based on the predicted results and the real data, and then back-propagated to the network, thereby updating the network parameters to make the generated sample sequence closer to the real value, such as Figure 2 Specifically, the amplitude of the FID signal is expressed as Where K is the number of features. Here, the real and imaginary parts of the FID signal are separated, so K = 2, and L is the total length of the FID sequence. In addition, the sampling time corresponding to each point in the FID is defined as At this point, the signal can be expressed as {X, M, s}. To achieve reconstruction of non-uniform sampling, the observation value of X is used to estimate and fill the under-sampled value. The ideal fully sampled free induction decay signal R0 is forward-noised to obtain R k Finally, in the reverse denoising stage of diffusion, the sampling point x0 is used as the conditional input, and the correlation between the values is used to gradually approach the noise to the true value of the undersampled point. θ (R0|x0) estimates the true conditional data distribution q(R0|x0) to achieve reconstruction. In addition, the separated sampling point x0 and the noise data R k The missing parts need to be padded with zeros to fix the input shape to be consistent, K×L.
[0079] Conditional diffusion probability model∈ θ The Transformer encoder structure is used to capture the correlation between the time dimension and the feature dimension, so as to facilitate the interpolation of time series. The diffusion step size T = 50 is set, and some auxiliary information is added as additional input, such as the time embedding s = {s 1:L}, feature embedding, sampling templates, etc., are used for model training.
[0080] In addition, each residual layer of the model uses a two-dimensional attention mechanism to capture the temporal and feature dependencies of the FID signal. The model contains a temporal Transformer layer and a feature Transformer layer, which is a Transformer encoder composed of a multi-head attention layer, a fully connected layer, and a layer normalization layer.
[0081] In the forward diffusion process, noise ∈ is gradually added to R0. The noise is Gaussian noise with a variance of 1. in satisfy In the reverse denoising process, the network input x0, R k and k, reasoning about R in step k k The core goal of this diffusion probability model is to achieve high-precision reconstruction of FID sequences using a deep generative model. The input is a four-dimensional tensor (B, 2, K, L), representing the batch size, number of channels (sampled values and noisy undersampled values), feature dimension, and time step, respectively. The output is a reconstructed three-dimensional tensor (B, K, L).
[0082] Specifically, in this embodiment, the network is divided into the following modules: (1) Convolution module, including multi-scale convolution and dilated convolution. Multi-scale convolution is set to fill in equal proportions to keep the dimension unchanged. After feature splicing, it is batch normalized and ReLU activated, and finally feature fusion is performed. The multi-receptive field parallel structure of the multi-scale convolution module can capture local changes and global trends at the same time, and the dilated convolution can avoid the information loss of the pooling operation while expanding the receptive field. (2) Diffusion process embedding module, first for a given diffusion step number, the input data is converted into a vector of the fixed length, and the vector is then nonlinearly projected through two fully connected layers. (3) Auxiliary information embedding module, for a given time step number and feature step number, the input data is converted into a time vector and a feature vector of fixed length, and the time vector, feature vector and sampling template are spliced as auxiliary information. (4) Spatiotemporal attention residual module, used to process time series data. The residual module adopts the Transformer encoder structure. Each encoder consists of a multi-head self-attention layer and a feedforward network layer. The feedforward network contains two linear transformations and GELU activation to increase the nonlinear expression ability. To ensure training stability, residual connections and layer normalization are applied after each sub-layer. The encoder consists of two main parts: the time processing layer and the feature processing layer. The time processing layer captures the global dependency and contextual information of the time dimension; the feature processing layer is used to extract information from the feature dimension, establish cross-feature associations, and enhance feature transformation capabilities. The entire model stacks four residual modules and performs weighted averaging on the jump connections of each residual module, which can gradually learn the relationship between complex time series patterns and features. The overall architecture is as follows: Figure 3 As shown in the figure, the residual module allows the network to directly learn the difference between input and output, making the network easier to train and converging faster. The model is trained using a generated simulated dataset. The constructed simulated data is normalized (each attenuation signal is divided by the first value of the attenuation signal to ensure that the attenuation signal starts at 1) and then input into the network. The network output and network label are calculated using the loss function to obtain the loss value. The parameter gradient is then backpropagated. The calculated gradient is passed through the Adam optimizer and combined with a multi-step learning rate adjustment strategy to gradually optimize the model's predictive ability, enabling it to better fit the characteristics and targets of the input data. After several rounds of training, the model's performance is evaluated on the validation set, and the best model is saved for subsequent application. The loss value represents the error between the network output and the label. The smaller the error, the closer the network output is to the label, and the better the network output effect.
[0083] S3, setting the number of iterative training times, iteratively training the updated diffusion probability model based on the number of iterative training times, obtaining an iteratively trained diffusion probability model, and after reaching the specified number of iterative training times, performing a performance score on the iteratively trained diffusion probability model using the validation set data of the sampled free induction decay signal data, and selecting the diffusion probability model with the highest performance score as the final diffusion probability model;
[0084] S4, the sampled test set data is input into the final diffusion probability model multiple times to reconstruct the nuclear magnetic resonance free induction decay signal to obtain multiple reconstruction results, the median of the multiple reconstruction results is taken in the time domain as the final reconstruction result, the preset interval of the multiple reconstruction results is taken as the confidence interval of the reconstruction result, and the reconstructed free induction decay signal and the uncertainty estimation of the reconstruction result are obtained based on the final reconstruction result and the confidence interval.
[0085] Specifically, the sampled test set data is input into the final diffusion probability model multiple times to reconstruct the nuclear magnetic resonance free induction decay signal to obtain multiple reconstruction results. The median of the multiple reconstruction results is taken as the final reconstruction result in the time domain. The preset interval of the multiple reconstruction results is taken as the confidence interval of the reconstruction result. Based on the final reconstruction result and the confidence interval, the reconstructed free induction decay signal and the uncertainty estimation of the reconstruction result are obtained, which specifically includes:
[0086] Perform M independent reconstructions on the test samples in the same test set data. Each reconstruction is based on the final diffusion probability model selected from the sampled validation set data. Gaussian noise is added to the sampled test set data through the forward diffusion module to obtain the noisy test set data. The error value is estimated through the inverse denoising module. Based on the estimated error value and the sampled test set, it is iterated T times to obtain a test set reconstruction result. A total of M independent reconstructions are performed, resulting in M time domain reconstruction results. The median of the M time domain signals is taken as the final time domain reconstruction result.
[0087] The preset interval of the M time domain reconstruction results is taken as the confidence interval of the test sample time domain signal; the M final time domain reconstruction results are Fourier transformed to obtain M spectra, and the median of each frequency point on these M spectra is taken as the final frequency domain reconstruction result; and the preset interval on each frequency point is taken as the confidence interval of the spectrum.
[0088] A reconstructed free induction decay signal is obtained based on the final reconstruction result in the time domain, the final reconstruction result in the frequency domain, and the confidence interval; the final reconstruction result includes the final reconstruction result in the time domain and the final reconstruction result in the frequency domain.
[0089] In this embodiment, 100 independent reconstructions are performed on the test samples in the same test set data, resulting in 100 time-domain reconstruction results. The median of these 100 time-domain signals is taken as the final time-domain reconstruction result. The median is used instead of the mean because it is only related to the ranking position and is not affected by extreme values in the reconstruction result. This provides a more robust measure of central tendency. If extreme values appear in the reconstruction result, the mean will be pulled to the tail, deviating from the correct trend. Therefore, the median better represents the center position of the reconstruction result.
[0090] The confidence interval for the test sample is calculated as the 5%–95% interval of the 100 reconstruction results. This interval is used to avoid extreme values in the reconstruction results that could affect the confidence interval. The confidence interval provides a more comprehensive assessment of the stability and reliability of the model's reconstruction results, helping to understand the model's performance. In the visualized results, the size of the confidence interval can be used to determine the model's certainty about its reconstruction results. A large confidence interval indicates high uncertainty and the model still needs to learn; a small confidence interval indicates low uncertainty and the model has generally determined the corresponding value.
[0091] Perform Fourier transform on the 100 reconstruction results to obtain 100 spectra. The median of each frequency point on these 100 spectra is taken as the final reconstruction result in the frequency domain; and the preset interval on each frequency point is taken as the confidence interval of the spectrum.
[0092] A reconstructed free induction decay signal is obtained based on the final reconstruction result in the time domain, the final reconstruction result in the frequency domain, and the confidence interval; the final reconstruction result includes the final reconstruction result in the time domain and the final reconstruction result in the frequency domain.
[0093] Specifically, the present invention is different from the method of performing undersampling reconstruction in the frequency domain. It processes directly in the time domain, can better utilize the correlation between sampling points in the time domain, achieve more accurate reconstruction at a lower sampling rate, does not require prior information, is not affected by overlapping peaks, avoids the interference of undersampling artifacts, is suitable for the reconstruction of data of different lengths and different sampling rates, and is of great significance for the reconstruction of non-uniform sampling of nuclear magnetic resonance signals; and compared with the prior art, the present invention uses a diffusion probability model to reconstruct directly in the time domain of the FID signal, can better utilize the correlation between sampling points in the time domain, achieve more accurate reconstruction at a lower sampling rate, and can achieve better reconstruction results on different sampling templates, has good generalization, does not require prior information, is not affected by overlapping peaks, avoids the interference of undersampling artifacts, and is suitable for the reconstruction of data of different lengths and different sampling rates.
[0094] In this example, the initial learning rate is set to 10 -3 , the batch size is set to 32, and the network training rounds are set to 2000; Figure 4This is the reconstruction result of a 128-length FID signal at a sampling rate of 25%. The shadow near the reconstruction result represents the confidence interval of the 100 generated samples. The reconstruction result is the median of these 100 generated samples. The relative two-norm error (RLNE) of this result is 0.019, indicating good reconstruction effect. For the 1000 samples in the test set, the average RLNE is 0.055. Figure 5 Shown Figure 4 The frequency domain diagram corresponding to the reconstruction result shows the reconstruction result of overlapping peaks. The reconstructed spectrum peaks are clear and complete, without any pseudo-peaks. In addition, the present invention can also achieve more accurate reconstruction for longer FID signals and lower sampling rates. Figure 6 This is the reconstruction result of the 256-length FID signal when the sampling rate is 20%, the RLNE is 0.043, and for the 1000 samples in the test set, the average RLNE is 0.085; Figure 7 Shown Figure 6 Frequency domain diagram corresponding to the reconstruction result. Overall, the present invention has high accuracy and robustness, can reconstruct high-quality free induction decay signals at low sampling rates, is not affected by overlapping peaks, avoids the interference of undersampling artifacts, and is suitable for the reconstruction of data of different lengths and different sampling rates.
[0095] Although the present invention has been particularly shown and described in conjunction with preferred embodiments, it will be understood by those skilled in the art that various changes in form and details may be made to the present invention without departing from the spirit and scope of the invention as defined in the appended claims, and all such changes are within the scope of protection of the present invention.
Claims
1. A method for reconstructing nuclear magnetic resonance free induction decay signals based on a diffusion probability model, characterized in that: include: S1, constructing a simulation data set based on the mathematical model of nuclear magnetic resonance free induction decay signal, dividing the simulation data set into a simulation training set, a simulation verification set, and a simulation test set, sampling the simulation data set by constructing a Poisson gap non-uniform sampling template, and obtaining the sampled training set, verification set, and test set; S2, constructing a diffusion probability model, which includes a forward diffusion module and a reverse denoising module. Gaussian noise is added to the sampled training set data through the forward diffusion module to obtain noisy training set data. The error value is estimated through the reverse denoising module. Based on the estimated error value and the sampled training set, a training set reconstruction result is obtained. The difference loss value between the noisy training set data and the training set reconstruction result is calculated. The difference loss value is averaged over multiple iterations to obtain a difference loss value for a training run. Backpropagation is performed based on the difference loss value for a training run to obtain a gradient. The network parameters of the diffusion probability model are updated based on the gradient to obtain an updated diffusion probability model. S3, setting the number of iterative training times, iteratively training the updated diffusion probability model based on the number of iterative training times, obtaining the diffusion probability model after iterative training, and after reaching the specified number of iterative training times, performing a performance score on the diffusion probability model after iterative training using the sampled validation set data, and selecting the diffusion probability model with the highest performance score as the final diffusion probability model; S4, the sampled test set data is input into the final diffusion probability model multiple times to reconstruct the nuclear magnetic resonance free induction decay signal to obtain multiple reconstruction results, the median of the multiple reconstruction results is taken in the time domain as the final reconstruction result, the preset interval of the multiple reconstruction results is taken as the confidence interval of the reconstruction result, and the reconstructed free induction decay signal and the uncertainty estimation of the reconstruction result are obtained based on the final reconstruction result and the confidence interval.
2. The method for reconstructing nuclear magnetic resonance free induction decay signals based on a diffusion probability model according to claim 1, wherein: In S1, a simulation data set is constructed based on the mathematical model of the nuclear magnetic resonance free induction decay signal, and the simulation data set is sampled using a Poisson gap non-uniform sampling template. The calculation formula is as follows: Where FID(t) represents the free induction decay signal data set after sampling; N is the total number of spectral peak components in a single free induction decay signal; A i and Represents the amplitude and relaxation rate of the i-th spectral peak. For each spectral peak component, A i Set to a random number between 0 and 2, Set to a random number between 5 and 60; j represents the imaginary unit; t represents the evolution time, t = [0:L-1] / F S , where F S is the bandwidth, set to a random number between 750 and 1500, L is the time series length, set to 128; Δf i For digital frequency, set from 0 to F S Random numbers between; NUS(t) represents the template of Poisson gap non-uniform sampling, specifically: Where t′ s Indicates the coordinate time corresponding to the s-th sampling point.
3. The method for reconstructing nuclear magnetic resonance free induction decay signals based on a diffusion probability model according to claim 1, wherein: In S2, the forward diffusion module adds Gaussian noise to the training set data of the sampled free induction decay signal data as follows: Where k represents the number of iteration steps; R k represents the noise data of the kth step; ∈ represents Gaussian noise with a variance of 1; β i represents the i-th constant representing the noise level in a vector of preset length T; T is the diffusion step length; R0 represents the initial data, that is, the ideal fully sampled free induction decay signal.
4. The method for reconstructing nuclear magnetic resonance free induction decay signals based on a diffusion probability model according to claim 1, wherein: In S2, the inverse denoising module includes a multi-scale convolution unit, a diffusion process embedding unit, an auxiliary information embedding unit and a spatiotemporal attention residual unit; The multi-scale convolution unit is used to use four parallel one-dimensional convolution paths, each of which is set with a convolution kernel of a different size. Based on the convolution kernels of different sizes, a multi-receptive field structure is constructed. The receptive field structure captures the local details and global change characteristics of the noisy training set data to obtain enhanced signal characteristics; The diffusion process embedding unit is used to convert the noisy training set data into a fixed-length vector based on a given number of diffusion steps, input the fixed-length vector into the first fully connected layer and the second fully connected layer for nonlinear projection, and obtain the projected signal features; The auxiliary information embedding unit is used to convert the noisy training set data into a time vector and a feature vector of fixed length based on a given number of time steps and feature steps, and to splice the time vector, the feature vector and the sampling template as auxiliary information to obtain the signal characteristics of the auxiliary information; The spatiotemporal attention residual unit is used to add the enhanced signal features and the projected signal features to obtain fused signal features. The time- and feature-based Transformer encoder captures the dependencies of the fused signal features in the time and feature dimensions to obtain higher-dimensional signal features, and the higher-dimensional signal features include global dependencies and contextual information in the time and feature dimensions. The obtained higher-dimensional signal features and the signal features of the auxiliary information are added after the receptive field is expanded by dilated convolution to obtain enhanced high-dimensional signal features. The enhanced high-dimensional signal features are passed through a gated activation unit and dilated convolution and are further input into the spatiotemporal attention residual unit. The enhanced signal features pass through a total of four spatiotemporal attention residual units, and the outputs of the four spatiotemporal attention residual units are spliced and merged using jump connections, and then passed through dilated convolution to obtain an estimated error value.
5. The method for reconstructing nuclear magnetic resonance free induction decay signals based on a diffusion probability model according to claim 1, wherein: In S2, the calculation formula of the difference loss value is as follows: in, Represents the difference loss value; N represents the number of data samples involved in the difference loss value calculation; θ represents the network parameter; ∈ (i) Represents the Gaussian noise of the i-th data; ∈ θ represents the noise prediction function; k represents the number of iteration steps; represents the noised data of the i-th data at the k-th step; represents the data point sampled in the i-th data; ||·||2 represents the L2 norm; NUS represents the template of Poisson gap non-uniform sampling.
6. The method for reconstructing nuclear magnetic resonance free induction decay signals based on a diffusion probability model according to claim 1, characterized in that: In S2, the iteration is repeated multiple times, and multiple difference loss values are averaged to obtain a difference loss value for one training, specifically including: The forward diffusion module and the reverse denoising module are iterated T times, where T is the pre-set diffusion step size. The difference loss value is calculated in each iteration, and T difference loss values are obtained. The T difference loss values are averaged to finally obtain the difference loss value of one training.
7. The method for reconstructing nuclear magnetic resonance free induction decay signals based on a diffusion probability model according to claim 1, characterized in that: Said S4 specifically includes: Perform M independent reconstructions on the test samples in the same test set data. Each reconstruction is based on the final diffusion probability model selected from the sampled validation set data. Gaussian noise is added to the sampled test set data through the forward diffusion module to obtain the noisy test set data. The error value is estimated through the inverse denoising module. According to the estimated error value, combined with the sampled test set, it is iterated T times to obtain a test set reconstruction result. A total of M independent reconstructions are performed M times to obtain M time domain reconstruction results. The median of the M time domain signals is taken as the final time domain reconstruction result; the preset interval of the M time domain reconstruction results is taken as the confidence interval of the test sample time domain signal; the M time domain reconstruction results are Fourier transformed to obtain M frequency spectra, and the median of each frequency point on these M spectra is taken as the final frequency domain reconstruction result; and the preset interval on each frequency point is taken as the confidence interval of the spectrum; A reconstructed free induction decay signal is obtained based on the final reconstruction result in the time domain, the final reconstruction result in the frequency domain, and the confidence interval; the final reconstruction result includes the final reconstruction result in the time domain and the final reconstruction result in the frequency domain.
Citation Information
Cited By
Fetal heart rate signal data enhancement method based on conditional diffusion model
CN121313132A
A fetal heart rate signal data enhancement method based on a conditional diffusion model
CN121313132B