Medical image segmentation method based on boundary perception multi-scale fusion network

By working together with the edge enhancement parallel Transformer module and the multi-scale edge enhancement feature extraction module, the problems of insufficient global-local feature fusion and weakened edge information in existing medical image segmentation methods are solved, achieving higher segmentation accuracy and boundary preservation capability.

CN121937731AActive Publication Date: 2026-04-28HUNAN NORMAL UNIVERSITY
View PDF 8 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HUNAN NORMAL UNIVERSITY
Filing Date
2026-03-31
Publication Date
2026-04-28

AI Technical Summary

Technical Problem

Existing medical image segmentation methods struggle to balance global context modeling and local detail preservation in complex medical image scenarios. Semantic alignment is insufficient in multi-scale feature fusion, and the efficiency of edge information transmission and fusion needs improvement, resulting in inadequate segmentation accuracy and boundary preservation capabilities.

Method used

The model employs a parallel Transformer module for edge enhancement, a multi-scale edge enhancement feature extraction module, and a feature reconstruction upsampling module to work together. It trains the model using a joint loss function for boundary differences, thereby enhancing boundary perception capabilities and achieving effective fusion of multi-scale features.

Benefits of technology

It improves the accuracy and boundary preservation ability of medical image segmentation, especially significantly improving the segmentation effect in complex structures and blurred boundary regions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121937731A_ABST
    Figure CN121937731A_ABST
Patent Text Reader

Abstract

The invention discloses a medical image segmentation method based on a boundary perception multi-scale fusion network, and the method comprises the following steps: obtaining existing medical image data, and obtaining a medical image data set; segmenting and marking the medical image data set to obtain a training data set; constructing an initial boundary sensing multi-scale fusion network model; introducing boundary difference joint loss, and training the initial boundary sensing multi-scale fusion network model based on the training data set to obtain a boundary sensing multi-scale fusion network model; and carrying out actual medical image segmentation based on the boundary perception multi-scale fusion network model. According to the method, through organic cooperation of the edge enhancement parallel Transform module, the multi-scale edge enhancement feature extraction module and the feature reconstruction up-sampling module, higher segmentation precision and boundary retention capability are realized in a complex medical image segmentation task.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of artificial intelligence and computer vision technology, specifically relating to a medical image segmentation method based on a boundary-aware multi-scale fusion network. Background Technology

[0002] Medical image segmentation aims to enable models to accurately identify and segment different organs, tissues, or lesion regions from complex medical images, thereby providing reliable structural information support for disease diagnosis, treatment planning, and clinical decision-making. In recent years, Convolutional Neural Networks (CNNs) and Transformers have emerged as two mainstream deep learning architectures in medical image segmentation, demonstrating complementary advantages in local feature extraction and global context modeling, respectively. CNNs, with their local connections, weight sharing, and hierarchical convolutional structures, can effectively capture spatial structural information in images and are widely used in encoder-decoder frameworks represented by U-Net. U-Net significantly improves segmentation performance by fusing shallow details with deep semantics through skip connections. U-Net++ enhances the interaction capabilities of multi-scale features through dense skip connections, while U-Net3+ further introduces full-scale skip connections to promote deep fusion of features at various levels between the encoder and decoder, driving the development of multi-scale information modeling.

[0003] However, limited by the local receptive field of convolutional kernels, traditional CNN models struggle to effectively model long-distance dependencies in complex medical image scenarios, resulting in limited segmentation accuracy in structurally complex or boundary-blurred regions. To overcome this bottleneck, the Transformer architecture, with its global modeling capabilities due to its self-attention mechanism, has been gradually introduced into visual tasks. The introduction of VisionTransformer (ViT) further propelled the application of Transformer in image recognition and segmentation. Researchers further proposed hybrid architectures such as TransUNet, which integrate CNN and Transformer, introducing a Transformer module at the U-Net encoding end while preserving local semantic information and enhancing global context modeling capabilities. Swin-UNet employs a hierarchical sliding window self-attention mechanism, achieving efficient multi-scale global modeling while controlling computational overhead. HiFormer constructs a dual-branch encoding structure, extracting local semantic and global dependency information through CNN and Swin Transformer respectively, and achieving complementarity between the two through a feature fusion module, effectively improving structural consistency and boundary preservation capabilities. Subsequently, methods such as CoTransUNet and UCTransNet further optimized the performance of hybrid architectures in medical image segmentation tasks by improving cross-layer feature fusion and attention mechanisms.

[0004] Meanwhile, significant differences exist in scale, morphology, and structure between organs and lesion regions in medical images, making multi-scale feature extraction and fusion a key technical direction for improving segmentation performance. Early methods mainly relied on the hierarchical structure of convolutional networks, achieving multi-scale fusion through feature concatenation or upsampling. For example, FPN introduced top-down paths and lateral connections to enhance the semantic interaction of multi-scale features; DeepLab series models expanded the receptive field through dilated convolutions and multi-scale context modules, improving the model's ability to recognize multi-scale targets. However, when dealing with complex medical images, these methods still struggle to effectively align high-level semantic information with low-level spatial details, especially in regions with blurred boundaries or small structures, where segmentation errors are easily generated.

[0005] Furthermore, medical images often suffer from tissue adhesions, blurred boundaries, and noise interference, making it difficult to accurately identify real tissue boundaries. To address this, some studies have explored the introduction of edge detection or boundary enhancement mechanisms to improve boundary segmentation accuracy. FBR-Net combines Laplacian convolution with spatial attention mechanisms to strengthen boundary feature representation; GED-Net achieves collaborative learning of edge information and semantic features through the design of independent edge branches; and BEFUnet constructs a dual-branch encoder structure to promote the interactive fusion of semantic features and edge information, thereby improving the segmentation performance of complex structural regions.

[0006] In summary, although existing methods have made some progress in CNN-Transformer fusion, multi-scale feature learning, and edge information modeling, the following problems still exist in complex medical image scenarios: First, it is still difficult to achieve a balance between global context modeling and local detail preservation; second, insufficient semantic alignment during multi-scale feature fusion leads to inconsistent feature representations; and third, the efficiency of edge information transmission and fusion in multi-level features needs to be improved. Therefore, it is urgent to construct a new medical image segmentation network that, based on the fusion of CNN's local perception capabilities and Transformer's global modeling capabilities, designs a more efficient multi-scale feature fusion strategy and boundary information enhancement mechanism to improve the model's ability to represent complex structures and blurred boundaries, thereby further improving the accuracy of medical image segmentation. Summary of the Invention

[0007] To address the shortcomings of existing technologies, the present invention aims to provide a medical image segmentation method based on a boundary-aware multi-scale fusion network. By organically coordinating an edge enhancement parallel Transformer module, a multi-scale edge enhancement feature extraction module, and a feature reconstruction upsampling module, the present invention effectively overcomes the limitations of existing methods in terms of insufficient global-local feature fusion, weakened edge information, and loss of upsampling details. This enables the present invention to achieve higher segmentation accuracy and boundary preservation capabilities in complex medical image segmentation tasks.

[0008] This invention provides a medical image segmentation method based on a boundary-aware multi-scale fusion network, comprising the following steps:

[0009] S1. Obtain existing medical image data to obtain a medical image dataset;

[0010] S2. Segment and label the medical image dataset to obtain the training dataset;

[0011] S3. Construct an initial boundary-aware multi-scale fusion network model;

[0012] S4. Introduce joint loss for boundary differences, and train the initial boundary-aware multi-scale fusion network model based on the training dataset to obtain the boundary-aware multi-scale fusion network model.

[0013] S5. Perform practical medical image segmentation based on a boundary-aware multi-scale fusion network model.

