A nuclear magnetic resonance spectrum noise reduction method and a nuclear magnetic resonance spectrum noise reduction device

By constructing a U-Net autoencoder through a lightweight neural network and utilizing one-dimensional convolution and linear interpolation algorithms, the problems of long training time and unsatisfactory noise reduction effect of deep neural network models were solved, achieving efficient nuclear magnetic resonance spectrum noise reduction and improving signal integrity and accuracy.

CN117314765BActive Publication Date: 2025-09-23HEFEI UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311102399.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-30
Publication Date
2025-09-23
Estimated Expiration
2043-08-30

AI Technical Summary

Technical Problem

Among the existing NMR spectrum denoising methods, the training time cost of deep neural network models is high and the denoising effect is not ideal.

Method used

A lightweight neural network model is used to construct a U-Net autoencoder structure through one-dimensional convolution and linear interpolation algorithms to encode, optimize and decode low signal-to-noise ratio nuclear magnetic spectrum data. Combined with diverse noise data training samples, the network's noise suppression and weak peak recovery capabilities are improved.

Benefits of technology

The experimental acquisition time is shortened, the noise reduction quality and signal integrity are improved, the number of model parameters is reduced, the generation of high-frequency artifacts is avoided, and the accuracy and noise reduction effect of the network are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117314765B_ABST
    Figure CN117314765B_ABST
Patent Text Reader

Abstract

The present invention relates to a method for reducing the noise of a nuclear magnetic resonance spectrum and a device for reducing the noise of a nuclear magnetic resonance spectrum. The method adopts a deep neural network model, and its design method includes: encoding the low signal-to-noise ratio nuclear magnetic spectrum data m times in sequence to obtain a feature map; optimizing the feature map to obtain an intermediate feature map; decoding the intermediate feature map m times in sequence, and superimposing the encoding output of the corresponding number of flashbacks during each decoding to finally obtain a decoded feature map; superimposing the low signal-to-noise ratio nuclear magnetic spectrum data on the decoded feature map and then reconstructing the data to obtain high signal-to-noise ratio nuclear magnetic spectrum data. The present invention inputs the low signal-to-noise ratio nuclear magnetic spectrum data obtained by a small number of acquisition times into a deep neural network to obtain high signal-to-noise ratio nuclear magnetic spectrum data, thereby achieving high denoising quality, reliable results, short reconstruction time, and having broad application prospects.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a denoising method in the field of nuclear magnetic resonance spectrum denoising, and in particular to a nuclear magnetic resonance spectrum denoising method based on a lightweight neural network. Background Art

[0002] Magnetic resonance spectroscopy (MRI) is an analytical method based on the interaction between the nuclear magnetic moments of atomic nuclei within molecules and strong magnetic fields. It obtains information about molecular structure and chemical bonds by applying radiofrequency electromagnetic waves to the nuclei and detecting the magnetic field effects. This analytical method, with its high accuracy and resolution, is widely used in research in chemistry, biology, and medicine, and can be applied to the detection of brain diseases, material structure, and electronic states. When denoising MRI data, both data accuracy and noise characteristics must be considered. Currently, commonly used denoising methods include baseline correction, peak intensity smoothing, signal-to-noise ratio enhancement, wavelet analysis, and principal component analysis. Deep learning-based denoising methods have also gained widespread application in recent years. Olaf et al. proposed the convolutional neural network (Unet), which uses an autoencoder architecture to encode input data into a lower-dimensional feature representation and restores it to the original data through a decoder. This network has been widely used in image segmentation and image denoising. Recently, Wu et al. proposed a Unet-based MRI denoising network, DNUnet, which achieved excellent denoising results for liquid NMR data. However, the large size of the network model and the high training time limit restrict its widespread application. Summary of the Invention

[0003] Based on this, it is necessary to address the technical problems of high training time cost and unsatisfactory noise reduction effect of the deep neural network model adopted in the existing nuclear magnetic resonance spectrum denoising method. The present invention provides a nuclear magnetic resonance spectrum denoising method based on a lightweight neural network.

[0004] The present invention is implemented by the following technical solution: a method for reducing the noise of nuclear magnetic resonance spectra, which inputs low signal-to-noise ratio nuclear magnetic resonance spectrum data into a deep neural network model for noise reduction to obtain high signal-to-noise ratio nuclear magnetic resonance spectrum data; the deep neural network model design method includes the following steps:

[0005] Step S1: Encode the low signal-to-noise ratio nuclear magnetic spectrum data m times in sequence to obtain the encoding feature map DResult m ;

[0006] Step S2: Encode the feature map DResult m Optimize to get the intermediate feature map Result mid ;

[0007] Step S3, the intermediate feature map Result midPerform m decodings in sequence, and in each decoding, the encoding feature map of the corresponding number of flashbacks needs to be superimposed, and finally the decoding feature map UResult is obtained m ;

[0008] Step S4, decode the feature map UResult m The low signal-to-noise ratio nuclear magnetic spectrum data are superimposed and then data reconstruction is performed to obtain the high signal-to-noise ratio nuclear magnetic spectrum data.

