A method for constructing an intelligent segmentation model of a magnetic resonance image
By constructing a cardiac region localization network, a region of interest intelligent enhancement module, and a multi-scale, multi-class segmentation network, combined with a cross-device domain adaptive optimization module, the time consumption, error, and cross-device adaptability issues of LGE-CMR image segmentation are solved, achieving automated, accurate multi-class segmentation and stable cross-device applications.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-04-10
- Publication Date
- 2026-07-03
Smart Images

Figure CN122336256A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of medical image processing technology, specifically to a method for constructing an intelligent segmentation model for magnetic resonance imaging. Background Technology
[0002] Acute myocardial infarction is a common high-risk cardiovascular disease in clinical practice. Late gadolinium-enhanced cardiac magnetic resonance imaging (LGE-CMR) is currently the gold standard for detecting myocardial scarring and microvascular obstruction. Myocardial scarring is the tissue formed by the repair of necrotic myocardium after myocardial infarction, while microvascular obstruction is the blood flow blockage caused by microvascular dysfunction in the infarcted area. Accurate detection and quantitative assessment of both (such as volume and proportion calculation) are crucial for risk stratification, treatment selection, and prognosis in patients with acute myocardial infarction. In current clinical practice, the core of LGE-CMR image analysis is the segmentation of myocardial boundaries, scar areas, and microvascular obstruction areas, and then obtaining key quantitative parameters based on the segmentation results to provide a basis for clinical decision-making.
[0003] Current LGE-CMR image segmentation typically employs manual segmentation. However, manual segmentation is not only time-consuming but also introduces inter-observer errors due to differences in judgment among physicians, making it difficult to meet the needs of standardized and efficient clinical analysis. While automatic segmentation methods have been developed, most models can only segment myocardium and scar tissue, failing to simultaneously and accurately identify microvascular occlusions. Some models that attempt to segment microvascular occlusions lack sufficient segmentation accuracy for small-volume microvascular occlusions, easily leading to missed or false detections due to limited feature information in small regions. Furthermore, different medical institutions' MRI equipment varies in magnetic field strength, contrast agent type, and imaging parameters. Existing automatic segmentation models have weak generalization ability across equipment data, requiring large-scale retraining after equipment replacement to maintain accuracy, making it difficult to adapt to diverse clinical application scenarios. Summary of the Invention
[0004] To address the shortcomings of existing technologies, this invention provides a method for constructing an intelligent segmentation model for magnetic resonance imaging, which solves the problems mentioned above in the prior art.
[0005] To achieve the above objectives, the present invention provides the following technical solution: a method for constructing an intelligent segmentation model for magnetic resonance imaging, comprising: S1. Acquire LGE-CMR images; S2. Construct a cardiac region localization network, which is used to locate the cardiac region in LGE-CMR images; S3. Construct a region of interest (ROI) intelligent enhancement module. The intelligent enhancement module is used to enhance the ROI of the heart based on the output of the heart region localization network. S4. Construct a multi-scale, multi-class segmentation network. The segmentation network is used to achieve multi-class segmentation of myocardium, scars, and microvascular occlusion based on the enhanced cardiac region of interest. S5. Construct a cross-device domain adaptive optimization module. The optimization module is used to improve the generalization ability of the segmentation network under different magnetic resonance device data.
[0006] Furthermore, the construction of the cardiac region localization network includes: The LGE-CMR images were resized and normalized using preset dimensions. The processed LGE-CMR images were labeled by at least two physicians with LGE-CMR diagnostic experience, who independently labeled the bounding boxes of the cardiac region. Any inconsistent labels were negotiated and confirmed before being used as training labels. Design adaptive anchor boxes. The adaptive anchor boxes are based on the aspect ratio distribution of all labeled bounding boxes, and generate multiple sets of initial anchor box groups that fit the heart region. An anchor box dynamic adjustment mechanism is introduced during the training process of the localization network. During the training process, the anchor box dynamic adjustment mechanism periodically calculates the intersection-union ratio (IUR) between the current anchor box and the ground truth bounding box. For anchor boxes with IUR less than a preset threshold, the anchor box size is updated according to the average width and height of the ground truth bounding box within the period to keep the number of anchor boxes constant.
[0007] Furthermore, the intelligent enhancement module for constructing the region of interest includes: The region of interest (ROI) of the heart is cropped based on the bounding box output by the heart region localization network, and bilinear interpolation is used to uniformly adjust the cropped ROI to a preset size to ensure consistent input size. Adaptive enhancement for attention guidance, including: Calculate the gray-level histogram of the region of interest in the heart to determine the signal range threshold for different tissue types such as myocardium, scar tissue, and microvascular obstruction; A signal attention map is generated using a Gaussian kernel for weighted generation, with different weights assigned to microvascular occlusion regions, scar regions, and myocardial regions. The enhancement parameters are dynamically adjusted based on the signal attention map. The enhancement parameters include the contrast adjustment magnitude and the image sharpening degree. The contrast adjustment magnitude is positively correlated with the weight, and the sharpening degree is set separately for microvascular occlusion areas, scar areas, and myocardial areas.
[0008] Furthermore, the construction of the multi-scale, multi-class segmentation network includes: A multi-scale feature fusion module is inserted between the encoder and decoder of the segmentation network. The multi-scale feature fusion module contains multiple feature processing branches. These branches receive feature maps of different scales output by the encoder. The feature processing branches perform convolution and upsampling on the feature maps of different scales to unify the scale, and then fuse the processed feature maps using element-wise addition. The fused feature maps are used to enhance the small-region feature representation of the segmentation network and are output to the decoder to achieve multi-class segmentation of myocardium, scars, and microvascular occlusion.
[0009] Furthermore, the multi-scale feature fusion module includes: The first feature processing branch receives the first-scale feature map output by the encoder, and after convolution processing, it is upsampled to the original scale by multiple times. The second feature processing branch receives the second-scale feature map output by the encoder, and after convolution processing, it is upsampled to the original scale by a small factor. The third feature processing branch receives the original scale feature map output by the encoder, and maintains the scale after convolution processing; The feature maps from the first, second, and third feature processing branches are fused element-wise, and the fused feature map is output to the decoder of the segmentation network.
[0010] Furthermore, the construction of the cross-device domain adaptive optimization module includes: A multi-layer convolutional network is constructed as a domain discriminator. The domain discriminator receives the feature map output by the segmentation network encoder and outputs a binary classification result indicating whether the feature map belongs to the source domain or the target domain. The binary classification result is output using the Sigmoid activation function and the binary cross-entropy is used as the loss function. Domain adaptive adversarial training is performed, which involves alternating training of the segmentation network and the domain discriminator. The segmentation network learns the domain invariance features of the LGE-CMR image by minimizing the judgment accuracy of the domain discriminator.
[0011] Furthermore, the semi-supervised training of the target domain includes: Pixel-level pseudo-labels are generated for unlabeled images of the target domain using a trained segmentation network; Pixels whose softmax output value is greater than a preset threshold in the pseudo-labels are selected as reliable supervision signals; The labeled data from the source domain and the reliable supervision signal data from the target domain are combined into training batches according to a preset ratio to further iterate the training of the model and optimize the model's adaptability to the target domain data.
[0012] Furthermore, the training of the heart region localization network is performed using the AdamW optimizer. During training, the Varifocal loss function is used to enhance the small target detection capability of the localization network. Pre-set data augmentation operations are also added during training, including horizontal flipping, image rotation, image brightness adjustment, addition of Gaussian noise, and mosaic enhancement.
[0013] Furthermore, the training of the multi-scale multi-class segmentation network is performed using a stochastic gradient descent optimizer with Nesterov momentum. The learning rate is adjusted using a multinomial decay strategy. During training, a weighted combination of Dice loss and cross-entropy loss is used as the loss function, and gradient clipping is employed to prevent network overfitting.
[0014] Furthermore, the sharpening level is set using a preset-size 3x3 sharpening kernel. The kernel matrix of the 3x3 sharpening kernel is a matrix with a center pixel of 5, adjacent pixels of -1, and the remaining pixels of 0. Contrast adjustment is performed using a specific ConvertScaleAbs function.
[0015] Compared with the prior art, the beneficial effects of the present invention are as follows: This invention achieves automatic localization of the heart region by constructing a heart region localization network. It is combined with a region of interest intelligent enhancement module to adjust the contrast and sharpness to highlight the lesion area. Combined with a feature fusion module of a multi-scale, multi-class segmentation network to enhance the feature expression of small regions, it can automatically complete multi-class segmentation of myocardial scars and microvascular occlusions. This solves the problems of long time consumption and inter-observer error in manual segmentation. At the same time, it avoids the problem that existing automatic segmentation models cannot accurately identify three types of regions at the same time and the false positives and false negatives in small regions. Furthermore, through the domain discriminator adversarial training and target domain semi-supervised training of the cross-device domain adaptive optimization module, the model learns domain invariant features, which improves the generalization ability under different magnetic resonance imaging equipment data. It does not require large-scale retraining after changing equipment and can adapt to diverse clinical application scenarios. Attached Figure Description
[0016] Figure 1 This is a flowchart of the method of the present invention; Figure 2 This is a schematic diagram of the region of interest extraction in the cardiac region localization network of the present invention; Figure 3 This is a schematic diagram of the organization and segmentation of the multi-scale, multi-category segmentation network of the present invention; Figure 4 This is a comparison of the segmentation results of the model of the present invention on LGE-CMR images in different clinical cases; Figure 5 This is a volume consistency verification diagram between the model segmentation results and the manually labeled results of this invention. Detailed Implementation
[0017] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0018] Please see Figure 1-5 This invention provides a method for constructing an intelligent segmentation model for magnetic resonance imaging, comprising: S1. Acquire LGE-CMR images; S2. Construct a cardiac region localization network, which is used to locate the cardiac region in LGE-CMR images; S3. Construct a region of interest (ROI) intelligent enhancement module. The intelligent enhancement module is used to enhance the ROI of the heart based on the output of the heart region localization network. S4. Construct a multi-scale, multi-class segmentation network. The segmentation network is used to achieve multi-class segmentation of myocardium, scars, and microvascular occlusion based on the enhanced cardiac region of interest. S5. Construct a cross-device domain adaptive optimization module. The optimization module is used to improve the generalization ability of the segmentation network under different magnetic resonance device data.
[0019] Specifically, when acquiring LGE-CMR images, images from different medical institutions and different models of MRI equipment can be collected, including 1.5T and 3.0T MRI scanners, covering various imaging parameters such as different repetition times, echo times, and slice thicknesses, to ensure that the subsequent model can adapt to diverse clinical data. When constructing the cardiac region localization network, the YOLOv8 model is used as the basic architecture. First, the acquired LGE-CMR images are uniformly resized to 640×640 pixels, and then normalized to eliminate interference caused by differences in image pixel values. Then, at least two physicians with LGE-CMR diagnostic experience independently annotate the cardiac region bounding boxes, and any inconsistencies are negotiated and confirmed to form high-quality training labels. Simultaneously, data augmentation operations such as horizontal flipping and image rotation are introduced to improve the network's robustness.
[0020] When constructing the region of interest (ROI) intelligent enhancement module, the ROI of the heart is cropped based on the bounding box output by the localization network. The cropped region is then uniformly adjusted to a preset size of 512×512 pixels using bilinear interpolation to ensure consistent input size. Next, the grayscale histogram of the ROI is calculated to determine the signal range thresholds of myocardial infarction, scar tissue, and microvascular obstruction. A signal attention map is generated using Gaussian kernel weighting, assigning different weights to different regions. The contrast and sharpness are then dynamically adjusted based on the attention map to highlight key regional features.
[0021] When constructing a multi-scale, multi-class segmentation network, an nnU-Net-based architecture is used, and a multi-scale feature fusion module is inserted between the encoder and decoder. This module contains multiple feature processing branches that receive feature maps of different scales. After convolution and upsampling to unify the scale, the feature maps are fused by element-wise addition to enhance the feature representation of small regions and help to accurately segment myocardium, scars, and microvascular occlusion.
[0022] When constructing the cross-device domain adaptive optimization module, a multi-layer convolutional network is built as a domain discriminator to receive the feature map output by the segmentation network encoder. The sigmoid activation function is used to output the binary classification result, and the binary cross-entropy is used as the loss function. By alternately training the segmentation network and the domain discriminator, the segmentation network learns the domain invariant features. At the same time, semi-supervised training of the target domain is combined with the training network to generate pseudo-labels and select reliable signals. These are then combined with the source domain data to form a training batch for iterative optimization.
[0023] This implementation effectively solves the problems of time-consuming manual segmentation, large inter-observer error, insufficient segmentation accuracy of small regions, and weak cross-device generalization in the background technology. It realizes automated and accurate processing of LGE-CMR images, improves the efficiency and consistency of clinical analysis, and the model can maintain stable performance on data from different devices.
[0024] In this embodiment, constructing the cardiac region localization network includes: The LGE-CMR images were resized and normalized using preset dimensions. The processed LGE-CMR images were labeled by at least two physicians with LGE-CMR diagnostic experience, who independently labeled the bounding boxes of the cardiac region. Any inconsistent labels were negotiated and confirmed before being used as training labels. Design adaptive anchor boxes. The adaptive anchor boxes are based on the aspect ratio distribution of all labeled bounding boxes, and generate multiple sets of initial anchor box groups that fit the heart region. An anchor box dynamic adjustment mechanism is introduced during the training process of the localization network. During the training process, the anchor box dynamic adjustment mechanism periodically calculates the intersection-union ratio (IUR) between the current anchor box and the ground truth bounding box. For anchor boxes with IUR less than a preset threshold, the anchor box size is updated according to the average width and height of the ground truth bounding box within the period to keep the number of anchor boxes constant.
[0025] Specifically, when adjusting the size of LGE-CMR images, the images can be uniformly scaled to 640×640 pixels. Normalization is performed by mapping pixel values to the [0,1] interval to eliminate pixel value differences caused by imaging from different devices. During the annotation process, two physicians with at least 5 years of experience in LGE-CMR diagnosis are selected to annotate the bounding boxes of the cardiac region on the processed images. After annotation, the results of the two physicians are compared. For annotated areas with less than 90% overlap, the final bounding boxes are confirmed through joint image review and consultation to form training labels, ensuring label accuracy.
[0026] When designing adaptive anchor boxes, the aspect ratios of all labeled bounding boxes are first statistically analyzed, and their distribution range and central tendency are calculated. Based on the statistical results, five initial anchor box groups adapted to the cardiac region are generated, with the aspect ratio of each group matching the statistically obtained typical aspect ratio. During the training of the localization network, an adjustment period is set every 10 training cycles. In each cycle, the intersection-union ratio (IUR) between the current anchor box and the ground truth labeled boxes is calculated. Anchor boxes with an IUR less than 0.5 are considered to have poor fit, and their dimensions are updated according to the average width and height of all ground truth labeled boxes in that cycle. After the update, the total number of anchor boxes remains unchanged.
[0027] This implementation method ensures that the anchor frame is always perfectly matched to the actual size and shape of the heart region, improving the detection accuracy of the positioning network for the heart region and avoiding missed or false detections due to mismatched anchor frames, thus providing a foundation for subsequent region of interest extraction.
[0028] In this embodiment, the intelligent enhancement module for constructing the region of interest includes: The region of interest (ROI) of the heart is cropped based on the bounding box output by the heart region localization network, and bilinear interpolation is used to uniformly adjust the cropped ROI to a preset size to ensure consistent input size. Adaptive enhancement for attention guidance, including: Calculate the gray-level histogram of the region of interest in the heart to determine the signal range threshold for different tissue types such as myocardium, scar tissue, and microvascular obstruction; A signal attention map is generated using a Gaussian kernel for weighted generation, with different weights assigned to microvascular occlusion regions, scar regions, and myocardial regions. The enhancement parameters are dynamically adjusted based on the signal attention map. The enhancement parameters include the contrast adjustment magnitude and the image sharpening degree. The contrast adjustment magnitude is positively correlated with the weight, and the sharpening degree is set separately for microvascular occlusion areas, scar areas, and myocardial areas.
[0029] Specifically, when cropping the region of interest (ROI) of the heart based on the bounding box output by the heart region localization network, the cropping range is formed by extending outward by 5 pixels from the bounding box to ensure that the heart region is completely included. The cropped ROI is uniformly adjusted to 512×512 pixels using bilinear interpolation. This method can better preserve image details during the resizing process, avoid information loss, and ensure the consistency of image size input to subsequent modules.
[0030] When performing attention-guided adaptive enhancement, the gray-level histogram of the region of interest in the heart is first calculated, and the number of pixels corresponding to different gray-level values is counted. Based on the histogram distribution, the signal range thresholds for myocardium, scars, and microvascular occlusion are determined. For example, regions with gray-level values in the range [100, 150] are initially identified as myocardium, regions with gray-level values in the range [180, 220] are identified as scars, and regions with gray-level values in the range [50, 80] are identified as microvascular occlusion. When generating the signal attention map, a Gaussian kernel with a standard deviation of 1.5 is used for weighting, assigning a weight of 1.2 to microvascular occlusion regions, a weight of 1.0 to scar regions, and a weight of 0.8 to myocardial regions, highlighting key lesion areas.
[0031] When dynamically adjusting enhancement parameters based on the signal attention map, the contrast adjustment magnitude is positively correlated with the region weight, meaning that the higher the weight of a region, the greater the contrast adjustment magnitude. For example, the contrast of the microvascular occlusion region is increased by 20%, the scar region by 15%, and the myocardial region by 10%. The sharpening level is set according to the region, with stronger sharpening for the microvascular occlusion region, medium sharpening for the scar region, and weaker sharpening for the myocardial region. This method enhances the distinction between lesion areas and normal areas, thereby improving the ability of the subsequent segmentation network to identify lesion areas.
[0032] In this embodiment, constructing a multi-scale, multi-class segmentation network includes: A multi-scale feature fusion module is inserted between the encoder and decoder of the segmentation network. The multi-scale feature fusion module contains multiple feature processing branches. These branches receive feature maps of different scales output by the encoder. The feature processing branches perform convolution and upsampling on the feature maps of different scales to unify the scale, and then fuse the processed feature maps using element-wise addition. The fused feature maps are used to enhance the small-region feature representation of the segmentation network and are output to the decoder to achieve multi-class segmentation of myocardium, scars, and microvascular occlusion.
[0033] Specifically, a multi-scale feature fusion module is inserted between the encoder and decoder of the segmentation network. This module contains three feature processing branches. The feature maps output by the encoder contain three scales: 128×128 pixels, 256×256 pixels, and 512×512 pixels, with the 512×512 pixel scale being the original scale. The first feature processing branch receives the 128×128 pixel feature map, processes it through a 3×3 convolutional layer with 64 kernels for feature extraction, and then upsamples it by 4 times to increase the feature map size to 512×512 pixels. The second feature processing branch receives the 256×256 pixel feature map, processes it through the same 3×3 convolutional layer, and then upsamples it by 2 times to adjust the size to 512×512 pixels. The third feature processing branch receives the original 512×512 pixel feature map, processes it through only a 3×3 convolutional layer, and maintains the original scale.
[0034] The feature maps processed from the three branches are fused element-wise. During the fusion process, the feature map of each branch is normalized to ensure a balanced contribution of features from each branch. The fused feature map is then input to the decoder. The decoder uses progressive upsampling and convolution operations, combined with multi-scale information from the fused feature map, to achieve multi-class segmentation of myocardial infarction, scarring, and microvascular occlusion.
[0035] This implementation can effectively integrate feature information at different scales, enhance the segmentation network's feature representation of small regions such as small-volume microvascular occlusion, improve the segmentation network's ability to distinguish different tissue types, and reduce missed detections and false detections.
[0036] In this embodiment, the multi-scale feature fusion module includes: The first feature processing branch receives the first-scale feature map output by the encoder, and after convolution processing, it is upsampled to the original scale by multiple times. The second feature processing branch receives the second-scale feature map output by the encoder, and after convolution processing, it is upsampled to the original scale by a small factor. The third feature processing branch receives the original scale feature map output by the encoder, and maintains the scale after convolution processing; The feature maps from the first, second, and third feature processing branches are fused element-wise, and the fused feature map is output to the decoder of the segmentation network.
[0037] Specifically, the first feature processing branch of the multi-scale feature fusion module receives the first-scale feature map output by the encoder. This first-scale feature map is 128×128 pixels. It first passes through a convolutional layer with a kernel size of 3×3, a stride of 1, and padding of 1 to extract features and adjust the dimensions of the feature map so that the number of channels in the feature map is consistent with the number of channels in the original scale feature map. Then, it uses bilinear interpolation to perform a 4x upsampling to upscale the feature map to the original scale, which is 512×512 pixels. During the upsampling process, the continuity and integrity of the feature information are maintained.
[0038] The second feature processing branch receives the second-scale feature map output by the encoder. This second-scale feature map is 256×256 pixels. After being processed by the convolutional layer with the same parameters, it is upsampled by 2 times using bilinear interpolation to adjust the feature map scale to the original scale, ensuring that the feature map size matches that of the feature maps processed by other branches.
[0039] The third feature processing branch receives the original scale feature map output by the encoder. This original scale feature map is 512×512 pixels. It only performs feature optimization through the above convolutional layer without changing the scale of the feature map, thus preserving the detailed information in the original scale feature map.
[0040] The feature maps processed from the three branches are element-wise summed and fused. During fusion, the pixel values of each branch's feature map are weighted equally to avoid an excessively high proportion of features from any single branch. The fused feature map is directly output to the decoder of the segmentation network, providing the decoder with rich multi-scale feature information and helping the decoder to accurately generate segmentation results. This implementation method can fully utilize the advantages of feature maps at different scales, improving the segmentation accuracy of the segmentation network for tissue regions of different sizes.
[0041] In this embodiment, the construction of the cross-device domain adaptive optimization module includes: A multi-layer convolutional network is constructed as a domain discriminator. The domain discriminator receives the feature map output by the segmentation network encoder and outputs a binary classification result indicating whether the feature map belongs to the source domain or the target domain. The binary classification result is output using the Sigmoid activation function and the binary cross-entropy is used as the loss function. Domain adaptive adversarial training is performed, which involves alternating training of the segmentation network and the domain discriminator. The segmentation network learns the domain invariance features of the LGE-CMR image by minimizing the judgment accuracy of the domain discriminator.
[0042] Specifically, when constructing a multi-layer convolutional network as a domain discriminator, the network consists of three convolutional layers and two fully connected layers. The first convolutional layer uses 3×3 kernels with 64 kernels, a stride of 2, and padding of 1. The second convolutional layer uses 3×3 kernels with 128 kernels, a stride of 2, and padding of 1. The third convolutional layer uses 3×3 kernels with 256 kernels, a stride of 2, and padding of 1. Each convolutional layer is followed by a batch normalization layer and a ReLU activation function. The fully connected layers contain 512 neurons and 1 neuron, respectively. The last fully connected layer is followed by a Sigmoid activation function, outputting the probability value of the feature map belonging to the source or target domain.
[0043] The loss function of the domain discriminator uses binary cross-entropy, and the formula is as follows: ,in For the sample size, The source domain label is set to 1, and the target domain label is set to 0, representing the true domain labels of the samples. This is the probability value output by the domain discriminator.
[0044] When performing domain adaptive adversarial training, an alternating training strategy is adopted. First, the parameters of the segmentation network are fixed, and the domain discriminator is trained. The parameters of the domain discriminator are adjusted through backpropagation to improve its ability to distinguish between source and target domain feature maps. Then, the parameters of the domain discriminator are fixed, and the segmentation network is trained. A domain loss is added to the segmentation loss. By minimizing the judgment accuracy of the domain discriminator, the segmentation network learns domain-invariant features that are not affected by device differences.
[0045] This implementation method can effectively reduce the impact of imaging differences between different magnetic resonance imaging devices on the segmentation network, improve the generalization ability of the segmentation network on cross-device data, and ensure that the model can work stably in different clinical scenarios.
[0046] In this embodiment, the semi-supervised training of the target domain includes: Pixel-level pseudo-labels are generated for unlabeled images of the target domain using a trained segmentation network; Pixels whose softmax output value is greater than a preset threshold in the pseudo-labels are selected as reliable supervision signals; The labeled data from the source domain and the reliable supervision signal data from the target domain are combined into training batches according to a preset ratio to further iterate the training of the model and optimize the model's adaptability to the target domain data.
[0047] Specifically, when generating pixel-level pseudo-labels for unlabeled images of the target domain using a trained segmentation network, the unlabeled image is input into the segmentation network, and the segmentation network outputs the probability value of each pixel belonging to myocardium, scar, or microvascular occlusion. The category with the highest probability value is selected as the pseudo-label category of that pixel, forming a complete pixel-level pseudo-label image.
[0048] When filtering pseudo-labels, a preset threshold of 0.7 is set. The maximum softmax output value of each pixel in the pseudo-label is counted. Pixels with a maximum value greater than 0.7 are determined to be reliable pixels, and their corresponding pseudo-labels are used as reliable supervision signals. Pixels with a maximum value less than or equal to 0.7 are determined to be unreliable pixels, and their pseudo-labels are removed to avoid introducing noise.
[0049] The labeled data from the source domain and the reliable supervision signal data from the target domain are combined into a training batch in a 7:3 ratio. During each model iteration, 70% of the samples are randomly selected from the labeled data from the source domain and 30% of the samples are randomly selected from the reliable supervision signal data from the target domain. These samples are then used to form the training batch and input into the model for training.
[0050] This implementation method can make full use of unlabeled data in the target domain to supplement the amount of training data, further optimize the model's adaptability to target domain data, reduce the model performance degradation caused by missing target domain data labels, and improve the model's segmentation accuracy in cross-device scenarios.
[0051] In this embodiment, the training of the heart region localization network is performed using the AdamW optimizer. During training, the Varifocal loss function is used to enhance the small target detection capability of the localization network. Pre-set data augmentation operations are also added during training, including horizontal flipping, image rotation, image brightness adjustment, adding Gaussian noise, and mosaic enhancement.
[0052] Specifically, the training of the cardiac region localization network uses the AdamW optimizer, with an initial learning rate of 0.001, a weight decay coefficient of 0.0005, and a momentum parameter of 0.9. These parameters are used to balance the training speed and stability of the model, avoiding training oscillations caused by excessively rapid parameter updates or slow convergence caused by excessively slow parameter updates.
[0053] The Varifoccal loss function is used during training, and the formula is as follows: ,in Indicates the predicted probability. This represents the positive and negative sample balance factor. Set to 0.75. Indicates the focus factor. Setting the loss function to 2 enhances the focus on small targets, improves the localization network's ability to detect targets such as the heart region, and reduces the chance of missing small targets.
[0054] During training, various data augmentation operations were incorporated. Horizontal flipping was performed with a 50% probability to flip the image horizontally, increasing the diversity of image perspectives. Image rotation was randomly rotated within the range of -15° to 15° to simulate images from different shooting angles. Image brightness was randomly adjusted within the range of 0.8 to 1.2 times the original brightness to adapt to different imaging lighting conditions. Gaussian noise with a standard deviation of 0.01 was added to enhance the model's robustness to noise. Mosaic enhancement stitched four different images into one image using a 2×2 grid, improving the model's adaptability to complex scenes.
[0055] The above training settings can improve the robustness and detection accuracy of the cardiac region localization network, ensuring that it can accurately locate the cardiac region in LGE-CMR images of different qualities and from different perspectives.
[0056] In this embodiment, the training of the multi-scale multi-class segmentation network is performed using a stochastic gradient descent optimizer with Nesterov momentum. The learning rate is adjusted using a multinomial decay strategy. During training, a weighted combination of Dice loss and cross-entropy loss is used as the loss function, and gradient pruning is employed to prevent overfitting of the network.
[0057] Specifically, the training of the multi-scale multi-class segmentation network adopts a stochastic gradient descent optimizer with an initial learning rate of 0.01 and a Nesterov momentum of 0.99. The Nesterov momentum allows the optimizer to predict the update direction in advance when updating parameters, thereby accelerating the model convergence speed and improving training stability.
[0058] The learning rate uses a multinomial decay strategy, the formula is as follows: ,in The initial learning rate, For the current training round, For the total number of training rounds, Set to 1000, The decay exponent, Setting it to 2 will gradually decrease the learning rate as the training rounds increase, avoiding parameter oscillations caused by an excessively large learning rate in the later stages of training and ensuring stable model convergence.
[0059] During training, a weighted combination of Dice loss and cross-entropy loss is used as the loss function, as shown in the formula: ,in Set to 0.7, Set to 0.3, Used to measure the overlap between the segmentation result and the true label. It is used to measure the difference between the classification probability and the true label. Combining the two can improve both the accuracy of segmentation and the reliability of classification.
[0060] Gradient clipping is employed during training, with the L2 norm of the gradient clipping threshold set to 10. When the gradient norm exceeds this threshold, the gradient value is proportionally reduced to prevent gradient explosion and ensure stable training. This training configuration effectively improves the segmentation accuracy of multi-scale, multi-class segmentation networks, avoids overfitting, and ensures the model consistently outputs high-quality segmentation results across various datasets.
[0061] In this embodiment, the sharpening level is set using a 3x3 sharpening kernel of a preset size. The kernel matrix of the 3x3 sharpening kernel is a matrix with a center pixel of 5, adjacent pixels of -1, and the remaining pixels of 0. Contrast adjustment is performed using a specific ConvertScaleAbs function.
[0062] Specifically, the sharpening level is set using a preset 3×3 sharpening kernel, the kernel matrix of which is as follows: When sharpening the region of interest, the sharpening kernel is convolved with the image. During the convolution process, the central element 5 of the kernel matrix enhances the current pixel value, while the surrounding -1 elements weaken the values of adjacent pixels. Through this difference enhancement, the edge details in the image are highlighted, making the boundaries of myocardium, scars, and microvascular blockages clearer, which is convenient for subsequent segmentation network recognition.
[0063] Contrast adjustment uses the ConvertScaleAbs function, which adjusts contrast by linearly transforming the image pixel values. The formula is as follows: ,in For the input image pixel values, This is the contrast adjustment factor. Adjust the offset for brightness. Set to 0 uniformly. To output the pixel values of the image. Different regions are determined based on the signal attention map. Value, microvascular obstruction area Set to 1.2, scar area Set to 1.1, myocardial region Setting it to 1.0 allows for targeted enhancement of the contrast in lesion areas, making the grayscale difference between lesion and normal areas more obvious, and improving the segmentation network's accuracy in recognizing lesion areas.
[0064] In summary, this invention achieves automatic localization of the heart region by constructing a heart region localization network. Combined with a region-of-interest (ROI) intelligent enhancement module, it adjusts contrast and sharpness to highlight lesion areas. Furthermore, it enhances the feature fusion module of a multi-scale, multi-class segmentation network to improve the representation of small region features. This enables automated multi-class segmentation of myocardial scars and microvascular occlusions, solving the problems of time-consuming manual segmentation and inter-observer errors. It also avoids the difficulty of existing automatic segmentation models in accurately identifying three types of regions simultaneously, as well as the issues of missed or false detections in small regions. Moreover, through adversarial training of the domain discriminator and semi-supervised training of the target domain in a cross-device domain adaptive optimization module, the model learns domain-invariant features, improving its generalization ability under different MRI device data. This eliminates the need for large-scale retraining after changing devices, adapting to diverse clinical application scenarios.
[0065] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus.
[0066] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A method for constructing an intelligent segmentation model of magnetic resonance imaging, characterized in that, include: S1. Acquire LGE-CMR images; S2. Construct a cardiac region localization network, which is used to locate the cardiac region in LGE-CMR images; S3. Construct a region of interest (ROI) intelligent enhancement module. The intelligent enhancement module is used to enhance the ROI of the heart based on the output of the heart region localization network. S4. Construct a multi-scale, multi-class segmentation network. The segmentation network is used to achieve multi-class segmentation of myocardium, scars, and microvascular occlusion based on the enhanced cardiac region of interest. S5. Construct a cross-device domain adaptive optimization module. The optimization module is used to improve the generalization ability of the segmentation network under different magnetic resonance device data.
2. The method for constructing an intelligent segmentation model of magnetic resonance images according to claim 1, characterized in that, The construction of the cardiac region localization network includes: The LGE-CMR images were resized and normalized using preset dimensions. The processed LGE-CMR images were labeled by at least two physicians with LGE-CMR diagnostic experience, who independently labeled the bounding boxes of the cardiac region. Any inconsistent labels were negotiated and confirmed before being used as training labels. Design adaptive anchor boxes. The adaptive anchor boxes are based on the statistical aspect ratio distribution of all labeled bounding boxes, and generate multiple sets of initial anchor box groups that fit the heart region. An anchor box dynamic adjustment mechanism is introduced during the training process of the localization network. During the training process, the anchor box dynamic adjustment mechanism periodically calculates the intersection-union ratio (IUR) between the current anchor box and the ground truth bounding box. For anchor boxes with IUR less than a preset threshold, the anchor box size is updated according to the average width and height of the ground truth bounding box within the period to keep the number of anchor boxes constant.
3. The method for constructing an intelligent segmentation model of magnetic resonance images according to claim 1, characterized in that, The intelligent enhancement module for constructing the region of interest includes: The region of interest (ROI) of the heart is cropped based on the bounding box output by the heart region localization network, and bilinear interpolation is used to uniformly adjust the cropped ROI to a preset size to ensure consistent input size. Adaptive enhancement for attention guidance, including: Calculate the gray-level histogram of the region of interest in the heart to determine the signal range threshold for different tissue types such as myocardium, scar tissue, and microvascular obstruction; A signal attention map is generated, which is generated using a Gaussian kernel for weighting, and different weights are assigned to the microvascular occlusion region, scar region and myocardial region respectively; The enhancement parameters are dynamically adjusted based on the signal attention map. The enhancement parameters include the contrast adjustment magnitude and the image sharpening degree. The contrast adjustment magnitude is positively correlated with the weight, and the sharpening degree is set separately for microvascular occlusion areas, scar areas, and myocardial areas.
4. The method for constructing an intelligent segmentation model of magnetic resonance images according to claim 1, characterized in that, The construction of the multi-scale, multi-class segmentation network includes: A multi-scale feature fusion module is inserted between the encoder and decoder of the segmentation network. The multi-scale feature fusion module contains multiple feature processing branches. These branches receive feature maps of different scales output by the encoder. The feature processing branches perform convolution and upsampling on the feature maps of different scales to unify the scale, and then fuse the processed feature maps using element-wise addition. The fused feature maps are used to enhance the small-region feature representation of the segmentation network and are output to the decoder to achieve multi-class segmentation of myocardium, scars, and microvascular occlusion.
5. The method for constructing an intelligent segmentation model of magnetic resonance images according to claim 4, characterized in that, The multi-scale feature fusion module includes: The first feature processing branch receives the first-scale feature map output by the encoder, and after convolution processing, it is upsampled to the original scale by multiple times. The second feature processing branch, The second feature processing branch receives the second-scale feature map output by the encoder, and after convolution processing, it is upsampled to the original scale by a small factor. The third feature processing branch, The third feature processing branch receives the original scale feature map output by the encoder, and maintains the scale after convolution processing; The feature maps from the first, second, and third feature processing branches are fused element-wise, and the fused feature map is output to the decoder of the segmentation network.
6. The method for constructing an intelligent segmentation model of magnetic resonance images according to claim 1, characterized in that, The cross-device domain adaptive optimization module includes: A multi-layer convolutional network is constructed as a domain discriminator. The domain discriminator receives the feature map output by the segmentation network encoder and outputs a binary classification result indicating whether the feature map belongs to the source domain or the target domain. The binary classification result is output using the Sigmoid activation function and the binary cross-entropy is used as the loss function. Domain adaptive adversarial training is performed, which involves alternating training of the segmentation network and the domain discriminator. The segmentation network learns the domain invariance features of the LGE-CMR image by minimizing the judgment accuracy of the domain discriminator.
7. The method for constructing an intelligent segmentation model of magnetic resonance images according to claim 6, characterized in that, Semi-supervised training of the target domain includes: Pixel-level pseudo-labels are generated for unlabeled images of the target domain using a trained segmentation network; Pixels whose softmax output value is greater than a preset threshold in the pseudo-labels are selected as reliable supervision signals; The labeled data from the source domain and the reliable supervision signal data from the target domain are combined into training batches according to a preset ratio to further iterate the training of the model and optimize the model's adaptability to the target domain data.
8. The method for constructing an intelligent segmentation model of magnetic resonance images according to claim 2, characterized in that, The heart region localization network was trained using the AdamW optimizer. During training, the Varifocal loss function was used to enhance the small target detection capability of the localization network. Pre-set data augmentation operations were also added during training, including horizontal flipping, image rotation, image brightness adjustment, adding Gaussian noise, and mosaic enhancement.
9. The method for constructing an intelligent segmentation model of magnetic resonance images according to claim 4, characterized in that, The multi-scale, multi-class segmentation network is trained using a stochastic gradient descent optimizer with Nesterov momentum. The learning rate is adjusted using a multinomial decay strategy. During training, a weighted combination of Dice loss and cross-entropy loss is used as the loss function, and gradient clipping is employed to prevent overfitting.
10. The method for constructing an intelligent segmentation model of magnetic resonance images according to claim 3, characterized in that, The sharpening level is set using a preset 3x3 sharpening kernel. The kernel matrix of the 3x3 sharpening kernel is a matrix with a center pixel of 5, adjacent pixels of -1, and other pixels of 0. Contrast adjustment is performed using a specific ConvertScaleAbs function.