[0014] In step S3, the initial boundary-aware multi-scale fusion network model includes an encoder part, a decoder part, a Bottleneck layer, a linear projection output layer, and a skip connection part.

[0015] The encoder section comprises a patch embedding module, a first hybrid parallel perceptual Transformer module, a first patch merging layer, a second hybrid parallel perceptual Transformer module, and a second patch merging layer, connected in sequence; the input to the encoder section is a vector with spatial dimensions. and the number of channels is Input image The encoder part uses a patch embedding module to divide the input image into 4×4 feature blocks; then the feature blocks are processed sequentially through the first hybrid parallel perceptual Transformer module, the first Patch Merging layer, the second hybrid parallel perceptual Transformer module, and the second Patch Merging layer. The hybrid parallel perceptual Transformer module performs global modeling and feature extraction, while the Patch Merging layer reduces the size of the input feature map by half to reduce the spatial dimension, while doubling the channel dimension.

[0016] The skip connection section includes a first multi-scale edge enhancement feature extraction module and a second multi-scale edge enhancement feature extraction module. The input of the first multi-scale edge enhancement feature extraction module is connected to the output of the first hybrid parallel perception Transformer module and the second feature reconstruction upsampling module, respectively. The result processed by the first multi-scale edge enhancement feature extraction module is added to the output of the second feature reconstruction upsampling module and then output to the fourth hybrid parallel perception Transformer module. The input of the second multi-scale edge enhancement feature extraction module is connected to the output of the second hybrid parallel perception Transformer module and the first feature reconstruction upsampling module, respectively. The result processed by the second multi-scale edge enhancement feature extraction module is added to the output of the first feature reconstruction upsampling module and then output to the third hybrid parallel perception Transformer module. The multi-scale edge enhancement feature extraction module extracts and fuses multi-scale contextual information and edge enhancement features from the encoder layer and decoder layer, explicitly strengthening the boundary perception capability during the skip connection process, and effectively integrating features at different levels with the help of an adaptive gating mechanism, thereby significantly improving the modeling capability for complex structures and fuzzy boundaries while transmitting semantic information.

[0017] The decoder section comprises a first feature reconstruction upsampling module, a third hybrid parallel perceptual Transformer module, a second feature reconstruction upsampling module, a fourth hybrid parallel perceptual Transformer module, and a third feature reconstruction upsampling module connected in sequence. The input to the decoder first passes through the first feature reconstruction upsampling module to restore spatial resolution and enhance feature representation. The result, along with the output of the second hybrid parallel perceptual Transformer module, is input to the second multi-scale edge enhancement feature extraction module for feature extraction and fusion. The output of the second multi-scale edge enhancement feature extraction module is added to the output of the first feature reconstruction upsampling module, serving as the input to the third hybrid parallel perceptual Transformer module. The third hybrid parallel perceptual Transformer module... The `mer` module enhances image feature extraction from the input features, and the result is input into the second feature reconstruction upsampling module. The output of the second feature reconstruction upsampling module, together with the output of the first hybrid parallel perceptual Transformer module, is input into the first multi-scale edge enhancement feature extraction module to extract and fuse features. The output of the first multi-scale edge enhancement feature extraction module is added to the output of the second feature reconstruction upsampling module, and this is used as the input of the fourth hybrid parallel perceptual Transformer module. The fourth hybrid parallel perceptual Transformer module enhances image feature extraction from the input features, and the result is input into the third feature reconstruction upsampling module. The output of the third feature reconstruction upsampling module is the output of the decoder part, and finally input into the linear projection output layer.

[0018] The Bottleneck layer includes a fifth hybrid parallel sensing Transformer module and a sixth hybrid parallel sensing Transformer module connected in sequence.

[0019] The first to sixth hybrid parallel perception Transformer modules have the same structure, including a spatial attention branch, a channel attention branch, and an MLP module. The input features of the hybrid parallel perception Transformer module are respectively input into the spatial attention branch and the channel attention branch for processing. The output results are weighted and fused, and then residually connected with the input features of the hybrid parallel perception Transformer module. The result of the residual connection is input into the MLP module for processing, and the result is added to the result of the residual connection as the output of the hybrid parallel perception Transformer module.

[0020] The spatial attention branch employs the Efficient Attention mechanism, which is as follows: First, the input features are layer-normalized, and the key (K) and value (V) matrices are multiplied to generate a finite set of global context vectors that are independent of the input size. Then, the query (Q) matrix is ​​aggregated with these context vectors to generate an output for each pixel position. Finally, spatial location priors are injected through position embedding convolution, and the local receptive field is expanded by combining side depth separable convolution to obtain the final output.

[0021] The spatial attention branch is represented by the following formula: ; ;in, This indicates that the Efficient Attention mechanism is used for processing. Represents the Efficient Attention operator; x is the input feature of the hybrid parallel perceptual Transformer module; Query for input spatial attention; The key for input spatial attention; Input spatial attention value (Value); Indicates spatial attention branch; Position-based embedding convolution; For side-depth separable convolution;

[0022] The channel attention branch is based on the Cross-Covariance Attention mechanism. Specifically, the input features are first normalized layer by layer, and the cross-covariance matrix of the key (K) and query (Q) is calculated to describe the global correlation between different channel features, thereby constructing a channel attention map. Then, the channel attention map is used to weight and integrate the values ​​(V) to achieve dynamic recalibration of the channel features.

[0023] The processing of the hybrid parallel perceptual Transformer module includes the following steps:

[0024] The input features of the hybrid parallel perceptual Transformer module are processed by both spatial attention and channel attention branches, with the spatial attention branch represented by the following formula: ; ;in, This indicates that the Efficient Attention mechanism is used for processing. Represents the Efficient Attention operator; x is the input feature of the hybrid parallel perceptual Transformer module; Input spatial attention query; The key for input spatial attention; Input spatial attention value (Value); Indicates spatial attention branch; Position-based embedding convolution; For side-depth separable convolutions; the channel attention branch is represented by the following formula: ;in, Input channel attention query; The key for input channel attention; The input channel attention value (Value); Indicates the channel attention branch, This represents the Cross-Covariance Attention operator;

[0025] The results of the spatial attention branch and the channel attention branch are weighted and fused, and then residually connected with the input features of the hybrid parallel perceptual Transformer module, expressed by the following formula: ;in, The features are obtained by weighted fusion of the two branches and the input residual; This indicates the first fusion weight to be learned; This indicates the second fusion weight to be learned;

[0026] The results of the residual join are input into the MLP module for processing, and are expressed using the following formula: ;in, It is a hybrid feedforward network (Mix-FFN). For fully connected layers, For depthwise separable convolution and For activation functions;

[0027] The result obtained from the MLP module is then added to the result of the residual connection, and this is used as the output of the hybrid parallel perceptual Transformer module, expressed by the following formula: .

[0028] The first multi-scale edge enhancement feature extraction module has the same structure as the second multi-scale edge enhancement feature extraction module, including a global edge awareness attention module, a multi-scale context feature extraction module, and a multi-scale adaptive gating selection module.

[0029] The global edge-aware attention module takes the feature sequence output by the decoder as input, extracts and fuses information through two parallel paths, enhances the network's ability to perceive edge regions and global dependencies, and obtains edge detail features.

[0030] Multi-scale context features are based on several parallel deep separable convolutional layers to obtain structural semantic information under different receptive fields, thus obtaining global context features;

[0031] The multi-scale adaptive gating selection module dynamically weights and fuses edge detail features and global context features, thereby enhancing the semantic understanding of multi-scale anatomical structures while maintaining accurate boundary localization capabilities.