[0009] As a further improvement of the above solution, in step S1, the encoding method of m-time encoding includes the following steps:

[0010] Step S11, performing one-dimensional convolution processing on the low signal-to-noise ratio nuclear magnetic spectrum data;

[0011] Step S12, performing batch normalization processing on the low signal-to-noise ratio nuclear magnetic spectrum data after the one-dimensional convolution processing;

[0012] Step S13, performing activation processing on the low signal-to-noise ratio nuclear magnetic spectrum data after batch normalization processing according to the activation function to obtain the mth feature map DCResult1 to be superimposed;

[0013] Step S14, for each data point on the characteristic graph DCResult1, corresponding spectrum data is obtained to form the first encoded characteristic graph DResult1;

[0014] Repeat steps S11 to S14 for m times on the feature graph DResult1 to obtain the feature graph DResult1. m , and the feature maps DCResult for the 1st to mth times to be superimposed m ~DCResult1.

[0015] Furthermore, in step S2, the feature graph DResult m The optimization method includes the following steps:

[0016] Step S21: the feature graph DResult m Perform one-dimensional convolution processing;

[0017] Step S22: the feature map DResult after one-dimensional convolution processing m Perform batch normalization;

[0018] Step S13: The feature map DResult after batch normalization is processed according to the activation function m Perform activation processing to obtain the intermediate feature map Result mid .

[0019] Furthermore, in step S3, the decoding method for m-times decoding includes the following steps:

[0020] Step S31: The intermediate feature map Result mid Perform linear interpolation to expand the dimension;

[0021] Step S32: Result after dimension expansion mid Overlay the mth feature map DCResult to be superimposed m , get the superimposed feature map DUResult1;

[0022] Step S33, performing one-dimensional convolution processing on the superimposed feature map DUResult1;

[0023] Step S34, performing batch normalization processing on the superimposed feature map DUResult1 after the one-dimensional convolution processing;

[0024] Step S35, performing activation processing on the batch normalized superposition feature map DUResult1 according to the activation function to obtain the first decoding feature map UResult1;

[0025] Repeat steps S31 to S35 for m times on the decoding feature map UResult1 to obtain the decoding feature map UResult of the mth decoding. m .

[0026] Preferably, in step S3, the data reconstruction method includes the following steps:

[0027] Step S41: Decode the feature map UResult m superimposing the low signal-to-noise ratio nuclear magnetic spectrum data;

[0028] Step S42: Decoding the superimposed decoding feature map UResult m Perform one-dimensional convolution processing;

[0029] Step S43: The decoded feature map UResult after one-dimensional convolution processing is processed according to the activation function m Activation processing is performed to obtain the high signal-to-noise ratio nuclear magnetic spectrum data.

[0030] More preferably, in the m-th encoding, the convolution kernel of the corresponding one-dimensional convolution is 15, the step size is 1, and zero padding is performed;

[0031] In the optimization method, the convolution kernel of the corresponding one-dimensional convolution is 15, the stride is 1, and zero padding is performed;

[0032] In the m-th decoding, the corresponding one-dimensional convolution has a kernel size of 5, a stride of 1, and zero padding;

[0033] In data reconstruction, the convolution kernel of the corresponding one-dimensional convolution is 1, the stride is 1, and no zero padding is performed.

[0034] More preferably, in the m-th encoding, the corresponding activation function adopts the LeakyRelu activation function;

[0035] In the optimization method, the corresponding activation function adopts the LeakyRelu activation function;

[0036] In the m-th decoding, the corresponding activation function adopts the LeakyRelu activation function;

[0037] In data reconstruction, the corresponding activation function uses the tanh activation function.

[0038] As a further improvement to the above solution, the nuclear magnetic resonance spectrum noise reduction method further includes the following steps:

[0039] The trained deep neural network model is used to perform corresponding data processing; the training method of the deep neural network model includes the following steps:

[0040] Step S51, using the formula FID=Ae i2πf1t1 e -t1 / T2 A series of one-dimensional NMR data are generated as training sample sets according to different A, f1, and T2, where A is the amplitude, f1 is the frequency, T2 is the relaxation time, t1 is the simulation sampling time point, and i is the imaginary part mark;

[0041] Step S52: The noise in each training sample is white noise Noise, which is generated using the formula Noise = n*(randn(1, NF2) + i*randn(1, NF2)), where n is the number of sampling points within the intensity range of the noise, NF2 is the number of sampling points in the direct dimension of the noise, and randn(1, NF2) represents white noise with NF2 points.

[0042] Step S54: superimpose each training sample FID and the corresponding white noise to obtain the training sample FID noisy ;

[0043] Step S55: Use four noise data with different signal-to-noise ratios for each training sample. Corresponding to the same noise-free label signal Y k , the kth data pair of training data is represented as

[0044] Step S56: Iteratively train the deep neural network model according to the training sample X until the corresponding normalized mean square error loss function converges, and then terminate the training. The current deep neural network model is the trained deep neural network model.

