Magnetic resonance image artifact defect area-oriented segmentation method

By combining local convolution and global attention mechanisms with the BASU network, the problem of insufficient automatic segmentation accuracy of artifact regions in magnetic resonance imaging was solved, achieving accurate segmentation of artifact regions and improving diagnostic accuracy.

CN121527005APending Publication Date: 2026-02-13ZHEJIANG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511615260.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-06
Publication Date
2026-02-13

AI Technical Summary

Technical Problem

Existing magnetic resonance imaging (MRI) techniques are prone to large-area signal loss and image distortion artifacts in patients with implanted MRI-compatible devices, leading to decreased diagnostic accuracy. Furthermore, there is a lack of effective artifact segmentation methods, especially in the case of insufficient automatic segmentation accuracy of artifact regions in brain MRI images.

Method used

We employ a dual-input deep learning network, Boundary-Aware SlimUNETR (BASU), based on the 3D Transformer and U-Net architecture. By combining local convolutional features with a global attention mechanism, we construct an artifact segmentation model through reflection rigid registration and data augmentation. Furthermore, we introduce a boundary-aware module and multiple loss function optimization to achieve accurate segmentation of artifact regions.

Benefits of technology

It significantly improves the segmentation accuracy of artifact regions, reduces oversegmentation and undersegmentation, enhances the ability to identify artifact edges, and provides a more accurate and efficient automated artifact segmentation scheme.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121527005A_ABST
    Figure CN121527005A_ABST
Patent Text Reader

Abstract

The invention discloses a segmentation method for an artifact defect area of a magnetic resonance image. The method comprises the following steps: acquiring a plurality of magnetic resonance images as original magnetic resonance images, performing reflection rigid registration processing on the original magnetic resonance images to obtain symmetrical representation images, and constructing a training set according to the original magnetic resonance images and the symmetrical representation images; establishing an artifact segmentation model, inputting the training set into the artifact segmentation model for training, and obtaining a trained artifact segmentation model; and obtaining a to-be-segmented original magnetic resonance image, processing the to-be-segmented original magnetic resonance image to obtain a to-be-segmented symmetric representation image, and jointly inputting the to-be-segmented symmetric representation image into the trained artifact segmentation model for artifact region segmentation to obtain an artifact region in the to-be-segmented original magnetic resonance image. The method effectively improves the positioning accuracy and segmentation precision of the artifact area, reduces the manual intervention cost, and is suitable for preoperative implantation planning, postoperative evaluation and other clinical image intelligent analysis scenes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of medical image processing, and more specifically to a method for segmenting artifact-related defect regions in magnetic resonance imaging. Background Technology

[0002] Magnetic resonance imaging (MRI) has important applications in clinical practice and research. However, for patients with implanted MRI-compatible devices, such as cochlear implants, pacemakers, or deep brain stimulators, MRI images are affected by the integrated magnet, resulting in large-area signal loss and image distortion artifacts, severely impacting diagnostic accuracy. Currently, there is a lack of effective techniques to significantly reduce these artifacts, and a unified tool for quantitative assessment of artifact regions is also lacking. When segmenting brain MRI images for artifacts, distortion and signal loss at the skull boundaries lead to contour and brain tissue defects, posing a significant challenge to both manual and automated artifact segmentation methods. This invention proposes a dual-input deep learning model based on a 3D Transformer (a global modeling neural network structure based on a self-attention mechanism) and a U-Net (a classic U-shaped convolutional neural network in medical image segmentation) architecture. Modeling and validation were performed using a cochlear implant as a representative device. The model integrates local convolutional features and a global attention mechanism, effectively addressing issues such as unclear artifact boundaries and structural loss.

[0003] Traditional methods for artifact segmentation rely on manual segmentation, using tools such as 3D Slicer and ITK-SNAP. These methods are typically time-consuming, and the segmentation results vary greatly between different surgeons. This is mainly because the artifacts are too large, covering the skull and making it impossible to accurately identify the outer edges of the artifacts, i.e., the outline of the vanished skull.

[0004] In recent years, with the development of deep learning, significant breakthroughs have been achieved in medical image analysis. In particular, the UNETR architecture, combining the U-Net model and Transformer, utilizes skip connections between the encoder and decoder for feature fusion and introduces a self-attention mechanism to enhance the model's ability to weight global features during upsampling and downsampling, thereby improving the accuracy of artifact region identification and driving the development of medical image segmentation. However, MRI data for patients with cochlear implants is relatively scarce. Training UNETR solely on this data cannot accurately determine the outer boundaries of artifacts, resulting in artifact segmentation edges significantly extending beyond the skull. Summary of the Invention