[0032] The global edge-aware attention module uses the feature sequence output by the decoder. As input, global average pooling and max pooling are performed in parallel. The Sobel operator is used to extract gradient features from the average pooling features. Then, the original edge mapping is converted into a spatial attention weight map through an edge enhancement convolutional network. The spatial attention weight map is multiplied element-wise with the average pooling features. The result is concatenated and projected with the max pooling features. Finally, the spatial attention weights are generated through the Sigmoid activation function, and the edge detail features are output.

[0033] The multi-scale context feature extraction module uses three parallel depthwise separable convolutional layers to process the input feature map. The depthwise separable convolution consists of depthwise convolution and pointwise convolution. The depthwise convolution uses the number of groups equal to the number of input channels, and then the pointwise convolution is used to adjust the channels to generate three feature maps with different receptive fields. Then, these three feature maps are concatenated in the channel dimension. The concatenated result is processed by 1×1 convolution and batch normalization before being input into the edge enhancement convolutional network. The result of the edge enhancement convolutional network is matrix multiplied with the input of the edge enhancement convolutional network. The result is processed by 1×1 convolution and batch normalization, and finally the global context features are obtained by the sigmoid activation function.

[0034] The multi-scale adaptive gating selection module adds and fuses edge detail features with global context features. Then, it uses a 1×1 convolution and a softmax function to map the fused features into two selection weights, A and B, corresponding to the weight coefficients of the edge detail features and global context features, respectively. The obtained selection weights are used to weight and adjust the input edge detail features and global context features, and residual connections are used to preserve the original feature information, thereby obtaining enhanced edge detail features and global context features. The enhanced edge detail features generate a gating signal through a sigmoid function to modulate the global context features. At the same time, the enhanced global context features also generate a gating signal through the same operation to inversely modulate the edge detail features. The bidirectionally modulated edge detail features and global context features are then multiplied element-wise and linearly transformed to obtain deeply fused interactive features.

[0035] The first to third feature reconstruction upsampling modules have the same structure, specifically: channel expansion is performed on the input features to obtain an enhanced feature representation; the enhanced feature representation is then processed by... The spatial size of the input feature map is doubled, and depthwise separable convolution is introduced to effectively reconstruct local spatial features. Finally, pointwise convolution is used to adjust the feature channels to half the number of channels in the input feature map to obtain the final fused features.

[0036] The feature reconstruction upsampling module is represented by the following formula: ; ; ;in, Indicates batch normalization; This represents a linear transformation operation. This represents depthwise separable convolution. This indicates that ReLU is activated. This represents pointwise convolution; x represents the input feature. This represents the enhanced feature representation; Represents local spatial features; Indicates the final fusion features; This is an upsampling operation.

[0037] In step S4, the joint loss of boundary differences Express it using the following formula: Where G represents the true label and P represents the predicted result; To adaptively adjust parameters;

[0038] By adaptively adjusting parameters according to the target size The value of allows the weights of the boundary region to be dynamically adjusted as the target scale changes. When the target is small, the boundary information occupies a more important proportion in the overall structure, and a larger weight can enhance the model's learning of boundary details. When the target is large, the boundary weights are appropriately reduced to avoid over-focusing on local noise.

[0039] This invention discloses a medical image segmentation method based on a boundary-aware multi-scale fusion network. By organically coordinating an edge enhancement parallel Transformer module, a multi-scale edge enhancement feature extraction module, and a feature reconstruction upsampling module, it effectively overcomes the limitations of existing methods in terms of insufficient global-local feature fusion, weakened edge information, and loss of upsampling details. This invention enables the method to achieve higher segmentation accuracy and boundary preservation capability in complex medical image segmentation tasks. Attached Figure Description

[0040] Figure 1 This is a schematic flowchart of the method of the present invention;

[0041] Figure 2 This is a schematic diagram of the boundary-aware multi-scale fusion network model in an embodiment of the present invention;

[0042] Figure 3 This is a schematic diagram of the hybrid parallel sensing Transformer module in an embodiment of the present invention;

[0043] Figure 4 This is a schematic diagram of the structure of the multi-scale edge enhancement feature extraction module in an embodiment of the present invention;

[0044] Figure 5 This is a comparison chart of qualitative segmentation results of different segmentation methods on the Synapse multi-organ segmentation dataset in this embodiment of the invention;

[0045] Figure 6 This is a comparison of qualitative segmentation results of different segmentation methods on the ACDC cardiac MRI dataset in this embodiment of the invention;

[0046] Figure 7 This is a comparison chart of qualitative segmentation results of different segmentation methods on the BUSI breast ultrasound dataset in this embodiment of the invention;

[0047] Figure 8 This is a comparison chart of qualitative segmentation results of different segmentation methods on the ISIC-2018 skin lesion dataset in this embodiment of the invention;

[0048] Figure 9 This is a comparison chart of qualitative segmentation results of different segmentation methods on the CVC-ClinicDB colonoscopy dataset in this embodiment of the invention. Detailed Implementation

[0049] This invention provides a medical image segmentation method based on a boundary-aware multi-scale fusion network, comprising the following steps:

[0050] S1. Obtain existing medical image data to obtain a medical image dataset;

[0051] The medical image data includes organ image data, heart structure image data, breast ultrasound image data, skin lesion image data, and colonoscopy image data.

[0052] S2. Segment and label the medical image dataset to obtain the training dataset;

[0053] S3. Construct an initial boundary-aware multi-scale fusion network model;

[0054] In step S3, the initial boundary-aware multi-scale fusion network model includes an encoder part, a decoder part, a Bottleneck layer, a linear projection output layer, and a skip connection part.

[0055] The encoder section comprises a patch embedding module, a first hybrid parallel perceptual Transformer module, a first patch merging layer, a second hybrid parallel perceptual Transformer module, and a second patch merging layer, connected in sequence; the input to the encoder section is a vector with spatial dimensions. and the number of channels is Input image The encoder part uses a patch embedding module to divide the input image into 4×4 feature blocks; then the feature blocks are processed sequentially through the first hybrid parallel perceptual Transformer module, the first Patch Merging layer, the second hybrid parallel perceptual Transformer module, and the second Patch Merging layer. The hybrid parallel perceptual Transformer module performs global modeling and feature extraction, while the Patch Merging layer reduces the size of the input feature map by half to reduce the spatial dimension, while doubling the channel dimension.

[0056] The skip connection section includes a first multi-scale edge enhancement feature extraction module and a second multi-scale edge enhancement feature extraction module. The input of the first multi-scale edge enhancement feature extraction module is connected to the output of the first hybrid parallel perception Transformer module and the second feature reconstruction upsampling module, respectively. The result processed by the first multi-scale edge enhancement feature extraction module is added to the output of the second feature reconstruction upsampling module and then output to the fourth hybrid parallel perception Transformer module. The input of the second multi-scale edge enhancement feature extraction module is connected to the output of the second hybrid parallel perception Transformer module and the first feature reconstruction upsampling module, respectively. The result processed by the second multi-scale edge enhancement feature extraction module is added to the output of the first feature reconstruction upsampling module and then output to the third hybrid parallel perception Transformer module. The multi-scale edge enhancement feature extraction module extracts and fuses multi-scale contextual information and edge enhancement features from the encoder layer and decoder layer, explicitly strengthening the boundary perception capability during the skip connection process, and effectively integrating features at different levels with the help of an adaptive gating mechanism, thereby significantly improving the modeling capability for complex structures and fuzzy boundaries while transmitting semantic information.