[0045] Furthermore, after step S52, the training sample FID is preprocessed. The preprocessing method of the training sample FID includes the following steps:

[0046] Step S531, performing Fourier transform on the training sample FID;

[0047] Step S532, normalizing the real and imaginary parts of the Fourier transformed training sample FID according to the maximum value of the real part of the signal;

[0048] Step S533, performing inverse Fourier transform on the normalized result to obtain FID2;

[0049] Therefore, the training sample FID noisy =FID2+Noise.

[0050] The present invention also provides a nuclear magnetic resonance spectrum noise reduction device, which applies any of the above-mentioned nuclear magnetic resonance spectrum noise reduction methods, and the nuclear magnetic resonance spectrum noise reduction device comprises:

[0051] The encoder module is used to encode the low signal-to-noise ratio nuclear magnetic spectrum data m times in sequence to obtain a feature map DResult m ;

[0052] The intermediate module is used to perform the feature map DResult m Optimize to get the intermediate feature map Result mid ;

[0053] The decoder module is used to decode the intermediate feature map Result mid Perform m decodings in sequence, and in each decoding, the corresponding number of reverse coding outputs must be superimposed, and finally the decoding feature map UResult is obtained. m ;

[0054] Output module, which is used to decode the feature map UResult m The low signal-to-noise ratio nuclear magnetic spectrum data are superimposed and then data reconstruction is performed to obtain the high signal-to-noise ratio nuclear magnetic spectrum data.

[0055] Compared with the prior art, the nuclear magnetic resonance spectrum noise reduction method of the present invention has the following beneficial effects:

[0056] (1) The deep neural network model used is a U-Net-based autoencoder structure that constructs a mapping from low signal-to-noise ratio to high signal-to-noise ratio NMR spectra, shortening the experimental acquisition time. Compared with ordinary convolutional neural networks, this structure can extract feature information of different scales through the encoder, better retaining small features, and has high application value for NMR spectral data.

[0057] (2) Different from the two-dimensional convolution of traditional Unet, the encoder module is implemented using one-dimensional convolution. For one-dimensional nuclear magnetic resonance data, one-dimensional convolution better maintains the integrity of the signal. At the same time, the convolution function of the encoder module uses a smaller number of convolution kernels, which greatly reduces the number of network parameters.

[0058] (3) The deconvolution part uses a linear interpolation algorithm. To restore the dimension of the feature map, the advantage of this method is that there are no parameters that need to be learned, which can reduce the number of model parameters. In addition, the linear interpolation method can avoid the generation of high-frequency artifacts to improve the accuracy of the network.

[0059] (4) Due to the diversity of noise data, four different sizes of white noise are added to the same simulated data sample label. This method can improve the network's ability to suppress noise and recover weak peaks. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] Figure 1 A flowchart of a method for reducing noise in nuclear magnetic resonance spectra provided by an embodiment of the present invention.

[0061] Figure 2 For application Figure 1 Functional module diagram of the nuclear magnetic resonance spectrum noise reduction device of the nuclear magnetic resonance spectrum noise reduction method.

[0062] Figure 3 for Figure 1 Flowchart of the encoding method used in the NMR spectrum noise reduction method.

[0063] Figure 4 for Figure 1 Characteristic graph DResult used in the NMR spectrum noise reduction method m Flowchart of the optimization method.

[0064] Figure 5 for Figure 1 Flowchart of the decoding method used in the NMR spectrum noise reduction method.

[0065] Figure 6 for Figure 1 Flowchart of the data reconstruction method used in the NMR spectrum noise reduction method.

[0066] Figure 7 for Figure 1Flowchart of the method for setting the training sample set used in training the deep neural network model used in the nuclear magnetic resonance spectrum denoising method.

[0067] Figure 8 For application Figure 1 Schematic diagram of the experimental results of the NMR spectrum noise reduction method. DETAILED DESCRIPTION

[0068] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.

[0069] The nuclear magnetic resonance spectrum denoising method of this embodiment is used to input low signal-to-noise ratio nuclear magnetic resonance spectrum data into a deep neural network model for denoising to obtain high signal-to-noise ratio nuclear magnetic resonance spectrum data. In this embodiment, the deep neural network model is designed as a lightweight neural network model. Based on the lightweight neural network model, the present invention can input low signal-to-noise ratio nuclear magnetic resonance spectrum data obtained through a small number of acquisition times into the lightweight neural network model to obtain high signal-to-noise ratio nuclear magnetic resonance spectrum data. This invention has high denoising quality, reliable results, short reconstruction time, and has broad application prospects.

