A method and system for removing artifacts from magnetic resonance images
By constructing and utilizing the artifact removal model, combined with the LLM and VQ-GAN models, the problem of low artifact removal efficiency in MRI images is solved, achieving efficient and realistic artifact removal effects, and improving the efficiency of diagnosis and treatment.
Patent Information
- Application Number
- CN202410902714.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-08
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2044-07-08
AI Technical Summary
Existing MRI image artifact removal methods cannot effectively remove or reduce artifacts, resulting in low diagnostic efficiency and high requirements on patient scanning time and comfort.
By obtaining historical artifact-free MRI data images for normalization processing and artifact simulation, large-parameter and small-parameter artifact removal models are constructed, using the LLM model combined with the VQ-GAN model, and combined with the large medical model PubMedCLIP to calculate the similarity and pyramid Semantic loss, iterative training to obtain the artifact removal model, and perform artifact removal processing.
It effectively removes or reduces artifacts in MRI images, improves the efficiency of diagnosis and treatment, and ensures the authenticity and universality of the results.
Smart Images

Figure CN118447123B
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of image artifact removal, and in particular relates to a method and system for removing nuclear magnetic resonance image artifacts. Background Art
[0002] Magnetic resonance imaging (MRI) is a safe and non-invasive medical imaging technique that is widely used in modern hospitals and clinics as one of the important diagnostic tools. It is widely used to diagnose any brain and spine abnormalities / diseases because it can effectively capture the body's tissue structure.
[0003] The information of each point in the MRI image is determined by the frequency and phase encoding. When the frequency and phase encoding of the received information are disturbed by external factors, image artifacts will appear. For example, artifacts related to image processing, such as folding, chemical shift, truncation, partial volume and data errors; artifacts related to hardware, such as magnetic field inhomogeneity, radio frequency inhomogeneity, gradient field inhomogeneity; artifacts related to patients, such as physiological movement, patient movement, metal implants, chemical shift, magnetic sensitivity; artifacts related to the environment, such as radio frequency leakage / interference, moving metal, sudden temperature changes, and artifacts caused by other factors. In most cases, artifacts will affect doctors' interpretation of images. It is very important to identify and try to eliminate / reduce these artifacts for disease diagnosis.
[0004] Once artifact data appears, technicians can usually rescan by changing the frequency encoding direction, increasing the bandwidth, increasing the FOV, reducing the layer thickness, etc., to obtain artifact-free or artifact-less MRI images. However, this undoubtedly increases the patient's scanning time and requires the patient to remain motionless for a long time, which may cause some discomfort. The existing artifact removal methods cannot effectively remove or reduce the artifacts generated, thereby affecting the efficiency of diagnosis and treatment. Summary of the invention
[0005] In order to solve the above technical problems, the present invention provides a method and system for removing artifacts from magnetic resonance images, which are used to solve the technical problems in the prior art.
[0006] On the one hand, the present invention provides the following technical solution, a method for removing artifacts from a nuclear magnetic resonance image, comprising:
[0007] Acquiring a historical artifact-free MRI data image, and performing normalization processing on the historical artifact-free MRI data image to obtain an artifact-free normalized image;
[0008] Performing artifact simulation on the artifact-free normalized image to obtain a simulated artifact image, and storing the artifact-free normalized image and the simulated artifact image in a training data set;
[0009] Constructing a first training model, inputting the training data set into the first training model for training, so as to obtain a large-parameter artifact removal model;
[0010] Building a second training model based on the large-parameter artifact removal model and its parameters, and inputting the training data set into the second training model for training to obtain a small-parameter artifact removal model;
[0011] Acquire a test data set, and input the test data set into the small parameter artifact removal model to perform artifact removal processing to obtain artifact removal image data;
[0012] The step of constructing a first training model and inputting the training data set into the first training model for training to obtain a large parameter artifact removal model comprises:
[0013] Constructing an LLM model and a VQ-GAN model, inserting the LLM model between an encoder and a decoder in the VQ-GAN model to obtain a first training model, inputting the training data set into the VQ-GAN model, and encoding the training data set through the encoder in the VQ-GAN model to obtain high-dimensional perceptual features in a continuous space;
[0014] Calculate the similarity between each data in the training data set by using the medical big model PubMedCLIP to obtain a number of candidate words, and store the candidate words in a codebook;
[0015] The codebook is used to replace the pre-trained fixed codebook in the LLM model to discretize the high-dimensional perceptual features to obtain discretized features, the discretized features are input into the decoder to restore the discretized features to obtain high-dimensional restored features, and the first training model is iteratively trained based on the high-dimensional restored features, the high-dimensional perceptual features and the pyramid semantic loss to obtain a large parameter artifact removal model, wherein the pyramid semantic loss for:
[0016] ;
[0017] In the formula, It represents the similarity calculated by the medical model PubMedCLIP. Indicates Layer text embedding, represents a function that generates text embeddings from tokens, represents the codebook, represents the number of embedding layers, Indicates The similarity of the training data, represents the first Candidate words.
[0018] Compared with the prior art, the beneficial effects of the present invention are as follows: the present invention first obtains a historical artifact-free MRI data image, and normalizes the historical artifact-free MRI data image to obtain an artifact-free normalized image; then performs artifact simulation on the artifact-free normalized image to obtain a simulated artifact image, and stores the artifact-free normalized image and the simulated artifact image in a training data set; then constructs a first training model, and inputs the training data set into the first training model for training to obtain a large-parameter artifact removal model; then constructs a second training model based on the first training model and its parameters, and inputs the training data set into the second training model for training to obtain a small-parameter artifact removal model; finally, obtains a test data set, and inputs the test data set into the small-parameter artifact removal model for artifact removal processing to obtain artifact-removed image data. The present invention can well remove or reduce artifacts existing in magnetic resonance images, and the method provided by the present invention has stronger universality and can also ensure the authenticity of the results.
[0019] Preferably, the step of performing artifact simulation on the artifact-free normalized image to obtain a simulated artifact image comprises:
[0020] Performing Fourier transformation on the artifact-free normalized image to obtain corresponding K-space sequence data;
[0021] The K-space sequence data is rotated and translated to obtain first processed image data :
[0022] ;
[0023] In the formula, represents K-space sequence data, represents a complex function, represents the center of rotation, , , Represent the first weight, the second weight, and the third weight respectively. , , Represents the rotation angles in three directions respectively. , , Represent the displacement in three directions respectively. Represents the location of spatial sequence data, , , Represents the vector space direction;
[0024] Randomly selecting a sequence of data from the K-space sequence data as reference data, selecting a number of sequence data on both sides of the reference data as data to be spliced according to its position in the sequence, intercepting partial images from each of the data to be spliced and the reference data, and performing image splicing to obtain second processed image data;
[0025] storing the first processed image data and the second processed image data in a data set to be processed, and performing an inverse Fourier transform on the data in the data set to be processed to obtain an image set to be processed;
[0026] The image to be processed is subjected to impurity removal and Gaussian blur processing to obtain a simulated artifact image.
[0027] Preferably, the step of performing impurity removal and Gaussian blur processing on the image to be processed to obtain a simulated artifact image includes:
[0028] Performing abnormal screening on the image set to be processed to obtain a screened image set;
[0029] Placing a discrete approximation of a Gaussian function on each pixel point of each image in the screened image set to obtain discrete pixel points;
[0030] Multiplying the pixel values of the discrete pixel point and the pixel values of the pixel points in its neighborhood range element by element to obtain a plurality of pixel products;
[0031] A plurality of pixel products are added together to obtain a blur value of the discrete pixel point, and Gaussian blur is added to each pixel point of each image in the screened image set based on the blur value to obtain a simulated artifact image.
[0032] Preferably, the step of constructing a second training model based on the large parameter artifact removal model and its parameters, and inputting the training data set into the second training model for training to obtain a small parameter artifact removal model comprises:
[0033] Constructing an MRI autoencoder capable of encoding MRI images into continuous perceptual features and discrete text tags through the first training model to obtain a second training model;
[0034] The loss is calculated on the training dataset through the frozen MRI autoencoder to obtain the dabs loss :
[0035] ;
[0036] In the formula, represents the data in the continuous space output by the frozen MRI autoencoder of the artifact-free normalized image in the training dataset, Represents the data in the continuous space output by the frozen MRI autoencoder of the simulated artifact image in the training dataset, express The data in the discrete space obtained by the quantizer, express The data in the discrete space obtained by the quantizer;
[0037] The dabs loss , L1 loss and perceptual loss are weighted summed to obtain a final loss function, and the second training model is iteratively trained based on the final loss function to obtain a small parameter artifact removal model.
[0038] Preferably, the step of acquiring a test data set and inputting the test data set into the small parameter artifact removal model for artifact removal processing to obtain artifact-free image data comprises:
[0039] Acquire a test data set, input the test data set into the residual block in the small parameter artifact removal model for a first feature extraction to obtain a feature image, wherein the small parameter artifact removal model sequentially includes a first convolution block, a downsampling tower, a second dual-domain convolution block, an upsampling tower, and a second convolution block;
[0040] Inputting the feature image into a downsampling tower in the small parameter artifact removal model for a second feature extraction to obtain first high-dimensional feature information, wherein the downsampling tower includes a plurality of groups of alternately arranged dual-domain residual blocks and a first dual-domain convolution block;
[0041] Inputting the first high-dimensional feature information into the second dual-domain convolution block to sequentially perform Fourier transform, complex-to-real number conversion, convolution operation, real-to-complex number conversion, and inverse Fourier transform to obtain second high-dimensional feature information;
[0042] The second high-dimensional feature information is sequentially input into the upsampling tower and the second convolution block for feature recovery to obtain artifact-free image data.
[0043] In a second aspect, the present invention provides the following technical solution: a system for removing artifacts from a nuclear magnetic resonance image, wherein the system adopts the method for removing artifacts from a nuclear magnetic resonance image as described above, and the system comprises:
[0044] A processing module, used for acquiring a historical artifact-free MRI data image, and performing normalization processing on the historical artifact-free MRI data image to obtain an artifact-free normalized image;
[0045] A simulation module, used for performing artifact simulation on the artifact-free normalized image to obtain a simulated artifact image, and storing the artifact-free normalized image and the simulated artifact image in a training data set;
[0046] A first training module is used to construct a first training model, and input the training data set into the first training model for training to obtain a large parameter artifact removal model;
[0047] A second training module is used to construct a second training model based on the large-parameter artifact removal model and its parameters, and input the training data set into the second training model for training to obtain a small-parameter artifact removal model;
[0048] The artifact removal module is used to obtain a test data set, and input the test data set into the small parameter artifact removal model to perform artifact removal processing to obtain artifact removal image data.
[0049] Preferably, the artifact removal module includes:
[0050] A first extraction submodule is used to obtain a test data set, and input the test data set into the residual block in the small parameter artifact removal model for a first feature extraction to obtain a feature image, wherein the small parameter artifact removal model sequentially includes a first convolution block, a downsampling tower, a second dual-domain convolution block, an upsampling tower, and a second convolution block;
[0051] A second extraction submodule is used to input the feature image into a downsampling tower in the small parameter artifact removal model for a second feature extraction to obtain first high-dimensional feature information, wherein the downsampling tower includes a plurality of groups of alternately arranged dual-domain residual blocks and a first dual-domain convolution block;
[0052] A conversion submodule, used for inputting the first high-dimensional feature information into the second dual-domain convolution block to sequentially perform Fourier transform, complex-to-real number conversion, convolution operation, real-to-complex number conversion, and inverse Fourier transform to obtain second high-dimensional feature information;
[0053] The recovery submodule is used to input the second high-dimensional feature information into the upsampling tower and the second convolution block in sequence to perform feature recovery to obtain artifact-free image data.
[0054] In a third aspect, the present invention provides the following technical solution: a computer comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned method for removing magnetic resonance image artifacts when executing the computer program.
[0055] In a fourth aspect, the present invention provides the following technical solution: a storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the method for removing artifacts from a magnetic resonance image as described above. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0057] Figure 1 A flowchart of a method for removing artifacts from a magnetic resonance image provided by Embodiment 1 of the present invention;
[0058] Figure 2 A model structure diagram of a first training model provided in Embodiment 1 of the present invention;
[0059] Figure 3 A model structure diagram of a second training model provided in Embodiment 1 of the present invention;
[0060] Figure 4 A model structure diagram of a small parameter artifact removal model provided in the first embodiment of the present invention;
[0061] Figure 5 A comparison diagram before and after artifact removal provided in the first embodiment of the present invention;
[0062] Figure 6 A structural block diagram of a system for removing artifacts from magnetic resonance images provided in Embodiment 2 of the present invention;
[0063] Figure 7 A schematic diagram of the hardware structure of a computer provided in another embodiment of the present invention.
[0064] The embodiments of the present invention will be further described below with reference to the accompanying drawings. DETAILED DESCRIPTION
[0065] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the embodiments of the present invention, and should not be construed as limiting the present invention.
[0066] In the description of the embodiments of the present invention, it should be understood that the terms "length", "width", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside" and "outside" etc., indicating orientations or positional relationships, are based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the embodiments of the present invention and simplifying the description, and do not indicate or imply that the referred device or element must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as a limitation on the present invention.
[0067] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of the present invention, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0068] In the embodiments of the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", "connected", "fixed" and the like should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, it can be the internal connection of two elements or the interaction relationship between two elements. For ordinary technicians in this field, the specific meanings of the above terms in the embodiments of the present invention can be understood according to specific circumstances.
[0069] Embodiment 1
[0070] In the first embodiment of the present invention, Figure 1 As shown, a method for removing artifacts from a nuclear magnetic resonance image comprises:
[0071] S1. Acquire a historical artifact-free MRI data image, and perform normalization processing on the historical artifact-free MRI data image to obtain an artifact-free normalized image;
[0072] Specifically, the historical artifact-free MRI data image here can be obtained by collecting the scanning image data of ordinary 2D MRI multiple times, and in this step, the normalization formula is a commonly used maximum and minimum normalization formula.
[0073] S2, performing artifact simulation on the artifact-free normalized image to obtain a simulated artifact image, and storing the artifact-free normalized image and the simulated artifact image in a training data set;
[0074] Specifically, step S2 includes:
[0075] S21 . Perform Fourier transform on the artifact-free normalized image to obtain corresponding K-space sequence data.
[0076] S22, rotating and translating the K-space sequence data to obtain first processed image data :
[0077] ;
[0078] In the formula, represents K-space sequence data, represents a complex function, represents the center of rotation, , , Represent the first weight, the second weight, and the third weight respectively. , , Represents the rotation angles in three directions respectively. , , Represent the displacement in three directions respectively. Represents the location of spatial sequence data, , , Represents the vector space direction;
[0079] Specifically, based on the different degrees of image quality degradation and structural deformation caused by artifacts, simulation schemes of different intensities can be adopted, that is, different rotation angles and displacements. Therefore, after rotating and translating the original K-space sequence data, the first processed image data can be obtained, and for specific artifacts, they can be motion artifacts, cross artifacts, truncation artifacts, chemical shift artifacts, etc.
[0080] S23, randomly selecting a sequence of data from the K-space sequence data as reference data, selecting a number of sequence data on both sides of the reference data as data to be spliced according to its position in the sequence, intercepting partial images from each of the data to be spliced and the reference data, and performing image splicing to obtain second processed image data;
[0081] Specifically, after obtaining the first processed image data, in order to retain the diversity of data to the greatest extent, it is necessary to adopt a stitching method to obtain the second processed image. For example, one data is selected on both sides of the reference data as the data to be stitched, and the data to be stitched on the left and right sides of the reference data and the reference data are divided into three equal parts. The left one-third of the image data is selected from the data to be stitched on the left side of the reference data, the middle one-third of the image data is selected from the reference data, and the right one-third of the image data is selected from the data to be stitched on the right side of the reference data. Then, the three image data are stitched together to obtain the second processed image data, and the number of data to be stitched can be selected in ascending order to obtain multiple second processed image data.
[0082] S24, storing the first processed image data and the second processed image data into a data set to be processed, and performing an inverse Fourier transform on the data in the data set to be processed to obtain an image set to be processed;
[0083] Specifically, after obtaining the data set to be processed, the data in the data set is a sequence data of the K space, so after inverse Fourier transformation, it is converted into an image domain sequence to obtain the image set to be processed.
[0084] S25, performing impurity removal and Gaussian blur processing on the image to be processed to obtain a simulated artifact image;
[0085] Wherein, the step S25 comprises:
[0086] S251, performing abnormal screening on the image set to be processed to obtain a screened image set;
[0087] Specifically, this step is mainly used to filter out some obviously unreasonable simulated images.
[0088] S252, placing a discrete approximation of the Gaussian function on each pixel point of each image in the screened image set to obtain discrete pixel points;
[0089] Specifically, the discrete approximation of the Gaussian function is usually a two-dimensional matrix.
[0090] S253: Multiply the pixel values of the discrete pixel point and the pixel values of the pixel points in its neighborhood by element, to obtain a plurality of pixel products.
[0091] S254, adding a number of pixel products to obtain a fuzzy value of the discrete pixel point, and adding Gaussian blur to each pixel point of each image in the screened image set based on the fuzzy value to obtain a simulated artifact image.
[0092] S3, constructing a first training model, inputting the training data set into the first training model for training, so as to obtain a large parameter artifact removal model;
[0093] like Figure 2 As shown, the first training model includes an LLM model and a VQ-GAN model. The LLM model mainly includes the quantizer in the figure, which is mainly used to add more medical imaging information to the high-dimensional information output by the encoder. After the decoder recovers it, the result will be significantly improved. The VQ-GAN model mainly includes the decoder and encoder in the figure. The encoder is mainly used to encode the image to generate high-dimensional perceptual features in a continuous space, and the decoder is mainly used to restore high-dimensional features. The medical large model shown in the figure is specifically a visual language large model PubMedCLIP based on a public medical knowledge base, and the LLM Codebook is specifically a codebook.
[0094] Wherein, the step S3 comprises:
[0095] S31, constructing an LLM model and a VQ-GAN model, inserting the LLM model between the encoder and the decoder in the VQ-GAN model to obtain a first training model, inputting the training data set into the VQ-GAN model, and encoding the training data set through the encoder in the VQ-GAN model to obtain high-dimensional perceptual features in a continuous space;
[0096] Specifically, the first training process needs to be implemented in a continuous feature space and a discrete tag embedding space, through a pre-trained MRI (magnetic resonance imaging) autoencoder guided by a large language model (LLM) guided by artifact-free images. The autoencoder is built on the VQ-GAN architecture, which consists of an encoder, a decoder, and a quantizer. VQ-GAN is a generative model that covers data compression technology.
[0097] S32, calculating the similarity between each data in the training data set by using the medical big model PubMedCLIP to obtain a number of candidate words, and storing the candidate words in a codebook;
[0098] Specifically, for the codebook, in the ordinary encoder + decoder structure, the decoder will directly restore the high-dimensional features obtained by the encoder. After adding the quantizer, the high-dimensional features output by the encoder will be processed by the quantizer, that is, these high-dimensional features are discretized, that is, the discrete representation of high-dimensional features. The quantizer obtained after pre-training is used here, which is equivalent to adding more medical imaging information to the high-dimensional information output by the encoder. In this way, after being restored by the decoder, the results obtained will be significantly improved.
[0099] S33, replacing the pre-trained fixed codebook in the LLM model with the codebook to discretize the high-dimensional perceptual features to obtain discretized features, inputting the discretized features into the decoder to restore the discretized features to obtain high-dimensional restored features, and iteratively training the first training model based on the high-dimensional restored features, the high-dimensional perceptual features and the pyramid semantic loss to obtain a large parameter artifact removal model, wherein the pyramid semantic loss for:
[0100] ;
[0101] In the formula, It represents the similarity calculated by the medical model PubMedCLIP. Indicates Layer text embedding, represents a function that generates text embeddings from tokens, represents the codebook, represents the number of embedding layers, Indicates The similarity of the training data, represents the first Candidate words.
[0102] Specifically, the codebook learned in the above steps is replaced with the pre-trained fixed codebook from the LLM model, and the codebook is obtained by calculating the similarity scores of different candidate words through PubMedCLIP, so that the fixed codebook obtained in this way is closer to the medical imaging information;
[0103] At the same time, pyramid semantic loss is used in the quantizer to learn hierarchical semantic information. The above process of learning hierarchical semantic information is carried out in the quantizer. As mentioned above, "high-dimensional perceptual features in continuous space and then searched by nearest neighbors", this method will make the discrete representation obtained by the quantizer lack specific semantic information.
[0104] S4, constructing a second training model based on the large-parameter artifact removal model and its parameters, and inputting the training data set into the second training model for training to obtain a small-parameter artifact removal model;
[0105] like Figure 3 As shown, in Figure 3 In the example, the encoder is the encoder in the first training model. Specifically, after obtaining the LLM-guided MRI autoencoder that can encode MRI images into continuous perceptual features and discrete text tags, the dabs loss is defined and the frozen autoencoder is used to calculate the images with artifacts and the images without artifacts, thereby training the network to obtain the final small parameter artifact removal model. That is, the above process can be expressed as using the encoder and quantizer trained in the first training model to train a model with a small number of parameters to obtain the final small parameter artifact removal model.
[0106] Wherein, the step S4 comprises:
[0107] S41. Construct an MRI autoencoder capable of encoding MRI images into continuous perceptual features and discrete text tags through the first training model to obtain a second training model.
[0108] Specifically, the MRI autoencoder is the encoder obtained by training the first training model.
[0109] S42. Calculate the loss of the training dataset using the frozen MRI autoencoder to obtain the dabs loss :
[0110] ;
[0111] In the formula, represents the data in the continuous space output by the frozen MRI autoencoder of the artifact-free normalized image in the training dataset, Represents the data in the continuous space output by the frozen MRI autoencoder of the simulated artifact image in the training dataset, express The data in the discrete space obtained by the quantizer, express The data in the discrete space is obtained through the quantizer.
[0112] S43, the dabs loss , L1 loss and perceptual loss are weighted summed to obtain a final loss function, and the second training model is iteratively trained based on the final loss function to obtain a small parameter artifact removal model.
[0113] S5. Acquire a test data set, and input the test data set into the small parameter artifact removal model to perform artifact removal processing to obtain artifact removal image data.
[0114] Wherein, the step S5 comprises:
[0115] like Figure 4 As shown, S51, obtain a test data set, input the test data set into the residual block in the small parameter de-artifacting model for the first feature extraction to obtain a feature image, and the small parameter de-artifacting model sequentially includes a first convolution block, a downsampling tower, a second dual-domain convolution block, an upsampling tower, and a second convolution block.
[0116] S52, inputting the feature image into a downsampling tower in the small parameter artifact removal model for a second feature extraction to obtain first high-dimensional feature information, wherein the downsampling tower includes a plurality of groups of alternating dual-domain residual blocks and a first dual-domain convolution block.
[0117] Among them, residual connections are added between the dual-domain residual block and the first dual-domain convolution block, and the downsampling tower and the upsampling tower both include several groups of alternating dual-domain residual blocks and first dual-domain convolution blocks. The downsampling tower and the upsampling tower are connected to each other through jump connections, and for the first convolution block and the second convolution block, they can obtain frequency domain information through Fourier transform and image domain information through inverse Fourier transform. The frequency domain information is a vector matrix expressed in complex form, and the real part and the imaginary part are respectively mapped to two channels. The corresponding frequency domain feature map is obtained through convolution calculation, which is opposite for the second convolution block.
[0118] S53. Input the first high-dimensional feature information into the second dual-domain convolution block to perform Fourier transform, complex-to-real number conversion, convolution operation, real-to-complex number conversion, and inverse Fourier transform in sequence to obtain second high-dimensional feature information.
[0119] S54: input the second high-dimensional feature information into an upsampling tower and a second convolution block in sequence to perform feature recovery, so as to obtain artifact-free image data.
[0120] Specifically, Figure 5 As shown, by comparison, the method for removing artifacts from nuclear magnetic resonance images provided by the present invention can effectively remove artifacts existing in nuclear magnetic resonance images to ensure the authenticity of the results.
[0121] The method for removing artifacts from magnetic resonance images provided in Example 1 of the present invention has the following beneficial effects compared with the prior art: the present invention first obtains a historical artifact-free MRI data image, and normalizes the historical artifact-free MRI data image to obtain an artifact-free normalized image; then performs artifact simulation on the artifact-free normalized image to obtain a simulated artifact image, and stores the artifact-free normalized image and the simulated artifact image in a training data set; then a first training model is constructed, and the training data set is input into the first training model for training to obtain a large-parameter artifact removal model; then a second training model is constructed based on the first training model, and the training data set is input into the second training model for training to obtain a small-parameter artifact removal model; finally, a test data set is obtained, and the test data set is input into the small-parameter artifact removal model for artifact removal processing to obtain artifact-removed image data. The present invention can well remove or reduce artifacts existing in magnetic resonance images, and the method provided by the present invention has stronger universality and can also ensure the authenticity of the results.
[0122] Embodiment 2
[0123] like Figure 6 As shown, in a second embodiment of the present invention, a system for removing artifacts from a nuclear magnetic resonance image is provided. The system adopts the method for removing artifacts from a nuclear magnetic resonance image as described in the first embodiment. The system comprises:
[0124] Processing module 1, used for acquiring historical artifact-free MRI data images, and performing normalization processing on the historical artifact-free MRI data images to obtain artifact-free normalized images;
[0125] A simulation module 2, configured to perform artifact simulation on the artifact-free normalized image to obtain a simulated artifact image, and store the artifact-free normalized image and the simulated artifact image in a training data set;
[0126] A first training module 3 is used to construct a first training model, and input the training data set into the first training model for training to obtain a large parameter artifact removal model;
[0127] A second training module 4 is used to construct a second training model based on the large-parameter artifact removal model and its parameters, and input the training data set into the second training model for training to obtain a small-parameter artifact removal model;
[0128] The artifact removal module 5 is used to obtain a test data set, and input the test data set into the small parameter artifact removal model to perform artifact removal processing to obtain artifact removal image data.
[0129] The simulation module 2 comprises:
[0130] A spatial transformation submodule, used for performing Fourier transformation on the artifact-free normalized image to obtain corresponding K-space sequence data;
[0131] The rotation and translation submodule is used to rotate and translate the K-space sequence data to obtain the first processed image data. :
[0132] ;
[0133] In the formula, represents K-space sequence data, represents a complex function, represents the center of rotation, , , Represent the first weight, the second weight, and the third weight respectively. , , Represents the rotation angles in three directions respectively. , , Represent the displacement in three directions respectively. Represents the location of spatial sequence data, , , Represents the vector space direction;
[0134] A stitching submodule, used for randomly selecting a sequence of data from the K-space sequence data as reference data, selecting a number of sequence data on both sides of the reference data as data to be stitched according to its position in the sequence, intercepting partial images from each of the data to be stitched and the reference data, and performing image stitching to obtain second processed image data;
[0135] an inverse transformation submodule, used for storing the first processed image data and the second processed image data into a data set to be processed, and performing an inverse Fourier transform on the data in the data set to be processed to obtain an image set to be processed;
[0136] The blur submodule is used to perform a noise removal and Gaussian blur process on the image to be processed to obtain a simulated artifact image.
[0137] The fuzzy submodule includes:
[0138] A screening unit, used for screening the image set to be processed for abnormalities to obtain a screening image set;
[0139] A discrete unit, used for placing a discrete approximation of a Gaussian function on each pixel point of each image in the screening image set to obtain a discrete pixel point;
[0140] A multiplication unit, used for performing element-by-element multiplication of the pixel values of the discrete pixel point and the pixel values of the pixel points within its neighborhood range to obtain a plurality of pixel products;
[0141] The accumulation unit is used to add the products of several pixels to obtain the blur value of the discrete pixel point, and add Gaussian blur to each pixel point of each image in the screened image set based on the blur value to obtain a simulated artifact image.
[0142] The first training module 3 includes:
[0143] An encoding submodule, used for constructing an LLM model and a VQ-GAN model, inserting the LLM model between an encoder and a decoder in the VQ-GAN model to obtain a first training model, inputting the training data set into the VQ-GAN model, and encoding the training data set through the encoder in the VQ-GAN model to obtain high-dimensional perceptual features in a continuous space;
[0144] A codebook submodule, used for calculating the similarity between each data in the training data set through the medical big model PubMedCLIP to obtain a number of candidate words, and storing the candidate words in the codebook;
[0145] The first training submodule is used to replace the pre-trained fixed codebook in the LLM model with the codebook to discretize the high-dimensional perceptual features to obtain discretized features, input the discretized features into the decoder to restore the discretized features to obtain high-dimensional restored features, and iteratively train the first training model based on the high-dimensional restored features, the high-dimensional perceptual features and the pyramid semantic loss to obtain a large parameter artifact removal model, wherein the pyramid semantic loss for:
[0146] ;
[0147] In the formula, It represents the similarity calculated by the medical model PubMedCLIP. Indicates Layer text embedding, represents a function that generates text embeddings from tokens, represents the codebook, represents the number of embedding layers, Indicates The similarity of the training data, represents the first Candidate words.
[0148] The second training module 4 includes:
[0149] A construction submodule is used to construct an MRI autoencoder that can encode MRI images into continuous perceptual features and discrete text tags through the first training model to obtain a second training model;
[0150] The loss submodule is used to calculate the loss of the training dataset through the frozen MRI autoencoder to obtain the dabs loss :
[0151] ;
[0152] In the formula, represents the data in the continuous space output by the frozen MRI autoencoder of the artifact-free normalized image in the training dataset, Represents the data in the continuous space output by the frozen MRI autoencoder of the simulated artifact image in the training dataset, express The data in the discrete space obtained by the quantizer, express The data in the discrete space obtained by the quantizer;
[0153] The second training submodule is used to convert the dabs loss , L1 loss and perceptual loss are weighted summed to obtain a final loss function, and the second training model is iteratively trained based on the final loss function to obtain a small parameter artifact removal model.
[0154] The artifact removal module 5 comprises:
[0155] A first extraction submodule is used to obtain a test data set, and input the test data set into the residual block in the small parameter artifact removal model for a first feature extraction to obtain a feature image, wherein the small parameter artifact removal model sequentially includes a first convolution block, a downsampling tower, a second dual-domain convolution block, an upsampling tower, and a second convolution block;
[0156] A second extraction submodule is used to input the feature image into a downsampling tower in the small parameter artifact removal model for a second feature extraction to obtain first high-dimensional feature information, wherein the downsampling tower includes a plurality of groups of alternately arranged dual-domain residual blocks and a first dual-domain convolution block;
[0157] A conversion submodule, used for inputting the first high-dimensional feature information into the second dual-domain convolution block to sequentially perform Fourier transform, complex-to-real number conversion, convolution operation, real-to-complex number conversion, and inverse Fourier transform to obtain second high-dimensional feature information;
[0158] The recovery submodule is used to input the second high-dimensional feature information into the upsampling tower and the second convolution block in sequence to perform feature recovery to obtain artifact-free image data.
[0159] like Figure 7 As shown, in some other embodiments of the present invention, the embodiments of the present invention provide the following technical solutions: a computer, comprising a memory 102, a processor 101, and a computer program stored in the memory 102 and executable on the processor 101, wherein the processor 101 implements the magnetic resonance image artifact removal method as described above when executing the computer program.
[0160] Specifically, the processor 101 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiment of the present invention.
[0161] Among them, the memory 102 may include a large-capacity memory for data or instructions. By way of example and not limitation, the memory 102 may include a hard disk drive (HDD), a floppy disk drive, a solid state drive (SSD), a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive, or a combination of two or more of these. Where appropriate, the memory 102 may include a removable or non-removable (or fixed) medium. Where appropriate, the memory 102 may be inside or outside the data processing device. In a specific embodiment, the memory 102 is a non-volatile memory. In a specific embodiment, the memory 102 includes a read-only memory (ROM) and a random access memory (RAM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically alterable ROM (EAROM) or a flash memory (FLASH), or a combination of two or more of these. Under appropriate circumstances, the RAM can be a static random access memory (SRAM) or a dynamic random access memory (DRAM), wherein the DRAM can be a fast page mode dynamic random access memory (FPMDRAM), an extended data output dynamic random access memory (EDODRAM), a synchronous dynamic random access memory (SDRAM), etc.
[0162] The memory 102 may be used to store or cache various data files that need to be processed and / or used for communication, as well as possible computer program instructions executed by the processor 101 .
[0163] The processor 101 implements the above-mentioned magnetic resonance image artifact removal method by reading and executing the computer program instructions stored in the memory 102 .
[0164] In some embodiments, the computer may further include a communication interface 103 and a bus 100. The processor 101, the memory 102, and the communication interface 103 are connected via the bus 100 and communicate with each other.
[0165] The communication interface 103 is used to implement communication between the modules, devices, units and / or equipment in the embodiment of the present invention. The communication interface 103 can also implement data communication with other components such as: external devices, image / data acquisition equipment, databases, external storage, and image / data processing workstations.
[0166] The bus 100 includes hardware, software or both, and couples the components of the computer device to each other. The bus 100 includes but is not limited to at least one of the following: a data bus, an address bus, a control bus, an expansion bus, and a local bus. By way of example and not limitation, bus 100 may include an Accelerated Graphics Port (AGP) or other graphics bus, an Extended Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hyper Transport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an InfiniBand interconnect, a Low Pin Count (LPC) bus, a memory bus, a Micro Channel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local Bus (VLB) bus, or other suitable buses or a combination of two or more of these. Where appropriate, bus 100 may include one or more buses. Although embodiments of the present invention describe and illustrate a particular bus, the present invention contemplates any suitable bus or interconnect.
[0167] The computer can execute the nuclear magnetic resonance image artifact removal method of the present invention based on the acquired nuclear magnetic resonance image artifact removal system, thereby realizing nuclear magnetic resonance image artifact removal.
[0168] In some further embodiments of the present invention, in combination with the above-mentioned method for removing artifacts from magnetic resonance images, the embodiments of the present invention provide the following technical solution: a storage medium having a computer program stored thereon, and the computer program implements the above-mentioned method for removing artifacts from magnetic resonance images when executed by a processor.
[0169] Those skilled in the art will appreciate that the logic and / or steps represented in the flowchart or otherwise described herein, for example, may be considered as an ordered list of executable instructions for implementing logical functions, and may be specifically implemented in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in conjunction with such instruction execution systems, devices or apparatuses. For purposes of this specification, "computer-readable medium" may be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in conjunction with such instruction execution systems, devices or apparatuses.
[0170] More specific examples of readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be a paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or, if necessary, processing in another suitable manner, and then stored in a computer memory.
[0171] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or a combination thereof: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0172] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0173] The above-mentioned embodiments only express several implementation methods of the present invention, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached claims.
Claims
1. A method for removing artifacts from a magnetic resonance image, characterized in that: include: Acquiring a historical artifact-free MRI data image, and performing normalization processing on the historical artifact-free MRI data image to obtain an artifact-free normalized image; Performing artifact simulation on the artifact-free normalized image to obtain a simulated artifact image, and storing the artifact-free normalized image and the simulated artifact image in a training data set; Constructing a first training model, inputting the training data set into the first training model for training, so as to obtain a large-parameter artifact removal model; Building a second training model based on the large-parameter artifact removal model and its parameters, and inputting the training data set into the second training model for training to obtain a small-parameter artifact removal model; Acquire a test data set, and input the test data set into the small parameter artifact removal model to perform artifact removal processing to obtain artifact removal image data; The step of constructing a first training model and inputting the training data set into the first training model for training to obtain a large parameter artifact removal model comprises: Constructing an LLM model and a VQ-GAN model, inserting the LLM model between an encoder and a decoder in the VQ-GAN model to obtain a first training model, inputting the training data set into the VQ-GAN model, and encoding the training data set through the encoder in the VQ-GAN model to obtain high-dimensional perceptual features in a continuous space; Calculate the similarity between each data in the training data set by using the medical big model PubMedCLIP to obtain a number of candidate words, and store the candidate words in a codebook; The codebook is used to replace the pre-trained fixed codebook in the LLM model to discretize the high-dimensional perceptual features to obtain discretized features, the discretized features are input into the decoder to restore the discretized features to obtain high-dimensional restored features, and the first training model is iteratively trained based on the high-dimensional restored features, the high-dimensional perceptual features and the pyramid semantic loss to obtain a large parameter artifact removal model, wherein the pyramid semantic loss for: ; In the formula, It represents the similarity calculated by the medical model PubMedCLIP. Indicates Layer text embedding, represents a function that generates text embeddings from tokens, represents the codebook, represents the number of embedding layers, Indicates The similarity of the training data, represents the first Candidate words; The step of constructing a second training model based on the large parameter artifact removal model and its parameters, and inputting the training data set into the second training model for training to obtain a small parameter artifact removal model comprises: Constructing an MRI autoencoder capable of encoding MRI images into continuous perceptual features and discrete text labels through the large parameter artifact removal model and its parameters to obtain a second training model; The loss is calculated on the training dataset through the frozen MRI autoencoder to obtain the dabs loss : ; In the formula, represents the data in the continuous space output by the frozen MRI autoencoder of the artifact-free normalized image in the training dataset, Represents the data in the continuous space output by the frozen MRI autoencoder of the simulated artifact image in the training dataset, express The data in the discrete space obtained by the quantizer, express The data in the discrete space obtained by the quantizer; The dabs loss , L1 loss and perceptual loss are weighted summed to obtain a final loss function, and the second training model is iteratively trained based on the final loss function to obtain a small parameter artifact removal model.
2. The method for removing artifacts from a nuclear magnetic resonance image according to claim 1, characterized in that: The step of performing artifact simulation on the artifact-free normalized image to obtain a simulated artifact image comprises: Performing Fourier transformation on the artifact-free normalized image to obtain corresponding K-space sequence data; The K-space sequence data is rotated and translated to obtain first processed image data : ; In the formula, represents K-space sequence data, represents a complex function, represents the center of rotation, , , Represent the first weight, the second weight, and the third weight respectively. , , Represents the rotation angles in three directions respectively. , , Represent the displacement in three directions respectively. Represents the location of spatial sequence data, , , Represents the vector space direction; Randomly selecting a sequence of data from the K-space sequence data as reference data, selecting a number of sequence data on both sides of the reference data as data to be spliced according to its position in the sequence, intercepting partial images from each of the data to be spliced and the reference data, and performing image splicing to obtain second processed image data; storing the first processed image data and the second processed image data in a data set to be processed, and performing an inverse Fourier transform on the data in the data set to be processed to obtain an image set to be processed; The image to be processed is subjected to impurity removal and Gaussian blur processing to obtain a simulated artifact image.
3. The method for removing artifacts from a nuclear magnetic resonance image according to claim 2, characterized in that: The step of performing impurity removal and Gaussian blur processing on the image to be processed to obtain a simulated artifact image comprises: Performing abnormal screening on the image set to be processed to obtain a screened image set; Placing a discrete approximation of a Gaussian function on each pixel point of each image in the screened image set to obtain discrete pixel points; Multiplying the pixel values of the discrete pixel point and the pixel values of the pixel points in its neighborhood range element by element to obtain a plurality of pixel products; A plurality of pixel products are added together to obtain a blur value of the discrete pixel point, and Gaussian blur is added to each pixel point of each image in the screened image set based on the blur value to obtain a simulated artifact image.
4. The method for removing artifacts from a nuclear magnetic resonance image according to claim 1, characterized in that: The step of acquiring a test data set and inputting the test data set into the small parameter artifact removal model for artifact removal processing to obtain artifact removal image data comprises: Acquire a test data set, input the test data set into the residual block in the small parameter artifact removal model for a first feature extraction to obtain a feature image, wherein the small parameter artifact removal model sequentially includes a first convolution block, a downsampling tower, a second dual-domain convolution block, an upsampling tower, and a second convolution block; Inputting the feature image into a downsampling tower in the small parameter artifact removal model for a second feature extraction to obtain first high-dimensional feature information, wherein the downsampling tower includes a plurality of groups of alternately arranged dual-domain residual blocks and a first dual-domain convolution block; Inputting the first high-dimensional feature information into the second dual-domain convolution block to sequentially perform Fourier transform, complex-to-real number conversion, convolution operation, real-to-complex number conversion, and inverse Fourier transform to obtain second high-dimensional feature information; The second high-dimensional feature information is sequentially input into the upsampling tower and the second convolution block for feature recovery to obtain artifact-free image data.
5. A system for removing artifacts from a nuclear magnetic resonance image, the system adopting the method for removing artifacts from a nuclear magnetic resonance image as claimed in claim 1, characterized in that: The system comprises: A processing module, used for acquiring a historical artifact-free MRI data image, and performing normalization processing on the historical artifact-free MRI data image to obtain an artifact-free normalized image; A simulation module, used for performing artifact simulation on the artifact-free normalized image to obtain a simulated artifact image, and storing the artifact-free normalized image and the simulated artifact image in a training data set; A first training module is used to construct a first training model, and input the training data set into the first training model for training to obtain a large parameter artifact removal model; A second training module is used to construct a second training model based on the large-parameter artifact removal model and its parameters, and input the training data set into the second training model for training to obtain a small-parameter artifact removal model; The artifact removal module is used to obtain a test data set, and input the test data set into the small parameter artifact removal model to perform artifact removal processing to obtain artifact-removed image data.
6. The magnetic resonance imaging artifact removal system according to claim 5, characterized in that: The artifact removal module comprises: A first extraction submodule is used to obtain a test data set, and input the test data set into the residual block in the small parameter artifact removal model for a first feature extraction to obtain a feature image, wherein the small parameter artifact removal model sequentially includes a first convolution block, a downsampling tower, a second dual-domain convolution block, an upsampling tower, and a second convolution block; A second extraction submodule is used to input the feature image into a downsampling tower in the small parameter artifact removal model for a second feature extraction to obtain first high-dimensional feature information, wherein the downsampling tower includes a plurality of groups of alternately arranged dual-domain residual blocks and a first dual-domain convolution block; A conversion submodule, used for inputting the first high-dimensional feature information into the second dual-domain convolution block to sequentially perform Fourier transform, complex-to-real number conversion, convolution operation, real-to-complex number conversion, and inverse Fourier transform to obtain second high-dimensional feature information; The recovery submodule is used to input the second high-dimensional feature information into the upsampling tower and the second convolution block in sequence to perform feature recovery to obtain artifact-free image data.
7. A computer comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method for removing artifacts from a nuclear magnetic resonance image according to any one of claims 1 to 4 is implemented.
8. A storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by the processor, the method for removing artifacts from a nuclear magnetic resonance image according to any one of claims 1 to 4 is implemented.