[0057] The decoder section comprises a first feature reconstruction upsampling module, a third hybrid parallel perceptual Transformer module, a second feature reconstruction upsampling module, a fourth hybrid parallel perceptual Transformer module, and a third feature reconstruction upsampling module connected in sequence. The input to the decoder first passes through the first feature reconstruction upsampling module to restore spatial resolution and enhance feature representation. The result, along with the output of the second hybrid parallel perceptual Transformer module, is input to the second multi-scale edge enhancement feature extraction module for feature extraction and fusion. The output of the second multi-scale edge enhancement feature extraction module is added to the output of the first feature reconstruction upsampling module, serving as the input to the third hybrid parallel perceptual Transformer module. The third hybrid parallel perceptual Transformer module... The `mer` module enhances image feature extraction from the input features, and the result is input into the second feature reconstruction upsampling module. The output of the second feature reconstruction upsampling module, together with the output of the first hybrid parallel perceptual Transformer module, is input into the first multi-scale edge enhancement feature extraction module to extract and fuse features. The output of the first multi-scale edge enhancement feature extraction module is added to the output of the second feature reconstruction upsampling module, and this is used as the input of the fourth hybrid parallel perceptual Transformer module. The fourth hybrid parallel perceptual Transformer module enhances image feature extraction from the input features, and the result is input into the third feature reconstruction upsampling module. The output of the third feature reconstruction upsampling module is the output of the decoder part, and finally input into the linear projection output layer.

[0058] The Bottleneck layer includes a fifth hybrid parallel sensing Transformer module and a sixth hybrid parallel sensing Transformer module connected in sequence.

[0059] The first to sixth Hybrid Parallel Perception Transformer Blocks (HPA-Transformer Blocks) have the same structure, including a spatial attention branch, a channel attention branch, and an MLP module. The input features of the Hybrid Parallel Perception Transformer Blocks are respectively input into the spatial attention branch and the channel attention branch for processing. The output results are weighted and fused, and then residually connected with the input features of the Hybrid Parallel Perception Transformer Blocks. The result of the residual connection is input into the MLP module for processing, and the result is added to the result of the residual connection as the output of the Hybrid Parallel Perception Transformer Block.

[0060] The spatial attention branch employs the Efficient Attention mechanism, which is as follows: First, the input features are layer-normalized, and the key (K) and value (V) matrices are multiplied to generate a finite set of global context vectors that are independent of the input size. Then, the query (Q) matrix is ​​aggregated with these context vectors to generate an output for each pixel position. Finally, spatial location priors are injected through position embedding convolution, and the local receptive field is expanded by combining side depth separable convolution to obtain the final output.

[0061] The spatial attention branch is represented by the following formula: ; ;in, This indicates that the Efficient Attention mechanism is used for processing. Represents the Efficient Attention operator; x is the input feature of the hybrid parallel perceptual Transformer module; Query for input spatial attention; The key for input spatial attention; Input spatial attention value (Value); Indicates spatial attention branch; Position-based embedding convolution; For side-depth separable convolution;

[0062] The channel attention branch is based on the Cross-Covariance Attention mechanism. Specifically, the input features are first normalized layer by layer, and the cross-covariance matrix of the key (K) and query (Q) is calculated to describe the global correlation between different channel features, thereby constructing a channel attention map. Then, the channel attention map is used to weight and integrate the values ​​(V) to achieve dynamic recalibration of the channel features.

[0063] The processing of the hybrid parallel perceptual Transformer module includes the following steps:

[0064] The input features of the hybrid parallel perceptual Transformer module are processed by both spatial attention and channel attention branches, with the spatial attention branch represented by the following formula: ; ;in, This indicates that the Efficient Attention mechanism is used for processing. Represents the Efficient Attention operator; x is the input feature of the hybrid parallel perceptual Transformer module; Query for input spatial attention; The key for input spatial attention; Input spatial attention value (Value); Indicates spatial attention branch; Position-based embedding convolution; For side-depth separable convolutions; the channel attention branch is represented by the following formula: ;in, Input channel attention query; The key for input channel attention; The input channel attention value (Value); Indicates the channel attention branch, This represents the Cross-Covariance Attention operator;

[0065] The results of the spatial attention branch and the channel attention branch are weighted and fused, and then residually connected with the input features of the hybrid parallel perceptual Transformer module, expressed by the following formula: ;in, The features are obtained by weighted fusion of the two branches and the input residual; This indicates the first fusion weight to be learned; This indicates the second fusion weight to be learned;

[0066] The results of the residual join are input into the MLP module for processing, and are expressed using the following formula: ;in, It is a hybrid feedforward network (Mix-FFN). For fully connected layers, For depthwise separable convolution and For activation functions;

[0067] The result obtained from the MLP module is then added to the result of the residual connection, and this is used as the output of the hybrid parallel perceptual Transformer module, expressed by the following formula: .

[0068] The first multi-scale edge enhancement feature extraction module (MEFEM) has the same structure as the second multi-scale edge enhancement feature extraction module, including a global edge-aware attention module, a multi-scale context feature extraction module, and a multi-scale adaptive gating selection module.

[0069] The global edge-aware attention module takes the feature sequence output by the decoder as input, extracts and fuses information through two parallel paths, enhances the network's ability to perceive edge regions and global dependencies, and obtains edge detail features.

[0070] Multi-scale context features are based on several parallel deep separable convolutional layers to obtain structural semantic information under different receptive fields, thus obtaining global context features;

[0071] The multi-scale adaptive gating selection module dynamically weights and fuses edge detail features and global context features, thereby enhancing the semantic understanding of multi-scale anatomical structures while maintaining accurate boundary localization capabilities.

[0072] The global edge-aware attention module uses the feature sequence output by the decoder. As input, average pooling and max pooling are performed in parallel. The Sobel operator is used to extract gradient features from the average pooling features. Then, the original edge mapping is converted into a spatial attention weight map through an edge enhancement convolutional network. The spatial attention weight map is multiplied element-wise with the average pooling features. The result is concatenated and projected with the max pooling features. Finally, the spatial attention weights are generated through the Sigmoid activation function, and the edge detail features are output.

[0073] The global edge-aware attention module is represented by the following formula: ; ; ; ; ; ; ; ;in, Let represent the horizontal convolution kernel of the Sobel operator; This represents the convolution kernel in the vertical direction of the Sobel operator; For convolution processing; The gradient is in the horizontal direction; The gradient is in the vertical direction; To prevent numerically unstable minimal constants; Edge intensity map; For edge enhancement convolutional network processing; This indicates element-wise multiplication. Indicates batch normalization, This represents the sigmoid activation function; Features that add edge information weights to the average pooling results; for The feature map is obtained by concatenating the feature map after max pooling along the channel dimension; Features output by the module;

[0074] The multi-scale context feature extraction module uses three parallel depthwise separable convolutional layers to process the input feature map. The depthwise separable convolution consists of depthwise convolution and pointwise convolution. The depthwise convolution uses the number of groups equal to the number of input channels, and then the pointwise convolution is used to adjust the channels to generate three feature maps with different receptive fields. Then, these three feature maps are concatenated in the channel dimension. The concatenated result is processed by 1×1 convolution and batch normalization before being input into the edge enhancement convolutional network. The result of the edge enhancement convolutional network is matrix multiplied with the input of the edge enhancement convolutional network. The result is processed by 1×1 convolution and batch normalization, and finally the global context features are obtained by the sigmoid activation function.

[0075] The multi-scale context feature extraction module is represented by the following formula: ; ; ; ;in, Indicates sigmoid activation. Indicates batch normalization, Represents depthwise separable convolution , This represents matrix multiplication. This is processed by an edge-enhancing convolutional network; x is the input to the multi-scale contextual feature extraction module; For channel splicing; Features obtained by splicing channels; Features obtained by edge enhancement convolutional networks; Features obtained by matrix multiplication; The output of the multi-scale context feature extraction module when the input is x;

