Cardiac medical image segmentation system based on global-local fusion attention mechanism
By employing a global-local fusion attention mechanism, combined with a global-local fusion attention module and loss function optimization, the problems of insufficient modeling of global and local information and high computational complexity in existing medical image segmentation models are solved, thereby improving the accuracy and robustness of medical image segmentation.
Patent Information
- Application Number
- CN202510732523.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-04
- Publication Date
- 2026-02-10
- Estimated Expiration
- 2045-06-04
AI Technical Summary
Existing medical image segmentation models struggle to simultaneously model both global and local information, fail to fully utilize channel and spatial information, suffer from high computational complexity, and lack sufficient pixel-level segmentation accuracy, especially when dealing with complex anatomical structures and blurred lesion boundaries.
A global-local fusion attention mechanism is adopted. By combining global context awareness and local detail focus through a global-local fusion attention module and a loss function module, regional weights are dynamically allocated. The pixel-level segmentation mask is optimized by utilizing the global-local fusion attention segmentation network architecture and loss function.
It significantly improves the feature representation ability and performance of the segmentation model, enhances the segmentation accuracy and robustness of complex anatomical structures, reduces computational complexity, and improves pixel-level segmentation accuracy.
Smart Images

Figure CN120672775B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of computer vision technology, specifically relating to a cardiac medical image segmentation system based on a global-local fusion attention mechanism. Background Technology
[0002] With the rapid development of medical imaging technology, medical images have become an important tool to assist doctors in disease diagnosis. In recent years, the vigorous development of deep learning technology has brought revolutionary breakthroughs to automated medical image segmentation. In particular, segmentation methods based on convolutional neural networks (CNNs), with their powerful feature extraction and end-to-end learning capabilities, have achieved remarkable results in the field of medical image segmentation. Currently, convolutional neural networks have become the mainstream technical framework for medical image segmentation tasks. Among them, segmentation models represented by fully convolutional networks (FCNs) and UNet are widely used in segmentation tasks of various medical images such as the heart, lungs, and brain. These networks can achieve accurate segmentation of regions of interest in medical images through multi-scale feature extraction and progressive upsampling. However, the complexity of medical image segmentation tasks also places higher demands on existing models, mainly in the following aspects:
[0003] 1. Insufficiency of Global and Local Information Modeling: Anatomical structures in medical images are typically complex and diverse, such as the four chambers of the heart, the distribution of vascular networks, and the morphological changes of tumors. These structures require both global contextual information to understand their overall morphology and local detail information to accurately characterize their boundaries. However, most existing segmentation models tend to focus on one aspect of either global or local information during feature extraction, making it difficult to simultaneously consider the characteristics of both. For example, global modeling methods can capture long-distance dependencies but tend to ignore local details, leading to blurred boundaries; while local modeling methods, although sensitive to details, lack a grasp of the overall structure, easily causing local misjudgments. Existing segmentation models struggle to simultaneously model both global and local information, significantly limiting their performance on complex structures.
[0004] 2. Insufficient Utilization of Channel and Spatial Information: In medical image segmentation tasks, the contributions of features from different channels and spatial locations to segmentation are uneven. Some classic attention mechanisms improve segmentation performance by adaptively adjusting the importance of each channel by modeling the relationships between channels. However, these methods mainly focus on modeling channel feature information while neglecting the role of spatial information. Spatial information is particularly important for medical image segmentation tasks, especially when dealing with blurred boundaries or small structures; a lack of attention to spatial information may lead to less refined segmentation results. Furthermore, while some attention mechanisms that combine channel and spatial information can model both types of information simultaneously, their computational cost is high, making them unsuitable for the cost-effectiveness requirements of medical image segmentation tasks.
[0005] 3. Computational Complexity: Medical image segmentation tasks typically involve high-resolution 3D or 2D image data, which significantly increases the computational cost of segmentation models. For example, existing complex attention mechanisms require substantial computational resources when processing high-resolution feature maps, making it difficult to meet the real-time and resource efficiency requirements of practical applications. Furthermore, while some lightweight attention mechanisms alleviate this problem to some extent by reducing the number of parameters and computational overhead, these methods generally lack the ability to model local information, resulting in less than ideal performance on tasks such as segmentation boundaries and fine-grained targets.
[0006] 4. High-precision pixel-level segmentation requirements: Medical image segmentation tasks require accurate classification of each pixel, which places higher demands on the detail processing capabilities of segmentation models. While global attention mechanisms can capture long-distance dependencies, they tend to overemphasize global information and neglect detailed modeling of local features, leading to blurred boundaries or target detection errors. Furthermore, when dealing with medical images with complex anatomical structures and blurred lesion boundaries, the accuracy and robustness of existing segmentation models still have significant room for improvement.
[0007] In recent years, researchers have proposed some lightweight attention mechanisms, which alleviate the aforementioned problems to some extent by reducing the number of parameters and computational overhead. However, these methods often neglect the modeling ability of local information, resulting in insufficient segmentation accuracy for fine boundary structures. Furthermore, medical image segmentation tasks require higher pixel-level accuracy, and traditional global attention mechanisms may focus too much on long-distance dependencies while neglecting local features, leading to blurred segmentation boundaries or target detection errors. Therefore, this invention proposes a cardiac medical image segmentation system based on a global-local fusion attention mechanism. Summary of the Invention
[0008] The purpose of this invention is to provide a cardiac medical image segmentation system based on a global-local fusion attention mechanism, which can solve the problems of insufficient modeling of channel and spatial information, neglect of local features, and excessive computational complexity in existing attention mechanisms for medical image segmentation tasks.
[0009] The specific technical solution adopted by this invention is as follows:
[0010] A cardiac medical image segmentation system based on a global-local fusion attention mechanism is characterized by comprising: a global-local fusion attention mechanism module, a global-local fusion attention segmentation network architecture, and a loss function module;
[0011] The global-local fusion attention mechanism module dynamically allocates weights for different regions by combining global context awareness and local detail focusing functions: its global module extracts the overall structure or long-range dependencies, and its local module captures the subtle features of neighboring regions. It also uses an adaptive fusion strategy to integrate the two types of information in a complementary manner to complete the multi-level collaborative representation of key features of complex data.
[0012] Preferably, in the global-local fusion attention mechanism module: the input feature map First, local spatial information is extracted using Local Average Pooling (LAP), and the input is then transformed... This paper selects S=7; then uses two branches to extract global and local information respectively; the global branch uses global average pooling (GAP) to reduce the dimensionality of the local feature map and transform it into a global feature map. To adapt to one-dimensional convolution operations; then, a one-dimensional convolution kernel (Conv1d) is used to learn cross-channel dependencies in the channel dimension to generate channel attention weights;
[0013] Local branches are directly in the local feature map Modeling spatial information and capturing local spatial context; to reduce computational overhead, firstly... The number of channels is reduced to dimensionality with a compression ratio of r=4. Then, local spatial information is extracted through two consecutive 7×7 large kernel 2D convolutions: the first large kernel convolution reduces the number of channels from C to C / r and extracts local spatial features through Batch Normalization (BN) and ReLU activation; the second large kernel convolution restores the number of channels from C / r to C and generates local spatial attention weights through BN operation again.
[0014] Finally, the attention maps generated by the global branch and the local branch are fused together, and the resolution of the fused attention map is adjusted to match that of the input feature map. Then, the fused attention map is matched with the original input feature map. By multiplying each channel, an optimized feature map is generated. This operation highlights important regions while suppressing redundant information, thus achieving feature optimization that simultaneously enhances channel sensitivity and spatial positioning capabilities.
[0015] The global-local fusion attention segmentation network architecture first extracts multi-level local features from the input image using a ResNet encoder; then, a high-dimensional embedding sequence is generated through linear projection, and spatial information is injected through positional encoding; during the encoding stage, global context dependencies are modeled through multiple TransformerLayers (including multi-head self-attention and feedforward networks), and feature distribution is optimized through layer normalization; in the skip connection stage, before fusing the features from each layer of the encoder with the corresponding layer of the decoder, a GLFA attention mechanism is introduced to dynamically calibrate the feature importance weights, suppress redundant information, and enhance the response of key regions; the decoder adopts a multi-level progressive upsampling structure, with each level improving resolution through transposed convolution, while simultaneously fusing... The SGE module incorporates a spatial gating enhancement unit. Traditional decoders, during progressive upsampling, are prone to losing fine-grained spatial details (especially edges and microstructures) as feature map resolution gradually recovers. Simple channel concatenation is insufficient to effectively filter key information from the multi-scale features transmitted by the encoder. The SGE module, through a grouped spatial attention mechanism, divides the feature map into multiple subgroups, calculates the spatial attention weight map for each subgroup, dynamically enhances the feature response of the target region, and suppresses irrelevant background noise. It strengthens detail recovery capabilities by collaboratively optimizing feature representation through channel attention and spatial masking. After channel concatenation of the upsampled features with GLFA-weighted encoder features, convolution refines the local structure, ultimately generating a pixel-level segmentation mask. The improved network, through the synergistic effect of GLFA and the SGE module, significantly improves the robustness of cross-level feature fusion and the accuracy of spatial detail reconstruction.
[0016] The loss function module combines cross-entropy loss and Dice loss to quantify the difference between the pixel-level segmentation mask segmentation result and the true value, and guides the optimization algorithm to optimize the pixel-level segmentation mask parameters, ultimately outputting a high-resolution pixel-level segmentation mask.
[0017] The loss function module's loss function can be expressed as:
[0018]
[0019] Among them, L CE Cross-entropy loss measures the difference between the model's predicted class distribution and the true distribution; L Dice The Dice loss is used to evaluate the overlap between the predicted results and the ground truth labels; N is the total number of pixels in the image; C is the total number of classes; and y is the number of pixels in the image.i,c Pixel i is the true label belonging to category C, using one-hot encoding; y i It is the probability value predicted by the model; The label is the real label, represented using binary representation; α is the weighting coefficient, which is α = 0.5 in this invention.
[0020] The technical effects achieved by this invention are as follows:
[0021] This invention proposes a medical image segmentation system based on a Global-Local Fusion Attention (GLFA) mechanism. This method significantly improves the feature representation capability and performance of the segmentation model by combining global channel information, local spatial information, and collaborative modeling of global and local features. Specifically, the GLFA mechanism of this invention fully leverages the potential of channel and spatial information through joint modeling of local and global branches.
[0022] This invention addresses the shortcomings and improvement needs of existing technologies in medical image segmentation tasks by providing a medical image segmentation method and its network architecture based on a Global-Local Fusion Attention (GLFA) mechanism. This invention aims to solve the problems of insufficient modeling of channel and spatial information, neglect of local features, and excessive computational complexity inherent in existing attention mechanisms for medical image segmentation. Furthermore, by embedding the GLFA module into a classic segmentation network (TransUNet), this invention significantly improves the feature extraction capability and segmentation accuracy of the segmentation network. Through innovative module design and optimization strategies, the method of this invention demonstrates superior performance and robustness in handling complex anatomical structure segmentation tasks.
[0023] This invention addresses the shortcomings of existing global attention mechanisms. While these mechanisms can capture long-range dependencies, they tend to overemphasize global information and neglect detailed modeling of local features, leading to blurred boundaries or incorrect object detection. Furthermore, existing attention mechanisms generally suffer from excessive computational cost. By combining global channel information, local spatial information, and collaborative modeling of global and local features, this invention significantly improves the feature representation capability and performance of the segmentation model. In the global branch, we use one-dimensional convolution, while in the local branches, we reduce computational cost by compressing the number of channels. Attached Figure Description
[0024] Figure 1 This is a system block diagram of the cardiac medical image segmentation system based on the global-local fusion attention mechanism of the present invention;
[0025] Figure 2 This is a schematic diagram of the GLFA module in this invention;
[0026] Figure 3 This is a schematic diagram of the SGE module in this invention. Detailed Implementation
[0027] To make the objectives and advantages of this invention clearer, the invention will be specifically described below with reference to embodiments. It should be understood that the following text is merely used to describe one or more specific embodiments of the invention and does not strictly limit the scope of protection specifically claimed by the invention.
[0028] like Figure 1 As shown, the cardiac medical image segmentation system based on the global-local fusion attention mechanism is characterized by including: a global-local fusion attention mechanism module, a global-local fusion attention segmentation network architecture, and a loss function module;
[0029] The global-local fusion attention mechanism module dynamically allocates weights for different regions by combining global context awareness and local detail focusing functions: its global module extracts the overall structure or long-range dependencies, and its local module captures the subtle features of neighboring regions. It also uses an adaptive fusion strategy to integrate the two types of information in a complementary manner to complete the multi-level collaborative representation of key features of complex data.
[0030] Preferably, in the global-local fusion attention mechanism module: the input feature map First, local spatial information is extracted using Local Average Pooling (LAP), and the input is then transformed... This paper selects S=7; then uses two branches to extract global and local information respectively; the global branch uses global average pooling (GAP) to reduce the dimensionality of the local feature map and transform it into a global feature map. To adapt to one-dimensional convolution operations; then, a one-dimensional convolution kernel (Conv1d) is used to learn cross-channel dependencies in the channel dimension to generate channel attention weights;
[0031] Local branches are directly in the local feature map Modeling spatial information and capturing local spatial context; to reduce computational overhead, firstly... The number of channels is reduced to dimensionality with a compression ratio of r=4. Then, local spatial information is extracted through two consecutive 7×7 large kernel 2D convolutions: the first large kernel convolution reduces the number of channels from C to C / r and extracts local spatial features through Batch Normalization (BN) and ReLU activation; the second large kernel convolution restores the number of channels from C / r to C and generates local spatial attention weights through BN operation again.
[0032] Finally, the attention maps generated by the global branch and the local branch are fused together, and the resolution of the fused attention map is adjusted to match that of the input feature map. Then, the fused attention map is compared with the original input feature map. By multiplying each channel, an optimized feature map is generated. This operation highlights important regions while suppressing redundant information, thus achieving feature optimization that simultaneously enhances channel sensitivity and spatial positioning capabilities.
[0033] The global-local fusion attention mechanism module described in this invention has the following specific process:
[0034] Input feature map (B is the batch size, C is the number of channels, H and W are the height and width) After local average pooling: Local Average Pooling (LAP): A 7×7 sliding window local average pooling operation is used to downsample each local region of the input feature map to extract local spatial information; the output local feature map is then processed.
[0035] Global channel branching design; global branches aim to model global dependencies across channels; Global Average Pooling (GAP) applies a layer of local average pooling to feature maps. The local feature map is reduced in dimensionality using global average pooling (GAP) via a global branch, transforming it into a global feature map.
[0036] Dynamic one-dimensional convolution kernel design:
[0037] To avoid information loss caused by a fixed kernel size, a dynamically adjustable one-dimensional convolution kernel is designed. The kernel size k is dynamically calculated based on the number of input channels C.
[0038]
[0039] in,
[0040]
[0041] k is the size of the one-dimensional convolution kernel, which is always an odd number to ensure the symmetry of the convolution operation. C is the number of channels, and γ and b are hyperparameters that control the compression factor of the convolution kernel size and the baseline bias, respectively.
[0042] Cross-channel attention generation: using one-dimensional convolution pairs Perform feature interaction to generate channel attention weights The formula is:
[0043]
[0044] Where σ is the Sigmoid activation function, used to normalize the attention weights to [0,1].
[0045] Local spatial feature extraction; local branching focuses on capturing spatial detail information;
[0046] Will The number of channels is compressed from r=4 to C / 4 to reduce computation. Local spatial features are then extracted using two consecutive 7x7 large-kernel convolutions. The expression is shown below:
[0047]
[0048] Among them, F local For local spatial features, BN is the batch normalization function, and ReLU is the activation function.
[0049] Spatial attention generation: The feature map is restored to the original input resolution by adaptive average pooling, and spatial attention weights are generated.
[0050] Global and local attention are fused; the attention weights generated by the global and local branches are combined to produce an optimized attention weight map. The global and local attention weights are balanced using the hyperparameter β (default 0.5). The expression for the fused attention weights is shown below:
[0051] A fusion =β·A global +(1-β)·A local
[0052] Among them, A fusion For the attention weights after fusion, A global For global branch attention weights, A local This represents the attention weights for local branches.
[0053] Subsequently, a channel-wise multiplication operation is performed to combine the fused attention weights with the input feature map, highlighting key regions and suppressing redundant information, thereby optimizing the feature representation. The final output feature map expression is shown below:
[0054]
[0055] Among them, X output For the final output feature map, A fusion The attention weights are the merged values.
[0056] This invention improves upon the classic segmentation network TransUNet based on the GLFA mechanism, proposing a novel medical image segmentation network architecture: a global-local fusion attention segmentation network. This network effectively enhances segmentation accuracy and boundary detail recovery through collaborative optimization of the encoder and decoder.
[0057] The global-local fusion attention segmentation network architecture first extracts multi-level local features from the input image using a ResNet encoder; then, a high-dimensional embedding sequence is generated through linear projection, and spatial information is injected through positional encoding; during the encoding stage, global context dependencies are modeled through multiple TransformerLayers (including multi-head self-attention and feedforward networks), and feature distribution is optimized through layer normalization; in the skip connection stage, before fusing the features from each layer of the encoder with the corresponding layer of the decoder, a GLFA attention mechanism is introduced to dynamically calibrate the feature importance weights, suppress redundant information, and enhance the response of key regions; the decoder adopts a multi-level progressive upsampling structure, with each level improving resolution through transposed convolution, while simultaneously fusing... The SGE module incorporates a spatial gating enhancement unit. Traditional decoders, during progressive upsampling, are prone to losing fine-grained spatial details (especially edges and microstructures) as feature map resolution gradually recovers. Simple channel concatenation is insufficient to effectively filter key information from the multi-scale features transmitted by the encoder. The SGE module, through a grouped spatial attention mechanism, divides the feature map into multiple subgroups, calculates the spatial attention weight map for each subgroup, dynamically enhances the feature response of the target region, and suppresses irrelevant background noise. It strengthens detail recovery capabilities by collaboratively optimizing feature representation through channel attention and spatial masking. After channel concatenation of the upsampled features with GLFA-weighted encoder features, convolution refines the local structure, ultimately generating a pixel-level segmentation mask. The improved network, through the synergistic effect of GLFA and the SGE module, significantly improves the robustness of cross-level feature fusion and the accuracy of spatial detail reconstruction.
[0058] The loss function module combines cross-entropy loss and Dice loss to quantify the difference between the pixel-level segmentation mask segmentation result and the true value, and guides the optimization algorithm to optimize the pixel-level segmentation mask parameters, ultimately outputting a high-resolution pixel-level segmentation mask.
[0059] The loss function module's loss function can be expressed as:
[0060]
[0061] Among them, L CE Cross-entropy loss measures the difference between the model's predicted class distribution and the true distribution; L Dice The Dice loss is used to evaluate the overlap between the predicted results and the ground truth labels; N is the total number of pixels in the image; C is the total number of classes; and y is the number of pixels in the image. i,c Pixel i is the true label belonging to category C, using one-hot encoding; y i It is the probability value predicted by the model; The label is the real label, represented using binary representation; α is the weighting coefficient, which is α = 0.5 in this invention.
[0062] In the specific experimental process of this invention
[0063] The experimental platform used in this study is shown in Table 1. The datasets used include the ACDC Heart Dataset and the CAMUS Dataset. All network architectures were evaluated using the same training and test sets.
[0064] The ACDC (Automated Cardiac Diagnosis Challenge) heart dataset is a widely used medical image segmentation dataset focused on the automatic segmentation of cardiac MRI images. This dataset contains data from 100 patients across five cardiac pathology types (normal, hypertrophic cardiomyopathy, dilated cardiomyopathy, abnormal right ventricle, and post-myocardial infarction). Each dataset includes biphasic images of end-diastole (ED) and end-systole (ES), with expert-manual annotations for the left ventricle (LV), right ventricle (RV), and myocardium (Myo). The training and test sets contain 80 and 20 patients, respectively. In this experiment, the training set contained 1000 MRI slice images, and the test set contained 200. The batch size during training was 2, the image size was adjusted to 256×256 pixels, and the training batch size was set to 100. To quantify the experimental results, Dice coefficient, precision, and recall were used as performance evaluation metrics. The expressions for these three metrics are as follows:
[0065]
[0066] Where |A∩B| represents the number of pixels in the overlapping area of A and B, |A| represents the number of positive pixels in the predicted result, and |B| represents the number of positive pixels in the true label. TP: True Positive Cases, i.e., the number of samples correctly classified as positive; FP: False Positive Cases, i.e., the number of samples that are actually positive but incorrectly classified as negative.
[0067] Table 1 Experimental Platform
[0068]
[0069] Comparison with other attention mechanisms: To verify the effectiveness of the proposed two-branch attention mechanism, we used the ACDC dataset and embedded current mainstream attention mechanisms into the skip connection part of the segmentation network designed in this paper, and conducted comparative experiments with our method. The comparison results are shown in the table below:
[0070] Table 2. Average Precision Stability
[0071]
[0072]
[0073] Table 3 Stable Average Recall
[0074]
[0075] As shown in Tables 2 and 3, the GLFA model outperforms all the comparison models in both Precision and Recall metrics. In terms of Precision, the average values of Rv, Myo, and Lv for the GLFA model are 0.8067, 0.8546, and 0.9303, respectively, representing improvements of 0.35%, 1.60%, and 0.19% compared to the second-best performing SE model, and improvements of 3.55%, 4.74%, and 2.82% compared to the NONE model. In terms of Recall, the average values of Rv, Myo, and Lv for the GLFA model are 0.8345, 0.8853, and 0.9296, respectively, representing improvements of 1.12%, 1.12%, and 0.07% compared to the SE model, and improvements of 8.26%, 8.00%, and 4.61% compared to the NONE model. Based on data analysis, the GLFA model demonstrates superior feature extraction and task generalization capabilities compared to attention mechanism models CBAM, ECA, and BAM, especially in the myocardial segmentation task, further validating its significant performance advantage in complex medical image segmentation tasks.
[0076] To clarify the contribution of different modules to the overall performance and reveal the key factors for improving model performance, this invention conducted ablation experiments using the ACDC dataset. TransUNet was selected as the baseline, and the experimental results are shown in Table 4.
[0077] Table 4 Ablation Data (Dice Coefficient)
[0078]
[0079]
[0080] As shown in Table 4, both the GLFA and SGE modules play a crucial role in improving model performance, and their combination further enhances the model's performance. In the Rv task, the baseline model's Dice coefficient was 87.34. Adding the GLFA module improved it to 90.14 (a 3.20% improvement), and adding the SGE module improved it to 90.37 (a 3.47% improvement). When both GLFA and SGE modules were added simultaneously, the Dice coefficient reached 91.17, a 4.39% improvement over the baseline. In the Myo task, the baseline model's Dice coefficient was 86.47. Adding the GLFA module improved it to 89.88 (a 3.94% improvement), and adding the SGE module improved it to 87.89 (a 1.64% improvement). Combining both modules resulted in a Dice coefficient of 90.02 (a 4.10% improvement over the baseline). In the Lv task, adding the GLFA module alone improved the Dice coefficient from 94.74 to 95.25 (an improvement of 0.54%), while adding the SGE module alone did not significantly improve it (95.02%). However, when the two were combined, the Dice coefficient reached 95.90, an improvement of 1.22% compared to the baseline.
[0081] In summary, the GLFA module delivered significant performance improvements across all tasks, particularly excelling in the Rv and Myo tasks; the SGE module also demonstrated performance gains across multiple tasks. When GLFA and SGE are used together, their synergistic effect further enhances the model's feature representation capabilities and segmentation performance, significantly improving segmentation accuracy across different tasks. These experimental results fully validate the effectiveness and complementarity of the two module designs, providing crucial support for further optimization of model performance.
[0082] In this invention, Figure 1 System block diagram of a cardiac medical image segmentation system based on a global-local fusion attention mechanism; Figure 1 As can be seen, the input image first extracts multi-level local features through a ResNet encoder, generates a high-dimensional embedding sequence through linear projection, and injects spatial information through positional encoding. During the encoding stage, global contextual dependencies are modeled through multiple Transformer Layers (including multi-head self-attention and feedforward networks), with feature distribution optimized through Layer Normalization. In the skip connection stage, before fusing the features from each encoder layer with the corresponding layers of the decoder, a GLFA attention mechanism is introduced to dynamically calibrate feature importance weights, suppress redundant information, and enhance the response of key regions.
[0083] The decoder section employs a multi-stage progressive upsampling structure, with each stage increasing resolution through transposed convolution, while also incorporating SGE modules (spatial gating enhancement units). Figure 3As shown, traditional decoders, during the progressive upsampling process, are prone to losing fine-grained spatial details (especially edges and microstructures) as the feature map resolution gradually recovers. Simple channel concatenation is insufficient to effectively filter key information from the multi-scale features transmitted by the encoder. The SGE module, through a grouped spatial attention mechanism, divides the feature map into multiple subgroups, calculates the spatial attention weight map for each subgroup, dynamically enhances the feature response of the target region, and suppresses irrelevant background noise. By collaboratively optimizing feature representation through channel attention and spatial masking, the ability to recover details is strengthened. After channel concatenation of the upsampled features with the GLFA-weighted encoder features, further convolution refines the local structure, ultimately generating a pixel-level segmentation mask. The improved network, through the synergistic effect of the GLFA and SGE modules, significantly improves the robustness of cross-level feature fusion and the accuracy of spatial detail reconstruction.
[0084] In this invention, Figure 2 This is a schematic diagram of the GLFA module; for example... Figure 2 The diagram illustrates the principle of GLFA. Input feature map. First, local spatial information is extracted using Local Average Pooling (LAP), and the input is then transformed... This paper selects S=7. Then, two branches are used to extract global and local information respectively. The global branch uses global average pooling (GAP) to reduce the dimensionality of the local feature map, transforming it into a global feature map. To adapt to one-dimensional convolution operations, a one-dimensional convolution kernel (Conv1d) is then used to learn cross-channel dependencies along the channel dimension, generating channel attention weights. The kernel size k of this one-dimensional convolution is dynamically calculated and proportional to the input C, as shown in the following formula:
[0085]
[0086] in:
[0087]
[0088] C is the number of channels, γ and b are hyperparameters that control the compression factor and baseline bias of the convolution kernel size, respectively; the default values are γ=2 and b=1, and k is the size of the one-dimensional convolution kernel, which is always an odd number to ensure the symmetry of the convolution operation. The output of the global branch is a global attention map, which is adaptively pooled or expanded to the same resolution as the original input feature map.
[0089] Local branches are directly in the local feature map The model first models spatial information and captures the local spatial context. To reduce computational overhead, it first... The number of channels is reduced to a dimensionality of r=4. Then, local spatial information is extracted through two consecutive 7×7 large kernel 2D convolutions: the first large kernel convolution reduces the number of channels from C to C / r and extracts local spatial features through Batch Normalization (BN) and ReLU activation; the second large kernel convolution restores the number of channels from C / r to C and generates local spatial attention weights through BN operation again.
[0090] Finally, the attention maps generated by the global branch and the local branch are fused together, and the resolution of the fused attention map is adjusted to match that of the input feature map. Then, the fused attention map is matched with the original input feature map. Channel-by-channel multiplication generates an optimized feature map. This operation highlights important regions while suppressing redundant information, achieving feature optimization that simultaneously enhances channel sensitivity and spatial positioning capabilities.
[0091] In this invention, Figure 3 This is a schematic diagram of the SGE module. Spatial Group Enhancement (SGE), as a novel lightweight spatial attention mechanism, exhibits unique advantages in local feature modeling. Its core idea is to divide the input feature map into several subgroups according to the channel dimension, and independently calculate the spatial attention weight map for each group. Specifically, each group of features first generates channel statistics through global average pooling, then generates a spatial attention mask through two convolutional layers, and finally normalizes to 0-1 weight values using the sigmoid function. Through grouping, SGE reduces the computational complexity of spatial attention to 1 / N of traditional methods (N is the number of groups), while avoiding information loss caused by channel dimensionality reduction. Experiments show that SGE can effectively improve the capture of edge details in semantic segmentation tasks, especially suitable for scenarios with blurred organ boundaries in medical images.
[0092] The above description is merely a preferred embodiment of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention. Structures, devices, and operating methods not specifically described or explained in this invention are implemented according to conventional methods in the art unless otherwise specified or limited.
Claims
1. A cardiac medical image segmentation system based on a global-local fusion attention mechanism, characterized in that: include: The module includes a global-local fusion attention mechanism, a global-local fusion attention segmentation network architecture, and a loss function module. The global-local fusion attention mechanism module dynamically allocates weights for different regions by combining global context awareness and local detail focusing capabilities. Its global module extracts the overall structure or long-range dependencies, while the local module captures the subtle features of the neighboring region. It also uses an adaptive fusion strategy to integrate the two types of information in a complementary manner, so as to complete the multi-level collaborative representation of the key features of complex data. The global-local fusion attention segmentation network architecture first extracts multi-level local features from the input image through a ResNet encoder; then generates a high-dimensional embedding sequence through linear projection, and injects spatial information through positional encoding; during the encoding stage, global context dependency is modeled through a multi-layer network containing multi-head self-attention and feedforward networks, and feature distribution is optimized through layer normalization. During the skip connection stage, before the features of each layer of the encoder are fused with the corresponding layers of the decoder, a GLFA attention mechanism is introduced to dynamically calibrate the feature importance weights. The decoder section adopts a multi-stage progressive upsampling structure, with each stage improving resolution through transposed convolution, while also incorporating a spatial gated enhancement unit as an SGE module; The SGE module divides the feature map into multiple subgroups through a grouped spatial attention mechanism, and calculates the spatial attention weight map for each subgroup. It optimizes feature representation through channel attention and spatial masking to enhance detail recovery capabilities. After concatenating the upsampled features with the GLFA-weighted encoder features, it refines the local structure through convolution, ultimately generating a pixel-level segmentation mask. The loss function module combines cross-entropy loss and Dice loss to quantify the difference between the pixel-level segmentation mask segmentation result and the true value, and guides the optimization algorithm to optimize the pixel-level segmentation mask parameters, ultimately outputting the pixel-level segmentation mask.
2. The cardiac medical image segmentation system based on global-local fusion attention mechanism according to claim 1, characterized in that: In the global-local fusion attention mechanism module: input feature map First, local spatial information is extracted using Local Average Pooling (LAP), and the input is then transformed... This paper selects S=7; then uses two branches to extract global and local information respectively; the global branch uses global average pooling (GAP) to reduce the dimensionality of the local feature map and transform it into a global feature map. To adapt to one-dimensional convolution operations; then, a one-dimensional convolution kernel (Conv1d) is used to learn cross-channel dependencies in the channel dimension to generate channel attention weights.
3. The cardiac medical image segmentation system based on global-local fusion attention mechanism according to claim 2, characterized in that: In the global-local fusion attention mechanism module: local branches are directly applied to local feature maps. Model spatial information and capture local spatial context; firstly, for The number of channels is reduced to dimensionality with a compression ratio of r=4. Then, local spatial information is extracted through two consecutive 7×7 large kernel 2D convolutions: the first large kernel convolution reduces the number of channels from C to C / r and extracts local spatial features through Batch Normalization (BN) and ReLU activation; the second large kernel convolution restores the number of channels from C / r to C and generates local spatial attention weights through BN operation again.
4. The cardiac medical image segmentation system based on global-local fusion attention mechanism according to claim 3, characterized in that: In the global-local fusion attention mechanism module: finally, the attention maps generated by the global branch and the local branch are fused, and the resolution of the fused attention map is adjusted to match that of the input feature map. Then, the fused attention map is matched with the original input feature map. Multiply each channel sequentially to generate an optimized feature map.
5. The cardiac medical image segmentation system based on global-local fusion attention mechanism according to claim 4, characterized in that: The loss function module's loss function can be expressed as: Among them, L CE Cross-entropy loss measures the difference between the model's predicted class distribution and the true distribution; L Dice The Dice loss is used to evaluate the overlap between the predicted results and the ground truth labels; N is the total number of pixels in the image; C is the total number of classes; and y is the number of pixels in the image. i,c Pixel i is the true label belonging to category C, using one-hot encoding; y i It is the probability value predicted by the model; The labels are real labels, represented using binary representation; α is the weighting coefficient; α = 0.5.