[0070] See also Figure 1 and Figure 2 , Figure 1 A flow chart of a method for reducing noise in nuclear magnetic resonance spectra provided by an embodiment of the present invention; Figure 2 Schematic diagram of the functional modules of the nuclear magnetic resonance spectrum denoising device provided in an embodiment of the present invention. In the present embodiment, the sample used is azithromycin, the data collected are the one-dimensional spectrum data of azithromycin, and the instrument used is a Varian 500MHz nuclear magnetic resonance spectrometer. The nuclear magnetic resonance spectrum denoising method of the present invention can be configured in the form of software when specifically applied, such as being designed as an independent APP, or being an embedded software that can be called at any time and applied in a computer terminal. The computer terminal may include a memory, a processor, and a computer program stored on the memory and running on the processor. The computer terminal may also be a smart phone, a tablet computer, a laptop computer, etc. that can execute a program. The processor may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chips in some embodiments. The processor is generally used to control the overall operation of a computer device. In the present embodiment, the processor is used to run the program code stored in the memory or process data. The steps of the nuclear magnetic resonance spectrum denoising method of the present invention can be implemented when the processor executes the program.

[0071] The nuclear magnetic resonance spectrum noise reduction method of the present invention can also be designed as a readable storage medium, such as a USB shield, in which computer program instructions are stored. When the computer program instructions are read and executed by a processor, any step of the above-mentioned nuclear magnetic resonance spectrum noise reduction method is executed. Made in the form of a USB shield, it can be plugged into a traditional noise reduction analyzer by electronic plug-in. The noise reduction analyzer can solve the technical problems of high training time cost and unsatisfactory noise reduction effect of the deep neural network model used in the traditional nuclear magnetic resonance spectrum noise reduction method when reducing the noise of the nuclear magnetic resonance spectrum by reading and executing the computer program instructions in the USB shield. Therefore, the upgrade and transformation of the traditional noise reduction analyzer can be achieved by using the USB shield, which is conducive to the promotion and application of the present invention.

[0072] Regardless of whether it is non-embedded or embedded, the NMR spectrum denoising method can be summarized as a corresponding NMR spectrum denoising device, the purpose of which is to denoise the spectrum data (i.e., low signal-to-noise ratio NMR spectrum data) through the deep neural network model designed by the present invention to obtain a denoised spectrum (high signal-to-noise ratio NMR spectrum data). The device mainly includes an encoder module, an intermediate module, a decoder module, and an output module.

[0073] The design method of the deep neural network model mainly includes the following four steps.

[0074] Step S1: Encode the low signal-to-noise ratio nuclear magnetic spectrum data m times in sequence to obtain a characteristic graph DResult m .

[0075] This step is performed by the encoder module, which implements the following functions: Figure 3 As shown, Figure 3 for Figure 1 Flowchart of the encoding method used in the nuclear magnetic resonance spectrum noise reduction method. The encoding method encodes the low signal-to-noise ratio nuclear magnetic spectrum data m times in sequence and finally outputs the feature map DResult m .

[0076] The encoding method of the m-time encoding comprises the following steps:

[0077] Step S11, performing one-dimensional convolution processing on the low signal-to-noise ratio nuclear magnetic spectrum data;

[0078] Step S12, performing batch normalization processing on the low signal-to-noise ratio nuclear magnetic spectrum data after the one-dimensional convolution processing;

[0079] Step S13, performing activation processing on the low signal-to-noise ratio nuclear magnetic spectrum data after batch normalization processing according to the activation function to obtain the mth feature map DCResult1 to be superimposed;

[0080] Step S14, for each data point on the characteristic graph DCResult1, corresponding spectrum data is obtained to form the first encoded characteristic graph DResult1;

[0081] Repeat steps S11 to S14 for m times on the feature graph DResult1 to obtain the feature graph DResult1. m , and the feature maps DCResult for the 1st to mth times to be superimposed m ~DCResult1.

[0082] The encoder module includes M downsampling modules, namely DSampleBlock1, ..., DSampleBlock m ,…,DSampleBlock M ; Among them, DSampleBlock m Denotes the m-th level downsampling module, where m = 1, 2, ..., M. Each downsampling module includes a one-dimensional convolution module, a batch normalization module, an activation function module, and a feature elimination module.

[0083] In the first encoding, the low signal-to-noise ratio nuclear magnetic spectrum data is input into the one-dimensional convolution module 1, and after passing through the batch normalization module 1 and the activation function module 1, the feature map DCResult1 to be superimposed for the mth time is obtained. In the present embodiment, the convolution kernel size of the one-dimensional convolution module 1 is 15, the convolution step size is 1, and zero padding is performed. The number of channels of the feature map DCResult1 is 24*m, and the size of the feature map remains unchanged. After passing through the feature elimination module 1, the resolution of the signal is converted to 1 / 2 times of the original to obtain the feature map DResult1. In the present embodiment, the corresponding spectrum data of every other data point on the feature map DCResult1 is obtained to form the feature map DResult1 for the first encoding.

[0084] Similarly, repeat steps S11 to S14 for m times on the feature graph DResult1 to obtain the feature graph DResult m , and the feature maps DCResult for the 1st to mth times to be superimposed m ~DCResult1.

[0085] Step S2: the feature graph DResult m Optimize to get the intermediate feature map Result mid .

