Magnetic resonance spectrum reconstruction method and device based on unsupervised feature extraction network
By using an unsupervised feature extraction network and MoCo learning training, combined with a U-Net network and a self-attention module, the problems of high data acquisition cost and poor generalization performance in existing technologies are solved, and efficient and accurate nuclear magnetic resonance spectral reconstruction is achieved.
Patent Information
- Application Number
- CN202511023906.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-24
- Publication Date
- 2025-11-11
AI Technical Summary
Existing deep learning-based nuclear magnetic resonance spectral reconstruction methods rely on supervised learning of high signal-to-noise ratio reference spectra, resulting in high data acquisition costs and poor generalization performance, making them difficult to adapt to practical applications across devices and parameters.
An unsupervised feature extraction network is adopted. By constructing a simulated nuclear magnetic spectrum dataset and training it with MoCo, the network is combined with a U-Net network and a self-attention module for reconstruction. Simulated noise and phase processing are used to generate training data, reducing the dependence on label data.
This method enables efficient training of feature extraction networks under unlabeled data conditions, improving the generalization and reconstruction performance of the reconstruction network, as well as increasing processing speed and the accuracy of the reconstructed signal.
Smart Images

Figure CN120928258A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of magnetic resonance spectral reconstruction, and specifically to a method and apparatus for magnetic resonance spectral reconstruction based on an unsupervised feature extraction network. Background Technology
[0002] The core task of nuclear magnetic resonance (NMR) spectral reconstruction is to recover high-fidelity spectral features from disturbed experimental NMR signals. In recent years, deep learning-based NMR spectral reconstruction methods have gradually become a research hotspot in this field, mainly achieving feature learning from the disturbed signal to a high-fidelity spectrum by constructing an end-to-end mapping network. Existing algorithms typically employ supervised learning methods, whose effectiveness heavily relies on constructing a sufficiently rich, dispersed, and precisely labeled training sample set; that is, each training sample must simultaneously contain the low-quality signal to be reconstructed and its corresponding high signal-to-noise ratio (SNR) reference spectrum. However, this method faces several technical obstacles in practical applications:
[0003] (1) The high signal-to-noise ratio reference spectrum required by supervised learning methods needs to be obtained through costly methods such as extending the scanning time or repeated sampling, which significantly increases the data acquisition cost.
[0004] (2) Existing supervised learning models are highly dependent on the distribution of training data, which can easily lead to overfitting and exhibit significant degradation in generalization performance in practical applications across devices and parameters. How to effectively train under these undesirable data conditions and improve the network's generalization to adapt to experimental data with complex distributions is the key to advancing the practical application of deep learning technology in the field of nuclear magnetic resonance spectroscopy reconstruction. Summary of the Invention
[0005] The purpose of this application is to propose a magnetic resonance spectrum reconstruction method and apparatus based on an unsupervised feature extraction network to address the aforementioned technical problems.
[0006] In a first aspect, the present invention provides a magnetic resonance spectrum reconstruction method based on an unsupervised feature extraction network, comprising the following steps:
[0007] A simulated NMR spectrum dataset is constructed based on NMR spectral characteristics and relevant mathematical models. Normalization and augmentation processing are performed on each simulated NMR spectrum sample in the simulated NMR spectrum dataset to obtain the processed simulated NMR spectrum dataset.
[0008] A feature extraction network is constructed and trained using MoCo learning to obtain a trained feature extraction network; the feature extraction network includes a first encoder and a second encoder that are set in parallel and have the same structure.
[0009] A magnetic resonance spectrum reconstruction model is constructed and trained to obtain a trained magnetic resonance spectrum reconstruction model. The magnetic resonance spectrum reconstruction model includes a U-Net network, a self-attention module, and a feature extraction module. The feature extraction module is the second encoder in the trained feature extraction network.
[0010] The nuclear magnetic resonance (NMR) spectrum data to be reconstructed is acquired and normalized to obtain the processed NMR spectrum data. The processed NMR spectrum data is then input into the trained magnetic resonance spectrum reconstruction model to predict the corresponding one-dimensional spectrum.
[0011] Preferably, the first encoder and the second encoder have structures including a first convolutional layer, a first max pooling layer, a first feature processing module, a second feature processing module, a third feature processing module, an average pooling layer and a fully connected layer connected in sequence. The first feature processing module and the second feature processing module have the same structure, each including three first basic residual modules and a second max pooling layer connected in sequence. The third feature processing module includes three second basic residual modules connected in sequence.
[0012] Preferably, both the first basic residual module and the second basic residual module include a second convolutional layer, a third convolutional layer and a fourth convolutional layer connected in sequence. The input features of the first basic residual module and the output features of the fourth convolutional layer form a shortcut connection, and the input features of the second basic residual module and the output features of the fourth convolutional layer form a residual connection.
[0013] As a preferred option, during the MoCo learning and training process of the feature extraction network, a dynamic memory repository is constructed. In the initial state, the dynamic memory repository stores randomly generated negative sample features and adopts a first-in-first-out update strategy.
[0014] In the current round, one simulated NMR spectrum sample from the simulated NMR spectrum dataset is normalized and then subjected to two random augmentation processes to obtain two processed simulated NMR spectrum samples, which are then input into the first encoder and the second encoder, respectively. This yields the sample features and their corresponding positive sample features for the current round. Based on the sample features and their corresponding positive sample features for the current round, and the dynamic memory repository for the current round, the contrastive learning loss function for the first encoder is constructed, as shown in the following equation:
[0015]
[0016] Among them, Loss Q Let q represent the contrastive learning loss function of the first encoder, and k represent the sample features in the current round. + k represents the positive sample features of the current round. iLet represent the i-th negative sample feature in the dynamic memory repository of the current round, C represent the number of negative sample features in the dynamic memory repository, and τ be the temperature parameter;
[0017] The positive sample features of the current round will be stored in the dynamic memory repository and used as the negative sample features in the dynamic memory repository of the next round.
[0018] During each training round, the parameters of the first encoder are updated via backpropagation; the parameters of the second encoder are updated using the following formula:
[0019] θ K =Bθ K-1 +(1-B)θ Q ;
[0020] Where, θ K-1 θ represents the parameter of the second encoder in the previous round. K θ represents the parameters of the second encoder in the current round. Q This represents the parameters of the first encoder in the current round, where B represents the momentum value;
[0021] After multiple rounds of training, until the contrastive learning loss function drops below the target value or the set number of rounds is reached, the parameters of the first encoder and the second encoder in the last round are obtained, thus obtaining the trained feature extraction network.
[0022] Preferably, in the trained magnetic resonance spectroscopy reconstruction model, the processed nuclear magnetic resonance (NMR) spectral data is input into the feature extraction module to obtain low-dimensional features; the processed NMR spectral data is then input into the U-Net network to obtain the low-level features output by the encoding module of the U-Net network. The low-dimensional features and the low-level features are then input into the self-attention module to obtain the fused features, as shown in the following equation:
[0023]
[0024] Among them, X m X represents low-dimensional features. r Representing the underlying features, X new The fusion feature is represented by d, where d represents the feature dimension.
[0025] The fused features are input into the decoding module of the U-Net network to obtain the corresponding one-dimensional spectrum.
[0026] As a preferred embodiment, each simulated NMR spectrum sample in the simulated NMR spectrum dataset is represented as follows:
[0027]
[0028] Where m is the total number of frequency components contained in the simulated NMR spectrum sample, A is the amplitude, f is the simulated nuclear resonance frequency, T2 is the transverse relaxation time, t is time, j is the imaginary unit, and g represents the g-th frequency component.
[0029] The normalization process is as follows:
[0030]
[0031] Among them, FID bfnorm FID represents the simulated NMR spectrum sample before normalization. norm This represents the normalized simulated NMR spectrum sample, and M represents the signal length of the original simulated NMR spectrum sample.
[0032] Augmentation processing includes randomly added noise and an initial phase. The noise addition process is as follows:
[0033] FID noise =FID bfnoise +(noise real +j·noise imag );
[0034] Among them, FID bfnoise This represents the simulated NMR spectrum sample before noise was added, FID. noise This represents the simulated NMR spectrum sample after adding noise. real and noise imag These are the real noise and the imaginary noise, respectively.
[0035] noise real noise imag ~N(0, noise) level 2 ), noise level Indicates the noise level, N(0, noise) level 2 () indicates a mean of 0 and a standard deviation of 0. level Gaussian distribution,
[0036] The process of adding the initial phase is as follows:
[0037] FID phase =FID bfphase ×e jφ ;
[0038] Where φ is the initial phase added, with a magnitude between 0 and 2π, FID bfphase This represents the simulated NMR spectrum sample before adding the initial phase, FID. phase This represents the simulated NMR spectrum sample after adding the initial phase.
[0039] Secondly, the present invention provides a magnetic resonance spectral reconstruction device based on an unsupervised feature extraction network, comprising:
[0040] The dataset construction module is configured to construct a simulated NMR spectrum dataset based on NMR spectrum characteristics and relevant mathematical models; and to perform normalization and augmentation processing on each simulated NMR spectrum sample in the simulated NMR spectrum dataset to obtain the processed simulated NMR spectrum dataset.
[0041] The network construction module is configured to build a feature extraction network and perform MoCo learning training to obtain a trained feature extraction network; the feature extraction network includes a first encoder and a second encoder that are set in parallel and have the same structure.
[0042] The model building module is configured to build and train a magnetic resonance spectrum reconstruction model to obtain a trained magnetic resonance spectrum reconstruction model. The magnetic resonance spectrum reconstruction model includes a U-Net network, a self-attention module, and a feature extraction module. The feature extraction module is the second encoder in the trained feature extraction network.
[0043] The reconstruction module is configured to acquire the NMR spectrum data to be reconstructed and perform normalization processing to obtain the processed NMR spectrum data. The processed NMR spectrum data is then input into the trained magnetic resonance spectrum reconstruction model to predict the corresponding one-dimensional spectrum.
[0044] Thirdly, the present invention provides an electronic device including one or more processors; and a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any implementation of the first aspect.
[0045] Fourthly, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method as described in any of the implementations of the first aspect.
[0046] Fifthly, the present invention provides a computer program product, including a computer program that, when executed by a processor, implements the method as described in any of the implementations in the first aspect.
[0047] Compared with the prior art, the present invention has the following beneficial effects:
[0048] (1) The magnetic resonance spectrum reconstruction method based on unsupervised feature extraction network proposed in this invention uses nuclear magnetic spectrum features combined with relevant mathematical models to construct a simulated nuclear magnetic spectrum dataset, and uses added noise and initial phase to simulate experimental data. Therefore, it is not necessary to collect a large amount of experimental data to train the feature extraction network and the magnetic resonance spectrum reconstruction model.
[0049] (2) The magnetic resonance spectrum reconstruction method based on unsupervised feature extraction network proposed in this invention introduces unsupervised learning into the reconstruction task of nuclear magnetic spectrum data. The feature extraction network is trained using MoCo learning. Therefore, the training of the feature extraction network does not require a large amount of labeled data, and the obtained low-dimensional features have strong generalization ability.
[0050] (3) The magnetic resonance spectrum reconstruction method based on unsupervised feature extraction network proposed in this invention uses the second encoder in the trained feature extraction network as the feature extraction module, and uses the low-dimensional features output by the feature extraction module to assist in the reconstruction of nuclear magnetic resonance spectrum, thereby improving the reconstruction effect of the original reconstruction network and processing speed. Attached Figure Description
[0051] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0052] Figure 1 This is a schematic flowchart of the magnetic resonance spectral reconstruction method based on an unsupervised feature extraction network, which is an embodiment of this application.
[0053] Figure 2 This is a schematic diagram of the structure of the first encoder or the second encoder of the magnetic resonance spectrum reconstruction method based on unsupervised feature extraction network according to an embodiment of this application;
[0054] Figure 3 This is a schematic diagram of the structure of the first and second basic residual modules of the magnetic resonance spectrum reconstruction method based on unsupervised feature extraction network according to an embodiment of this application.
[0055] Figure 4 This is a schematic diagram of the magnetic resonance spectrum reconstruction model of the magnetic resonance spectrum reconstruction method based on unsupervised feature extraction network, which is an embodiment of this application.
[0056] Figure 5 This is a schematic diagram of the magnetic resonance spectral data to be processed, as shown in an embodiment of this application.
[0057] Figure 6This is a schematic diagram comparing the reconstruction result of the magnetic resonance spectral reconstruction method based on unsupervised feature extraction network according to an embodiment of this application with a reference signal;
[0058] Figure 7 This is a schematic diagram comparing the reconstruction results using only the U-Net network with the reference signal.
[0059] Figure 8 This is a schematic diagram of a magnetic resonance spectral reconstruction device based on an unsupervised feature extraction network, as an embodiment of this application.
[0060] Figure 9 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0061] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this invention, and not all of them. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.
[0062] Figure 1 This application illustrates an embodiment of a magnetic resonance spectral reconstruction method based on an unsupervised feature extraction network, comprising the following steps:
[0063] S1. Construct a simulated NMR spectrum dataset based on NMR spectrum characteristics and relevant mathematical models; normalize and augment each simulated NMR spectrum sample in the simulated NMR spectrum dataset to obtain the processed simulated NMR spectrum dataset.
[0064] In a specific embodiment, each simulated NMR spectrum sample in the simulated NMR spectrum dataset is represented as follows:
[0065]
[0066] Where m is the total number of frequency components contained in the simulated NMR spectrum sample, A is the amplitude, f is the simulated nuclear resonance frequency, T2 is the transverse relaxation time, t is time, j is the imaginary unit, and g represents the g-th frequency component.
[0067] The normalization process is as follows:
[0068]
[0069] Among them, FID bfnorm FID represents the simulated NMR spectrum sample before normalization. normThis represents the normalized simulated NMR spectrum sample, and M represents the signal length of the original simulated NMR spectrum sample.
[0070] Augmentation processing includes randomly added noise and an initial phase. The noise addition process is as follows:
[0071] FID noise =FID bfnoise +(noise real +j·noise imag );
[0072] Among them, FID bfnoise This represents the simulated NMR spectrum sample before noise was added, FID. noise This represents the simulated NMR spectrum sample after adding noise. real and noise imag These are the real noise and the imaginary noise, respectively.
[0073] noise real noise imag ~N(0, noise) level 2 ), noise level Indicates the noise level, N(0, noise) level 2 () indicates a mean of 0 and a standard deviation of 0. level Gaussian distribution,
[0074] The process of adding the initial phase is as follows:
[0075] FID phase =FID bfphase ×e jφ ;
[0076] Where φ is the initial phase added, with a magnitude between 0 and 2π, FID bfphase This represents the simulated NMR spectrum sample before adding the initial phase, FID. phase This represents the simulated NMR spectrum sample after adding the initial phase.
[0077] Specifically, embodiments of this application propose a mathematical model for generating simulated nuclear magnetic resonance (FID) spectra in training data. This mathematical model simulates different FID spectral signals by superimposing multiple frequency components. Indicates oscillation. The decay is indicated, hence the separate representation. In one embodiment, in this mathematical model, m is a random integer between 1 and 20, and A... g f is a random integer between 1 and 30.g The value is a random integer between 80 and 2000. The generated training data is divided into an 80% training set and a 20% test set. In other embodiments, other values may be selected.
[0078] Furthermore, the training data needs to be normalized and augmented. In a preferred embodiment, normalization is performed first, followed by augmentation. In one embodiment, M in the normalization calculation formula is set to 512. The augmentation process on the training data includes adding noise and initializing the phase. The added noise is Gaussian noise. In one embodiment, the added noise level is [not specified in the original text]. level The value is 0.05. The magnitude of the added initial phase is between 0 and 2π. Therefore, by randomly adding noise and initial phase, the simulated NMR spectra after augmentation are inconsistent. The subsequent feature extraction network can use comparative learning to eliminate these different noises and phase interferences, thereby learning the essential signal characteristics. This processing method is used to simulate possible instrument noise and phase interference in real-world experiments.
[0079] S2, construct a feature extraction network and perform MoCo learning training to obtain a trained feature extraction network; the feature extraction network includes a first encoder and a second encoder that are set in parallel and have the same structure.
[0080] In a specific embodiment, the structure of the first encoder and the second encoder includes a first convolutional layer, a first max pooling layer, a first feature processing module, a second feature processing module, a third feature processing module, an average pooling layer and a fully connected layer connected in sequence. The first feature processing module and the second feature processing module have the same structure, both including three first basic residual modules and a second max pooling layer connected in sequence. The third feature processing module includes three second basic residual modules connected in sequence.
[0081] In a specific embodiment, both the first basic residual module and the second basic residual module include a second convolutional layer, a third convolutional layer and a fourth convolutional layer connected in sequence. The input features of the first basic residual module and the output features of the fourth convolutional layer form a shortcut connection, and the input features of the second basic residual module and the output features of the fourth convolutional layer form a residual connection.
[0082] In a specific embodiment, during the MoCo learning and training process of the feature extraction network, a dynamic memory repository is constructed. In the initial state, the dynamic memory repository stores randomly generated negative sample features and adopts a first-in-first-out update strategy.
[0083] In the current round, one simulated NMR spectrum sample from the simulated NMR spectrum dataset is normalized and then subjected to two random augmentation processes to obtain two processed simulated NMR spectrum samples, which are then input into the first encoder and the second encoder, respectively. This yields the sample features and their corresponding positive sample features for the current round. Based on the sample features and their corresponding positive sample features for the current round, and the dynamic memory repository for the current round, the contrastive learning loss function for the first encoder is constructed, as shown in the following equation:
[0084]
[0085] Among them, Loss Q Let q represent the contrastive learning loss function of the first encoder, and k represent the sample features in the current round. + k represents the positive sample features of the current round. i Let represent the i-th negative sample feature in the dynamic memory repository of the current round, C represent the number of negative sample features in the dynamic memory repository, and τ be the temperature parameter;
[0086] The positive sample features of the current round will be stored in the dynamic memory repository and used as the negative sample features in the dynamic memory repository of the next round.
[0087] During each training round, the parameters of the first encoder are updated via backpropagation; the parameters of the second encoder are updated using the following formula:
[0088] θ K =Bθ K-1 +(1-B)θ Q ;
[0089] Where, θ K-1 θ represents the parameter of the second encoder in the previous round. K θ represents the parameters of the second encoder in the current round. Q This represents the parameters of the first encoder in the current round, where B represents the momentum value;
[0090] After multiple rounds of training, until the contrastive learning loss function drops below the target value or the set number of rounds is reached, the parameters of the first encoder and the second encoder in the last round are obtained, thus obtaining the trained feature extraction network.
[0091] For details, please refer to Figure 2In this embodiment, a feature extraction network is first constructed, which includes a first encoder and a second encoder. The two encoders have the same structure, both being variant residual networks mainly composed of stacked convolutional layers, pooling layers, fully connected layers, and basic residual modules. The processed simulated NMR spectrum samples are input into the feature extraction network. Initial feature extraction is performed first through a first convolutional layer (conv) with a kernel size of 9, followed by downsampling through a max pooling layer with a stride of 4. Subsequently, three feature processing modules are used: The first feature processing module contains three basic residual modules and a max pooling layer with a stride of 4, with 8 input channels and 32 output channels. Each basic residual module enables a shortcut connection with a kernel size of 1 (is_shortcut=true) to adapt to changes in channel dimension; the second feature processing module has the same structure as the first feature processing module, increasing the output channels to the set feature dimension of 128; the third feature processing module continues to stack three basic residual modules on a constant feature dimension (is_shortcut=false). (See reference) Figure 3 Both the first and second basic residual modules contain basic residual structures (Blocks). Each basic residual structure contains three convolutional layers (conv1, conv2, conv3), all of which use convolutional kernels of size 21 for deep feature extraction. The difference is that the first basic residual module uses shortcut connections, while the second basic residual module uses residual connections. After the final average pooling (AvgPool) layer, the feature vector is finally output through a linear fully connected layer (Linear), with a final output dimension of 128.
[0092] The feature extraction network is further trained using the MoCo learning strategy. The specific process is as follows: Simulated NMR spectrum samples obtained by normalization and two different random augmentation processes are respectively input into the first encoder and the second encoder, and the sample features q and their corresponding positive sample features k are output respectively. + Because of q and k + All were obtained by processing the same simulated NMR spectrum sample, therefore k + The positive sample features can be used as the positive sample features q. However, the features stored in the dynamic memory repository are not obtained from the same simulated NMR spectrum sample as the sample feature q. Therefore, the features stored in the dynamic memory repository are all negative sample features for the sample feature q. Based on the sample feature q and its corresponding positive sample features and the negative sample features stored in the dynamic memory repository, a contrastive learning loss function for the first encoder is constructed. The parameters θ of the first encoder are... QThe update is determined by backpropagation, and the parameters θ of the second encoder are... K The update satisfies the momentum update formula. In one embodiment, the magnitude of τ in the contrastive learning loss function is 0.07, and B = 0.999. Therefore, the momentum update formula is: θ K =0.999θ K-1 +0.001θ Q A dynamic memory repository is used to store 65,536 negative sample features. It has a dimension of 128 and employs a first-in, first-out (FIFO) update strategy. Initially, the dynamic memory repository is a randomly generated (65,536, 128) matrix, representing irrelevant negative sample features relative to the first simulated NMR spectrum sample. During subsequent training, positive sample features from the previous round of simulated NMR spectrum samples are stored in the dynamic memory repository as negative sample features for the current round. Simultaneously, one negative sample feature is deleted from the dynamic memory repository according to the FIFO principle. The processed simulated NMR spectrum dataset is used to perform unsupervised pre-training on the feature extraction network. The outputs of the first and second encoders are used to calculate the loss value using the contrastive learning loss function. The parameter gradients obtained from the backpropagation algorithm are used to update the parameters of the first encoder using the Adam optimization algorithm, and then the parameters of the second encoder are updated using the momentum update formula. This process iterates until the loss value falls below the target value or the set number of rounds is reached, at which point training terminates. In one embodiment, the initial learning rate is set to 10. -3 The batch size was set to 256, and the network training epochs were set to 150. After the above training process, the trained feature extraction network was finally obtained.
[0093] S3. Construct and train a magnetic resonance spectrum reconstruction model to obtain a trained magnetic resonance spectrum reconstruction model. The magnetic resonance spectrum reconstruction model includes a U-Net network, a self-attention module, and a feature extraction module. The feature extraction module is the second encoder in the trained feature extraction network.
[0094] For details, please refer to Figure 4 The second encoder in the trained feature extraction network is used as the feature extraction module and combined with the self-attention module into the traditional U-Net network to construct a magnetic resonance spectroscopy reconstruction model. The structure of the U-Net network will not be described in detail here. The magnetic resonance spectroscopy reconstruction model includes a U-Net network, a feature extraction module, and a self-attention module. The U-Net network serves as the backbone network. The noisy simulated NMR spectrum sample X with initial phase processing is input into the feature extraction module to obtain the corresponding low-dimensional features X. m The low-dimensional feature X is processed through a self-attention module. m The low-level features X are obtained by downsampling the simulated NMR spectrum sample X to be reconstructed using the first half of the U-Net network.r Perform feature fusion to obtain fused feature X new The fused features are then input into the latter half of the U-Net network for upsampling to obtain the predicted one-dimensional spectrum, pred. The one-dimensional spectrum pred output by the magnetic resonance spectral reconstruction model is compared with the original simulated NMR spectrum sample (i.e., clean spectrum) label without augmentation, and a loss function is constructed as shown in the following equation:
[0095]
[0096] Where Loss represents the loss function used in the training of the magnetic resonance spectroscopy reconstruction model, and pred p The label represents the one-dimensional spectrum corresponding to the p-th processed simulated NMR spectrum sample. p Let P represent the normalized simulated NMR spectrum sample that has not undergone augmentation processing, corresponding to the p-th processed simulated NMR spectrum sample, where P represents the total number of simulated NMR spectrum samples after the p-th processing.
[0097] The parameter gradients are obtained through backpropagation, and the parameters of the magnetic resonance spectroscopy reconstruction model are optimized and updated. Specifically, during the training of the magnetic resonance spectroscopy reconstruction model, the parameters of the feature extraction module are not frozen. A second encoder of the trained feature extraction network is used; that is, the parameters of the second encoder of the trained feature extraction network are imported at the beginning of training. During the training process, the loss value is also fine-tuned through backpropagation on the parameters of the second encoder of the trained feature extraction network. After several iterations, the loss value decreases to the target value, and training terminates. In one embodiment, the initial learning rate is set to 10. -2 The batch size was set to 256, and the network training epochs were set to 150. During the testing phase, a clean one-dimensional spectrum can be obtained simply by inputting the noisy simulated NMR spectrum sample containing the initial phase to be reconstructed into the magnetic resonance spectroscopy reconstruction model.
[0098] S4. Acquire the NMR spectrum data to be reconstructed and perform normalization processing to obtain the processed NMR spectrum data. The processed NMR spectrum data is then input into the trained magnetic resonance spectrum reconstruction model to predict the corresponding one-dimensional spectrum.
[0099] In a specific embodiment, in the trained magnetic resonance spectroscopy reconstruction model, the processed nuclear magnetic resonance spectroscopy data is input into the feature extraction module to obtain low-dimensional features; the processed nuclear magnetic resonance spectroscopy data is input into the U-Net network to obtain the low-level features output by the encoding module of the U-Net network; the low-dimensional features and the low-level features are input into the self-attention module to obtain the fused features, as shown in the following formula:
[0100]
[0101] Among them, X m X represents low-dimensional features. r Representing the underlying features, X new The fusion feature is represented by d, where d represents the feature dimension.
[0102] The fused features are input into the decoding module of the U-Net network to obtain the corresponding one-dimensional spectrum.
[0103] Specifically, by deploying the trained magnetic resonance spectroscopy reconstruction model, the normalized NMR spectral data to be reconstructed (i.e., the processed NMR spectral data) can be input into the feature extraction module and the U-Net network, respectively. The feature extraction module outputs the corresponding low-dimensional feature X. m The first half of the U-Net network outputs the low-level features X. r The two features are fused using a self-attention module to obtain the fused feature X. new The first half of the U-Net network is the encoding module, and the second half is the decoding module. Therefore, the underlying features X r It is the output of the encoding module, while the fused feature X new It is the input to the decoding module, low-dimensional feature X m As auxiliary information for the underlying feature X r Further optimization yields the fusion feature X. new Replace the original underlying feature X r The input is then processed by the decoding module to obtain a more accurate one-dimensional spectrum.
[0104] The effects of the present invention will be further illustrated below through specific embodiments.
[0105] The magnetic resonance spectrum reconstruction method based on unsupervised feature extraction network proposed in the embodiments of this application and the reconstruction of magnetic resonance spectrum data using only the U-Net network (i.e., without using the aforementioned feature extraction module and self-attention module) are compared. The results are as follows: Figure 5-7 As shown, a comparison of the reconstruction results of two different methods is presented. Figure 5 For the magnetic resonance spectral data to be reconstructed, Figure 6 and Figure 7 The reconstruction results of the magnetic resonance spectrum reconstruction method based on unsupervised feature extraction network proposed in the embodiments of this application and the reconstruction results using only the U-Net network are shown respectively. Blue represents the reference signal, and orange represents the reconstructed signal. Comparative observation is provided. Figure 6 and Figure 7The results show that the magnetic resonance spectrum reconstruction method based on unsupervised feature extraction network proposed in the embodiments of this application has a reconstructed signal that is closer to the main peak of the reference signal, while the method using U-Net network alone has a large deviation in the recovery of some peaks. This indicates that the magnetic resonance spectrum reconstruction method based on unsupervised feature extraction network proposed in the embodiments of this application has higher accuracy in peak matching of the reconstructed signal.
[0106] To avoid individual differences, 200 signals were selected for testing in the embodiments of this application. The L2 norm error (RLNE) and signal-to-noise ratio (SNR) of the magnetic resonance spectrum reconstruction method based on unsupervised feature extraction network proposed in the embodiments of this application and the reconstruction method using only U-Net network were calculated and evaluated. The RLNE of the reconstruction result of the magnetic resonance spectrum reconstruction method based on unsupervised feature extraction network proposed in the embodiments of this application is 0.2325, which is lower than the RLNE value of 0.2889 of the reconstruction result of traditional U-Net network. The SNR of the reconstruction result of the magnetic resonance spectrum reconstruction method based on unsupervised feature extraction network proposed in the embodiments of this application is 12.9083, which is higher than the SNR value of 10.5529 of the reconstruction result of traditional U-Net network. In summary, the magnetic resonance spectrum reconstruction method based on unsupervised feature extraction network proposed in the embodiments of this application has significant advantages in signal reconstruction and can provide more accurate and reliable reconstruction results.
[0107] Further reference Figure 8 As an implementation of the methods shown in the above figures, this application provides an embodiment of a magnetic resonance spectrum reconstruction device based on an unsupervised feature extraction network. This device embodiment is similar to... Figure 1 Corresponding to the method embodiments shown, this device can be specifically applied to various electronic devices.
[0108] This application provides a magnetic resonance spectral reconstruction device based on an unsupervised feature extraction network, comprising:
[0109] Dataset construction module 1 is configured to construct a simulated NMR spectrum dataset based on NMR spectrum characteristics and relevant mathematical models; and to perform normalization and augmentation processing on each simulated NMR spectrum sample in the simulated NMR spectrum dataset to obtain the processed simulated NMR spectrum dataset.
[0110] Network building module 2 is configured to build a feature extraction network and perform MoCo learning training to obtain a trained feature extraction network; the feature extraction network includes a first encoder and a second encoder that are set in parallel and have the same structure;
[0111] Model building module 3 is configured to build and train a magnetic resonance spectrum reconstruction model to obtain a trained magnetic resonance spectrum reconstruction model. The magnetic resonance spectrum reconstruction model includes a U-Net network, a self-attention module, and a feature extraction module. The feature extraction module is the second encoder in the trained feature extraction network.
[0112] Reconstruction module 4 is configured to acquire the nuclear magnetic resonance (NMR) spectrum data to be reconstructed and perform normalization processing to obtain the processed NMR spectrum data. The processed NMR spectrum data is then input into the trained magnetic resonance spectrum reconstruction model to predict the corresponding one-dimensional spectrum.
[0113] Figure 9 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present invention. For example... Figure 9 As shown, the electronic device in this embodiment includes a processor 901 and a memory 902; wherein the memory 902 is used to store computer execution instructions; and the processor 901 is used to execute the computer execution instructions stored in the memory to implement the various steps performed by the electronic device in the above embodiment. For details, please refer to the relevant descriptions in the foregoing method embodiments.
[0114] Alternatively, the memory 902 can be either standalone or integrated with the processor 901.
[0115] When the memory 902 is set up independently, the electronic device also includes a bus 903 for connecting the memory 902 and the processor 901.
[0116] This invention also provides a computer storage medium storing computer execution instructions, which, when executed by processor 901, implement the above method.
[0117] This invention also provides a computer program product, including a computer program that, when executed by a processor 901, implements the above-described method.
[0118] In the embodiments provided by this invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or modules, and may be electrical, mechanical, or other forms.
[0119] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to implement the solution of this embodiment according to actual needs.
[0120] Furthermore, the functional modules in the various embodiments of this invention can be integrated into one processing unit, or each module can exist physically separately, or two or more modules can be integrated into one unit. The unit formed by the above modules can be implemented in hardware or in the form of hardware plus software functional units.
[0121] The integrated modules described above, implemented as software functional modules, can be stored in a computer-readable storage medium. These software functional modules, stored in a storage medium, include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor 901 to execute some steps of the methods of the various embodiments of this application.
[0122] It should be understood that the processor 901 described above can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor, or the processor 901 can be any conventional processor 901. The steps of the method disclosed in this invention can be directly manifested as the hardware processor 901 executing the steps, or as a combination of hardware and software modules within the processor 901 executing the steps.
[0123] The memory 902 may include high-speed RAM memory, and may also include non-volatile memory NVM, such as at least one disk storage device, and may also be a USB flash drive, portable hard drive, read-only memory, disk or optical disc, etc.
[0124] Bus 903 can be an Industry Standard Architecture (ISA), a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Bus 903 can be divided into address bus, data bus, control bus, etc. For ease of illustration, the bus 903 in the accompanying drawings of this application is not limited to only one bus 903 or one type of bus 903.
[0125] The aforementioned storage medium can be implemented from any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The storage medium can be any available medium accessible to general-purpose or special-purpose computers.
[0126] An exemplary storage medium is coupled to a processor 901, enabling the processor 901 to read information from and write information to the storage medium. Alternatively, the storage medium can be an integral part of the processor 901. The processor 901 and the storage medium can reside in an application-specific integrated circuit (ASIC). Alternatively, the processor 901 and the storage medium can exist as discrete components in an electronic device or a host device.
[0127] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.
[0128] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A magnetic resonance spectral reconstruction method based on an unsupervised feature extraction network, characterized in that, Includes the following steps: A simulated NMR spectrum dataset is constructed based on NMR spectral characteristics and relevant mathematical models; each simulated NMR spectrum sample in the simulated NMR spectrum dataset is normalized and augmented to obtain the processed simulated NMR spectrum dataset. A feature extraction network is constructed and trained using MoCo learning to obtain the trained feature extraction network. The feature extraction network includes a first encoder and a second encoder that are configured in parallel and have the same structure; A magnetic resonance spectrum reconstruction model is constructed and trained to obtain a trained magnetic resonance spectrum reconstruction model. The magnetic resonance spectrum reconstruction model includes a U-Net network, a self-attention module, and a feature extraction module. The feature extraction module is the second encoder in the trained feature extraction network. The nuclear magnetic resonance (NMR) spectrum data to be reconstructed is acquired and normalized to obtain the processed NMR spectrum data. The processed NMR spectrum data is then input into the trained magnetic resonance spectrum reconstruction model to predict the corresponding one-dimensional spectrum.
2. The magnetic resonance spectrum reconstruction method based on unsupervised feature extraction network according to claim 1, characterized in that, The first encoder and the second encoder each have a structure comprising a first convolutional layer, a first max pooling layer, a first feature processing module, a second feature processing module, a third feature processing module, an average pooling layer, and a fully connected layer connected in sequence. The first feature processing module and the second feature processing module have the same structure, each comprising three first basic residual modules and a second max pooling layer connected in sequence. The third feature processing module comprises three second basic residual modules connected in sequence.
3. The magnetic resonance spectrum reconstruction method based on unsupervised feature extraction network according to claim 2, characterized in that, Both the first and second basic residual modules include a second convolutional layer, a third convolutional layer, and a fourth convolutional layer connected in sequence. The input features of the first basic residual module and the output features of the fourth convolutional layer form a shortcut connection, and the input features of the second basic residual module and the output features of the fourth convolutional layer form a residual connection.
4. The magnetic resonance spectral reconstruction method based on unsupervised feature extraction network according to claim 1, characterized in that, During the MoCo learning and training process of the feature extraction network, a dynamic memory repository is constructed. In the initial state, the dynamic memory repository stores randomly generated negative sample features and adopts a first-in-first-out update strategy. In the current round, one simulated NMR spectrum sample from the simulated NMR spectrum dataset is normalized and then subjected to two random augmentation processes to obtain two processed simulated NMR spectrum samples, which are then input into the first encoder and the second encoder, respectively. This yields the sample features and their corresponding positive sample features for the current round. Based on the sample features and their corresponding positive sample features for the current round, and the dynamic memory repository for the current round, the contrastive learning loss function of the first encoder is constructed, as shown in the following equation: Among them, Loss Q Let q represent the contrastive learning loss function of the first encoder, and k represent the sample features in the current round. + k represents the positive sample features of the current round. i Let represent the i-th negative sample feature in the dynamic memory repository of the current round, C represent the number of negative sample features in the dynamic memory repository, and τ be the temperature parameter; The positive sample features of the current round will be stored in the dynamic memory repository and used as the negative sample features in the dynamic memory repository of the next round. During each training round, the parameters of the first encoder are updated via backpropagation; the parameters of the second encoder are updated using the following formula: i K =Bθ K-1 +(1-B)θ Q ; Where, θ K-1 θ represents the parameter of the second encoder in the previous round. K θ represents the parameters of the second encoder in the current round. Q This represents the parameters of the first encoder in the current round, where B represents the momentum value; After multiple rounds of training, until the contrastive learning loss function drops below the target value or the set number of rounds is reached, the parameters of the first encoder and the second encoder in the last round are obtained, thus obtaining the trained feature extraction network.
5. The magnetic resonance spectrum reconstruction method based on unsupervised feature extraction network according to claim 1, characterized in that, In the trained magnetic resonance spectroscopy reconstruction model, the processed nuclear magnetic resonance (NMR) spectral data is input into the feature extraction module to obtain low-dimensional features; the processed NMR spectral data is input into the U-Net network to obtain the low-level features output by the encoding module of the U-Net network; the low-dimensional features and the low-level features are then input into the self-attention module to obtain fused features, as shown in the following equation: Among them, X m X represents low-dimensional features. r Representing the underlying features, X new The fusion feature is represented by d, where d represents the feature dimension. The fused features are input into the decoding module of the U-Net network to obtain the corresponding one-dimensional spectrum.
6. The magnetic resonance spectrum reconstruction method based on unsupervised feature extraction network according to claim 1, characterized in that, Each simulated NMR spectrum sample in the simulated NMR spectrum dataset is represented as follows: Where m is the total number of frequency components contained in the simulated NMR spectrum sample, A is the amplitude, f is the simulated nuclear resonance frequency, T2 is the transverse relaxation time, t is time, j is the imaginary unit, and g represents the g-th frequency component. The normalization process is as follows: Among them, FID bfnorm FID represents the simulated NMR spectrum sample before normalization. norm This represents the normalized simulated NMR spectrum sample, and M represents the signal length of the original simulated NMR spectrum sample. The augmentation process includes randomly added noise and an initial phase. The noise addition process is as follows: FID noise =FID bfnoise +(noise real +j·noise imag ); Among them, FID bfnoise This represents the simulated NMR spectrum sample before noise was added, FID. noise This represents the simulated NMR spectrum sample after adding noise. real and noise imag These are the real noise and the imaginary noise, respectively. noise real noise imag ~N(0, noise) level 2 ), noise level Indicates the noise level, N(0, noise) level 2 () indicates a mean of 0 and a standard deviation of noise. level Gaussian distribution, The process of adding the initial phase is as follows: FID phase =FID bfphase ×e jφ ; Where φ is the initial phase added, with a magnitude between 0 and 2π, FID bfphase This represents the simulated NMR spectrum sample before adding the initial phase, FID. phase This represents the simulated NMR spectrum sample after adding the initial phase.
7. A magnetic resonance spectral reconstruction device based on an unsupervised feature extraction network, characterized in that, include: The dataset construction module is configured to construct a simulated nuclear magnetic spectrum dataset based on nuclear magnetic spectrum characteristics and relevant mathematical models. Normalization and augmentation are performed on each simulated NMR spectrum sample in the simulated NMR spectrum dataset to obtain the processed simulated NMR spectrum dataset. The network construction module is configured to build a feature extraction network and perform MoCo learning training to obtain a trained feature extraction network. The feature extraction network includes a first encoder and a second encoder that are configured in parallel and have the same structure; The model building module is configured to build and train a magnetic resonance spectrum reconstruction model to obtain a trained magnetic resonance spectrum reconstruction model. The magnetic resonance spectrum reconstruction model includes a U-Net network, a self-attention module, and a feature extraction module. The feature extraction module is the second encoder in the trained feature extraction network. The reconstruction module is configured to acquire the nuclear magnetic resonance (NMR) spectrum data to be reconstructed and perform normalization processing to obtain processed NMR spectrum data. The processed NMR spectrum data is input into the trained magnetic resonance spectrum reconstruction model to predict the corresponding one-dimensional spectrum.
8. An electronic device, comprising: One or more processors; Storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1-6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1-6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1-6.