[0005] This invention addresses the problem of automated segmentation of artifact-related defect regions in magnetic resonance imaging (MRI) images using deep learning. It proposes a novel solution and customized strategy, with deep learning as the core and foundation. Specifically, it introduces an innovative dual-input deep learning network, Boundary-Aware SlimUNETR (BASU), based on a 3D Transformer and U-Net architecture, successfully resolving the accuracy issues of previous methods, such as oversegmentation, undersegmentation, and inability to accurately determine the outer edges of artifacts in artifact-related defect regions.

[0006] The technical solution of this invention is: This invention includes the following steps: S1. Acquire magnetic resonance images and preprocess them as the original magnetic resonance images. Perform reflection rigid registration on the original magnetic resonance images to obtain symmetrical representation images. Then, construct a training set based on the original magnetic resonance images and symmetrical representation images. S2. Establish a artifact segmentation model, input the training set into the artifact segmentation model for training, and obtain the trained artifact segmentation model. S3. Obtain the original magnetic resonance image to be segmented, and process it to obtain the symmetrical representation image to be segmented. Input the two images together into the trained artifact segmentation model to segment the artifact regions and obtain the artifact regions in the original magnetic resonance image to be segmented.

[0007] The preprocessing in step S1 includes data augmentation using random flipping and cutting methods.

[0008] The specific steps for obtaining a symmetrical representation image by performing reflection rigid registration on the original magnetic resonance image are as follows: 1) Horizontally flip the original magnetic resonance image to obtain a horizontally flipped image; 2) Rigid registration is performed using the original magnetic resonance image as the reference image and the horizontally flipped image as the moving image to obtain a structure-aligned image; 3) The structure-aligned image and the original magnetic resonance image are weighted and fused to obtain a symmetrical representation image.

[0009] The artifact segmentation model includes an encoder, a decoder, and a boundary awareness module. The original magnetic resonance image and the symmetry representation image are input into the encoder for feature extraction to obtain N feature maps at different depths. Then, the N feature maps at different depths are input into the decoder layer by layer for upsampling. At each upsampling stage, the feature maps at the corresponding depth features of the encoder are fused to obtain output feature maps at different depths in N stages. The output feature map of the penultimate stage is input into the boundary awareness module for processing to obtain a predicted boundary probability map. The output feature map of the final stage is used as the output of the artifact segmentation model, and the predicted boundary probability map is used to construct the loss function.

[0010] The encoder consists of N sequentially connected encoding units, and the decoder consists of N sequentially connected decoding units. Each encoding unit and the corresponding depth decoding unit are fused through skip connections. The input of the first encoding unit is the original magnetic resonance image and the symmetric representation image. The input of the remaining N-1 encoding units is the output of the previous encoding unit. Each encoding unit outputs a feature map at a different depth. The input of the first decoding unit is the output of the last encoding unit. The input of the remaining N-1 decoding units is the concatenation result of the output of their respective previous decoding units and the feature map at the corresponding depth of the encoding unit. Each decoding unit outputs a feature map at a different depth.

[0011] The encoding unit includes a depthwise convolutional layer, a group normalization layer, and a block module connected in sequence. The input of the encoding unit is processed by the depthwise convolutional layer and the group normalization layer in sequence, and then input to the block module for feature extraction to obtain the feature map at the current depth. The decoding unit includes a Block module, a deconvolution layer, and a group normalization layer connected in sequence. The input of the decoding unit is processed by the Block module for feature extraction, and then processed by the deconvolution layer and the group normalization layer to obtain the output feature map of the current upsampling stage.

[0012] The Block module includes two image block partitioning layers, a local representation aggregation layer, two linear convolutional layers, a global sparse Transformer layer, and a local anti-diffusion layer. The input of the Block module is sequentially processed by the first image block partitioning layer to extract local features, then by the local representation aggregation layer to integrate neighborhood information, and then by the first linear convolutional layer to perform channel fusion processing to obtain a local feature map. The local feature map is then sequentially processed by the second image block partitioning layer, the global sparse Transformer layer, and the local anti-diffusion layer to obtain a global enhanced feature map. Finally, the global enhanced feature map is input into the second linear convolutional layer to obtain the output of the Block module.