[0086] This step is performed by the intermediate module, and the functions implemented by the intermediate module are as follows: Figure 4 As shown, Figure 4 for Figure 1Characteristic graph DResult used in the NMR spectrum noise reduction method m Flowchart of the optimization method. Feature graph DResult m The optimization method includes the following steps:

[0087] Step S21: the feature graph DResult m Perform one-dimensional convolution processing;

[0088] Step S22: the feature map DResult after one-dimensional convolution processing m Perform batch normalization;

[0089] Step S13: The feature map DResult after batch normalization is processed according to the activation function m Perform activation processing to obtain the intermediate feature map Result mid .

[0090] The intermediate modules include one-dimensional convolutional layer module 2, batch normalization module 2 and activation function module 2. Feature map DResult m After processing by the intermediate module, the intermediate feature map Result is output mid , the number of channels in the middle layer is 288, the convolution kernel size is 15, the convolution step is 1, and zero padding is performed.

[0091] Step S3, the intermediate feature map Result mid Perform m decodings in sequence, and in each decoding, the corresponding number of reverse coding outputs must be superimposed, and finally the decoding feature map UResult is obtained. m .

[0092] This step is performed by the decoder module, which implements the following functions: Figure 5 As shown, Figure 5 for Figure 1 Flowchart of the decoding method used in the nuclear magnetic resonance spectrum noise reduction method. The decoding method performs the decoding on the intermediate feature map Result mid Perform m decoding operations in sequence and finally output the decoding feature map UResult m .

[0093] The decoding method of the m-time decoding comprises the following steps:

[0094] Step S31: The intermediate feature map Result mid Perform linear interpolation to expand the dimension;

[0095] Step S32: Result after dimension expansion mid Overlay the mth feature map DCResult to be superimposed m , get the superimposed feature map DUResult1;

[0096] Step S33, performing one-dimensional convolution processing on the superimposed feature map DUResult1;

[0097] Step S12, performing batch normalization processing on the superimposed feature map DUResult1 after the one-dimensional convolution processing;

[0098] Step S13, performing activation processing on the batch normalized superposition feature map DUResult1 according to the activation function to obtain the first decoding feature map UResult1;

[0099] Repeat steps S31 to S34 for m times on the decoding feature map UResult1 to obtain the decoding feature map UResult of the mth decoding. m .

[0100] In the decoder module, by using the linear interpolation algorithm, To restore the dimension of the feature map, the advantage of this method is that there are no parameters that need to be learned, which can reduce the number of model parameters. In addition, the linear interpolation method can avoid the generation of high-frequency artifacts to improve the accuracy of the network.

[0101] The decoder module consists of M upsampling modules, which are USampleBlock1, ..., USampleBlock m ,…,USampleBlock M Among them, USampleBlock m Denotes the mth level upsampling module, m = 1, 2, ..., M. Each upsampling module includes a linear interpolation function module, a superposition module 1, a one-dimensional convolution module 3, a batch normalization layer module 3 and an activation function module 3. In this embodiment, M = 12, so the mth level upsampling module DSampleBlock m This is the third upsampling module of the 12th level.

[0102] When m=1, the decoder module receives the feature map Result mid , Result mid After linear interpolation and dimension expansion, the output DCResult of the decoder part 11 The layers are stacked according to the number of channels, followed by one-dimensional convolution for feature fusion, resulting in the upsampling module's output, UResult1, which has 264 channels and a feature map twice the size of the input. The one-dimensional convolution uses a kernel size of 5, a stride of 1, and zero padding.

[0103] When m=2,3…M, the decoder module receives the feature map UResult m-1 , Resultm-1 After linear interpolation and dimension expansion, the output DCResult of the decoder part 12-m The channels are superimposed and then one-dimensional convolution is performed to fuse the features to obtain the output UResult of the upsampling module. m , the number of channels is 288-24*m, and the feature map size is 2 m+1 The one-dimensional convolution parameters used by the decoder module are all the same.

[0104] Step S4: Decode the feature map UResult m The low signal-to-noise ratio nuclear magnetic spectrum data are superimposed and then data reconstruction is performed to obtain the high signal-to-noise ratio nuclear magnetic spectrum data.

[0105] This step is performed by the output module, and the functions implemented by the output module are as follows: Figure 6 As shown, Figure 6 for Figure 1 Flowchart of the data reconstruction method used in the NMR spectrum denoising method. The output module includes a superposition module 2, a one-dimensional convolution module 4, and an activation function module 4. The one-dimensional convolution module 4 uses a convolution kernel size of 1, a step size of 1, and no zero padding. In this embodiment, the final output data size is 8192, consistent with the input sample, i.e., NMR spectrum data with a high signal-to-noise ratio.

[0106] The data reconstruction method comprises the following steps:

[0107] Step S41: Decode the feature map UResult m superimposing the low signal-to-noise ratio nuclear magnetic spectrum data;

[0108] Step S42: Decoding the superimposed decoding feature map UResult m Perform one-dimensional convolution processing;

[0109] Step S43: The decoded feature map UResult after one-dimensional convolution processing is processed according to the activation function m Activation processing is performed to obtain the high signal-to-noise ratio nuclear magnetic spectrum data.

