A cardiac medical image segmentation method based on improved U-Net
By introducing a multidimensional context-aware module and an inverse feature modulation module into the U-Net model, the problems of complex structure and category imbalance in cardiac MRI image segmentation are solved, achieving higher segmentation accuracy and robustness.
Patent Information
- Application Number
- CN202411663177.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-20
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2044-11-20
AI Technical Summary
The existing U-Net model has limitations in processing complex structures and multi-scale features in cardiac MRI image segmentation, especially the loss of detail information and the problem of class imbalance in multi-class segmentation, which affects the segmentation accuracy of the heart boundary.
The Multidimensional Context Awareness (MDCA) module and the Reverse Feature Modulation (RFM) module are used to improve the U-Net model. MDCA captures global and local context information by generating spatial attention maps, and RFM adjusts feature weights through reverse masks and dynamic weights to enhance the segmentation accuracy of the model in complex structures and category imbalanced areas.
The accuracy and robustness of cardiac image segmentation are improved, especially when dealing with complex structures and category-imbalanced areas, and the segmentation effect of cardiac boundaries and small areas is significantly improved.
Smart Images

Figure CN119624986B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a medical image segmentation method, and in particular to a cardiac medical image segmentation method based on an improved U-Net. Background Art
[0002] Cardiac image segmentation plays a key role in the diagnosis, treatment, and monitoring of cardiovascular diseases. Accurate segmentation of cardiac anatomical structures, such as the left ventricle, right ventricle, and myocardium, is crucial for quantitative analysis of cardiac function and identification of lesions. Cardiac magnetic resonance imaging (MRI) has become a commonly used imaging technique in clinical practice due to its high resolution and non-invasive characteristics. However, cardiac MRI image segmentation faces multiple challenges, including complex cardiac anatomy, individual differences, the influence of pathological conditions, and image noise and artifacts. These problems make the manual segmentation process time-consuming and labor-intensive, further promoting the development of automated segmentation methods.
[0003] U-Net, a classic convolutional neural network architecture, has been widely used in medical image segmentation. Its unique encoder-decoder architecture and skip connection mechanism enable it to effectively capture global information and recover high-resolution features. While U-Net performs well in cardiac image segmentation tasks, it still has limitations when dealing with complex structures and multi-scale features. In particular, it can lead to loss of detailed information during the decoding phase, affecting the accuracy of cardiac boundary segmentation. Existing models also pay insufficient attention to class imbalance when handling multi-category segmentation tasks, resulting in suboptimal segmentation results for small regions or cardiac structures with blurred boundaries (such as the myocardium). Summary of the Invention
[0004] This paper aims to provide a cardiac medical image segmentation method based on an improved U-Net. By introducing a multidimensional contextual attention module (MDCA) and a reverse feature modulation module (RFM), this method improves the segmentation accuracy of complex cardiac structures and enhances the model's performance in multi-class segmentation tasks. This not only provides new technical support for automated cardiovascular disease diagnosis but also lays a foundation for further research in the field of medical image analysis.
[0005] The purpose of the present invention is achieved through the following technical solutions:
[0006] A cardiac medical image segmentation method based on an improved U-Net, the method comprising a multidimensional context awareness module (MDCA), a reverse feature modulation module (RFM), and a model architecture;
[0007] The Multi-Dimensional Context-Aware Module (MDCA) is proposed in the high-level skip connection of the U-Net model. This module can focus on both global and local context information. Capturing this information helps to understand and segment the cardiac structure more accurately. The MDCA module measures the correlation between features in the horizontal and vertical directions by generating a spatial attention map. Query, Key, and Value represent Figure 1 In the query vector, key vector, and value vector, Query, Key, and Value are generated by generating query, key, and value feature maps from the input feature map through a 1×1 convolution operation, which is represented as follows:
[0008] Query=W q ×X,Key=W k ×X,Value=W v ×X (1)
[0009] Where: X is the input feature map, W q 、W k 、W v These are 1×1 convolution weight matrices used to generate query, key, and value feature maps, respectively; enabling the model to provide higher segmentation accuracy and robustness when processing complex cardiac structures;
[0010] The Reverse Feature Modulation Module (RFM) generates an inverse mask and adaptively adjusts feature weights, enabling the model to maintain high accuracy in difficult-to-segment areas such as the myocardium. This effectively improves accuracy in multi-class segmentation tasks, especially in areas with class imbalance or blurred boundaries.
[0011] The model architecture retains the symmetric encoder-decoder structure of U-Net, enhancing the ability to segment complex cardiac anatomical structures. In the encoder, multiple 3x3 convolutional layers are alternating with ReLU activation functions to extract multi-layer features of the input image. Batch normalization (BatchNorm) is used to accelerate training and improve stability. The specific convolution and pooling operations are expressed as follows:
[0012] X l+1 =MaxPool(ReLU(BatchNorm(Conv(X l )))) (9)
[0013] Among them, X l The input feature map of layer l is extracted through 3x3 convolution, and then nonlinearly transformed through batch normalization and ReLU activation function. Finally, the spatial resolution of the feature map is gradually reduced through max pooling (MaxPool) to capture more global information while reducing the computational burden.
[0014] By combining the MDCA and RFM modules, the improved U-Net model not only performs better in multi-scale feature capture and global information fusion, but also solves the problems of detail loss and category imbalance.
[0015] In the cardiac medical image segmentation method based on the improved U-Net, the calculation of the correlation matrix of the multidimensional context-aware module (MDCA) generates the correlation matrix A between the features by calculating the dot product of the query and the key:
[0016]
[0017] Here, the softmax function is used to normalize the correlation matrix A so that it reflects the relative importance between features, d k Is the dimension scaling factor of Key, used to prevent the dot product result from being too large. The attention matrix A is then applied to Value to generate the weighted output:
[0018] O=A×Value (3)
[0019] This operation helps the model capture global and local contextual information, especially for accurate segmentation of complex heart boundaries.
[0020] The cardiac medical image segmentation method based on the improved U-Net, the reverse feature modulation module (RFM) model generates a rough segmentation mask M for each category i , where i represents the category index; the coarse mask is generated by Sigmoid activation:
[0021] M i =Sigmoid(f coarse (X)) (5)
[0022] Among them, f coarse Represents the rough segmentation result generated by the network; then the reverse mask R of each category is generated by the reverse operation i :
[0023] R i =1-M i (6)
[0024] This reverse mask R i It allows the model to focus more accurately on areas outside the current category, further improving segmentation accuracy.
[0025] The cardiac medical image segmentation method based on the improved U-Net, the model architecture convolution and pooling operations are expressed by the following formula:
[0026] X l+1 =MaxPool(ReLU(BatchNorm(Conv(X l )))) (9)
[0027] Among them, X l The input feature map of the lth layer is extracted through 3x3 convolution, and then nonlinearly transformed through batch normalization and ReLU activation function. Finally, the spatial resolution of the feature map is gradually reduced through maximum pooling (MaxPool) to capture more global information while reducing the computational burden.
[0028] The advantages and effects of the present invention are:
[0029] In response to the technical challenges in cardiac MRI image segmentation, the present invention proposes a multi-dimensional contextual attention module (MDCA) and a reverse feature modulation module (RFM) by improving the U-Net model. These modules not only enhance the segmentation accuracy of the model for complex cardiac anatomical structures, but also effectively solve the problem of category imbalance in multi-category segmentation. With the help of the MDCA module, the model can better integrate global and local information, thereby improving the ability to capture details of cardiac images. The RFM module ensures high-precision performance when processing blurred boundaries and small areas through dynamic weight adjustment. Through these improvements, the present invention provides effective technical support for the automated diagnosis and evaluation of cardiovascular diseases, and at the same time lays a solid foundation for further development in the field of medical image analysis in the future. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 This is a structural diagram of the multi-dimensional context perception module of the present invention;
[0031] Figure 2 This is a structural diagram of the reverse characteristic modulation module of the present invention. DETAILED DESCRIPTION
[0032] The present invention will be described in detail below with reference to the embodiments shown in the accompanying drawings.
[0033] The present invention is composed of the following:
[0034] 1. Multidimensional Context Awareness (MDCA)
[0035] In cardiac structure analysis, it is crucial to accurately capture complex anatomical features. In this paper, to improve this capability, we propose a multi-dimensional context-aware module (MDCA) in the high-level skip connection of the U-Net model. This module can focus on both global and local context information. Capturing this information helps to understand and segment cardiac structures more accurately. The MDCA module measures the correlation between features in the horizontal and vertical directions by generating a spatial attention map. Query, Key, and Value represent Figure 1 In the query vector, key vector, and value vector, Query, Key, and Value are generated by generating query, key, and value feature maps from the input feature map through a 1×1 convolution operation, which is represented as follows:
[0036] Query=W q ×X,Key=W k ×X,Value=W v ×X (1)
[0037] Where: X is the input feature map, W q 、W k 、W v The 1×1 convolution weight matrices used to generate the query, key, and value feature maps are respectively. The correlation matrix is calculated by calculating the dot product of the query and key to generate the correlation matrix A between the features:
[0038]
[0039] Here, the softmax function is used to normalize the correlation matrix A so that it reflects the relative importance between features, d k Is the dimension scaling factor of Key, used to prevent the dot product result from being too large. The attention matrix A is then applied to Value to generate the weighted output:
[0040] O=A×Value (3)
[0041] This operation can help the model capture global and local context information, especially for the accurate segmentation of complex heart boundaries. In order to retain the original information in the input features, the MDCA module uses a residual connection to add the input feature X directly to the output feature O to reduce feature loss:
[0042] Y=O+γ×X (4)
[0043] Here, γ is a learnable weight parameter that adjusts the strength of the residual connection. This helps preserve key details in the input feature map while minimizing the loss of important information. The MDCA module enhances the model's spatial context awareness, enabling it to better capture complex cardiac anatomy. Unlike the skip connections of traditional U-Net, MDCA preserves more fine-grained features during the decoding phase, significantly improving image resolution and detail processing. This enables the model to achieve higher segmentation accuracy and robustness when processing complex cardiac structures.
[0044] 2. Reverse Feature Modulation Module (RFM)
[0045] In this paper, we also propose a reverse feature modulation module (RFM) to focus on solving the class imbalance problem in multi-class segmentation tasks. RFM generates a reverse mask and adaptively adjusts the feature weights to ensure that the model maintains high accuracy in difficult-to-segment areas such as the myocardium. First, the model generates a rough segmentation mask M for each class. i , where i represents the category index. The coarse mask is generated by Sigmoid activation:
[0046] M i =Sigmoid(f coarse (X)) (5)
[0047] Among them, f coarse Represents the rough segmentation result generated by the network. Then the reverse mask R of each category is generated by the reverse operation i :
[0048] R i =1-M i (6)
[0049] This reverse mask R i This allows the model to focus more accurately on areas outside the current category, further improving segmentation accuracy. In order to adaptively adjust features of different categories, the RFM module combines a dynamic weight generator that generates a dynamic weight w for each category from the input features through a global pooling operation. i Dynamic weights adaptively weight the features of each category according to the category, ensuring that the model is more sensitive to key areas in complex anatomical structures. For each category, the features are element-wise multiplied with the inverse mask and the dynamic weights:
[0050] O i =w i ×R i ×Conv(X) (7)
[0051] In this way, the model enhances these features to make it perform better in difficult areas. i are combined (by averaging or summing) to generate the final output feature O final To prevent the loss of important original information, the RFM module also introduces a residual connection to add the input feature X back to the final output:
[0052] Y=O final +X (8)
[0053] This residual connection ensures that key details of the input are preserved. By combining dynamic weights and inverse masks, the RFM module effectively improves the accuracy of multi-category segmentation tasks, especially when dealing with areas with unbalanced categories or blurred boundaries.
[0054] 3. Model Architecture
[0055] In this paper, the improved model retains the symmetrical encoder-decoder structure of U-Net, enhancing the ability to segment complex cardiac anatomical structures. In the encoder, multiple 3x3 convolutional layers are used alternately with ReLU activation functions to extract multi-layer features of the input image, and batch normalization (BatchNorm) is used to accelerate training and improve stability. The specific convolution and pooling operations can be expressed as follows:
[0056] X l+1 =MaxPool(ReLU(BatchNorm(Conv(X l )))) (9)
[0057] Among them, X l The input feature map of layer l is extracted through 3x3 convolution, then nonlinearly transformed through batch normalization and ReLU activation function. Finally, the spatial resolution of the feature map is gradually reduced through max pooling to capture more global information while reducing the computational burden. In the decoder, upsampling is performed through 3x3 deconvolution to restore the spatial resolution of the image. The deconvolution operation formula is as follows:
[0058] X up =ConvTranspose(X low ) (10)
[0059] After each upsampling, the feature map of the upper decoder is concatenated with the corresponding encoder feature map. This operation can be expressed by the following formula:
[0060] X concat =Concat(X encoder ,X decoder) (11)
[0061] Combining the features of the encoder and decoder ensures that important local information is not lost when recovering high-resolution features. To further enhance segmentation performance, this paper incorporates a multi-dimensional contextual attention module (MDCA) into the skip connection. We choose to add the MDCA module to the higher-level skip connections because the feature maps at these levels contain richer global and local information. By enhancing the fusion of this information through MDCA, we can better capture the complex structures in cardiac images. By generating a contextual attention map in the spatial dimension, the MDCA module ensures that important spatial details are not lost when fusing the features of the high-level encoder and low-level decoder, while also enhancing the guidance of global information on local features. This design improves the ability to capture multi-scale features, especially in processing the boundary details and complex structures of the heart. The introduction of the MDCA module enables the model to not only recover high-resolution features during decoding, but also significantly improve the segmentation accuracy of blurred boundary areas in cardiac images.
[0062] At the end of the model, we proposed a reverse feature modulation module (RFM) to specifically address the class imbalance problem in multi-class segmentation tasks. RFM adaptively assigns weights to each class by generating a reverse mask and combining it with a dynamic weight generator. The advantage of this design is that it can dynamically adjust the feature weights of different classes, ensuring that the model performs more accurately when processing small and difficult-to-segment areas. RFM not only enhances the focus on difficult-to-segment areas through the reverse mask mechanism, but also enhances the adaptability and robustness of the model in multi-class segmentation tasks by dynamically adjusting the features of each class, especially maintaining high segmentation accuracy under complex pathological conditions.
[0063] By combining the MDCA and RFM modules, the improved U-Net model not only performs better in multi-scale feature capture and global information fusion, but also effectively solves the problems of detail loss and category imbalance.
Claims
1. A cardiac medical image segmentation method based on improved U-Net, characterized in that: The method includes a multi-dimensional context awareness module MDCA, a reverse feature modulation module RFM, and a model architecture; A multi-dimensional context-aware module (MDCA) was proposed within the high-level skip connections of the U-Net model. This module simultaneously focuses on both global and local contextual information, capturing this information to more accurately understand and segment cardiac structures. The MDCA module generates a spatial attention map to measure the correlation between features in both horizontal and vertical directions. Query, Key, and Value represent query vector, key vector, and value vector, respectively. Query, Key, and Value are generated by generating query, key, and value feature maps from the input feature map through a 1×1 convolution operation, as shown below: (1) Where: is the input feature map, These are 1×1 convolution weight matrices used to generate query, key, and value feature maps, respectively; enabling the model to provide higher segmentation accuracy and robustness when processing complex cardiac structures; The reverse feature modulation module (RFM) generates a reverse mask and adaptively adjusts feature weights, allowing the model to maintain high accuracy in difficult-to-segment areas. This effectively improves accuracy in multi-class segmentation tasks, and is particularly effective when dealing with areas with class imbalance or blurred boundaries. The model architecture retains the symmetric encoder-decoder structure of U-Net, enhancing the ability to segment complex cardiac anatomical structures. In the encoder, multiple 3x3 convolutional layers are alternating with ReLU activation functions to extract multi-layer features of the input image. Batch normalization (BatchNorm) is used to accelerate training and improve stability. The specific convolution and pooling operations are expressed as follows: (9) in, Indicates the The input feature map of the layer is subjected to 3x3 convolution to extract features, and then nonlinear transformation is performed through batch normalization and ReLU activation function. Finally, the spatial resolution of the feature map is gradually reduced through MaxPool to capture more global information while reducing the computational burden. By combining the MDCA and RFM modules, the improved U-Net model not only performs better in multi-scale feature capture and global information fusion, but also solves the problems of detail loss and class imbalance. The calculation of the multi-dimensional context-aware module MDCA correlation matrix generates the correlation matrix between features by calculating the dot product of query and key : (2) here, Function used to normalize the correlation matrix , which reflects the relative importance of the features. yes Dimension scaling factor to prevent the dot product result from being too large; then the attention matrix Will be applied to , to generate the weighted output: (3) The reverse feature modulation module RFM model generates a rough segmentation mask for each category ,in Represents the category index; the coarse mask is generated by Sigmoid activation: (5) in, Represents the rough segmentation result generated by the network; then the reverse operation is performed to generate the reverse mask of each category : (6) This reverse mask It allows the model to focus more accurately on areas outside the current category, further improving segmentation accuracy.