[0013] The boundary awareness module includes two convolutional layers, a grouping normalization layer, a sigmoid activation function, and a deconvolutional layer. The output feature map output from the penultimate upsampling stage in the decoder is processed sequentially through the first convolutional layer, the grouping normalization layer, and the second convolutional layer, and then sequentially processed through the sigmoid activation function and the deconvolutional layer to obtain the predicted boundary probability map.

[0014] During training in step S2, a loss function is used to calculate the loss of the artifact segmentation model. The loss calculation is specifically obtained according to the following formula: in, Represents the overall loss function. , and These represent the Focal loss function, the Dice loss function, and the boundary-aware loss function, respectively. , and Let represent the weight coefficients of the loss terms for the Focal loss function, Dice loss function, and boundary-aware loss function, respectively; j represents the category sequence number, j=1 to J, where J represents the total number of categories; and i represents the voxel sequence number, i=1 to I, where I represents the total number of voxels. Indicates the first Individual elements in the first Predicted probability of class The actual label for the current location. This represents the probability map of the predicted boundary. Represents the true boundary probability diagram. This represents the L1 norm.

[0015] The beneficial effects of this invention are: The BASU network of this invention adopts a U-Net architecture, performing feature fusion through skip connections between the encoder and decoder. Each encoder and decoder includes a context integration module for efficiently extracting and aggregating representation information by combining local convolutions and global attention. Secondly, to further guide the segmentation process, this invention introduces an auxiliary boundary prediction branch at the end of the decoder. Finally, by comparing the results with other 3D segmentation models, BASU achieves significant progress on multiple metrics. This demonstrates that the BASU algorithm has significant advantages in practical applications, providing a more efficient and accurate solution for automated artifact segmentation, and solving the problems of high error rates and low segmentation speed in traditional artifact segmentation. Attached Figure Description

[0016] Figure 1 Flowchart of a deep learning-based automatic segmentation method for artifact-related defects in magnetic resonance images in this embodiment of the invention. Figure 2 A model architecture diagram of a deep learning-based automatic segmentation method for artifact-related defect regions in magnetic resonance images, as described in this invention embodiment; Figure 3 This is a schematic diagram of data reflection registration in an embodiment of the present invention; Figure 4 This is a diagram illustrating the segmentation results in an embodiment of the present invention; Figure 5 This is a diagram illustrating the segmentation results of T1 and T2 in an embodiment of the present invention; Figure 6 This is a box plot of the intermodal artifact edge segmentation error in an embodiment of the present invention; Figure 7 This is a diagram illustrating the edges of the segmentation result in an embodiment of the present invention; Figure 8 This is a comparison diagram of the segmentation results of various methods in the embodiments of the present invention. Detailed Implementation

[0017] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and do not limit the scope of protection of this invention.

[0019] Figure 1 The flowchart of the deep learning-based automatic segmentation method for artifact-related defect regions in magnetic resonance images, as shown in the embodiments of the present invention, is as follows: Figure 1 As shown, this embodiment includes the following steps: S1. Acquire several magnetic resonance images as original magnetic resonance images, perform reflection rigid registration on the original magnetic resonance images to obtain symmetrical representation images, and then construct a training set based on the original magnetic resonance images and symmetrical representation images. S2. Establish a artifact segmentation model, input the training set into the artifact segmentation model for training, and obtain the trained artifact segmentation model. S3. Obtain the original magnetic resonance image to be segmented and process it to obtain the symmetric representation image to be segmented. Input the original magnetic resonance image to be segmented and the symmetric representation image into the trained artifact segmentation model to segment the artifact region and obtain the artifact region in the original magnetic resonance image to be segmented.

[0020] Specifically, this invention mainly comprises two parts: a training phase and a testing phase. First, all collected brain magnetic resonance imaging (MRI) datasets are randomly divided into training and testing sets. During the training phase, the training set is used to train the artifact segmentation model. For the training data, reflection registration is first performed, followed by random flipping and cropping of the original image and its corresponding registered image to achieve a more robust preprocessing process.

