Magnetic resonance image reconstruction method based on plural Transformers
By introducing the complex Transformer and the interactive complex multi-head self-attention mechanism into MRI image reconstruction, combined with the complex convolution and data consistency layer, the feature extraction difficulty of the existing Transformer on MRI frequency domain complex data is solved, and undersampling is achieved. Accurate reconstruction and efficient calculation of MRI images.
Patent Information
- Application Number
- CN202410800028.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-20
- Publication Date
- 2024-10-01
AI Technical Summary
It is difficult for existing Transformer models to achieve global feature extraction on MRI frequency domain complex data, which limits the reconstruction performance of magnetic resonance images, especially under undersampling conditions.
A magnetic resonance image reconstruction method based on complex Transformer is designed. By constructing a dual-domain data reconstruction block and combining complex convolution and interactive complex multi-head self-attention mechanism, it can effectively extract the local and long-term dependencies of MRI frequency domain complex data. Features, and achieve interactive fusion of image domain and frequency domain data through the data consistency layer and fusion module.
It achieves accurate reconstruction of undersampled magnetic resonance images, improves the reconstruction performance and generalization ability of the model, reduces computational complexity, and significantly improves MRI image quality in practical applications.
Smart Images

Figure CN118736041A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of magnetic resonance medical image restoration (reconstruction), that is, using an end-to-end deep network model to achieve accurate reconstruction of undersampled magnetic resonance images, specifically a magnetic resonance image reconstruction method based on complex Transformer. Background Art
[0002] Magnetic Resonance Imaging (MRI) is a non-invasive medical imaging technology that does not cause harm to the human body due to radiation. It has flexible imaging methods and can achieve imaging in multiple directions, including cross-section, coronal, and sagittal planes. MRI can provide very rich tissue and anatomical information, assisting clinicians in timely detection of tiny lesions. However, the imaging speed limits the scope of MRI application. It often takes 10-20 minutes to acquire a set of MRI images. Patients will feel uncomfortable during this process, and the patient's voluntary movement during this process will also cause the image quality to deteriorate. Therefore, speeding up MRI and improving the working efficiency of the MRI system will help improve the quality of MRI images, speed up clinical diagnosis efficiency, and expand the scope of MRI application.
[0003] MRI data is different from image data. MRI data is frequency domain complex data, which is called K space in medicine. Frequency domain data needs to be transformed into image domain data through inverse Fourier transform, while image domain data is transformed into frequency domain data through Fourier transform. Image domain data is used to obtain magnetic resonance (MR) images through amplitude calculation. It often takes a long time to collect all K space signals (full sampling). The representative methods of existing mainstream accelerated MRI are parallel imaging technology and compressed sensing technology. Parallel imaging technology uses multiple coils to collect data, and the sensitivity information of the coils can be used to infer the uncollected data, thereby speeding up MRI. However, parallel imaging technology requires that the number of coils is much larger than the acceleration factor (the larger the acceleration factor, the higher the sampling rate). If the acceleration factor is too large, it is easy to cause image quality degradation. Therefore, in practical applications, the acceleration factor is limited to 2-3. Compressed sensing technology only collects part of the K space data (undersampling), and then uses iterative methods to infer the uncollected signals. However, the iterative method of compressed sensing technology is often very time-consuming and has poor generalization.
[0004] Emerging deep learning technology is similar to compressed sensing technology. It only collects part of the K-space data, and then uses the network to infer the collected data. In the case of sufficient training data, deep learning technology can achieve data reconstruction with a high acceleration factor. Unlike compressed sensing technology, the trained model only needs one forward propagation time to reconstruct an MR image, and the reasoning time is short. At the same time, the network model has good generalization. The representative Transformer in deep learning technology can model the global features of the image, making up for the shortcoming that Convolutional Neural Networks (CNN) is difficult to effectively model the long-term dependencies of the image. Therefore, MRI reconstruction models based on Transformer have sprung up like mushrooms after rain.
[0005] However, the existing Transformer model focuses on feature extraction of real-valued data and is difficult to work on MRI frequency domain complex data. Existing studies only use amplitude images or divide MRI real and imaginary data into two input channels. The former destroys the data structure of MRI and the latter discards phase information, thereby limiting the reconstruction performance of the model. To this end, the present invention specifically designs a complex Transformer model for global feature extraction of MRI complex data, thereby achieving accurate reconstruction of undersampled magnetic resonance images. Summary of the invention
[0006] Aiming at the problem that the existing Transformer is difficult to realize global feature extraction of MRI complex data, thereby limiting the model reconstruction performance, the present invention proposes a magnetic resonance image reconstruction method based on complex Transformer.
[0007] The present invention is implemented by adopting the following technical solution: a magnetic resonance image reconstruction method based on complex Transformer, the steps of which are as follows:
[0008] Step 1: input an undersampled MR image, perform Fourier transform on the undersampled MR image to obtain undersampled frequency domain complex data, and perform inverse Fourier transform on the undersampled frequency domain complex data to obtain undersampled image domain complex data;
[0009] Step 2: input the undersampled image domain complex data into the image domain feature reconstruction block to achieve image domain complex data reconstruction, and input the undersampled frequency domain complex data into the K-space feature reconstruction block to achieve frequency domain complex data reconstruction;
[0010] Step 3: The reconstructed image domain complex data and the reconstructed frequency domain complex data are passed through a data consistency layer to achieve fidelity of the original undersampled data;
[0011] Step 4: Perform inverse Fourier transformation on the image domain complex data and the frequency domain complex data after the data consistency layer, and then fuse them to obtain fused image domain complex data; perform Fourier transformation on the image domain complex data after the data consistency layer, and fuse them with the frequency domain complex data after the data consistency layer, and then obtain fused frequency domain complex data;
[0012] Step 5: Use the fused image domain complex data and frequency domain complex data as the input of the next image domain feature reconstruction block and K-space feature reconstruction block, and continue to repeat steps 2-5;
[0013] Step 6: After repeating steps 2-5 for multiple times, the image obtained by amplitude calculation of the complex data in the image domain after the last fusion is used as the final reconstruction result of the network.
[0014] This method requires the construction of a dual domain data reconstruction block (DDDRB). Each DDDRB consists of an image domain feature reconstruction block (IFRB), a K-spaces feature reconstruction block (KFRB), a data consistency layer, an image domain fusion block (IF) and a K-space fusion block (KF). The above steps 2-4 are the complete execution flow of a DDDRB. Step 5 is to use the output of the previous DDDRB as the input of the next DDDRB. Step 6 is to use the image obtained by amplitude calculation of the fused image domain complex data in the last DDDRB as the final reconstruction result of the network. In DDDRB, IFRB and KFRB can realize feature extraction of undersampled image domain complex data and frequency domain complex data, and use the extracted features to realize the reconstruction of image domain and K space (dual domain) data; the DC layer can realize the fidelity of the original undersampled data, so that the network can focus on the recovery of uncollected data; IF and KF are used to realize the interactive fusion of image domain data and frequency domain data.
[0015] IFRB and KFRB have the same structure, both of which are composed of complex convolution and the complex Transformer specially designed by the present invention. Complex convolution can extract local features of complex data in the frequency domain, while complex Transfomer can effectively model the long-term dependencies of complex data in the frequency domain. Specifically, the IFRB and KRFB structures first have two complex convolutions with a convolution kernel of 3×3, a step size of 1, and a padding of 1, followed by a complex Transformer specially designed by the present invention, and finally two complex convolutions with a convolution kernel of 3×3, a step size of 1, and a padding of 1.
[0016] Complex convolution is different from traditional convolution. It has two convolution kernels, namely the real part convolution kernel and the imaginary part convolution kernel. MRI complex data also has real and imaginary parts. The method of complex convolution is to subtract the result of traditional convolution between the real part of the frequency domain complex data and the real part of the complex convolution and the result of traditional convolution between the imaginary part of the frequency domain complex data and the imaginary part of the complex convolution to obtain the real part of the complex convolution result, and add the result of traditional convolution between the real part of the frequency domain complex data and the imaginary part of the complex convolution and the result of traditional convolution between the imaginary part of the frequency domain complex data and the real part of the complex convolution to obtain the imaginary part of the complex convolution result. One complex convolution consists of four traditional convolutions. Let the complex convolution kernel be f=c+di, c is the real part of the complex convolution kernel f, d is the imaginary part of the complex convolution kernel, and i represents the sign of the imaginary part. The frequency domain complex data is x=m+ni, m is the real part of the frequency domain complex data x, and n is the imaginary part of the frequency domain complex data x. Then in Represents a convolution operation.
[0017] In order to capture the long-term dependencies of complex data in the frequency domain, the present invention specially designs a complex Transformer. The difference from the existing Transformer is that the present invention replaces the original MLP (Multi-Layer Perceptron) and LN (Layer Normalization) with complex MLP and complex LN, and replaces the multi-head attention (Multi-Head Self-Attention, MHSA) with the interactive complex multi-head attention (Interactive Complex Multi-Head Self-Attention, ICMHSA) designed by the present invention.
[0018] The implementation of ICMHSA is similar to that of complex convolution. First, through three complex MLPs, we can get the query vector q, key vector k and value vector v, where q, k and v are all in complex form. Let q r and q i is the real and imaginary part of the query vector q, k r and k i are the real and imaginary parts of the key vector k, vr and v i is the real and imaginary part of the value vector v. The ICMHSA calculation result is in complex form. The real part of the ICMHSA result is calculated by subtracting the result of matrix multiplication of the real part of the query vector and the real part of the key vector from the result of matrix multiplication of the imaginary part of the query vector and the imaginary part of the key vector, and then dividing by (is a constant), passes through the softmax function, and then performs matrix multiplication on the result of the softmax function and the real part of the value vector v. Let the output of ICMHSA be a, a r is the real part of a, a i is the imaginary part of a, then Where * indicates matrix multiplication. The imaginary part of the ICMHSA result is calculated by adding the result of matrix multiplication of the real part of the query vector and the imaginary part of the key vector to the result of matrix multiplication of the imaginary part of the query vector and the real part of the key vector, and then dividing by (is a constant), passes through the softmax function, and then performs matrix multiplication on the result of the softmax function and the imaginary part of the value vector v. Finally, the real and imaginary parts of ICMHSA are concatenated, a = concat(a r ,a i ).
[0019] In order to reduce the amount of calculation of Transformer, researchers have reduced the calculation of attention from the global window to the local window, and the representative ones are Swin Transformer, CSWin Transformer and BiFormer. In theory, the attention of all the above-mentioned Transformers can be designed as ICMHSA, but the present invention chooses to practice on CSWin Transformer.
[0020] CSWin Transformer divides the extracted features into two parts in the channel dimension. Let the feature size be H×W×C, where H represents the length of the feature map, W represents the width of the feature map, and C represents the number of channels of the feature map. CSWin Transformer divides part of the features (H×W×C / 2) into local regions with a length of sw and a width of W, and calculates the attention in each local region. The remaining features (H×W×C / 2) are divided into local regions with a length of H and a width of sw, and the attention in each local region is calculated. Among them, sw is a hyperparameter set manually.
[0021] In CSWin Transformer, the time complexity of generating query vector, key vector and value vector through three MLPs is 3×H×W×C×C. CSWin Transformer will perform another MLP on the attention output, and the time complexity of this part is H×W×C×C. The time complexity of the first half of the feature attention calculation is mainly the matrix multiplication of the query vector and the key vector, and the subsequent matrix multiplication with the value vector. The time complexity of these two parts is sw×H×H×W×C / 2. Similarly, it is easy to get the time complexity of the second half of the feature attention calculation is sw×W×H×W×C / 2. Therefore, the total time complexity of CSWinTransformer is H×W×C×(4×C+sw×H+sw×W). In the improved CSWinTransformer of the present invention, the time complexity of the four-time complex MLP is 16×H×W×C×C, and the time complexity of the first half feature attention calculation is 3×sw×W×H×W×C, which includes four matrix multiplications of the query vector and the key vector, and then two matrix multiplications with the value vector. Similarly, it is easy to get that the time complexity of the second half feature attention calculation is 3×sw×H×H×W×C. Therefore, the total time complexity of the improved CSWin Transformer is H×W×C×(16×C+3×sw×H+3×sw×W). Compared with the original CSWin Transformer, the time complexity of the improved CSWin Transformer of the present invention increases linearly.
[0022] The data consistency layer enables the network to focus on the recovery of uncollected data and achieve the fidelity of the original undersampled frequency domain complex data. The calculation of the data consistency layer is completed in the K space. For image domain data, it needs to be Fourier transformed before data consistency operation can be performed. Let j be a point in the K space, and y(j) be the sampling value corresponding to point j. When point j is an unsampled point, the value of the point uses the network estimation value, that is, out DC (j) = F(j), where F(·) is the feature reconstruction block. When point j is a sampling point, the value of this point uses the linear weighted value of the network estimation value and the sampling value, that is, Among them, η is a learnable parameter of the network. The purpose of adding a data consistency layer to the image domain feature reconstruction block and the K-space feature reconstruction block is to further strengthen the connection between the reconstructed dual-domain data and the original sampled data, which not only achieves the fidelity of the original undersampled K-space data, but also enables the network model to focus on the recovery of unsampled data.
[0023] The image domain fusion module IF and the K space fusion module KF use the same fusion strategy. Before fusion, the data in different domains need to be transformed or inversely transformed to the same domain through Fourier transformation. Assuming that B1 and B2 are both image domain data, the fusion strategy is Where u is a learnable parameter.
[0024] The network model samples dual-branch image domain and frequency domain data in parallel, avoiding the impact of unnecessary priority priors introduced during the serial processing of image domain and frequency domain data on the model reconstruction effect during the network reconstruction process. At the same time, in order to realize the information interaction of dual-domain and dual-branch data, a fusion module is introduced to transform the information of different domains into the same domain through Fourier transform and inverse transform, and then realize the interactive fusion of different branch information.
[0025] Although the network finally uses the image obtained after amplitude calculation of the complex data in the image domain after the last fusion as the final reconstruction result, in order to optimize the branch network of the K space, the output of the last K space fusion block is compared with the full sampling K space for loss calculation, forcing the K space branch network to reconstruct data close to the full sampling K space.
[0026] In order to solve the problem that the existing Transformer is difficult to act on frequency domain complex data, or destroys the MRI complex data structure, or discards important phase information, thereby limiting the model reconstruction performance, the present invention designs interactive self-attention and then designs a complex Transformer, which, combined with complex convolution, can achieve accurate reconstruction of under-sampled MR images. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 This is a structural diagram of the network model of the present invention.
[0028] Figure 2 This is a diagram of the complex Transformer structure of the present invention.
[0029] Figure 3 This is a diagram of the interactive complex self-attention structure of the present invention.
[0030] Figure 4 Schematic diagram of an embodiment of the present invention, wherein (a) is an undersampled knee joint MR image with a sampling rate of only 10%, (b) shows a network reconstructed image, and (c) shows a fully sampled image.
[0031] Figure 5 Schematic diagram of an embodiment of the present invention, wherein (a) is an undersampled brain MR image with a sampling rate of only 20%, (b) shows a network reconstructed image, and (c) shows a fully sampled image. DETAILED DESCRIPTION
[0032] The present invention will be further described below in conjunction with the accompanying drawings and specific embodiments:
[0033] Reference Figure 1 (a) In this embodiment, a magnetic resonance image reconstruction method based on a complex Transformer includes the following steps:
[0034] Step 1: Perform Fourier transform on an undersampled image to obtain undersampled frequency domain complex data, then perform inverse Fourier transform on the undersampled frequency domain complex data to obtain undersampled image domain complex data, and input it into the first dual-domain data reconstruction block. At this time, the input data has a dimension of [1,1,256,256,2], the input batch size is 1, the number of channels is 1, the data size is 256×256, and the last dimension 2 indicates that the data is two channels of the real and imaginary parts of the complex data.
[0035] Step 2: Reference Figure 1 (a) The dual-domain data reconstruction block uses a dual-branch structure to process the image domain and frequency domain complex data in parallel. The image domain complex data is processed by the image domain feature reconstruction block to realize feature extraction and reconstruction of the image domain complex data, and the frequency domain complex data is processed by the K-space feature reconstruction block to realize K-space feature extraction and reconstruction. Take the image domain complex data as an example, and the frequency domain complex data is the same.
[0036] Step 2.1: Reference Figure 1 (b),In the dual-domain data reconstruction block, the image domain complex data first undergoes two 3×3 complex convolutions to extract the local underlying features of the image domain complex data, and the dimension changes to [1, 32, 256, 256, 2].
[0037] Step 2.2: These low-level features are then fed into the complex Transformer to effectively model the long-term dependencies between complex data features in the image domain. Figure 2 In the complex Transformer, the feature dimension is first changed to [1, 32, 65536, 2], and then passed through the complex LN without changing the dimension. It is then input into the interactive self-attention to extract the global features of the complex data in the image domain. Figure 3 In ICMHSA, three complex MLPs are used to generate q, k, and v vectors, all with dimensions [1, 32, 65536, 2]. Then, the q, k, and v vectors are transformed. If the number of headers is 4 and sw is 4, the result of the dimension transformation is [64, 4, 1024, 8, 2]. The dimension means that the image domain features are divided into 64 local regions with a length of 1024. Each feature point in the region is represented by a vector of length 8. Since the data is in complex form, the last dimension is 2. When calculating attention, four relationships are considered. According to the formula Compute the real attention, The dimensions are [64,4,1024,8] and [64,4,8,1024] respectively. The result of matrix multiplication is [64,4,1024,1024]. The dimension is [64,4,1024,1024], divided by After softmax, the real attention map is obtained, and the dimension remains unchanged, which is [64, 4, 1024, 1024]. The meaning of this dimension is that in the local area, the relationship between the four feature points is considered. Finally, the real attention map is combined with v r (The dimension is [64, 4, 1024, 8]) and matrix multiplication is performed to obtain the final result of the real part of the attention, with the dimension [64, 4, 1024, 8]. Similarly, the dimension of the imaginary part of the attention calculation result is [64, 4, 1024, 8]. Finally, the real and imaginary attention calculation results are concatenated in dimension to obtain the final result of ICHMSA, with dimension [64, 4, 1024, 8, 2]. Finally, the dimension is transformed to obtain [1, 32, 65536, 2]. The input and the output of ICHMSA are added element by element residually, with dimension [64, 4, 1024, 8, 2]. This is followed by complex MLP and complex LN, with dimension [1, 32, 65536, 2]. Finally, the input and the output after complex MLP and complex LN are added element by element residually to obtain the final result of complex Transformer, with dimension [1, 32, 65536, 2].
[0038] Step 2.3: Finally, the deep global features extracted by the complex Transformer are subjected to two 3×3 complex convolutions. The purpose is to use these extracted deep global features to reconstruct the image domain complex data through complex convolution. The dimension after two complex convolutions is [1,1,256,256,2], which is the same as the dimension of the original input image domain data. The difference is that the input is undersampled image domain complex data, and this data is the reconstructed image domain complex data.
[0039] Step 3: The image domain complex data is reconstructed through IFRB with a dimension of [1,1,256,256,2], and the frequency domain complex data is reconstructed through KFRB with a dimension of [1,1,256,256,2]. The reconstructed dual-domain data are then passed through the data consistency layer to achieve the fidelity of the original undersampled data. For a sampled point, the value corresponding to the point is the linear weighted value of the network estimation value and the sampling value, and the unsampled point uses the network estimation value. Let the sampling mask be mask, mask is a matrix with a value of 0 or 1, 0 means unsampled, and 1 means sampled. The data consistency operation can be expressed as Among them, x kis the undersampled frequency domain complex data, F(·) is the feature reconstruction block, and η is a learnable parameter. Before this, the image domain complex data needs to be Fourier transformed to obtain frequency domain complex data, and after completing the data consistency operation, the inverse Fourier transform is performed to the image domain complex data. The data consistency operation has no dimensionality change.
[0040] Step 4: Transform the dual-domain data of the data consistency layer to the same domain through Fourier transform or inverse transform. The fusion strategy realizes interactive fusion, where B1 and B2 are the data that need to be fused, u is a learnable parameter, and the process data is a dimensional change.
[0041] Step 5: Reference Figure 1 (a), after executing steps 2-4 for a dual-domain data reconstruction block, the output of the previous dual-domain data reconstruction block is used as the input of the next dual-domain data reconstruction block, and the image obtained by amplitude calculation of the output of the IF in the last dual-domain data reconstruction block is used as the final reconstruction result.
[0042] Step 6: Network loss function: The network uses the mean absolute loss of the image domain Where N is the number of image pixels, is the reconstructed image, y is the fully sampled image), K-space mean absolute loss in, To reconstruct the K-space data, y is the output of KF in the last DDDRB. k is the full sampled K-space data) and the image gradient (edge) mean absolute loss in, The three losses are jointly optimized using the network, where the image domain mean square loss weight is 1, the K-space mean square loss weight is 0.1, and the image gradient loss is 100.
[0043] Step 7: Establish knee joint dataset: 10092 slice data were selected from the FastMRI public knee joint dataset, and knee joint images were obtained by inverse Fourier transform and amplitude image. The images were cropped to 256×256 size, and 7012 images were selected for training, 2080 images were selected for verification, and 1000 images were selected for testing.
[0044] Step 8: Brain dataset establishment: 6000 T1-weighted sagittal brain MR images with an image size of 256×256 were selected from the IXI brain dataset. 4200 images were selected for training, 1200 images were selected for verification, and 600 images were selected for testing.
[0045] Step 9: Network model training parameter setting: A Linux server with a graphics card model of NVIDIA V100 and a video memory of 32G was used to train the network model. A total of 30 epochs were trained, the learning rate was set to 0.0005, the optimizer used was the adam optimizer, and the network framework was PyTorch 1.12.0.
Claims
1. A magnetic resonance image reconstruction method based on complex Transformer, Features: The following steps are involved: Step 1: input an undersampled MR image, perform Fourier transform on the undersampled MR image to obtain undersampled frequency domain complex data, and perform inverse Fourier transform on the undersampled frequency domain complex data to obtain undersampled image domain complex data; Step 2: input the undersampled image domain complex data into the image domain feature reconstruction block to achieve image domain complex data reconstruction, and input the undersampled frequency domain complex data into the K-space feature reconstruction block to achieve frequency domain complex data reconstruction; Step 3: The reconstructed image domain complex data and the reconstructed frequency domain complex data are passed through a data consistency layer to achieve fidelity of the original undersampled frequency domain complex data; Step 4: Perform inverse Fourier transformation on the image domain complex data and the frequency domain complex data after the data consistency layer, and then fuse them to obtain fused image domain complex data; perform Fourier transformation on the image domain complex data after the data consistency layer, and fuse them with the frequency domain complex data after the data consistency layer, and then obtain fused frequency domain complex data; Step 5: Use the fused image domain complex data and frequency domain complex data as inputs of the next image domain data reconstruction block and K-space data reconstruction block, and continue to repeat steps 2-5; Step 6: After repeating steps 2-5 for multiple times, the image obtained by amplitude calculation of the complex data in the image domain after the last fusion is used as the final reconstruction result of the network.
2. The magnetic resonance image reconstruction method based on complex Transformer according to claim 1, Features: The image domain feature reconstruction block and the K-space feature reconstruction block use complex convolution and complex Transformer to jointly extract the local and global features of the frequency domain complex data, effectively modeling the long-term dependencies of the frequency domain complex data; the complex Transformer is an improvement on the CSWin Transformer, including complex MLP, complex LN and interactive complex multi-head attention mechanism; The interactive complex self-attention in the complex Transformer considers the same real and imaginary part correlation as the complex convolution, effectively retaining the important phase information of the frequency domain complex data.
3. The magnetic resonance image reconstruction method based on complex Transformer according to claim 2, Features: The network model samples dual-branch image domain and frequency domain data in parallel, avoiding the impact of unnecessary priority priors introduced during the serial processing of image domain and frequency domain data on the model reconstruction effect during the network reconstruction process. At the same time, in order to realize the information interaction of dual-domain and dual-branch data, a fusion module is introduced to transform the information of different domains into the same domain through Fourier transform and inverse transform, and then realize the interactive fusion of different branch information.
4. The magnetic resonance image reconstruction method based on complex Transformer according to claim 3, Features: Although the network finally uses the image obtained after amplitude calculation of the complex data in the image domain after the last fusion as the final reconstruction result, in order to optimize the branch network of the K space, the output of the last K space fusion block is compared with the full sampling K space for loss calculation, forcing the K space branch network to reconstruct data close to the full sampling K space.