[0076] The multi-scale adaptive gating selection module adds and fuses edge detail features with global context features. Then, it uses a 1×1 convolution and a softmax function to map the fused features into two selection weights, A and B, corresponding to the weight coefficients of the edge detail features and global context features, respectively. The obtained selection weights are used to weight and adjust the input edge detail features and global context features, and residual connections are used to preserve the original feature information, thus obtaining enhanced edge detail features and global context features. The enhanced edge detail features generate a gating signal through a sigmoid function to modulate the global context features. Simultaneously, the enhanced global context features also generate a gating signal through the same operation to inversely modulate the edge detail features. The bidirectionally modulated edge detail features and global context features are then multiplied element-wise and subjected to a linear transformation to obtain deeply fused interactive features.

[0077] The multi-scale adaptive gating selection module is represented by the following formula: ; ; ; ; ; Where [A,B] represents the gating attention allocation weights, Indicates sigmoid activation. Represents the phase of a matrix. This indicates element-wise multiplication. These represent linear transformation operations; Enhanced edge detail features; Enhanced global context features; These are edge detail features after bidirectional modulation; These are global context features after bidirectional modulation; For deeply integrated interactive features.

[0078] The first to third feature reconstruction upsampling modules (FR Upsampling) have the same structure, specifically: channel expansion is performed on the input features to obtain an enhanced feature representation; the enhanced feature representation is then processed by... The spatial size of the input feature map is doubled, and depthwise separable convolution is introduced to effectively reconstruct local spatial features. Finally, pointwise convolution is used to adjust the feature channels to half the number of channels in the input feature map to obtain the final fused features.

[0079] The feature reconstruction upsampling module is represented by the following formula: ; ; ;in, Indicates batch normalization; This represents a linear transformation operation. This represents depthwise separable convolution. This indicates that ReLU is activated. This represents pointwise convolution; x represents the input feature. This represents the enhanced feature representation; Represents local spatial features; Indicates the final fusion features; This is an upsampling operation.

[0080] S4. Introduce joint loss for boundary differences, and train the initial boundary-aware multi-scale fusion network model based on the training dataset to obtain the boundary-aware multi-scale fusion network model.

[0081] In step S4, the joint loss of boundary differences Express it using the following formula: Where G represents the true label and P represents the predicted result; To adaptively adjust parameters;

[0082] By adaptively adjusting parameters according to the target size The value of allows the weights of the boundary region to be dynamically adjusted as the target scale changes. When the target is small, the boundary information occupies a more important proportion in the overall structure, and a larger weight can enhance the model's learning of boundary details. When the target is large, the boundary weights are appropriately reduced to avoid over-focusing on local noise.

[0083] S5. Perform practical medical image segmentation based on a boundary-aware multi-scale fusion network model.

[0084] The method of the present invention will be further described below with reference to the embodiments:

[0085] To verify the effectiveness of the hybrid parallel perceptual Transformer module, ablation experiments were conducted on its core structure. First, the hybrid parallel perceptual Transformer module was removed from the basic encoder-decoder framework, and various attention structures were constructed for comparison, including the standard Transformer structure, a structure retaining only spatial attention branches, a structure retaining only channel attention branches, and a parallel combination of spatial and channel attention structures. The results are detailed in Table 1.

[0086] Table 1. Ablation experiments of the hybrid parallel perceptual Transformer module on the Synapse dataset.

[0087] Experimental results show that the standard Transformer structure achieves an average DSC of approximately 80% on the Synapse dataset, with a boundary distance (HD) of 30.91 mm, indicating insufficient segmentation accuracy in complex boundary regions. Introducing a spatial attention branch improves the model's average DSC to 82.07%, demonstrating that global modeling in the spatial dimension effectively enhances structural information representation; however, the HD remains at 23.94 mm, indicating limited improvement in boundary accuracy. Using only the channel attention branch, the model achieves an average DSC of 81.32%, while the HD decreases to 18.95 mm, a reduction of approximately 40% compared to the standard Transformer, demonstrating the significant role of channel-dimensional feature reshaping in boundary localization. Fusing spatial and channel attention in a parallel structure further improves the model's average DSC to 82.51%, showing a significant improvement over single attention structures. Finally, by introducing a CNN local feature enhancement mechanism to form the complete HPA-Transformer Block, the proposed method achieves an average DSC of 82.97% and an HD of 18.47 mm on the Synapse dataset, achieving optimal overall performance. The experimental results above show that the proposed hybrid parallel perceptual Transformer structure can enhance the expression of boundary structures while maintaining the global dependency modeling capability, thereby effectively improving the overall accuracy and boundary localization capability of medical image segmentation.

[0088] To verify the effectiveness of the multi-scale edge enhancement feature extraction module MEFEM, ablation experiments were conducted on its internal components. Based on a unified encoder-decoder backbone network, the experiments systematically evaluated the contributions of the global edge awareness attention module GEAM, the multi-scale context feature extraction module MCFE, and the multi-scale adaptive gating selection mechanism MASG to model performance by progressively removing key components from the module. The results are detailed in Table 2.

[0089] Table 2 Ablation experiments of the multi-scale edge enhancement feature extraction module on the Synapse dataset.

[0090] Experimental results show that when using only the global edge-aware attention module, the model achieves an average DSC of 82.43% and an HD of 13.53 mm, a significant improvement over the baseline model using only basic skip connections. This indicates that the module effectively enhances the network's ability to perceive boundary regions and improves the quality of segmentation boundaries. Building upon this, by adding a multi-scale contextual feature extraction structure and fusing it using a simple feature addition method, the model can further integrate structural information from different receptive fields, further improving the structural consistency and region integrity of the segmentation results. However, due to the lack of an effective feature selection mechanism, some information redundancy still exists between features of different scales. When a multi-scale adaptive gating selection mechanism is further introduced to form the complete MEFEM module, the model achieves optimal performance, reaching an average DSC of 84.56% and an HD of 12.68 mm on the Synapse dataset. These results demonstrate that the adaptive gating mechanism can effectively filter and fuse multi-scale features, enabling synergistic enhancement between edge-aware information and multi-scale semantic information, thereby significantly improving the overall accuracy and boundary localization ability of the model in complex medical image segmentation tasks.

[0091] The experimental results show that the proposed multi-scale edge enhancement feature extraction module, by integrating edge-aware attention, multi-scale context modeling, and adaptive gating fusion mechanism, can form a complementary and synergistic feature learning structure, thereby significantly enhancing the network's ability to express complex tissue boundaries and multi-scale anatomical structures, and improving the overall accuracy and boundary localization performance in medical image segmentation tasks.

[0092] To verify the effectiveness of the Feature Reconstruction Upsampling (FR) module, ablation experiments were conducted while maintaining the consistency of the rest of the network structure. The experiments compared and analyzed the bilinear interpolation upsampling method, the Patch Expanding module in the Swin-Transformer, and the FR module proposed in this invention. The results are detailed in Table 3.

[0093] Table 3 Ablation experiments of the feature reconstruction upsampling module on the Synapse dataset.

[0094] Experimental results show that while traditional bilinear interpolation can restore the spatial resolution of feature maps, the lack of an effective feature reconstruction mechanism limits the model's performance in detail recovery and boundary preservation, resulting in relatively low overall segmentation performance. Replacing the upsampling structure with the PatchExpanding module from Swin-Transformer improves model performance, indicating that channel rearrangement can recover spatial information and enhance feature representation to some extent. Furthermore, the proposed feature reconstruction upsampling module achieves optimal segmentation performance on the Synapse dataset. This module, by reconstructing and compressing channel features while simultaneously improving spatial resolution, achieves synergistic enhancement of spatial detail recovery and feature representation optimization, effectively improving segmentation boundary quality and overall structural reconstruction capabilities.