[0021] After preprocessing, the enhanced training samples are input into the artifact segmentation model for training, and the network parameters are continuously updated. During model training, intermediate models are used for validation to evaluate their performance on the validation set. For the test set, the same reflection registration and data augmentation strategies as the training set are used for preprocessing. The processed test samples are then input into the current segmentation model to obtain prediction results for artifact regions, and the current model is evaluated based on the prediction accuracy. If the model is the optimal model in the current iteration, its parameters are saved; otherwise, they are not saved, and iterative optimization continues. After training, the testing phase begins. The optimal model parameters obtained during training are loaded into the artifact segmentation model, and final inference prediction is performed on the test set, outputting the automatic segmentation result of the artifact region. This segmentation result has good boundary details and overall structural consistency, making it suitable for efficient artifact detection tasks in medical image analysis.

[0022] Preprocessing in step S1 includes data augmentation using random flipping and cutting methods.

[0023] In existing research, most symmetry modeling methods typically employ symmetric image patch construction strategies or directly horizontally flip the image. However, these methods often overlook the inherent anatomical asymmetry of the brain and rotational changes that may be introduced during image acquisition. This problem is exacerbated in the presence of artificial implants (such as cochlear implants), as the inhomogeneity of local magnetic fields further exacerbates structural biases, making simple flipping and stacking insufficient to construct effective symmetry priors. To address these challenges, a reflection registration strategy is proposed to generate more accurately aligned symmetric representations.

[0024] like Figure 3 As shown, the symmetrical representation image obtained by performing reflection rigid registration on the original magnetic resonance image is as follows: 1) Horizontally flip the original magnetic resonance image to obtain a horizontally flipped image; 2) Rigid registration is performed using the original magnetic resonance image as the reference image and the horizontally flipped image as the moving image to obtain a structure-aligned image; 3) The structure-aligned image and the original magnetic resonance image are weighted and fused to obtain a symmetrical representation image.

[0025] Specifically, for each original MRI volumetric image (denoted as MRIgt), its horizontally flipped version (denoted as MRIf) is first generated. Using the original image MRIgt as a reference image, a structurally aligned flipped image (denoted as MRIrf) is obtained through rigid registration, serving as the moving image. Finally, MRIgt and MRIrf are weighted and fused to generate the final symmetrical representation image, denoted as MRIa. This strategy explicitly introduces a spatial registration process, considers anatomical asymmetry, improves the consistency between the left and right hemispheres, and mitigates geometric distortions caused by implant-induced artifacts and natural anatomical differences. Therefore, it provides a more stable and reliable structural prior for subsequent artifact segmentation tasks.

[0026] Due to the large spatial dimensions of artifacts in medical images and implants, and the limited computational resources, this invention proposes a lightweight 3D segmentation network. This model is specifically designed for segmenting brain MRI images with severe structural distortion caused by implants, and is particularly suitable for cases where the skull boundary is partially or completely missing. By fusing and improving the boundary-aware supervision mechanism to adapt to artifact segmentation tasks, a "Boundary-Aware Slim UNETR" (BA-Slim UNETR) is formed, significantly improving the model's ability to identify blurred artifact boundaries and the overall segmentation accuracy under complex structural conditions and severe artifacts.

[0027] The artifact segmentation model includes an encoder, a decoder, and a boundary awareness module. The original magnetic resonance image and its symmetry representation image are input into the encoder for feature extraction, resulting in N feature maps at different depths. Subsequently, the N feature maps at different depths are input into the decoder layer by layer for upsampling. At each upsampling stage, the feature maps at the corresponding depths output by the encoder are fused to obtain output feature maps at different depths at N stages. The output feature map from the penultimate upsampling stage is input into the boundary awareness module for processing to obtain a predicted boundary probability map. The output feature map from the final upsampling stage is used as the output of the artifact segmentation model, and the predicted boundary probability map is used to construct the loss function.

[0028] The encoder consists of N sequentially connected encoding units, and the decoder consists of N sequentially connected decoding units. Each encoding unit and the corresponding depth decoding unit are fused through skip connections. The input of the first encoding unit is the original magnetic resonance image and the symmetric representation image. The input of the remaining N-1 encoding units is the output of the previous encoding unit. Each encoding unit outputs a feature map at a different depth. The input of the first decoding unit is the output of the last encoding unit. The input of the remaining N-1 decoding units is the concatenation result of the output of their respective previous decoding units and the feature map at the corresponding depth of the encoding unit. Each decoding unit outputs a feature map at a different depth.

[0029] The encoding unit consists of a depthwise convolutional layer, a group normalization layer, and a block module connected in sequence. The input of the encoding unit is processed by the depthwise convolutional layer and the group normalization layer in sequence, and then input to the block module for feature extraction to obtain the feature map at the current depth. The decoding unit consists of a Block module, a deconvolution layer, and a group normalization layer connected in sequence. The input of the decoding unit is processed by the Block module for feature extraction, and then processed by the deconvolution layer and the group normalization layer to obtain the output feature map of the current upsampling stage.