[0110] The present invention is different from the two-dimensional convolution of traditional Unet. The encoder module of this network is implemented using one-dimensional convolution. For one-dimensional nuclear magnetic resonance data, one-dimensional convolution better maintains the integrity of the signal. At the same time, the one-dimensional convolution of the encoder module uses a smaller number of convolution kernels than the encoder module, which greatly reduces the number of network parameters. There are no special requirements for the specific one-dimensional convolution function. In this embodiment, in the m-time encoding, the convolution kernel of the corresponding one-dimensional convolution is 15, the step size is 1, and zero padding is performed; in the optimization method, the convolution kernel of the corresponding one-dimensional convolution is 15, the step size is 1, and zero padding is performed; in the m-time decoding, the convolution kernel of the corresponding one-dimensional convolution is 5, the step size is 1, and zero padding is performed; in data reconstruction, the convolution kernel of the corresponding one-dimensional convolution is 1, the step size is 1, and no zero padding is performed.

[0111] There are no special requirements for the activation function. It is best that in the m-time encoding, the corresponding activation function adopts the LeakyRelu activation function; in the optimization method, the corresponding activation function adopts the LeakyRelu activation function; in the m-time decoding, the corresponding activation function adopts the LeakyRelu activation function; in data reconstruction, the corresponding activation function adopts the tanh activation function.

[0112] The above is an introduction to the specific structure of the deep neural network model used in the nuclear magnetic resonance spectrum denoising method of the present invention. It is best to perform training processing on the established deep neural network model, so that the trained deep neural network model can be used to perform corresponding data processing. In this embodiment, the method for setting the training sample set used in the training of the deep neural network model includes the following steps.

[0113] Using the formula Generate ideal one-dimensional nuclear magnetic resonance data, where A, f1, and T2 are the amplitude, frequency, and relaxation time of the ideal data, respectively. These parameter values ​​are randomly set within a certain range to generate random spectral peaks, and nuclear magnetic resonance data containing multiple spectral peaks are obtained by adding multiple spectral peaks. The noise in the training sample is white noise, generated using the formula Noise = n*(randn(1, NF2) + i*randn(1, NF2)), where n and NF2 represent the intensity range of the noise and the number of sampling points in the direct dimension, respectively. Before adding noise, perform Fourier transform on the FID signal, and normalize the real and imaginary parts of the result according to the maximum value of the real part of the signal. Then perform inverse Fourier transform on the normalized result to obtain FID2. The noisy FID signal can be obtained by the formula FID noisy =FID2+Noise generation, the training data set uses four noise data with different signal-to-noise ratios Corresponding to the same noise-free label signal Y k (Remember that the low signal-to-noise ratio data is X, and the label data is Y, then X=fft(FIDnoisy ), Y = fft(FID)), the i-th data pair of training data can be expressed as where X i , Y i The size of both is 8192.

[0114] That is, see Figure 7 , Figure 7 for Figure 1 A flowchart of a method for setting a training sample set used in training a deep neural network employed in a method for denoising nuclear magnetic resonance spectra. The method for setting a training sample set includes the following steps.

[0115] Step S51, using formula A series of one-dimensional NMR data are generated as training sample sets according to different A, f1, and T2, where A is the amplitude, f1 is the frequency, T2 is the relaxation time, t1 is the simulation sampling time point, and i is the imaginary part mark.

[0116] The training sample FID can be preprocessed. This method includes the following steps: Step S531, performing a Fourier transform on the training sample FID; Step S532, normalizing both the real and imaginary parts of the Fourier-transformed training sample FID according to the maximum value of the real part of the signal; Step S533, performing an inverse Fourier transform on the normalized result to obtain FID2. Due to the diversity of noisy data, four different levels of white noise are added to the same simulated data sample label. This method can improve the network's resilience to noise and weak peaks.

[0117] In step S52, the noise in each training sample is white noise, generated using the formula Noise = n*(randn(1, NF2) + i*randn(1, NF2)), where n is the number of sampling points within the noise intensity range, NF2 is the number of sampling points in the direct dimension of the noise, and randn(1, NF2) represents white noise with NF2 points. A complete FID signal consists of 8192 FID data points.

[0118] Step S54: superimpose each training sample FID and the corresponding white noise to obtain the training sample FID noisy Therefore, the training sample FID noisy =FID2+Noise.

[0119] Step S55: For each training sample, four noise data with different signal-to-noise ratios are used to correspond to the same noise-free label signal, and the low signal-to-noise ratio data is recorded as X=fft(FID noisy ), the label data is Y = fft(FID), and the kth data pair of the training data is expressed as

[0120] Step S56: Iteratively train the deep neural network model according to the training sample X until the corresponding normalized mean square error loss function converges, and then terminate the training. The current deep neural network model is the trained deep neural network model.