[0095] The experimental results show that the proposed feature reconstruction upsampling module can more effectively recover the high-frequency detail information lost during the downsampling process in the decoding stage, and improve the overall accuracy and boundary localization ability in medical image segmentation tasks while maintaining structural integrity.

[0096] To verify the overall performance of the model, comparative experiments were conducted on the Synapse multi-organ segmentation dataset, the ACDC dataset, the BUSI breast ultrasound image dataset, the ISIC-2018 skin lesion segmentation dataset, and the CVC-ClinicDB colonoscopy image dataset. Specifically, the model was compared with 13 state-of-the-art methods on the Synapse multi-organ segmentation dataset, including UNet, Att-UNet, and BRAU-Net++ based on convolutional neural networks; Swin-UNet, MissFormer, CSWin-UNet, and MCCSeg based on Vision Transformer; and hybrid architectures combining CNN and Transformer, such as TransUNet, HiFormer, CoTransUNet, BEFUnet, E-TUNet, and PVT-EMCAD. The experimental results are shown in Table 4.

[0097] Table 4 Performance comparison on the Synapse dataset

[0098] In terms of overall performance, this model achieves state-of-the-art results in both the average Dice coefficient and Hausdorff distance, two key evaluation metrics. Specifically, in terms of the Dice coefficient, it improves by 9.11%p compared to the worst-performing method in the comparison model, and by 1.97%p compared to the current best-performing baseline method, indicating a higher overlap between the segmentation results and the ground truth annotations. In terms of the HD metric, which measures boundary localization accuracy, the model achieves a result of 12.68 mm, a reduction of 27.02 mm compared to the worst-performing method, and a reduction of 2.02 mm compared to the current best-performing method, demonstrating that the proposed structure can significantly improve boundary localization accuracy in medical image segmentation.

[0099] Further analysis of the segmentation results for each organ reveals that the model's segmentation accuracy is significantly superior to other comparative methods for smaller organs with indistinct boundaries, such as the pancreas and gallbladder, demonstrating a stronger ability to recognize small target structures. However, for larger organs with more regular structures and clearer boundaries, such as the liver and stomach, the model's performance is comparable to existing state-of-the-art methods. These experimental results demonstrate that the model can effectively improve its feature representation ability for complex structures and regions with blurred boundaries, thus achieving more stable and superior overall performance in medical image segmentation tasks.

[0100] Qualitative segmentation results of different segmentation methods on the Synapse multi-organ segmentation dataset, for example... Figure 5 As shown in the figure, compared with other contrast methods, the BMF-Med model exhibits more accurate segmentation results in organs with small volume and complex boundaries, such as the pancreas and gallbladder. Some contrast methods tend to have blurred boundaries or discontinuous segmentation in adjacent organ regions, while the BMF-Med model can better identify subtle structural differences between organs, generating more complete segmentation contours that are highly consistent with the real annotations.

[0101] The experimental results on the ACDC dataset are shown in Table 5. To verify the performance of the model in the dynamic cardiac structure segmentation task, the proposed BMF-Med model was compared with several current mainstream state-of-the-art methods. The experimental results show that the overall segmentation performance of the model on the ACDC dataset is significantly better than existing methods, achieving an overall Dice score of 92.21%. This represents a 7.71% improvement over the worst-performing method among the comparison models and a 1.67% improvement over the current best-performing method, demonstrating a significant performance advantage.

[0102] Table 5 Performance comparison on the ACDC dataset

[0103] In terms of specific structural segmentation results, the model achieved optimal or competitive results in the three key structures: right ventricle (RV), left ventricle (LV), and myocardium (MYO). Specifically, the Dice scores for RV reached 91.29%, LV 95.89%, and MYO 89.47%, all superior to the segmentation performance of the comparison methods. These results demonstrate that the model can effectively improve the recognition accuracy and segmentation stability of structural regions when dealing with cardiac structures with complex morphological changes and significant motion characteristics.

[0104] The comprehensive experimental results show that the proposed model has achieved the current state-of-the-art performance on the ACDC dataset, indicating that the method has strong feature representation and structural modeling capabilities in complex medical image segmentation tasks, thus providing more accurate and reliable segmentation results for cardiac function assessment and clinical auxiliary diagnosis.

[0105] Qualitative segmentation results of different segmentation methods in the ACDC cardiac MRI dataset, for example... Figure 6 As shown, compared to the comparative method, which is prone to irregular boundaries or local breaks in the right ventricular endocardial boundary and the outer layer of myocardium, the BMF-Med model can maintain better boundary continuity and structural consistency, resulting in smoother and more accurate segmentation of cardiac anatomy.

[0106] The experimental results on the BUSI breast ultrasound image dataset are shown in Table 6. To verify the performance of the model in breast tumor segmentation, the proposed BMF-Med model was compared with several mainstream segmentation methods. The experimental results show that the model outperforms the comparison methods on the BUSI dataset, achieving outstanding results on multiple evaluation metrics.

[0107] Table 6 Performance comparison on the BUSI dataset

[0108] In terms of core segmentation metrics, the model achieved a Dice coefficient of 81.49% and an IoU of 74.61%, indicating a high degree of overlap between the segmented regions and the ground truth annotations, and effectively maintaining the structural integrity of the target regions. Simultaneously, the recall rate reached 89.73%, significantly outperforming the comparison methods, demonstrating the method's strong ability to identify lesion regions and effectively reducing false negatives. While maintaining a high recall rate, the model also achieved a precision of 81.32%, demonstrating good predictive reliability and effectively controlling the false positive rate. Furthermore, the overall accuracy of the model reached 97.34%, further illustrating the high stability and accuracy of this method in breast ultrasound image segmentation tasks.

[0109] The comprehensive experimental results show that the performance advantage of the model on the BUSI dataset is mainly due to the proposed edge enhancement and multi-scale feature modeling mechanism. This mechanism can effectively enhance the expression of boundary information of lesion areas and improve robustness to complex background noise, thereby achieving more accurate lesion area localization and boundary segmentation in breast ultrasound images.

[0110] Qualitative segmentation results of different segmentation methods in the BUSI breast ultrasound dataset, for example... Figure 7 As shown, the BMF-Med model can more accurately locate tumor regions in the face of common noise interference and blurred boundaries in breast ultrasound images. The segmentation results generated are superior to other methods in terms of boundary accuracy and region integrity.

[0111] The experimental results on the ISIC-2018 skin lesion segmentation dataset are shown in Table 7. To verify the performance of the proposed method in complex skin lesion segmentation tasks, the proposed BMF-Med model was compared with several state-of-the-art segmentation methods. The results show that the overall performance of the proposed method on this dataset is significantly better than the comparative methods, achieving optimal or competitive results on multiple evaluation metrics.

[0112] Table 7 Performance comparison on the ISIC-2018 dataset

[0113] In terms of core segmentation metrics, the proposed method achieves a Dice coefficient of 90.59% and an IoU of 85.12%, indicating a high degree of overlap between the predicted segmented region and the actual lesion region, enabling more accurate lesion region segmentation. Regarding recall, the proposed method achieves 93.75%, significantly improving the ability to identify actual lesion pixels and effectively reducing the risk of missed diagnoses in clinical applications. Simultaneously, the model achieves a precision of 90.70%, indicating high reliability of its prediction results and reducing the possibility of misclassifying normal skin as lesion regions. Furthermore, the overall accuracy of the model reaches 96.71%, further validating the stability and accuracy of the proposed method in skin lesion segmentation tasks.