[0030] In the encoding unit, the output of the grouping normalization layer serves as the input to the Block module in the current encoding unit; in the decoding unit, the input of the current decoding unit serves as the input to the Block module. The Block module includes two image block partitioning layers, one local representation aggregation layer, two linear convolutional layers, one global sparse Transformer layer, and one local anti-diffusion layer. The input of the Block module is sequentially processed by the first image block partitioning layer to extract local features, then by the local representation aggregation layer to integrate neighborhood information, and then by the first linear convolutional layer for channel fusion processing to obtain a local feature map. The local feature map is then sequentially processed by the second image block partitioning layer, the global sparse Transformer layer, and the local anti-diffusion layer to obtain a global enhanced feature map. Finally, the global enhanced feature map is input into the second linear convolutional layer to obtain the output of the Block module.

[0031] Specifically, this module is based on Slim UNETR and consists of the following five sub-modules: Patch Partition: Embeds local features through 3D deep convolution, while implicitly introducing spatial location encoding without changing the original spatial dimension.

[0032] Local Representations Congregation: Combines 1×1×1 point convolutions and 3×3×3 depthwise convolutions to extract local neighborhood context. Residual connections and group normalization are used to enhance stability and expressiveness.

[0033] Line Convolutions: Two sequential 1×1×1 convolutions combined with the Gaussian Error Linear Unit (GELU) activation function are used for channel fusion. GELU is a non-linear activation function based on probability theory. Its output represents the result of the input value being probabilistically weighted by the standard normal distribution cumulative function. This process is similar to the feedforward network in Transformer.

[0034] Global Sparse Transformer: To reduce the computational complexity of the full self-attention mechanism, a sparse token sampling mechanism is introduced, selecting only feature tokens from representative regions for multi-head self-attention modeling. A token is a basic feature unit encoded in the image, used to express the semantics of a local region. This strategy reduces redundant computation while maintaining global awareness, helping to improve the efficiency and accuracy of MRI artifact segmentation.

[0035] Local Reverse Diffusion (RDD): This mechanism upsamples the feature map using transposed convolution and refines channel features using point-wise convolution (1×1×1 convolution), injecting the global context information extracted from the encoder back into the high-resolution voxel space. This effectively fuses local details with global semantics, improving the model's ability to accurately identify the edges of artifact regions.

[0036] These modules form a closed-loop structure, encompassing local encoding, global interaction, and local refinement, supporting efficient and expressive high-resolution 3D segmentation feature learning.

[0037] To improve edge localization capabilities, this invention adds a parallel boundary-aware supervision branch at the end of the decoder. This module extracts features from the mid-level decoder, passes them through two 3×3×3 convolutional layers and a sigmoid activation, and outputs a boundary probability map of the same size as the segmentation result.

[0038] The ground truth boundary map is generated by applying the 3D Sobel operator to the artifact mask. During training, the L1 loss function is used to calculate the error between the predicted boundary and the true boundary, guiding the network to focus more on the contour region. This effectively reduces undersegmentation of artifact regions and helps to recover contaminated structural boundaries.

[0039] The boundary awareness module includes two convolutional layers, a grouping normalization layer, a sigmoid activation function, and a deconvolutional layer. The output feature map from the penultimate upsampling stage in the decoder is processed sequentially through the first convolutional layer, the grouping normalization layer, and the second convolutional layer, and then sequentially through the sigmoid activation function and the deconvolutional layer to obtain the predicted boundary probability map.

[0040] To improve artifact segmentation performance and alleviate training difficulties caused by class imbalance, this invention proposes a composite optimization strategy integrating three loss functions: Dice loss, Focal loss, and boundary-aware loss, to construct a more robust deep learning segmentation model. To enhance the model's attention to hard-classified samples, the Focal loss incorporates a hard-sample adjustment mechanism. Furthermore, to improve segmentation accuracy in artifact boundary regions, a boundary-aware supervision module is proposed. This module outputs a predicted boundary probability map through an auxiliary branch. And compared with the true boundary map generated by applying the 3D Sobel operator to the target segmentation mask. In comparison, the boundary-aware loss function, guided by explicit boundaries, effectively alleviates the boundary blurring problem caused by artifact contamination.

