DWI image Ghost artifact removal method and device, storage medium and system
Through improved Unet model and NLM filtering technology, the problem of removing Ghost artifacts in DWI images is solved, and image quality improvement and diagnostic accuracy are achieved.
Patent Information
- Application Number
- CN202411458662.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-18
- Publication Date
- 2025-03-21
AI Technical Summary
Common Ghost artifacts in DWI images seriously interfere with the identification and analysis of lesion areas, and the prior art is difficult to effectively remove.
The improved Unet model (AR-Unet model) is adopted, which introduces residual blocks in the encoder and decoder, and an attention gate module is introduced in the jump connection part. Combined with NLM filtering technology, the DWI images are deartifact and denoising.
Effectively remove Ghost artifacts in DWI images, significantly improve image quality, improve the accuracy of lesion detection and diagnostic reliability.
Smart Images

Figure CN119672138A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of medical image processing, and in particular to a method, device, storage medium and system for removing Ghost artifacts from DWI images. Background Art
[0002] Diffusion weighted imaging (DWI) is an important technique of magnetic resonance imaging (MRI). Through its sensitivity to the diffusion movement of water molecules, it can be effectively used to detect lesions in the brain, spinal cord and other areas. However, due to factors such as the inhomogeneity of the magnetic field and the involuntary movement of the patient during the scan, a variety of motion artifacts often appear in DWI images, including ghost artifacts, blurring artifacts and streak artifacts. Among them, ghost artifacts are the most common and most influential problem, which manifests as repeated images along the phase encoding direction, seriously interfering with the identification and analysis of the lesion area.
[0003] Therefore, how to remove Ghost artifacts in DWI images is a technical problem that needs to be solved urgently. Summary of the invention
[0004] The embodiments of the present application provide a method, device, storage medium and system for removing Ghost artifacts from DWI images, which can remove Ghost artifacts from DWI images.
[0005] The present application provides a method for removing ghost artifacts from a DWI image, the method comprising:
[0006] Acquire multiple original DWI images in CIF format from a magnetic resonance imaging system, and preprocess all the original DWI images to generate corresponding multiple preprocessed DWI images;
[0007] Annotating the brain in all the pre-processed DWI images, generating a binary annotation map corresponding to each of the pre-processed DWI images, and obtaining a plurality of the binary annotation maps;
[0008] Dividing all the original DWI images and the binary annotated images to generate a training set, a validation set, and a test set;
[0009] Obtaining an AR-Unet model obtained by improving the original Unet model, training, verifying and evaluating the model using the training set, the validation set and the test set respectively, to generate a trained AR-Unet model, wherein the second convolutional layer in the encoder and the decoder of the AR-Unet model is a residual block, and the jump connection part structure includes an attention gate module;
[0010] Using the trained AR-Unet model to test the preprocessed DWI image to generate a mask image;
[0011] The mask image is processed, and the processed mask image is multiplied with the original DWI image, and the cranial brain region portion in the original DWI image is retained to obtain a DWI image after artifacts are removed.
[0012] In the method for removing Ghost artifacts from DWI images described in the embodiment of the present application, after obtaining the DWI image after removing the artifacts, the method further includes:
[0013] The NLM filtering technology is used to perform denoising on the DWI image after the artifacts are removed.
[0014] In the DWI image Ghost artifact removal method described in the embodiment of the present application, the processing of the mask image includes:
[0015] According to a preset pixel threshold, a binarization operation is performed on the mask image;
[0016] The mask image after the binarization operation is converted into a single-channel eight-bit image, and the mask image after the conversion into the single-channel is inverted.
[0017] In the DWI image Ghost artifact removal method described in the embodiment of the present application, after generating the trained AR-Unet model, the method further includes:
[0018] Saving the trained AR-Unet model;
[0019] Before the trained AR-Unet model is used to test the preprocessed DWI image to generate a mask image, the method further includes:
[0020] Convert the format of the saved trained AR-Unet model;
[0021] Use ONNX Runtime and Opencv in C++ to load and run the trained AR-Unet model after format conversion and initialize the inference environment.
[0022] In the DWI image Ghost artifact removal method described in the embodiment of the present application, the AR-Unet model obtained by improving the original Unet model is obtained, and the training set, validation set and test set are used to train, validate and evaluate the model, and the trained AR-Unet model is generated, including:
[0023] An AR-Unet model is obtained by improving the original Unet model, and the training set, validation set and test set are respectively loaded through the AR-Unet model for training, validation and evaluation to generate the trained AR-Unet model.
[0024] In the method for removing Ghost artifacts from a DWI image described in an embodiment of the present application, before using the trained AR-Unet model to test the pre-processed DWI image and generate a mask image, it also includes:
[0025] The trained AR-Unet model is set to use a multi-threaded processing mode.
[0026] In the DWI image Ghost artifact removal method described in the embodiment of the present application, the preprocessing includes standardization processing and normalization processing.
[0027] An embodiment of the present application also provides a device for removing Ghost artifacts from DWI images, the device comprising a processor and a memory, the memory storing a computer program, and the processor calling the computer program stored in the memory to execute the method for removing Ghost artifacts from DWI images described in any of the above embodiments.
[0028] The embodiment of the present application further provides a DWI image Ghost artifact removal system, and the DWI image Ghost artifact removal system includes the DWI image Ghost artifact removal device described in the above embodiment.
[0029] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed on a computer, the computer executes the method for removing Ghost artifacts from DWI images described in any of the above embodiments.
[0030] The method for removing Ghost artifacts from DWI images provided in the embodiment of the present application is to first obtain multiple original DWI images in CIF format from a magnetic resonance imaging system, and preprocess all the original DWI images to generate multiple corresponding preprocessed DWI images, then annotate the brain in all preprocessed DWI images, generate a binary annotation map corresponding to each preprocessed DWI image, and obtain multiple binary annotation maps, then divide all the original DWI images and the binary annotation maps to generate a training set, a validation set, and a test set, and then obtain the AR-Unet model obtained by improving the original Unet model, respectively use the training set, validation set, and test set to train, verify, and evaluate it, generate a trained AR-Unet model, then use the trained AR-Unet model to test the preprocessed DWI image, generate a mask image, and finally process the mask image, and multiply the processed mask image with the original DWI image, retain the brain region part in the original DWI image, so as to obtain the DWI image after artifact removal. Through this method, the embodiment of the present application can remove Ghost artifacts in DWI images. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application, and those skilled in the art can obtain other drawings based on these drawings without creative work.
[0032] Figure 1 A flowchart of a method for removing Ghost artifacts from DWI images provided in an embodiment of the present application.
[0033] Figure 2 A network structure diagram of the AR-Unet model provided in an embodiment of the present application.
[0034] Figure 3 An attention gate module provided in an embodiment of the present application.
[0035] Figure 4 A comparison chart of the segmentation results of the Unet, Res-Unet and AR-Unet models provided in the embodiments of the present application.
[0036] Figure 5 A comparison chart of the denoising results of NLM filtering, median filtering and bilateral filtering provided in the embodiments of the present application.
[0037] Figure 6 This is a schematic diagram of the structure of a DWI image Ghost artifact removal device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0038] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.
[0039] The present application embodiment provides a method for removing ghost artifacts from DWI images. Figure 1 , Figure 1 The present invention provides a flow chart of a method for removing ghost artifacts from DWI images, which may include the following steps:
[0040] Step 101 : acquiring a plurality of original DWI images in CIF format from a magnetic resonance imaging system, and preprocessing all the original DWI images to generate a plurality of corresponding preprocessed DWI images.
[0041] Among them, the embodiment of the present application first needs to read the DWI image data, which is stored in the CIF format in the magnetic resonance system. CIF files usually contain the header information and data part of the image. By locating the data offset, the header information can be skipped and the image data part can be directly read. This part of the data is stored in a 16-bit unsigned integer format to represent the pixel value of the image. The read 16-bit data needs to be converted to an 8-bit representation for subsequent processing. This application uses the converTo function in the Opencv library to map the original 16-bit image data to an 8-bit space of 0-255.
[0042] Among them, due to the different quality of the collected images, data screening is required.
[0043] In some embodiments, the preprocessing includes standardization and normalization.
[0044] Among them, in order to meet the input requirements of the deep learning model, the image data needs to be normalized, that is, the pixel values need to be mapped to the range of [0, 1].
[0045] In order for the model below to process the input image data, the image data must first be converted into a format acceptable to the model. The input image is a three-channel color image with pixel values between 0 and 255. The model requires the input data to be a one-dimensional floating-point array, and each pixel value must be normalized to the range [0,1]. To this end, the image data is expanded and normalized by channel, and finally converted into a one-dimensional std::vector <float>Array. When traversing each pixel of the image, extract the value of each channel (red, green, blue) in turn, convert it to floating point numbers and then normalize it. The processed data is stored in a one-dimensional array in sequence, ready to be used as input for the model.
[0046] Step 102: annotate the brain in all the preprocessed DWI images, generate a binary annotated map corresponding to each of the preprocessed DWI images, and obtain a plurality of the binary annotated maps.
[0047] Among them, you can use a professional medical image annotation tool, image labeler, to manually annotate the brain in the preprocessed DWI image, and complete the data annotation with the help of professional physicians. During manual annotation, the annotator accurately annotates based on the morphology and position of the brain to generate a corresponding binary annotation map (Mask). Each preprocessed DWI image corresponds to a binary annotation map of the same size, where the pixel value of the brain area is 1 and the pixel value of the non-background area is 0. Mask is saved in png format to facilitate subsequent model training. To ensure the consistency of annotation, multiple annotators independently annotate the same image, and finally the standard results are determined through expert review.
[0048] In some embodiments, before labeling the brain in all the pre-processed DWI images and generating a binary labeling map corresponding to each of the pre-processed DWI images, the method further includes:
[0049] The preprocessed DWI images in CIF format are saved in png format.
[0050] The reason why the preprocessed DWI image in CIF format is saved in png format is to facilitate data annotation later.
[0051] Step 103: divide all the original DWI images and the binary annotation images to generate a training set, a validation set, and a test set.
[0052] Among them, the embodiment of the present application divides the original DWI image and the binary annotation image into a training set, a validation set and a test set, and completes the division of the deep learning data set training set, validation set and test set according to the ratio of 7:2:1.
[0053] The training set is used for model training (AR-Unet model), accounting for 70% of the total data set. This part of the data is used to adjust the weight of the model so that it can learn to identify the characteristics of artifacts.
[0054] The validation set accounts for 15% of the total dataset and is used to evaluate the performance of the model during the training process to prevent overfitting. The model hyperparameters are adjusted by evaluating the accuracy of the model on the validation set after each training cycle.
[0055] The test set also accounts for 15% of the total data set and is used for the final evaluation of the model after training is completed to test the performance of the model on unseen data. This data set does not participate in the training process and is only used after training is completed.
[0056] Step 104, obtaining an AR-Unet model obtained by improving the original Unet model, and respectively training, verifying and evaluating it using the training set, verification set and test set to generate a trained AR-Unet model, wherein the AR-Unet model, the second convolutional layer in the encoder and decoder is a residual block, and the jump connection part structure includes an attention gate module.
[0057] In recent years, deep learning methods, especially the Unet model, have been gradually applied to the field of medical image processing. Due to its powerful ability in segmentation tasks, it has become a potential tool for artifact removal. However, when processing DWI images, the traditional Unet model often fails to capture enough details, and there is still room for improvement in artifact removal. Therefore, the embodiment of the present application improves the original Unet model to obtain the AR-Unet model.
[0058] The AR-Unet model replaces the second convolutional layer with a residual block in the encoder and decoder of the original Unet model, and introduces an attention gate module in the jump connection part of the original Unet model. The residual module is introduced in the encoder and decoder parts of the original Unet model to improve the model's deep feature extraction capabilities. The attention gate module is introduced in the jump connection part to increase the model's attention to the brain area of the DWI image and further improve the effect of artifact removal.
[0059] like Figure 2 As shown in the figure, in the encoder and decoder of the original Unet model, the second convolutional layer is replaced by a residual block, which can enhance the training stability of the model and improve the reconstruction effect of the decoder part.
[0060] like Figure 3 As shown in the figure, an attention gate module is introduced into the jump connection part of the original Unet model, which can enhance the model's attention to important features in the image and enable the model to better focus on the cranial brain area.
[0061] The present embodiment uses a cross entropy loss function to test the training effect, which is defined as follows:
[0062]
[0063] Among them, w and h represent the width and height of the prediction area respectively, c is the type of pixel, is the label of the pixel, and is the predicted value of the pixel.
[0064] Reference Figure 4 , the segmentation results of AR-Unet model are compared with those of commonly used Unet and Res-Unet models. Figure 4 As shown in the figure, all three models can identify the brain structure in DWI images, but Unet and Res-Unet have over-segmentation problems when it comes to edge recognition and when Ghost artifacts are severe. The AR-Unet model can improve edge recognition capabilities and further improve the over-segmentation problem.
[0065] The embodiment of the present application uses DSC, Precision, and Spe as evaluation indicators to ensure that the model can not only correctly identify artifacts, but also accurately locate their boundaries. As shown in Table 1, Table 1 compares the evaluation indicators of the segmentation results of the three models AR-Unet, Unet, and Res-Unet.
[0066] model DSC Precision Spe AR-Unet 0.9321 0.9436 0.9430 Res-Unet 0.8831 0.9230 0.9381 Unet 0.8660 0.8963 0.9323
[0067] Table 1 Comparison of evaluation indicators for segmentation results
[0068] The improved original Unet model uses the Adam optimizer, and the initial learning rate is set to 1×10 -5 , the learning stops after 100 iterations. When the validation loss does not decrease every ten rounds, the learning rate decays to 0.5 of the original value, and the minimum learning rate is 1×10 -9 Due to GPU memory limitations, the batch size of the training set and validation set is set to 4.
[0069] In some embodiments, after generating the trained AR-Unet model, the method further includes:
[0070] Saving the trained AR-Unet model;
[0071] Before the trained AR-Unet model is used to test the preprocessed DWI image to generate a mask image, the method further includes:
[0072] Convert the format of the saved trained AR-Unet model;
[0073] Use ONNX Runtime and Opencv in C++ to load and run the trained AR-Unet model after format conversion and initialize the inference environment.
[0074] Among them, after the model (AR-Unet model) of the embodiment of the present application is trained using the Keras framework in the Python environment, the weight and structure of the model are saved as a .h5 file. However, since the .h5 file is not suitable for cross-platform model calls, and the .onnx file is a cross-platform open neural network exchange format that can call models between different frameworks and platforms, the embodiment of the present application performs format conversion on the saved trained AR-Unet model, wherein the tf2onnx tool can be used to convert the .h5 file to a .onnx file.
[0075] Among them, the embodiment of the present application uses ONNX Runtime as the reasoning engine, and implements the loading and initialization of the model through C++. Create an environment object (Ort::Env) and a session object (Ort::Session) of ONNX Runtime, and the session object is used to manage the loading and reasoning of the model. During the initialization process, session options are also configured, including setting the number of threads and graph optimization level to improve reasoning efficiency. Model loading is completed by passing the path of the model file to the constructor of Ort::Session. The loading process automatically parses the input and output node information of the model, and obtains the name and dimension information of each node, which will be used in the subsequent reasoning process.
[0076] In some embodiments, the AR-Unet model obtained by improving the original Unet model is trained, verified and evaluated using the training set, verification set and test set respectively to generate a trained AR-Unet model, including:
[0077] An AR-Unet model obtained by improving the original Unet model is obtained, and the training set, validation set and test set are loaded through the AR-Unet model for training, validation and evaluation to generate the trained AR-Unet model.
[0078] Among them, the labeled and divided data sets are loaded locally, and the data will be augmented online (such as rotation, translation, scaling, etc.) during the loading process to enhance the generalization ability of the model (AR-Unet model).
[0079] Step 105: Use the trained AR-Unet model to test the preprocessed DWI image to generate a mask image.
[0080] In some embodiments, before the pre-processed DWI image is tested using the trained AR-Unet model to generate a mask image, the method further includes:
[0081] The trained AR-Unet model is set to use a multi-threaded processing mode.
[0082] To improve the reasoning speed, the number of threads in session_options can be adjusted to optimize the image processing performance. The embodiment of the present application uses multi-threading technology to accelerate image processing, uses std::thread in C++ to implement multi-threading, automatically obtains the number of computer threads, divides the image into multiple areas, and assigns them to different threads for processing, thereby significantly improving the processing speed.
[0083] The embodiment of the present application uses a multi-threaded method to effectively improve the speed of image processing. The speed of removing ghost artifacts from DWI images is 60ms-70ms / cif, which meets clinical needs.
[0084] Step 106, processing the mask image, and multiplying the processed mask image with the original DWI image, retaining the cranial brain region portion of the original DWI image, to obtain a DWI image after artifact removal.
[0085] Among them, the processed mask image is multiplied with the original DWI image, and the cranial brain area part in the original DWI image is retained. The final image is the image after artifact removal. The quality of the obtained DWI image after artifact removal is significantly improved, which is convenient for further medical diagnosis and analysis.
[0086] In some embodiments, after obtaining the DWI image after removing artifacts, the method further includes:
[0087] The NLM filtering technology is used to perform denoising on the DWI image after the artifacts are removed.
[0088] Among them, in order to effectively remove random noise in DWI images while retaining image details, the NLM filtering method is applied to the image after artifact removal to improve the quality of DWI images, thereby improving the accuracy of diagnosis. NLM filtering is used to further enhance the DWI image after artifact removal. For a certain pixel p in the image, the similarity between the pixel and other local pixel blocks is searched and calculated, and the weighted average is performed to update the value of the pixel to achieve the effect of smoothing and denoising. Compared with the traditional processing method based on a small area around a pixel in the image, the NLM global search method is more suitable for DWI image enhancement.
[0089] Reference Figure 5 ,Common filtering methods are applied to the DWI images after artifact removal.,Compared with median filtering and bilateral filtering, the NLM filtering method,can effectively remove image noise without changing the lesion structure,,and reduces image distortion.
[0090] In some embodiments, the processing the mask image includes:
[0091] According to a preset pixel threshold, a binarization operation is performed on the mask image;
[0092] The mask image after the binarization operation is converted into a single-channel eight-bit image, and the mask image after the conversion into the single-channel is inverted.
[0093] Among them, the mask image generated by reasoning needs to be further processed in order to be combined with the original image to remove artifacts. This includes the following steps: according to the set pixel threshold, the inference result is binarized, all pixels greater than the pixel threshold are set to 1 (indicating the presence of artifacts), and pixels less than the pixel threshold are set to 0; the binarized result is converted into a single-channel 8-bit image (each pixel value is 0 or 255). In order to perform further operations with the original image, it is usually necessary to invert the mask image (that is, white means retention and black means removal).
[0094] As can be seen from the above, this application introduces an attention gate module and a residual module based on the Unet model, and uses a deep learning model to remove artifacts and denoise DWI images. In order to facilitate the call and integration of deep learning models in magnetic resonance imaging systems, efficient model reasoning and deployment are achieved through ONNX and C++, and multi-threaded acceleration is supported. This application combines the Unet model architecture, residual module, attention gate mechanism and non-local mean (NLM) filtering technology, which can not only effectively remove Ghost artifacts, but also significantly improve image quality. Moreover, the developed model can be efficiently inferred and deployed in actual clinical environments.
[0095] All the above optional technical solutions can be arbitrarily combined to form optional embodiments of the present application, which will not be described one by one here.
[0096] In specific implementation, the present application is not limited by the execution order of the various steps described. If no conflict occurs, some steps can be performed in other orders or simultaneously.
[0097] As can be seen from the above, the DWI image Ghost artifact removal method provided in the embodiment of the present application first obtains multiple original DWI images in CIF format from the magnetic resonance imaging system, and preprocesses all the original DWI images to generate corresponding multiple preprocessed DWI images, then annotates the brain in all preprocessed DWI images, generates a binary annotation map corresponding to each preprocessed DWI image, and obtains multiple binary annotation maps, then divides all the original DWI images and the binary annotation maps to generate a training set, a validation set and a test set, and then obtains the AR-Unet model obtained by improving the original Unet model, and uses the training set, validation set and test set to train, verify and evaluate it respectively to generate a trained AR-Unet model, then uses the trained AR-Unet model to test the preprocessed DWI image to generate a mask image, and finally processes the mask image, and multiplies the processed mask image with the original DWI image, retains the brain area part in the original DWI image, and thus obtains the DWI image after artifact removal. Through this method, the embodiment of the present application can not only remove Ghost artifacts in DWI images, but also improve the quality of DWI images, thereby improving the accuracy of diagnosis.
[0098] The present application also provides a device for removing ghost artifacts from DWI images. Figure 6 , Figure 6 A schematic diagram of the structure of a DWI image Ghost artifact removal device provided in an embodiment of the present application. The DWI image Ghost artifact removal device 30 includes a memory 120, one or more processors 180, and one or more applications, wherein the one or more applications are stored in the memory 120 and configured to be executed by the processor 180; the memory 120 can be used to store applications and data. The application stored in the memory 120 contains executable code. The application can be composed of various functional modules. The processor 180 executes various functional applications and data processing by running the application stored in the memory 120. In addition, the memory 120 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage device. Accordingly, the memory 120 may also include a memory controller to provide the processor 180 with access to the memory 120.
[0099] The processor 180 is the control center of the device, and uses various interfaces and lines to connect various parts of the entire terminal, and executes various functions of the device and processes data by running or executing applications stored in the memory 120, and calling data stored in the memory 120, so as to monitor the device as a whole. Optionally, the processor 180 may include one or more processing cores; preferably, the processor 180 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs.
[0100] Specifically in this embodiment, a computer program is stored in the memory 120 , and the processor 180 executes the DWI image Ghost artifact removal method based on the DWI image Ghost artifact removal system described in any of the above embodiments by calling the computer program stored in the memory 120 .
[0101] An embodiment of the present application further provides a DWI image Ghost artifact removal system, and the DWI image Ghost artifact removal system includes the DWI image Ghost artifact removal device described above.
[0102] An embodiment of the present application further provides a computer-readable storage medium, wherein a computer program is stored in the storage medium. When the computer program is executed on a computer, the computer executes the method for removing Ghost artifacts from DWI images described in any of the above embodiments.
[0103] It should be noted that, for the DWI image Ghost artifact removal method described in the present application, ordinary testers in the field can understand that the implementation of all or part of the process of the DWI image Ghost artifact removal method described in the embodiment of the present application can be completed by controlling the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium, such as stored in the memory of the DWI image Ghost artifact removal system, and executed by at least one processor in the DWI image Ghost artifact removal system, and the execution process may include the process of the embodiment of the DWI image Ghost artifact removal method. Among them, the storage medium can be a disk, an optical disk, a read-only memory (ROM), a random access memory (RAM), etc.
[0104] The above is a detailed introduction to the DWI image Ghost artifact removal method, device, storage medium and system provided in the embodiments of the present application. This article uses specific examples to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core ideas of the present application; at the same time, for technicians in this field, according to the ideas of the present application, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as a limitation on the present application.< / float>
Claims
1. A method for removing ghost artifacts from DWI images, characterized in that: The method comprises: Acquire multiple original DWI images in CIF format from a magnetic resonance imaging system, and preprocess all the original DWI images to generate corresponding multiple preprocessed DWI images; Annotating the brain in all the pre-processed DWI images, generating a binary annotation map corresponding to each of the pre-processed DWI images, and obtaining a plurality of the binary annotation maps; Dividing all the original DWI images and the binary annotated images to generate a training set, a validation set, and a test set; Obtaining an AR-Unet model obtained by improving the original Unet model, training, verifying and evaluating the model using the training set, the validation set and the test set respectively, to generate a trained AR-Unet model, wherein the second convolutional layer in the encoder and the decoder of the AR-Unet model is a residual block, and the jump connection part structure includes an attention gate module; Using the trained AR-Unet model to test the preprocessed DWI image to generate a mask image; The mask image is processed, and the processed mask image is multiplied with the original DWI image, and the cranial brain region portion in the original DWI image is retained to obtain a DWI image after artifacts are removed.
2. The method for removing Ghost artifacts from DWI images according to claim 1, characterized in that: After obtaining the DWI image after removing the artifacts, the method further includes: The NLM filtering technology is used to perform denoising on the DWI image after the artifacts are removed.
3. The method for removing Ghost artifacts from DWI images according to claim 1, characterized in that: The processing of the mask image comprises: According to a preset pixel threshold, a binarization operation is performed on the mask image; The mask image after the binarization operation is converted into a single-channel eight-bit image, and the mask image after the conversion into the single-channel is inverted.
4. The method for removing Ghost artifacts from DWI images according to claim 1, characterized in that: After generating the trained AR-Unet model, the method further includes: Saving the trained AR-Unet model; Before the trained AR-Unet model is used to test the preprocessed DWI image to generate a mask image, the method further includes: Convert the format of the saved trained AR-Unet model; Use ONNX Runtime and Opencv in C++ to load and run the trained AR-Unet model after format conversion and initialize the inference environment.
5. The method for removing Ghost artifacts from DWI images according to claim 1, characterized in that: The AR-Unet model obtained by improving the original Unet model is obtained, and the training set, the validation set and the test set are used to train, validate and evaluate the AR-Unet model to generate the trained AR-Unet model, including: An AR-Unet model is obtained by improving the original Unet model, and the training set, validation set and test set are respectively loaded through the AR-Unet model for training, validation and evaluation to generate the trained AR-Unet model.
6. The method for removing Ghost artifacts from DWI images according to claim 1, characterized in that: Before the trained AR-Unet model is used to test the preprocessed DWI image to generate a mask image, the method further includes: The trained AR-Unet model is set to use a multi-threaded processing mode.
7. The method for removing Ghost artifacts from DWI images according to claim 1, characterized in that: The preprocessing includes standardization and normalization.
8. A device for removing ghost artifacts from DWI images, characterized in that: The device includes a processor and a memory, wherein a computer program is stored in the memory, and the processor is used to execute the DWI image Ghost artifact removal method according to any one of claims 1 to 7 by calling the computer program stored in the memory.
9. A DWI image Ghost artifact removal system, characterized in that: The DWI image Ghost artifact removal system includes the DWI image Ghost artifact removal device according to claim 8.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed on a computer, the computer is enabled to execute the method for removing Ghost artifacts from DWI images according to any one of claims 1 to 7.