[0121] Compare the network output with the labeled data: Use the normalized mean square error loss function shown in formula (1) to calculate the difference between the two. Then use the backpropagation algorithm combined with the Adam optimizer to update the network weights of all one-dimensional convolutions. After the next batch of data is fed into the network, repeat the above steps, iteratively update the network parameters, and record the loss value each time. When the loss function converges, terminate the training and obtain the expected network model.

[0122] In this example, the model was trained using the early stopping method. When the loss function value did not decrease for 20 consecutive times, the learning rate was adjusted to 1 / 3 of the original value, and training continued. When the loss function value in the second round of training did not decrease for 20 consecutive times, the network was considered to have converged, and the model with the lowest loss function value during the training process was recorded as the best model. In this example, the network was iteratively trained for 100 times until convergence. The model generated by the 80th iteration was recorded as the best model and subsequent experiments were carried out. The loss function value was 0.03, and the learning rates for the two rounds of training were 0.003 and 0.001, respectively.

[0123] Construct the back propagation loss function L, as shown in formula (1):

[0124] L=L NMSE (1)

[0125] In formula (1), L NMSE is the normalized root mean square error, which can be obtained from formula (2):

[0126]

[0127] In formula (2), f(j) is the low signal-to-noise ratio data of point j, is the label data of the j-th point.

[0128] In step 2.6, the Adam optimizer is used to update the network weights, calculate the loss function, iteratively update the network parameters, and record the loss value each time. When the loss function converges, training is terminated to obtain the desired network model. In this example, the network converged after 21 iterations, and the loss error was 0.03.

[0129] In this embodiment, a Varian 500MHzh nuclear magnetic resonance instrument was used to sample the nuclear magnetic resonance spectrum of azithromycin. The one-dimensional data was repeatedly sampled 4 times, and then the experimental data was Fourier transformed to obtain the frequency domain data and a phase correction program was added. The final experimental spectra were as follows: Figure 8 The network trained by the above steps is repeated 4 times and the output of the network is the result after noise reduction, as shown in the area (a) in the figure. Figure 8 In general, this method uses less computing resources and achieves better noise reduction effect.

[0130] The present invention constructs a mapping between low signal-to-noise ratio nuclear magnetic resonance data and high signal-to-noise ratio nuclear magnetic resonance data, trains and optimizes network parameters, and obtains an expected deep neural network model. The low signal-to-noise ratio nuclear magnetic resonance spectrum data obtained through a small number of acquisition times is input into the expected deep neural network model to obtain high signal-to-noise ratio nuclear magnetic resonance spectrum data. The present invention has high denoising quality, reliable results, short reconstruction time, and has broad application prospects.

[0131] The above-described embodiments merely illustrate several implementations of the present invention, and while their descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the patent. It should be noted that a person skilled in the art would be able to make numerous variations and improvements without departing from the spirit of the present invention, all of which fall within the scope of protection of the present invention. Therefore, the scope of protection of the patent for this invention shall be determined by the appended claims.

Claims

1. A method for reducing the noise of nuclear magnetic resonance spectra, which inputs low signal-to-noise ratio nuclear magnetic resonance spectrum data into a deep neural network model for noise reduction to obtain high signal-to-noise ratio nuclear magnetic resonance spectrum data; characterized in that: The deep neural network model design method comprises the following steps: Step S1, the low signal-to-noise ratio nuclear magnetic spectrum data are sequentially m Second encoding to obtain the encoding feature map DResult m ; Step S2: Encoding feature map DResult m Optimize to get the intermediate feature map Result mid ; Step S3, the intermediate feature map Result mid Proceed in sequence m Decoding, each time you decode, you need to superimpose the encoding feature map of the corresponding number of flashbacks, and finally get the decoding feature map UResult m ; Step S4: Decode the feature map UResult m superimposing the low signal-to-noise ratio nuclear magnetic spectrum data and then reconstructing the data to obtain the high signal-to-noise ratio nuclear magnetic spectrum data; In step S1, the m The encoding method of the secondary encoding comprises the following steps: Step S11, performing one-dimensional convolution processing on the low signal-to-noise ratio nuclear magnetic spectrum data; Step S12, performing batch normalization processing on the low signal-to-noise ratio nuclear magnetic spectrum data after the one-dimensional convolution processing; Step S13, performing activation processing on the low signal-to-noise ratio nuclear magnetic spectrum data after batch normalization processing according to the activation function, and obtaining the first m The feature map to be superimposed DCResult 1; Step S14: feature map DCResult 1, and obtain the corresponding spectrum data for every other data point to form the first encoded feature map DResult 1; Feature Map DResult 1 Repeat steps S11 to S14 for m times to obtain the characteristic graph DResult m , and 1st to m The feature map to be superimposed DCResult m ~ DCResult 1; In step S2, the feature map DResult m The optimization method includes the following steps: Step S21: feature map DResult m Perform one-dimensional convolution processing; Step S22: the feature map after one-dimensional convolution processing DResult m Perform batch normalization; Step S13: The feature map after batch normalization is processed according to the activation function DResult m Perform activation processing to obtain the intermediate feature map Result mid ; In step S3, the m The decoding method of the secondary decoding comprises the following steps: Step S31: The intermediate feature map Result mid Perform linear interpolation to expand the dimension; Step S32: after the dimension expansion Result mid Superposition m The feature map to be superimposed DCResult m , and get the superimposed feature map DUResult 1; Step S33: Overlay feature map DUResult 1. Perform one-dimensional convolution processing; Step S34, superimpose the feature map after one-dimensional convolution processing DUResult 1. Perform batch normalization; Step S35: The superimposed feature map after batch normalization is processed according to the activation function DUResult 1. Perform activation processing to obtain the decoding feature map of the first decoding UResult 1; Decoding feature map UResult 1 Repeat steps S31 to S35 for m times to obtain m Decoding feature map of the second decoding UResult m .