[0041] During the training phase, this model employs a combined loss function of Soft Dice Loss, Focal Loss, and L1 Loss to enhance sensitivity to foreground regions and mitigate class imbalance. The model optimizes the contour and structural accuracy of artifact regions by calculating the difference between the predicted results and the true labels layer by layer. Ultimately, the trained model can perform fast and accurate 3D segmentation of artifact regions in MRI images with limited resources, demonstrating good performance and inference efficiency.

[0042] During training in step S2, the loss function is used to calculate the loss of the artifact segmentation model. The loss calculation is specifically obtained according to the following formula: in, Represents the overall loss function. , and These represent the Focal loss function, the Dice loss function, and the boundary-aware loss function, respectively. , and Let represent the weight coefficients of the loss terms for the Focal loss function, Dice loss function, and boundary-aware loss function, respectively; j represents the category sequence number, j=1 to J, where J represents the total number of categories; and i represents the voxel sequence number, i=1 to I, where I represents the total number of voxels. Indicates the first Individual elements in the first Predicted probability of class The actual label for the current location (using one-hot encoding). This represents the probability map of the predicted boundary. Represents the true boundary probability diagram. This represents the L1 norm.

[0043] The weighting coefficient for the loss term is empirically selected; in this embodiment, it is set to... , , This method can be integrated into the training process of 3D medical image segmentation neural networks, and is especially suitable for segmentation tasks of artifact regions caused by implants such as cochlear implants in brain MRI, with the characteristics of high accuracy and high robustness.

[0044] In summary, Figure 2 This is a structural diagram of the artifact segmentation model in an embodiment of the present invention. Figure 2 As shown, the artifact segmentation model (Boundary-Aware Slim UNETR) proposed in this invention adopts a U-shaped encoder-decoder structure and achieves multi-scale feature fusion through skip connections. The encoder downsamples the input 3D volume data (size H×W×D) layer by layer, while the decoder gradually restores the spatial resolution. In each layer of the encoder... ( In this case, the spatial resolution of the feature map is reduced to: In a specific implementation of the multi-level convolutional layer input method of this invention, the proposed deep learning automatic segmentation method for artifact-prone regions of magnetic resonance imaging (MRI) images employs a modified BA-Slim UNETR network structure for modeling and segmentation. In terms of network structure design, this embodiment adopts an encoder-decoder structure and achieves multi-scale feature fusion through multi-layer skip connections. First, the input three-dimensional brain MRI image is fed into the encoder module. The encoder uses three-dimensional depthwise separable convolutions for layer-by-layer downsampling. Compared with traditional convolutional methods, this structure can effectively reduce the number of model parameters and memory usage, thereby improving the overall efficiency and deployability of the network.

[0045] In each layer of the encoder and decoder, a context integration module is introduced to enhance feature representation capabilities. This module integrates local convolutional operations with a global attention mechanism, capturing long-range dependencies while preserving local structural information, thus achieving accurate modeling of complex artifact boundaries. The feature extraction module adopts an improved Slim UNETR encoder structure, which, unlike the standard fully connected Transformer structure, extracts multi-scale contextual information by combining convolution with a sparse self-attention mechanism. The input MRI image is first divided into voxels through Patch Partition and then fed into multiple Slim UNETR Block modules. Each block constructs hierarchical features through local representation aggregation, sparse attention modeling, and anti-diffusion mechanisms, forming low-level and high-level feature maps at different levels. The feature map extracted by the initial convolutional structure serves as the low-level feature map, while the feature maps output from subsequent stages serve as high-level feature maps at different semantic levels, achieving effective encoding of multi-scale features in artifact-related defect regions. This feature extraction module primarily uses convolution combined with a Transformer sparse mechanism, balancing global modeling and resource efficiency.

[0046] To further improve segmentation accuracy, this embodiment introduces a boundary-aware auxiliary branch at the end of the decoder to explicitly guide the network in learning artifact edge structures. This boundary branch extracts mid-layer decoding features and sequentially passes them through two 3×3×3 volumetric convolutions and a sigmoid activation function, outputting a boundary probability map with the same size as the main segmentation map. The ground truth boundary map is generated by applying a 3D Sobel operator to the artifact mask and is compared with the predicted boundary map during training using a ℓ1 loss function, thereby enhancing the network's sensitivity to contour regions, effectively alleviating the under-segmentation problem of artifact regions, and improving the overall boundary recovery effect.

[0047] Within the main network structure, several key functional modules are further integrated to achieve superior segmentation performance. These modules are connected end-to-end to form a closed-loop network architecture, enabling the entire process from local perception and global modeling to local refinement, thereby supporting efficient and accurate segmentation of artifact regions in high-resolution 3D magnetic resonance images. During the model training phase, a standard supervised learning process is employed, combining artifact region masks and boundary ground truth maps as supervision signals to jointly optimize the loss functions of the main segmentation task and the boundary auxiliary task, further enhancing the model's robustness and generalization ability.

[0048] In this embodiment, the experiment was conducted on an NVIDIA RTX A4500 GPU equipped with 20GB of video memory. The training dataset contained magnetic resonance imaging data from 12 subjects, each with three registered and aligned 3D MRI modalities: T1-weighted spin echo (T1w SE), T2-weighted fast spin echo (T2w FSE), and T2-weighted gradient echo (T2wGRE). To enhance data diversity and improve the model's generalization ability, additional localizer sequences were also introduced as supplementary data.

[0049] Each sample was paired with its mirror-registered version as a structural symmetry prior to aid robust modeling in areas of severe anatomical degradation. Data preprocessing, based on the MONAI framework, primarily included: spatial orientation normalization, channel-first transformation, data type unification, multi-class label conversion, and isotropic resampling (1×1×1 mm). 3 ), space filling, center cropping, and random image patch extraction (patch size is 160×160×160).