[0114] The comprehensive experimental results show that the performance advantage of the method of this invention on the ISIC-2018 dataset is mainly due to the proposed multi-scale edge enhancement feature extraction and hybrid attention modeling mechanism. This mechanism can effectively enhance the expression of boundary information of lesion areas and improve the perception of complex texture changes, so as to achieve more accurate and stable segmentation results even in complex scenarios such as blurred boundaries and irregular shapes of skin lesions.

[0115] Qualitative segmentation results of different segmentation methods in the ISIC-2018 skin lesion dataset, for example... Figure 8 As shown in the image, the red portion represents the model's prediction, and the blue portion represents the ground truth mask. For lesion areas with complex color and texture variations, the BMF-Med model can effectively distinguish lesion areas from normal skin tissue, avoiding oversegmentation or undersegmentation, and maintaining the overall consistency of lesion morphology.

[0116] The experimental results on the CVC-ClinicDB colonoscopy image dataset are shown in Table 8. To verify the performance of the proposed method in the digestive tract polyp segmentation task, the proposed BMF-Med model was compared with several mainstream segmentation methods. The experimental results show that the overall performance of the proposed method on this dataset is significantly better than existing methods, achieving leading results on multiple evaluation metrics.

[0117] Table 8 Performance Comparison on the CVC-ClinicDB Dataset

[0118] In terms of core segmentation metrics, the method of this invention achieved a Dice coefficient of 92.38% and an IoU of 90.42%, indicating a higher overlap between the predicted polyp region and the actual annotation, enabling more accurate characterization of the polyp's boundary contour. Regarding recall, the method achieved 96.47%, demonstrating a significantly enhanced ability to identify small or irregularly shaped polyps, effectively reducing the risk of missed detections during clinical examinations. Simultaneously, the model achieved a precision of 95.40%, exhibiting high predictive accuracy and effectively distinguishing real polyps from interfering structures such as intestinal mucosal folds. Furthermore, the overall accuracy of the model reached 99.36%, further validating the stability and reliability of the method in complex colonoscopy image environments.

[0119] The comprehensive experimental results show that the excellent performance of the method of this invention on the CVC-ClinicDB dataset is mainly due to the proposed multi-scale feature modeling and edge enhancement mechanism. This mechanism can effectively model the features of polyps of different sizes and shapes by dynamically adjusting the receptive field range, thereby improving the lesion recognition ability and boundary localization accuracy of the model under complex background conditions.

[0120] Qualitative segmentation results of different segmentation methods on the CVC-ClinicDB colonoscopy dataset, for example... Figure 9 As shown, the BMF-Med model can accurately identify polyp regions of different shapes, and can still generate clear and complete segmentation boundaries even in complex cases where the polyp and the surrounding mucosa are similar in color.

Claims

1. A medical image segmentation method based on a boundary-aware multi-scale fusion network, characterized in that, Includes the following steps: S1. Obtain existing medical image data to obtain a medical image dataset; S2. Segment and label the medical image dataset to obtain the training dataset; S3. Construct an initial boundary-aware multi-scale fusion network model; S4. Introduce joint loss for boundary differences, and train the initial boundary-aware multi-scale fusion network model based on the training dataset to obtain the boundary-aware multi-scale fusion network model. S5. Perform practical medical image segmentation based on a boundary-aware multi-scale fusion network model.

2. The medical image segmentation method based on boundary-aware multi-scale fusion network according to claim 1, characterized in that, In step S3, the initial boundary-aware multi-scale fusion network model includes an encoder part, a decoder part, a Bottleneck layer, a linear projection output layer, and a skip connection part. The encoder section comprises a patch embedding module, a first hybrid parallel perceptual Transformer module, a first patch merging layer, a second hybrid parallel perceptual Transformer module, and a second patch merging layer, connected in sequence; the input to the encoder section is a vector with spatial dimensions. and the number of channels is Input image The encoder part uses a patch embedding module to divide the input image into 4×4 feature blocks; then the feature blocks are processed sequentially through the first hybrid parallel perceptual Transformer module, the first Patch Merging layer, the second hybrid parallel perceptual Transformer module, and the second Patch Merging layer. The hybrid parallel perceptual Transformer module performs global modeling and feature extraction, while the Patch Merging layer reduces the size of the input feature map by half to reduce the spatial dimension, while doubling the channel dimension. The skip connection section includes a first multi-scale edge enhancement feature extraction module and a second multi-scale edge enhancement feature extraction module. The input of the first multi-scale edge enhancement feature extraction module is connected to the output of the first hybrid parallel perception Transformer module and the second feature reconstruction upsampling module, respectively. The result processed by the first multi-scale edge enhancement feature extraction module is added to the output of the second feature reconstruction upsampling module and then output to the fourth hybrid parallel perception Transformer module. The input of the second multi-scale edge enhancement feature extraction module is connected to the output of the second hybrid parallel perception Transformer module and the first feature reconstruction upsampling module, respectively. The result processed by the second multi-scale edge enhancement feature extraction module is added to the output of the first feature reconstruction upsampling module and then output to the third hybrid parallel perception Transformer module. The multi-scale edge enhancement feature extraction module extracts and fuses multi-scale contextual information and edge enhancement features from the encoder layer and decoder layer, explicitly strengthening the boundary perception capability during the skip connection process, and effectively integrating features at different levels with the help of an adaptive gating mechanism, thereby significantly improving the modeling capability for complex structures and fuzzy boundaries while transmitting semantic information. The decoder section includes a first feature reconstruction upsampling module, a third hybrid parallel perceptual Transformer module, a second feature reconstruction upsampling module, a fourth hybrid parallel perceptual Transformer module, and a third feature reconstruction upsampling module connected in sequence. The input of the decoder section first passes through the first feature reconstruction upsampling module to restore spatial resolution and enhance feature representation. The result, together with the output of the second hybrid parallel perceptual Transformer module, is input into the second multi-scale edge enhancement feature extraction module to extract and fuse features. The output of the second multi-scale edge enhancement feature extraction module is added to the output of the first feature reconstruction upsampling module and used as the input of the third hybrid parallel perceptual Transformer module. The third hybrid parallel perceptual Transformer module performs enhanced image feature extraction on the input features, and the result is input into the second feature reconstruction upsampling module. The output of the second feature reconstruction upsampling module and the output of the first hybrid parallel perceptual Transformer module are input together into the first multi-scale edge enhancement feature extraction module to extract and fuse features. The output of the first multi-scale edge enhancement feature extraction module is added to the output of the second feature reconstruction upsampling module and used as the input of the fourth hybrid parallel perceptual Transformer module; the fourth hybrid parallel perceptual Transformer module performs enhanced image feature extraction on the input features, and the result is input into the third feature reconstruction upsampling module; The output of the third feature reconstruction upsampling module is the output of the decoder part, and is finally input into the linear projection output layer; The Bottleneck layer includes a fifth hybrid parallel sensing Transformer module and a sixth hybrid parallel sensing Transformer module connected in sequence.