2. The method for reducing noise in nuclear magnetic resonance spectrum according to claim 1, wherein: In step S3, the data reconstruction method includes the following steps: Step S41: Decode the feature map UResult m superimposing the low signal-to-noise ratio nuclear magnetic spectrum data; Step S42: Decoding the superimposed feature map UResult m Perform one-dimensional convolution processing; Step S43: Decoding the feature map after one-dimensional convolution processing according to the activation function UResult m Activation processing is performed to obtain the high signal-to-noise ratio nuclear magnetic spectrum data.

3. The method for reducing noise in nuclear magnetic resonance spectrum according to claim 2, wherein: exist m In the sub-encoding, the convolution kernel of the corresponding one-dimensional convolution is 15, the stride is 1, and zero padding is performed; In the optimization method, the convolution kernel of the corresponding one-dimensional convolution is 15, the stride is 1, and zero padding is performed; exist m In the decoding, the corresponding one-dimensional convolution has a kernel size of 5, a stride of 1, and is zero-padded. In data reconstruction, the convolution kernel of the corresponding one-dimensional convolution is 1, the stride is 1, and no zero padding is performed.

4. The method for reducing noise in nuclear magnetic resonance spectrum according to claim 2, wherein: exist m In the sub-encoding, the corresponding activation function is LeakyRelu Activation function; In the optimization method, the corresponding activation function adopts LeakyRelu Activation function; exist m In the decoding, the corresponding activation function is LeakyRelu Activation function; In data reconstruction, the corresponding activation function adopts tanh Activation function.

5. The method for reducing noise in nuclear magnetic resonance spectrum according to claim 1, wherein: The nuclear magnetic resonance spectrum noise reduction method further comprises the following steps: The trained deep neural network model is used to perform corresponding data processing; the training method of the deep neural network model includes the following steps: Step S51, using formula According to different A 、 f 1. T 2 Generate a series of one-dimensional NMR data as a training sample set, where, A is the amplitude, f 1 is the frequency, T 2 is the relaxation time, t 1 is the simulation sampling time point, i is the imaginary part mark; Step S52: The noise in each training sample is white noise. Noise , using the formula Noise=n* ( randn (1, NF 2)+ i * randn (1, NF 2)) Generate, where n is the number of sampling points within the noise intensity range, NF 2 is the number of sampling points of the direct dimension of the noise, randn (1, NF 2) White noise with NF2 as the representative number of points; Step S54: superimpose each training sample FID and the corresponding white noise Noise Get training samples FID noisy ; Step S55: Use four noise data with different signal-to-noise ratios for each training sample. 、 、 、 Corresponding to the same noise-free label signal Y k , training data k The data pairs are represented as ; Step S56: Based on the training samples X The deep neural network model is iteratively trained until the corresponding normalized mean square error loss function converges, and the training is terminated. The current deep neural network model is the trained deep neural network model.

6. The method for reducing noise in nuclear magnetic resonance spectrum according to claim 5, characterized in that: After step S52, the training samples are also FID Do preprocessing, training samples FID The preprocessing method includes the following steps: Step S531: training samples FID Perform Fourier transform; Step S532: Fourier transform the training samples FID The real and imaginary parts of are normalized according to the maximum value of the real part of the signal; Step S533, perform inverse Fourier transform on the normalized result to obtain FID 2; Therefore, the training samples FID noisy = FID 2+ Noise .

7. A nuclear magnetic resonance spectrum noise reduction device, which uses the nuclear magnetic resonance spectrum noise reduction method according to any one of claims 1 to 6, characterized in that: The nuclear magnetic resonance spectrum noise reduction device comprises: The encoder module is used to sequentially process the low signal-to-noise ratio nuclear magnetic spectrum data. m Secondary encoding to obtain feature map DResult m ; The intermediate module is used to DResult m Optimize to get the intermediate feature map Result mid ; The decoder module is used to decode the intermediate feature maps Result mid Proceed in sequence m Decode multiple times. Each time you decode, you need to superimpose the corresponding number of reversed encoding outputs, and finally get the decoding feature map. UResult m ; Output module, which is used to decode feature maps UResult m The low signal-to-noise ratio nuclear magnetic spectrum data are superimposed and then data reconstruction is performed to obtain the high signal-to-noise ratio nuclear magnetic spectrum data.