[0050] Building upon this, standard data augmentation strategies were further employed, including random flipping of spatial axes, intensity normalization, and random perturbation. Notably, to preserve complete anatomical information, skull stripping was not performed during model training.

[0051] Model optimization was performed using the AdamW optimizer with a weight decay factor of 0.4. The initial learning rate was 0.001, and a linear warm-up strategy combined with cosine annealing learning rate scheduling was used to promote stable model convergence.

[0052] The implementation results of a deep learning-based automatic segmentation method for artifact-prone regions in magnetic resonance imaging are also presented. For example... Figure 4 As shown, the artifact segmentation results obtained by the artifact segmentation model provided in the embodiment are basically consistent with the manual segmentation results, which demonstrates the accuracy of the artifact segmentation model of this method. Figure 5 , Figure 6 , Figure 7 The segmentation results of T1 and T2 in the embodiments of the present invention are shown. Comparative analysis shows that the average distance of the outer boundary of the artifact region by this method is only 3mm, the maximum distance is about 6mm, and the minimum distance is 0mm. This fully demonstrates that the segmented artifact boundary contour has high accuracy and consistency, which meets the needs of clinical analysis and processing.

[0053] Figure 8The accompanying diagrams show a comparison of segmentation results from various methods in this invention, illustrating representative segmentation results from 3D U-Net, nnU-Net, Slim UNETR, and the BA-Slim UNETR proposed in this invention. While other models exhibit varying degrees of indentation or protrusion at artifact boundaries, the segmentation contours generated by this invention (BA-Slim UNETR) are more continuous, smoother, and conform to anatomical structures, better matching manually annotated results and providing the most visually accurate segmentation performance.

[0054] The specific embodiments described above illustrate the technical solution and beneficial effects of the present invention in detail. It should be understood that the above description is only the most preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, additions, and equivalent substitutions made within the scope of the principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for segmenting artifact-related defect regions in magnetic resonance imaging, characterized in that, Includes the following steps: S1. Acquire magnetic resonance images and preprocess them as the original magnetic resonance images. Perform reflection rigid registration on the original magnetic resonance images to obtain symmetrical representation images. Then, construct a training set based on the original magnetic resonance images and symmetrical representation images. S2. Establish a artifact segmentation model, input the training set into the artifact segmentation model for training, and obtain the trained artifact segmentation model. S3. Obtain the original magnetic resonance image to be segmented, and process it to obtain the symmetrical representation image to be segmented. Input the two images together into the trained artifact segmentation model to segment the artifact regions and obtain the artifact regions in the original magnetic resonance image to be segmented.

2. The segmentation method for artifact-related defect regions in magnetic resonance images according to claim 1, characterized in that: The preprocessing in step S1 includes data augmentation using random flipping and cutting methods.