3. The medical image segmentation method based on boundary-aware multi-scale fusion network according to claim 2, characterized in that, The first to sixth hybrid parallel perception Transformer modules have the same structure, including a spatial attention branch, a channel attention branch, and an MLP module. The input features of the hybrid parallel perception Transformer module are respectively input into the spatial attention branch and the channel attention branch for processing. The output results are weighted and fused, and then residually connected with the input features of the hybrid parallel perception Transformer module. The result of the residual connection is input into the MLP module for processing, and the result is added to the result of the residual connection as the output of the hybrid parallel perception Transformer module. The spatial attention branch adopts the Efficient Attention mechanism, which is as follows: First, the input features are normalized layer by layer, the key and value matrices are multiplied, and a set of finite global context vectors that are independent of the input size are aggregated; then, the query matrix is ​​aggregated with these context vectors to generate an output for each pixel position; finally, spatial position priors are injected through position embedding convolution, and the local receptive field is expanded by combining side depth separable convolution to obtain the final output. The spatial attention branch is represented by the following formula: ; ;in, This indicates that the Efficient Attention mechanism is used for processing. Represents the Efficient Attention operator; x is the input feature of the hybrid parallel perceptual Transformer module; For input spatial attention queries; The key for input spatial attention; The input spatial attention value is Value; Indicates spatial attention branch; Position-based embedding convolution; For side-depth separable convolution; The channel attention branch is based on the Cross-Covariance Attention mechanism. Specifically, the input features are first normalized layer by layer, and the cross-covariance matrix of key K and query Q is calculated to describe the global correlation between different channel features, thereby constructing a channel attention map. Then, the value V is weighted and integrated using the channel attention map to achieve dynamic recalibration of the channel features.

4. The medical image segmentation method based on boundary-aware multi-scale fusion network according to claim 2, characterized in that, The processing of the hybrid parallel perceptual Transformer module includes the following steps: The input features of the hybrid parallel perceptual Transformer module are processed by both spatial attention and channel attention branches, with the spatial attention branch represented by the following formula: ; ;in, This indicates that the Efficient Attention mechanism is used for processing. Represents the Efficient Attention operator; x is the input feature of the hybrid parallel perceptual Transformer module; Input a query for spatial attention; The key for input spatial attention; The input spatial attention value is Value; Indicates spatial attention branch; Position-based embedding convolution; For side-depth separable convolutions; the channel attention branch is represented by the following formula: ;in, Input channel attention query; The key for input channel attention; Value is the input channel attention value. Indicates the channel attention branch, This represents the Cross-Covariance Attention operator; The results of the spatial attention branch and the channel attention branch are weighted and fused, and then residually connected with the input features of the hybrid parallel perceptual Transformer module, expressed by the following formula: ;in, The features are obtained by weighted fusion of the two branches and the input residual; This indicates the first fusion weight to be learned; This indicates the second fusion weight to be learned; The results of the residual join are input into the MLP module for processing, and are expressed using the following formula: ;in, For a hybrid feedforward network, For fully connected layers, For depthwise separable convolution and For activation functions; The result obtained from the MLP module is then added to the result of the residual connection, and this is used as the output of the hybrid parallel perceptual Transformer module, expressed by the following formula: .

5. The medical image segmentation method based on boundary-aware multi-scale fusion network according to claim 2, characterized in that, The first multi-scale edge enhancement feature extraction module has the same structure as the second multi-scale edge enhancement feature extraction module, including a global edge awareness attention module, a multi-scale context feature extraction module, and a multi-scale adaptive gating selection module. The global edge-aware attention module takes the feature sequence output by the decoder as input, extracts and fuses information through two parallel paths, enhances the network's ability to perceive edge regions and global dependencies, and obtains edge detail features. Multi-scale contextual features are based on several parallel deep separable convolutional layers to obtain structural semantic information under different receptive fields, thus obtaining global contextual features; The multi-scale adaptive gating selection module dynamically weights and fuses edge detail features and global context features, thereby enhancing the semantic understanding of multi-scale anatomical structures while maintaining accurate boundary localization capabilities.

6. The medical image segmentation method based on a boundary-aware multi-scale fusion network according to claim 5, characterized in that, The global edge-aware attention module uses the feature sequence output by the decoder. As input, global average pooling and max pooling are performed in parallel. The Sobel operator is used to extract gradient features from the average pooling features. Then, the original edge mapping is converted into a spatial attention weight map through an edge enhancement convolutional network. The spatial attention weight map is multiplied element-wise with the average pooling features. The result is concatenated with the max pooling features and then projected into a convolutional network. Finally, the spatial attention weights are generated through the Sigmoid activation function, and the edge detail features are output. The multi-scale context feature extraction module uses three parallel depthwise separable convolutional layers to process the input feature map. The depthwise separable convolution consists of depthwise convolution and pointwise convolution. The depthwise convolution uses the number of groups equal to the number of input channels, and then the pointwise convolution is used to adjust the channels to generate three feature maps with different receptive fields. Then, these three feature maps are concatenated in the channel dimension. The concatenated result is processed by 1×1 convolution and batch normalization before being input into the edge enhancement convolutional network. The result of the edge enhancement convolutional network is matrix multiplied with the input of the edge enhancement convolutional network. The result is processed by 1×1 convolution and batch normalization, and finally the global context features are obtained by the sigmoid activation function. The multi-scale adaptive gating selection module adds and fuses edge detail features and global context features. Then, it uses a 1×1 convolution and a softmax function to map the fused features into two selection weights, A and B, which correspond to the weight coefficients of the edge detail features and global context features, respectively. The obtained selection weights are used to adjust the input edge detail features and global context features, and residual connections are combined to preserve the original feature information, thereby obtaining the enhanced edge detail features and global context features. The enhanced edge detail features are gated using the Sigmoid function to generate a gated signal, which is used to modulate the global context features. At the same time, the enhanced global context features are also gated using the same operation to inversely modulate the edge detail features. The bidirectionally modulated edge detail features and global context features are then multiplied element-wise and linearly transformed to obtain the deeply fused interactive features.

7. The medical image segmentation method based on a boundary-aware multi-scale fusion network according to claim 2, characterized in that, The first to third feature reconstruction upsampling modules have the same structure, specifically: channel expansion is performed on the input features to obtain an enhanced feature representation; the enhanced feature representation is then processed by... The spatial size of the input feature map is doubled, and depthwise separable convolution is introduced to effectively reconstruct local spatial features. Finally, pointwise convolution is used to adjust the feature channels to half the number of channels in the input feature map to obtain the final fused features.

8. The medical image segmentation method based on a boundary-aware multi-scale fusion network according to claim 7, characterized in that, The feature reconstruction upsampling module is represented by the following formula: ; ; ;in, Indicates batch normalization; This represents a linear transformation operation. This represents depthwise separable convolution. This indicates that ReLU is activated. This represents pointwise convolution; x represents the input feature. This represents the enhanced feature representation; Represents local spatial features; Indicates the final fusion features; This is an upsampling operation.

9. The medical image segmentation method based on boundary-aware multi-scale fusion network according to claim 1, characterized in that, In step S4, the joint loss of boundary differences Express it using the following formula: Where G represents the true label and P represents the predicted result; To adaptively adjust parameters; By adaptively adjusting parameters according to the target size The value of allows the weights of the boundary region to be dynamically adjusted as the target scale changes. When the target is small, the boundary information occupies a more important proportion in the overall structure, and a larger weight can enhance the model's learning of boundary details. When the target is large, the boundary weights are appropriately reduced to avoid over-focusing on local noise.

Citation Information

Patent Citations

  • Transform-CNN medical image segmentation method and system based on multi-scale fusion semantic enhancement

    CN120318256A

  • Medical image fuzzy boundary segmentation method based on edge perception Mama network

    CN120747143A

  • TransUNet-based medical image segmentation method

    CN121190758A

  • Efficient medical image segmentation method considering global modeling and local enhancement

    CN121213590A

  • Medical image segmentation method based on AFMHiFormer

    CN121415077A