3. The segmentation method for artifact-related defect regions in magnetic resonance images according to claim 1, characterized in that: The specific steps for obtaining a symmetrical representation image by performing reflection rigid registration on the original magnetic resonance image are as follows: 1) Horizontally flip the original magnetic resonance image to obtain a horizontally flipped image; 2) Rigid registration is performed using the original magnetic resonance image as the reference image and the horizontally flipped image as the moving image to obtain a structure-aligned image; 3) The structure-aligned image and the original magnetic resonance image are weighted and fused to obtain a symmetrical representation image.

4. The segmentation method for artifact-related defect regions in magnetic resonance images according to claim 1, characterized in that: The artifact segmentation model includes an encoder, a decoder, and a boundary awareness module. The original magnetic resonance image and the symmetry representation image are input into the encoder for feature extraction to obtain N feature maps at different depths. Then, the N feature maps at different depths are input into the decoder layer by layer for upsampling. At each upsampling stage, the feature maps at the corresponding depth features of the encoder are fused to obtain output feature maps at different depths in N stages. The output feature map of the penultimate stage is input into the boundary awareness module for processing to obtain a predicted boundary probability map. The output feature map of the final stage is used as the output of the artifact segmentation model, and the predicted boundary probability map is used to construct the loss function.

5. The segmentation method for artifact-related defect regions in magnetic resonance images according to claim 1, characterized in that: The encoder consists of N sequentially connected encoding units, and the decoder consists of N sequentially connected decoding units. Each encoding unit and the corresponding depth decoding unit are fused through skip connections. The input of the first encoding unit is the original magnetic resonance image and the symmetric representation image. The input of the remaining N-1 encoding units is the output of the previous encoding unit. Each encoding unit outputs a feature map at a different depth. The input of the first decoding unit is the output of the last encoding unit. The input of the remaining N-1 decoding units is the concatenation result of the output of their respective previous decoding units and the feature map at the corresponding depth of the encoding unit. Each decoding unit outputs a feature map at a different depth.

6. The segmentation method for artifact-related defect regions in magnetic resonance images according to claim 1, characterized in that: The encoding unit includes a depthwise convolutional layer, a group normalization layer, and a block module connected in sequence. The input of the encoding unit is processed by the depthwise convolutional layer and the group normalization layer in sequence, and then input to the block module for feature extraction to obtain the feature map at the current depth. The decoding unit includes a Block module, a deconvolution layer, and a group normalization layer connected in sequence. The input of the decoding unit is processed by the Block module for feature extraction, and then processed by the deconvolution layer and the group normalization layer to obtain the output feature map of the current upsampling stage.

7. The segmentation method for artifact-related defect regions in magnetic resonance images according to claim 1, characterized in that: The Block module includes two image block partitioning layers, a local representation aggregation layer, two linear convolutional layers, a global sparse Transformer layer, and a local anti-diffusion layer. The input of the Block module is sequentially processed by the first image block partitioning layer to extract local features, then by the local representation aggregation layer to integrate neighborhood information, and then by the first linear convolutional layer to perform channel fusion processing to obtain a local feature map. The local feature map is then sequentially processed by the second image block partitioning layer, the global sparse Transformer layer, and the local anti-diffusion layer to obtain a global enhanced feature map. Finally, the global enhanced feature map is input into the second linear convolutional layer to obtain the output of the Block module.

8. The segmentation method for artifact-related defect regions in magnetic resonance images according to claim 1, characterized in that: The boundary awareness module includes two convolutional layers, a grouping normalization layer, a sigmoid activation function, and a deconvolutional layer. The output feature map output from the penultimate upsampling stage in the decoder is processed sequentially through the first convolutional layer, the grouping normalization layer, and the second convolutional layer, and then sequentially processed through the sigmoid activation function and the deconvolutional layer to obtain the predicted boundary probability map.

9. The segmentation method for artifact-related defect regions in magnetic resonance images according to claim 1, characterized in that: During training in step S2, a loss function is used to calculate the loss of the artifact segmentation model. The loss calculation is specifically obtained according to the following formula: in, Represents the overall loss function. , and These represent the Focal loss function, the Dice loss function, and the boundary-aware loss function, respectively. , and Let represent the weight coefficients of the loss terms for the Focal loss function, Dice loss function, and boundary-aware loss function, respectively; j represents the category sequence number, j=1 to J, where J represents the total number of categories; and i represents the voxel sequence number, i=1 to I, where I represents the total number of voxels. Indicates the first Individual elements in the first Predicted probability of class The actual label for the current location. This represents the probability map of the predicted boundary. Represents the true boundary probability diagram. This represents the L1 norm.