A medical image segmentation method, system, and device based on multi-attention and multi-scale fusion
By employing the multi-attention and multi-scale fusion method of the MAMF-Net model, the problem of insufficient fusion between global semantics and local details in medical image segmentation is solved, achieving higher segmentation accuracy and robustness, and improving the ability to identify the boundary and semantic location of lesion regions.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING UNIV OF CIVIL ENG & ARCHITECTURE
- Filing Date
- 2026-03-11
- Publication Date
- 2026-05-26
AI Technical Summary
Existing medical image segmentation methods are insufficient in terms of global semantics and local detail fusion, and have difficulty effectively capturing fine-grained features of the Transformer. In particular, there is still room for optimization in the extraction and fusion of discriminative features in medical images.
We adopt the MAMF-Net model based on multi-attention and multi-scale fusion. By combining hybrid convolution and Transformer architecture, adaptive dilated convolution, dual-channel attention gating and multi-scale global channel feature enhancement methods, we enhance feature extraction and fusion, and achieve cross-layer semantic alignment and information compensation.
It significantly improves the accuracy and robustness of medical image segmentation, enhances the recognition accuracy of lesion region boundaries and semantic locations, optimizes global context awareness, and improves the model's generalization performance.
Smart Images

Figure CN121810693B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image segmentation technology, and in particular to a medical image segmentation method, system and device based on multi-attention and multi-scale fusion. Background Technology
[0002] With the help of medical imaging technology, doctors can now understand patients' conditions more clearly and intuitively, leading to more accurate diagnoses. Tumor segmentation is particularly crucial in surgical planning, as it helps to accurately detect tumor boundaries and guide surgical procedures. However, medical images often suffer from low resolution, similar tissue structures, and uneven distribution of foreground and background, posing significant challenges to clinical diagnosis. Currently, artificial intelligence is widely used in the medical field, and combining deep learning with medical image segmentation technology has become an important tool for achieving accurate case interpretation.
[0003] In medical image segmentation tasks, the widely used U-Net introduces long skip connections between each layer of its symmetrical U-shaped encoder and decoder structure to mitigate the spatial information loss caused by downsampling. Despite the advantages of skip connections, U-Net still faces challenges in global multi-scale context modeling and addressing the semantic gap. Many researchers have improved upon the U-Net architecture to obtain more discriminative features. For example, U-Net++ uses its nested structure and dense skip connections to acquire discriminative features; Attention U-Net and Channel U-Net combine different types of attention mechanisms to enhance discriminative features, thereby optimizing the important information extracted by the encoder and decoder.
[0004] Since the introduction of the Transformer, thanks to its powerful context extraction capabilities, Trans UNet and TransAtt UNet have been found to effectively enhance the global semantic information of lesion location and shape through their global context modeling capabilities, thereby strengthening discriminative semantic features. DS-Trans UNet directly uses the Swing Transformer for information fusion, but neglects the semantic gap between spatial and semantic information. These methods still struggle to capture the Transformer's limitations in handling fine-grained features, especially in medical images, where there is still room for optimization in discriminative feature extraction and fusion.
[0005] Due to the varying sizes and shapes of lesions in medical images, uneven distribution of foreground and background, blurred boundaries, and semantic gaps, extracting discriminative lesion features during the encoding stage and achieving efficient feature fusion during the decoding stage remains an unsolved problem. Summary of the Invention
[0006] The purpose of this application is to provide a medical image segmentation method, system, and device based on multi-attention and multi-scale fusion, which solves the problem of insufficient fusion of global semantics and local details in medical image segmentation.
[0007] To achieve the above objectives, this application provides the following solution.
[0008] Firstly, this application provides a medical image segmentation method based on multiple attention and multi-scale fusion, including:
[0009] A MAMF-Net model is constructed. The MAMF-Net model includes an encoder and a decoder with multiple skip connections. The encoder adopts a hybrid architecture of convolution and Transformer and integrates an adaptive dilated convolution method. The decoder integrates dual-channel attention gating and multi-scale global channel feature enhancement methods to enhance the features transmitted by skip connections and combine them with the features extracted by the encoder to fuse and reconstruct the segmentation results.
[0010] Obtain a historical medical image sample set; wherein each historical medical image sample includes the historical medical image and the corresponding segmentation target annotation;
[0011] The MAMF-Net model is trained using the historical medical image sample set to obtain a medical image segmentation model;
[0012] Acquire any medical image to be identified, and input the medical image to be identified into the medical image segmentation model to determine the corresponding segmentation result.
[0013] Secondly, this application provides a medical image segmentation system based on multiple attention and multi-scale fusion, comprising:
[0014] The model building module is used to build the MAMF-Net model. The MAMF-Net model includes an encoder and a decoder with multiple skip connections. The encoder adopts a hybrid architecture of convolution and Transformer and integrates an adaptive dilated convolution method. The decoder integrates dual-channel attention gating and multi-scale global channel feature enhancement methods to enhance the features transmitted by skip connections and combine them with the features extracted by the encoder to fuse and reconstruct the segmentation results.
[0015] The sample acquisition module is used to acquire a historical medical image sample set; wherein each historical medical image sample includes the historical medical image and the corresponding segmentation target annotation;
[0016] The model training module is used to train the MAMF-Net model using the historical medical image sample set to obtain a medical image segmentation model;
[0017] The model application module is used to acquire any medical image to be identified and input the medical image to be identified into the medical image segmentation model to determine the corresponding segmentation result.
[0018] Thirdly, this application provides a computer device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement a medical image segmentation method based on multiple attention and multi-scale fusion.
[0019] According to the specific embodiments provided in this application, the following technical effects are disclosed: In the encoder section, this application employs a hybrid design of convolution and Transformer, integrating an Adaptive Dilated Convolution Feature Extraction (AADC) method to collaboratively model local details and global context. In the decoder section, it integrates Dual-Channel Attention Gating (LDCAG) and Multi-Scale Global Channel Feature Enhancement (MSGCA). The dual-channel attention gating architecture enhances the localization accuracy of edge structures through a coordinate attention mechanism, while the hierarchical feature fusion mechanism implemented by MSGCA achieves adaptive integration from local details to global semantics through cross-layer gating attention. This application significantly improves the model's accuracy in recognizing the boundaries and semantic locations of lesion regions while maintaining low computational complexity.
[0020] The MAMF-Net model protected in this application, through the synergistic effect of its components, not only effectively bridges the semantic gap between the encoder and decoder but also optimizes feature map quality, thereby improving image segmentation performance. Compared with traditional convolutional or pure Transformer structures, the MAMF-Net model possesses superior multi-scale feature representation capabilities and global context awareness, achieving higher accuracy and generalization performance in medical image segmentation tasks. Based on this, training and applying the MAMF-Net model can improve the segmentation accuracy and boundary preservation capabilities of medical image segmentation models on complex anatomical structures. Attached Figure Description
[0021] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0022] Figure 1This is a flowchart illustrating a medical image segmentation method based on multiple attention and multi-scale fusion in one embodiment of this application.
[0023] Figure 2 This is a schematic diagram of the MAMF-Net model in one embodiment of this application.
[0024] Figure 3 This is a framework diagram of an adaptive dilated convolution module in one embodiment of this application.
[0025] Figure 4 This is a framework diagram of the channel attention structure in one embodiment of this application.
[0026] Figure 5 This is a diagram of the Transformer layer framework in one embodiment of this application.
[0027] Figure 6 This is a framework diagram of a dual-channel attention gating module in one embodiment of this application.
[0028] Figure 7 This is a framework diagram of multi-scale global channel feature enhancement in one embodiment of this application.
[0029] Figure 8 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation
[0030] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0031] This application draws on the effectiveness of attention mechanisms in skip connections and embeds attention modules into each layer of skip paths to enhance the ability to capture key features during the decoding stage, thereby further improving the accuracy and robustness of medical image segmentation results.
[0032] Significant progress has been made in the fusion of Transformer and CNN in the field of medical image segmentation. This application proposes a lightweight attention module and a multi-level attention fusion module, which are integrated into the TransUNet architecture. This improved structure, while maintaining low computational complexity, can more effectively capture long-range dependencies and fine-grained features, achieving synergistic enhancement of global semantic modeling and local spatial information, thereby achieving higher accuracy and robustness in complex medical image segmentation tasks.
[0033] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0034] In one exemplary embodiment, such as Figure 1 As shown, a medical image segmentation method based on multi-attention and multi-scale fusion is provided. This method is executed by a computer device, specifically by a computer device such as a terminal or server alone, or by a terminal and server together. In the embodiments of this application, it includes the following steps 101 to 104.
[0035] Step 101, construct the MAMF-Net model; as follows Figure 2 As shown, the MAMF-Net model includes an encoder and a decoder with multiple skip connections. The encoder adopts a hybrid architecture of convolution and Transformer, combining the local feature extraction capability of CNN with the global modeling capability of Transformer, and integrates an adaptive dilated convolution method to enhance the ability to capture context. The decoder integrates dual-channel attention gating and multi-scale global channel feature enhancement methods to enhance the features transmitted by skip connections, and combines them with the features extracted by the encoder to fuse and reconstruct the segmentation results. The decoder can be divided into two parts. One part introduces a multi-layer adaptive skip fusion mechanism, which can aggregate multi-scale features from different coding layers to achieve cross-layer semantic alignment and information compensation. For example, in the early stage of decoding, LDCAG is used, followed by MSGCA, to weight and reconstruct multi-channel, multi-scale features, enabling the model to focus on key semantic features. The other part restores spatial resolution through progressive upsampling, while fusing contextual information from different levels to achieve refined segmentation and reconstruction.
[0036] The encoder comprises multiple convolutional downsampling modules, adaptive dilated convolution modules, and Transformer modules arranged sequentially. Specifically, the encoder adopts a hybrid architecture combining convolution and Transformer, aiming to fully combine the sensitivity of convolutional neural networks to local spatial features with the modeling ability of Transformer to global contextual relationships, in order to better adapt to the collaborative learning of fine-grained and semantic hierarchical information in complex medical images.
[0037] In complex medical images, lesion regions often exhibit high morphological diversity and spatial inhomogeneity, posing a challenge to models capturing key contextual features. To address this issue, this application proposes an adaptive dilated convolution feature extraction method. The adaptive dilated convolution module (AADC) adaptively adjusts the receptive fields of three parallel convolutional branches using a learnable dilation rate parameter and recalibrates the feature channels using a channel attention mechanism. This allows for the dynamic capture of multi-scale contextual dependency information, including local details, intermediate ranges, and long distances, while maintaining computational efficiency. The resulting multi-scale contextual dependency features are then fed into the Transformer module.
[0038] like Figure 3 As shown, the adaptive dilated convolution module includes a first channel attention unit, three convolutional branches, and a convolutional unit; the input of the first channel attention unit is used to receive the first feature map (corresponding to...). Figure 3 The first channel attention unit is connected to the input of three convolutional branches (iuput, which serves as the input feature map). The output of the first channel attention unit is connected to the input of the three convolutional branches. The three convolutional branches are used to perform parallel convolution processing (Conv) according to different adaptive dilation rates. The outputs of the three convolutional branches are connected to the input of the convolutional unit after element-wise addition. The output of the convolutional unit is connected to the Transformer module.
[0039] The forward propagation mathematical expression for the adaptive dilated convolution module is:
[0040] .
[0041] in, For the output features of adaptive dilated convolution, For the input features of the adaptive dilated convolution module, For learnable bias, "Channel attention structure" refers to the first channel attention unit. Normalize the LayerNorm layer. () represents the dimensionality transformation operation that reshapes the feature tensor to a shape (B,C,H,W). RPReLU i The improved parameterized corrected linear unit used for the i-th branch introduces two learnable translation parameters, Conv, on top of the standard PReLU. i Refers to the first Convolution processing of each branch, For the first The adaptive expansion rate of each branch.
[0042] The channel attention structure of the first channel attention unit is as follows: Figure 4 As shown, CA employs dual-pooling feature extraction and shares MLP processing, and its calculation rules are as follows:
[0043] .
[0044] .
[0045] .
[0046] in, Compression ratio =16, For spatial location index. For the c-th channel, adaptive average pooling is used to average the values of all spatial locations for each channel, capturing the global statistical information of the channel. For the c-th channel, adaptive max pooling is used to capture the salient features of the channel by taking the maximum value at all spatial locations of each channel. The features are the pooled features after processing. To achieve channel dimensionality reduction, the ReLU function introduces nonlinearity. To achieve channel recovery, we first reduce dimensionality and then increase it, reducing the number of parameters while maintaining expressive power, learning the complex dependencies between channels, and capturing cross-channel interaction information.
[0047] Compared to traditional two-dimensional full attention mechanisms, the AADC used in this application decomposes two-dimensional attention into two one-dimensional operations, significantly reducing computational complexity. Furthermore, the AADC design introduces a dual-channel guidance mechanism, achieving synergistic optimization of spatial information and channel dependencies through feature interaction and weighted fusion between two axial features. This structure not only enhances the model's ability to perceive long-distance dependencies but also improves the robustness of feature representation for lesion regions at different scales. Each attention pathway is stabilized during training through normalization and residual connections. The final output features show significant improvements in semantic consistency and boundary clarity.
[0048] The Transformer module is used to extract and enhance some semantic features from the multi-scale context-dependent features using adaptive channel equalization, resulting in an enhanced feature map which is then sent to the upsampling fusion module. The Transformer module includes multiple transformer units arranged sequentially, corresponding to... Figure 5 There are n units in total; in practical applications, it also includes a linear projection layer and a hidden feature layer, and a total of twelve transformer units can be set.
[0049] like Figure 5As shown, each transformer unit includes a first normalized LayerNorm layer, an MSA multi-head self-attention mechanism layer, a second normalized LayerNorm layer, an MLP multilayer perceptron, and an adaptive channel balance (AdaptiveCB) layer.
[0050] The output of the first normalization layer is connected to the input of the MSA multi-head self-attention mechanism layer; the output of the MSA multi-head self-attention mechanism layer is then connected to the input of the first normalization layer, and subsequently to the input of the second normalization layer. The output of the second normalization layer is connected to the input of the MLP multilayer perceptron; the output of the MLP multilayer perceptron is connected to the input of the adaptive channel equalization layer; the output of the adaptive channel equalization layer is then connected to the upsampling fusion module, following a skip connection with the input of the second normalization layer.
[0051] To further enhance feature representation capabilities and optimize training stability, an adaptive channel equalization layer is introduced. This layer improves the balance of information flow between channels in a lightweight manner by performing weighted fusion between the original features and the global average features to achieve dynamic balance at the channel level. The calculation formula for the adaptive channel equalization layer is as follows:
[0052] .
[0053] Where α∈[0,1] is an adjustable coefficient used to control the fusion ratio of local features and global context. This operation can achieve dense information propagation between features without significantly increasing the computational cost, thereby improving the semantic consistency and feature discriminativeness of the model. X1 is the input feature of the adaptive channel equalization layer. To calculate the average value of X1 along the first dimension, while keeping the number of dimensions of the output tensor consistent with that of the input.
[0054] like Figure 2 As shown, a reshape module is also set between the encoder and decoder to adjust the shape of the features.
[0055] The core objective of the decoder is to accurately reconstruct the original image feature map by relying on the deep semantic features extracted by the encoder and combining them with the shallow detail features passed through skip connections, through a series of structured operations. The decoder includes multiple upsampling fusion modules, a dual-channel attention gating module, a multi-scale global channel feature enhancement module, and a convolutional partitioning module; the number of upsampling fusion modules is the same as the number of convolutional downsampling modules; between any pair of corresponding upsampling fusion modules and convolutional downsampling modules, one of the dual-channel attention gating modules or one of the multi-scale global channel feature enhancement modules is configured.
[0056] The upsampling fusion module receives the upsampled features obtained by progressively upsampling the enhanced feature map and fuses them with the corresponding edge structure and spatial localization enhancement features or the multi-scale semantic features. Specifically, the upsampling fusion module includes two components. The first component is a cascaded upsampling convolution, which serves as the core unit for resolution restoration. It iteratively enlarges the size of the input feature map, doubling the spatial resolution of the feature map with each upsampling convolution block. This provides a basis for subsequent feature fusion and the final output to match the scale of the original image, effectively compensating for the spatial detail information lost during encoder downsampling. The second component is feature fusion, which plays a crucial role in cross-layer feature integration. On one hand, it receives shallow encoder features (such as tissue edges, lesion textures, and other low-level spatial information) directly transmitted via skip connections. On the other hand, it connects to the deep semantic features of the decoder after upsampling. Through a designed fusion mechanism, the two types of features are efficiently integrated, making the deep semantic information and shallow detail information complementary, providing strong support for the decoder to accurately restore the spatial structure and category attributes of the target region.
[0057] Currently, skip connections in U-shaped structures often employ simple feature concatenation or element-wise addition to achieve cross-layer feature transfer, which exposes limitations in medical image segmentation, failing to fully leverage the core value of cross-layer feature complementarity. It was only with the introduction of attention mechanisms that skip connections were upgraded from "passive feature transfer" to an effective implementation of "active selection, semantic matching, and finally dynamic fusion." Traditional attention mechanisms often face problems such as high computational overhead and parameter redundancy during channel modeling. To maintain performance while reducing complexity, this application proposes a dual-channel attention gating architecture (LDCAG).
[0058] The Dual-Channel Attention Gating (LDCAG) module is used to generate edge structure and spatial localization enhancement features by combining channel attention and spatial gating mechanisms for low-level skip features. For example... Figure 6 As shown, the dual-channel attention gating module includes a max pooling unit, a first convolutional Conv unit, a second convolutional Conv unit, and a gating fusion unit (corresponding to...). Figure 6The GateFusion and the second channel attention CA unit.
[0059] The max-pooling unit is used to extract global channel statistical features from low-level skip features. The output of the max-pooling unit is connected to the inputs of the first convolutional unit and the second convolutional unit, respectively. The first and second convolutional units generate channel weights for the global channel statistical features in both height and width directions. Both convolutional units are lightweight 1×1 convolutions, and the channel weights generated in the height and width directions are represented as follows: , This highlights key semantic features, and then the attention from the two directions is spliced together.
[0060] The outputs of the first and second convolutional units are multiplied element-wise and then connected to the input of the gated fusion unit. The output of the gated fusion unit is connected to the input of the second channel attention unit. The output of the second channel attention unit is added element-wise to the output of the max pooling unit and then connected to the upsampling fusion module. The gated fusion unit is used to fuse channel features in two different directions, height and width, to dynamically suppress background noise and redundant channels, and obtain edge structure and spatial positioning enhancement features.
[0061] LDCAG introduces a gating structure that adaptively adjusts the information flow channels between the encoder and decoder feature maps, suppressing noise and redundant features. Unlike the attention gates in traditional Attention U-Net, LDCAG significantly reduces the number of parameters while offering more targeted feature selection capabilities. The introduction of residual paths further stabilizes gradient propagation, enabling the model to exhibit stronger interpretability and segmentation consistency in the multi-layer feature fusion stage.
[0062] In short, LDCAG achieves efficient information filtering and fusion among features at different levels by combining channel attention and spatial gating mechanisms. Its complete forward propagation expression is shown below:
[0063] .
[0064] Among them, To define the output characteristics of the dual-channel attention gating module, The input features for skip connections are also known as low-level skip features. is the gating signal; CA is the channel attention structure, corresponding to the second channel attention unit. The Sigmoid activation function is used in the formula to map the convolution output to the range [0,1] to generate attention weights. The fusion feature is calculated using the following formula: , , For convolution operations, this aligns the channels.
[0065] In medical image segmentation scenarios, lesion regions often exhibit significant multi-scale differences (e.g., coexistence of small lesions and large-area lesions, and scale heterogeneity in different parts of the same lesion), and the boundaries between some lesions and surrounding normal tissues are blurred (e.g., tumor infiltration areas, inflammatory edema zones). Traditional feature stitching and upsampling alone are insufficient to fully capture multi-scale contextual information and cannot specifically enhance the feature representation of blurred boundaries. This leads to uneven recognition capabilities of the model for lesions at different scales and insufficient segmentation accuracy for boundary regions. To address this core issue and further improve the multi-scale perception capability and context fusion effect of the decoder, this application designs a Multi-Scale Global Channel Feature Enhancement (MSGCA) method.
[0066] The Multi-Scale Global Channel Feature Enhancement (MSGCA) module is used to combine high-level skip features with upsampled features collected by the upsampling fusion module to achieve feature reconstruction from global semantics to pixel-level details, generating multi-scale semantic features; wherein, the number of skip connections corresponding to the low-level skip features and the high-level skip features is determined according to a preset ratio. Figure 2 In the middle, low-level hop features correspond to two hop connections, while high-level hop features correspond to one hop connection.
[0067] like Figure 7 As shown, the multi-scale global channel feature enhancement module includes a third convolutional unit, a fourth convolutional unit, a spatial-channel gating unit, and a cross-scale multi-head attention unit. The input of the third convolutional unit is used to receive high-level skip features. The output of the third convolutional unit is connected to the input of the cross-scale multi-head attention unit. The inputs of the fourth convolutional unit and the spatial-channel gating unit are used to receive upsampled features collected by the upsampling fusion module. The outputs of the fourth convolutional unit and the spatial-channel gating unit are connected to the input of the cross-scale multi-head attention unit after element-wise addition. The output of the cross-scale multi-head attention unit is connected to the upsampling fusion module.
[0068] The third convolutional unit is used to extract the contextual information of the high-level jump features under different receptive fields in parallel through multi-scale convolutional paths, so as to achieve feature capture from local to global, and to obtain the projected features by using adaptive channel projection; the fourth convolutional unit is used to perform depthwise separable convolution on the upsampled features; the spatial-channel gating unit is used to adaptively filter key features on the upsampled features; the cross-scale multi-head attention unit is used to integrate the received features by using an adaptive weighting strategy to enhance the discriminative expression of the lesion region and generate multi-scale semantic features.
[0069] Features at different levels have different numbers of channels and resolutions, requiring unification into the same embedding space for subsequent fusion. MSGCA extracts contextual information from different receptive fields through parallel multi-scale convolutional paths, with each branch using different kernel sizes (e.g., 3×3, 5×5, 7×7) to achieve feature capture from local to global perspectives. Adaptive channel projection is employed. Correspondingly, the mathematical expression for the third convolutional unit is as follows:
[0070] .
[0071] in, The features are projected and normalized. Input the number of channels. The number of embedded channels is the output. For the features of the i-th skip connection, , For batch statistics, and For learnable scaling and offset parameters, To prevent division by zero for smaller values. Although the projected features are channel-aligned, they lack spatial context modeling. Depthwise separable convolutions enhance the local receptive field while maintaining parameter efficiency. Correspondingly, the mathematical expression for the fourth convolutional unit is:
[0072] .
[0073] in, The input features are depthwise separable convolutions. The output features of the fourth convolutional unit, For activation function, Batch normalization is used to stabilize the feature distribution, making the network easier to train. It uses depthwise convolution, with each channel convolved independently. Although this increases the number of parameters, it provides a better understanding of the entire text.
[0074] Features from various scales are fused and then incorporated into a global contextual attention mechanism. This mechanism utilizes an adaptive weighting strategy to integrate multi-scale semantic features, thereby enhancing the discriminative representation of lesion regions. Furthermore, MSGCA employs channel-wise feature recalibration and feature normalization fusion during the fusion stage, significantly reducing information conflicts between different scales. This method can capture rich global contextual information while maintaining computational efficiency and effectively improves the problems of boundary ambiguity and missed detection of small targets, providing a more accurate semantic representation for subsequent decoder reconstruction.
[0075] The convolutional partitioning module is used to perform size restoration and segmentation prediction on the final features output by multiple upsampling and fusion modules to obtain the predicted segmentation result. Specifically, the convolutional partitioning module includes at least a segmentation head, which serves as the terminal output unit of the decoder. Its core function is to further map and restore the final feature map after upsampling and feature fusion processing to a size completely consistent with the original input image, ultimately generating a predicted feature map that can accurately represent the target segmentation region, laying a crucial foundation for the model to output the final segmentation result.
[0076] Step 102: Obtain a historical medical image sample set; wherein, each historical medical image sample includes a historical medical image and the corresponding segmentation target annotation, and the historical medical image can be a cardiac MRI image from the ACDC dataset and an abdominal CT image from the Synapse dataset.
[0077] Specifically, the ACDC dataset contains cardiac MRI sequence images of 100 heart disease patients, covering different pathological types such as healthy individuals, cardiomyopathy, myocardial infarction, and right ventricular dilatation. Each case provides annotations at two time points: end-diastolic and end-systolic, annotating three cardiac structures: the left ventricle, right ventricle, and myocardium. The Synapse dataset contains abdominal CT scan images of 30 subjects, annotating eight major abdominal organs (liver, spleen, pancreas, left and right kidneys, stomach, aorta, and inferior vena cava). The image size is 512×512 pixels, with a slice thickness of approximately 0.625 mm.
[0078] Step 103: Train the MAMF-Net model using the historical medical image sample set to obtain a medical image segmentation model. In a specific application, step 103 includes:
[0079] (1) The historical medical image sample set is input into the MAMF-Net model in a batch processing manner to obtain the prediction segmentation result for each historical medical image.
[0080] Specifically, the historical medical image sample set is divided into a training set, a validation set, and a test set. For example, in the ACDC dataset, 20 cases are selected from 100 cases as the test set, 10 as the validation set, and the remaining 70 as the training set. In the Synapse dataset, 6 cases are selected from 30 cases as the test set, 6 as the validation set, and the remaining 18 as the training set.
[0081] The medical images for each case were uniformly resized to 224×224 pixels and standardized. In particular, data augmentation techniques, including random rotation and flipping, and random angle rotation, were used for the training set to increase the diversity of the training data. The training set was fed into the model in batches, with each batch containing 24 images. If the number of slices from a case was insufficient for a batch, slices from the next case were used to supplement the batch.
[0082] When each batch of training data is input into the MAMF-Net network, it is first downsampled by the encoder to form feature layers of different sizes. Features from adjacent layers (low-resolution and high-resolution feature layers) are used to extract multi-scale receptive field features through adaptive dilated convolution, enhancing the ability to capture contextual information. A dual-channel attention gating architecture is used to selectively enhance low-level skip features, strengthening spatial localization and edge structure. Finally, a multi-scale global channel feature enhancement method is used for cross-layer semantic information fusion to improve global consistency. After downsampling, four feature maps of different sizes are obtained after multiple attention processing. These are then combined with the corresponding feature maps of the upsampling stage to achieve effective fusion of contextual information. After upsampling, the final model outputs a predicted segmentation result of the same size as the input image.
[0083] (2) Compare the predicted segmentation result with the corresponding segmentation target label, and calculate the value of the loss function; wherein the formula of the loss function is: ;in, The value of the loss function. For cross-entropy loss, This is a loss for Dice.
[0084] Cross-entropy loss prioritizes pixel-by-pixel classification accuracy and provides stable gradients; Dice loss focuses on region overlap and is naturally robust to class imbalance. This loss function balances the contributions of cross-entropy loss and Dice loss through equal-weighted addition, ensuring fair evaluation on the dataset.
[0085] (3) Based on the value of the loss function, the MAMF-Net model is optimized using the stochastic gradient descent algorithm, and a medical image segmentation model is obtained when the preset termination condition is met. Specifically, the MAMF-Net model is trained using the stochastic gradient descent algorithm, with an initial learning rate of 0.01, a momentum coefficient of 0.9, and a weight decay of 0.0001. In this application, the training set is trained for 30,000 iterations, using multinomial learning rate decay. During training, model checkpoints are saved every 500 iterations, and training loss and validation metrics are recorded.
[0086] Similarly, the test set data is input into the trained medical image segmentation model for segmentation prediction. Slice-by-slice inference is performed for each test case, and the predicted results are then compared with the ground truth image. The Dice similarity coefficient and Hausdorff distance are calculated as evaluation metrics to verify model performance. No loss function is calculated during testing, thus not affecting the already trained model parameters. Other comparative experiments follow similar steps, all involving encoder and decoder stages to obtain segmentation results.
[0087] Based on the aforementioned training, validation, and test sets, this application analyzes the performance of MAMF-Net compared to other classic methods. The model is tested and compared on the Synapse and ACDC datasets to verify its superiority. To further evaluate the contribution of each component of the framework, a series of ablation experiments were designed on the Synapse and ACDC datasets to analyze the effect of each design element in the model.
[0088] To evaluate the segmentation results of the proposed method, the Dice similarity coefficient (DSC) and Hausdorff distance (HD) were used as evaluation metrics.
[0089] .
[0090] .
[0091] Where M and N represent the point sets corresponding to the ground truth and the predicted results, respectively. The symbol h(M, N) represents the supremum of the minimum distance from all points in set M to set N, used to quantify the maximum deviation between the two point sets, and is calculated using the following formula: .
[0092] This application conducts experiments on the Synapse and ACDC datasets and compares them with several classic and state-of-the-art segmentation networks. All experiments are based on Python 3.10, PyTorch 2.0.0, and CUDA 11.8, and trained using an NVIDIA GeForce RTX 3060 GPU. Input images were uniformly resized to 224×224 pixels before training. Model parameters were initialized using a pre-trained "R50-ViT" model. In the model trained using the SGD optimizer, the weight decay coefficient was set to 0.0001, and the training was conducted for 100 epochs; momentum was set to 0.9, and the initial learning rate was 0.01. When using the datasets, a 3:1 ratio was adopted, with 75% as the training set and 25% as the test set to ensure sufficient training. The experimental results are shown in Tables 1 and 2.
[0093] Table 1. Comparison of MAMF-Net metrics on the Synapse dataset.
[0094]
[0095] The comprehensive evaluation results on the Synapse dataset, along with the corresponding visualization annotations, demonstrate that the MAMF-Net architecture exhibits the most competitive overall segmentation performance. Quantitative analysis shows that the model achieves an average Dice similarity coefficient (DSC) of 80.17%, which significantly outperforms traditional convolutional networks, including the classic U-Net (75.43%) and U-Net++ (76.13%). It also surpasses current mainstream Transformer-based hybrid architectures, such as the basic TransUNet (76.05%), Swin-UNet (76.04%), and improved versions including VA-TransUNet (78.21%), DA-TransUNet (78.33%), and EG-TransUNet (78.79%).
[0096] Furthermore, the model in this application demonstrates outstanding performance in several challenging organ segmentation tasks. In spleen segmentation, this application achieved a DSC score of 90.57%, which is 1.35 percentage points higher than the current best-performing comparison method MSF-Trans UNet (89.22%). This improvement validates the effectiveness of the multiple attention mechanism in complex soft tissue segmentation.
[0097] For stomach segmentation, this application achieved a DSC of 82.93%, a significant improvement (4.9%) compared to the second-best method, MSF-Trans UNet (78.03%), fully demonstrating the advantage of the proposed feature fusion strategy in handling the problem of blurred boundaries in hollow organs. In the highly challenging pancreas segmentation task, this application ranked first with a DSC of 61.21%, highlighting the model's enhanced ability to extract features from small-scale, low-contrast organs.
[0098] From the perspective of boundary segmentation accuracy, the model in this application maintains a good performance of 26.52 mm on the Hausdorff distance metric, which is on par with the best-performing Swin-UNet (26.49 mm) and DA-TransUNet (26.72 mm). This result confirms the effectiveness of the multi-scale feature fusion mechanism in preserving spatial details. Specifically, the Adaptive Dilated Convolution (AADC) method compensates for the spatial information loss during downsampling through multi-receptive field feature extraction, while the Dual-Channel Attention Gated Architecture (LDCAG) enhances the localization accuracy of edge structures through a coordinate attention mechanism. The synergistic effect of the two ensures a high degree of consistency between the segmentation boundary and the real anatomical structure. Furthermore, the balanced performance of the model on organs at different scales further verifies the rationality of its structural design. For large-scale organs such as the liver, the model achieved an excellent segmentation accuracy of 94.78%; for medium-scale organs such as the kidneys, the model maintained a competitive performance level (79.21% for the left kidney and 77.11% for the right kidney); and for small-scale organs such as the pancreas (61.21%) and the aorta (87.80%), the model demonstrated leading segmentation capabilities. This stable performance across scales is attributed to the hierarchical feature fusion mechanism implemented by MSGCA, which achieves adaptive integration from local details to global semantics through cross-layer gated attention.
[0099] Table 2 Comparison of MAMF-Net metrics on the ACDC dataset
[0100]
[0101] Experimental results on the ACDC cardiac MRI segmentation dataset demonstrate that MAMF-Net achieves a mean DSC of 91.09% and a Hausdorff distance of 1.28 mm, ranking best among all comparison methods. Particularly in the most challenging right ventricle segmentation task, our model significantly outperforms existing methods with a DSC of 90.12%, validating the powerful segmentation capability of the multi-attention mechanism for irregularly shaped structures. Furthermore, the excellent performance of our model in myocardial (87.88%) and left ventricle (96.49%) segmentation demonstrates the good adaptability of the multi-scale feature fusion mechanism across different cardiac structures. These results, together with the previous leading performance on the Synapse dataset, prove the strong generalization ability and clinical practical value of the proposed method.
[0102] To better verify the effectiveness of each design, this application conducted ablation experiments on the Synapse dataset and the ACDC dataset, respectively. The experimental results are shown in Tables 3 and 4.
[0103] Table 3 Comparison of ablation experiment results of MAMF-Net on the Synapse dataset
[0104]
[0105] Table 4 Comparison of ablation experiment results of MAMF-Net on the ACDC dataset
[0106]
[0107] As shown in Tables 3 and 4, MSGCA is proven to be the core driver of performance improvement. When tested on the Synapse dataset, when it was introduced alone into the baseline model (T+MSGCA), the model's average Dice similarity coefficient (DSC) significantly increased from 76.05% to 77.12%, an increase of 1.07 percentage points. This result demonstrates that jointly modeling high-level skip features and decoder semantics through a cross-layer gating attention mechanism can effectively enhance the global consistency of features, compensating for the inherent shortcomings of traditional U-shaped architectures in long-range dependency modeling. Specifically, at the organ level, MSGCA brought consistency improvements to several key structures, including the left kidney (+1.15%), right kidney (+3.43%), liver (+0.89%), and spleen (+1.73%), fully validating its powerful ability to integrate global contextual information.
[0108] Secondly, AADC and LDCAG demonstrated their refined enhancement effects at specific levels. AADC (T+AADC) primarily aims to compensate for feature loss during downsampling through multi-receptor field fusion. Experiments show that this method slightly improves the average DSC (76.23%) and effectively reduces the Hausdorff distance (HD), indicating that it helps generate smoother and more accurate boundaries. Its significant improvement of 2.22% in right kidney segmentation proves its excellent feature enhancement effect on organs with relatively fixed morphology and location. LDCAG (T+LDCAG) was designed to enhance spatial localization and edge structures. Although its improvement on average DSC is limited when introduced alone, and its global HD index increases slightly due to amplifying some spatial noise in the underlying features, it achieves considerable performance gains in aortic segmentation with obvious directional structures, highlighting the unique advantage of its dual-channel attention mechanism in capturing spatial dimensional information of linear anatomical structures such as blood vessels.
[0109] The fluctuating performance of individual design experiments on small organs such as the gallbladder and pancreas precisely illustrates the challenge of complex medical image segmentation tasks: a single improvement is insufficient to address all scenarios. AADC may introduce interference due to a mismatch between the receptive field setting and the scale of small targets; LDCAG may inadvertently weaken key signals when suppressing background noise due to the weak features of small targets.
[0110] Ultimately, the superior performance of the complete MAMF-Net architecture stems from the deep collaboration among its modules. The architecture design of this application forms a clear feature processing pipeline: in the encoder section, AADC and LDCAG in the skip connections work together to cleanse and enhance features from the dimensions of "contextual breadth" and "spatial precision," respectively, providing detailed and accurately localized feature representations for subsequent processing. At the decoder level, MSGCA is responsible for fusing and aligning global semantic information, guiding the final segmentation decision. This collaborative workflow, from local to global and from detail to semantics, enables the complete model to overcome the limitations of a single module, achieving significantly better performance than any single module combination on almost all organs, particularly achieving a leap in performance on complex structures such as the spleen (90.57%), stomach (82.93%), right atrium (90.12%), and myocardium (87.88%).
[0111] Step 104: Obtain any medical image to be identified and input the medical image to be identified into the medical image segmentation model to determine the corresponding segmentation result.
[0112] In summary, this application proposes a novel architecture, MAMF-Net. First, the encoder employs a CNN+Transformer approach to enhance the model's global and local feature fusion capabilities, and uses adaptive dilated convolution to aggregate different receptive field contexts, compensating for downsampling feature loss. Second, at the low-level skip connections in the decoder, a dual-channel attention gating architecture is used to strengthen spatial localization and edge structure, suppressing background noise. Finally, at the high-level decoder, a multi-scale global channel enhancement method is employed to jointly fuse multi-layer skip features with decoder semantics, improving global consistency and thus achieving feature reconstruction from global semantics to pixel-level details.
[0113] During training, any historical medical image from the training set is input into a multi-level feature re-extraction and aggregation neural network model to determine the segmented medical image. This model includes an encoder, a decoder, and multiple skip connections. Feature layers of different resolutions extracted by the encoder are passed to the decoder through the skip connections for fusion and reconstruction, determining the final segmentation result. Experiments on the Synapse and ACDC datasets show that MAMF-Net achieves excellent performance in the Synapse multi-organ segmentation task with an average Dice coefficient of 80.17% and a Hausdorff distance of 26.52 mm, and in the ACDC heart structure segmentation task with an average Dice coefficient of 91.09% and a Hausdorff distance of 1.28 mm. This application demonstrates significant improvements in boundary sharpness, small object recognition, and global consistency, validating the effectiveness of the proposed method in multi-scale feature fusion and semantic alignment.
[0114] Based on the same inventive concept, this application also provides a system. The solution provided by this system is similar to the solution described in the above method. Therefore, the specific limitations of one or more system embodiments provided below can be found in the limitations of the method above, and will not be repeated here.
[0115] In one exemplary embodiment, a medical image segmentation system based on multiple attention and multi-scale fusion is provided, comprising:
[0116] The model building module is used to build the MAMF-Net model. The MAMF-Net model includes an encoder and a decoder with multiple skip connections. The encoder adopts a hybrid architecture of convolution and Transformer and integrates an adaptive dilated convolution method. The decoder integrates dual-channel attention gating and multi-scale global channel feature enhancement methods to enhance the features transmitted by skip connections and combine them with the features extracted by the encoder to fuse and reconstruct the segmentation results.
[0117] The sample acquisition module is used to acquire a historical medical image sample set; wherein each historical medical image sample includes the historical medical image and the corresponding segmentation target annotation.
[0118] The model training module is used to train the MAMF-Net model using the historical medical image sample set to obtain a medical image segmentation model.
[0119] The model application module is used to acquire any medical image to be identified and input the medical image to be identified into the medical image segmentation model to determine the corresponding segmentation result.
[0120] This application proposes a multi-scale feature fusion medical image segmentation architecture, called MAMF-Net, incorporating multiple attention mechanisms, to address the insufficient fusion of global semantics and local details in medical image segmentation. First, in the encoder stage, a convolutional and Transformer structure is combined, utilizing adaptive channel equalization to extract and enhance key semantic features. This improves feature discriminative power while reducing parameter count and computational overhead. An adaptive dilated convolution method enhances low-level spatial features and suppresses noise. The output multi-layer features are progressively passed to the decoder for semantic reconstruction. Then, in the decoder stage, the model achieves multi-scale feature fusion through an efficient attention module. A dual-channel attention gating architecture is used at low-level skip connections to enhance local structural representation through coordinate attention mechanisms. Finally, a multi-scale global channel feature enhancement method is used for feature reweighting, achieving adaptive fusion of cross-layer semantic information. The network employs a multi-level residual connection structure, effectively mitigating the gradient vanishing problem and improving architectural stability. By fusing the local sensitivity of convolution with the global modeling capability of the Transformer, the entire framework significantly improves the model's accuracy in recognizing lesion region boundaries and semantic locations while maintaining low computational complexity. Compared with traditional convolutional or pure Transformer structures, MAMF-Net has better multi-scale feature representation capabilities and global context awareness capabilities, achieving higher accuracy and generalization performance in medical image segmentation tasks.
[0121] Compared with the prior art, this application has the following advantages:
[0122] (1) An adaptive dilated convolution-based feature extraction method was used. Multi-scale receptive field features were extracted in parallel by a learnable dilation rate. Combined with channel attention dynamic weighted fusion, information loss was compensated before the encoder transformer layer to enhance organ boundary discrimination ability.
[0123] (2) A dual-channel attention gating architecture is proposed: the low-level skip features are selectively enhanced through the channel attention mechanism, the inter-channel dependencies are captured by global average pooling, background noise and redundant channels are dynamically suppressed, and edge structures and spatial localization information related to the segmentation task are highlighted, providing clean detailed features for subsequent decoding fusion.
[0124] (3) Propose a multi-scale global channel feature enhancement method: process multiple high-level jump features simultaneously through cross-layer joint modeling, use multi-head cross attention to fuse encoder semantics and decoder context, combine spatial-channel dual gating to adaptively filter key features, and improve the global consistency of high-level features and small target recognition ability by dynamically balancing original details and enhanced semantics through learnable residual weights.
[0125] This application improves the segmentation accuracy and boundary preservation capability of medical image segmentation models on complex anatomical structures by introducing a multi-attention and multi-scale feature fusion mechanism. To achieve the above objectives, this application uses the MAMF-Net architecture. In the encoder part, a hybrid design of CNN and Transformer is adopted, integrating an adaptive dilated convolution feature extraction method to collaboratively model local details and global context. In the decoder part, dual-channel attention gating and multi-scale global channel feature enhancement methods are integrated, aiming to systematically solve problems such as downsampling feature loss, spatial localization ambiguity, and cross-layer semantic inconsistency.
[0126] Experimental results on the Synapse multi-organ CT dataset and the ACDC cardiac MRI dataset demonstrate that, thanks to its multi-attention-guided multi-scale feature fusion mechanism, MAMF-Net significantly outperforms existing mainstream methods in overall segmentation accuracy (DSC), especially exhibiting superior boundary integrity in complex structures such as the spleen, stomach, and right ventricle. This architecture, through the synergistic effect of its components, not only effectively bridges the semantic gap between the encoder and decoder but also optimizes feature map quality, thereby improving image segmentation performance.
[0127] In one exemplary embodiment, a computer device is provided, which may be a server or a terminal, and its internal structure diagram may be as follows. Figure 8As shown, this computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and databases. The internal memory provides the environment for the operating system and computer programs stored in the non-volatile storage media. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When the computer program is executed by the processor, it implements a medical image segmentation method based on multiple attention and multi-scale fusion.
[0128] Those skilled in the art will understand that Figure 8 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0129] In one exemplary embodiment, a computer device is also provided, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps in the above-described method embodiments.
[0130] In one exemplary embodiment, a computer-readable storage medium is provided storing a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.
[0131] In one exemplary embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.
[0132] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.
[0133] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM).
[0134] The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0135] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0136] This document uses specific examples to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. Furthermore, those skilled in the art will recognize that, based on the ideas of this application, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A medical image segmentation method based on multiple attention and multi-scale fusion, characterized in that, The method includes: A MAMF-Net model is constructed. The MAMF-Net model includes an encoder and a decoder with multiple skip connections. The encoder adopts a hybrid architecture of convolution and Transformer and integrates an adaptive dilated convolution method. The decoder integrates dual-channel attention gating and multi-scale global channel feature enhancement methods to enhance the features transmitted by skip connections and combine them with the features extracted by the encoder to fuse and reconstruct the segmentation results. Obtain a historical medical image sample set; wherein each historical medical image sample includes the historical medical image and the corresponding segmentation target annotation; The MAMF-Net model is trained using the historical medical image sample set to obtain a medical image segmentation model; Acquire any medical image to be identified, and input the medical image to be identified into the medical image segmentation model to determine the corresponding segmentation result; The encoder includes multiple convolutional downsampling modules, adaptive dilated convolution modules, and a Transformer module arranged sequentially. The decoder includes multiple upsampling fusion modules, a dual-channel attention gating module, a multi-scale global channel feature enhancement module, and a convolution partitioning module; the number of upsampling fusion modules is the same as the number of convolution downsampling modules; between any pair of corresponding upsampling fusion modules and convolution downsampling modules, there is either a dual-channel attention gating module or a multi-scale global channel feature enhancement module; The adaptive dilated convolution module is used to adaptively adjust the receptive fields of the three parallel convolution branches through a learnable dilation rate parameter on the first feature map output by multiple convolution downsampling modules, and to recalibrate the feature channels using a channel attention mechanism to obtain multi-scale context-dependent features and send them to the Transformer module. The Transformer module is used to extract and enhance some semantic features from the multi-scale context-dependent features using adaptive channel equalization, and then send the enhanced feature map to the upsampling fusion module. The dual-channel attention gating module is used to generate edge structure and spatial positioning enhancement features for low-level jump features by combining channel attention and spatial gating mechanisms. The multi-scale global channel feature enhancement module is used to combine high-level jump features with upsampled features collected by the upsampling fusion module to achieve feature reconstruction from global semantics to pixel-level details and generate multi-scale semantic features; wherein, the number of jump connection layers corresponding to the low-level jump features and the high-level jump features is determined according to a preset ratio. The upsampling fusion module is used to receive the upsampling features obtained by progressive upsampling of the enhanced feature map, and fuse them with the corresponding edge structure and spatial positioning enhancement features or the multi-scale semantic features. The convolution segmentation module is used to perform size restoration and segmentation prediction on the final features output by multiple upsampling fusion modules to obtain the predicted segmentation result.
2. The medical image segmentation method based on multiple attention and multi-scale fusion according to claim 1, characterized in that, The adaptive dilated convolution module includes a first channel attention unit, three convolutional branches, and a convolutional unit. The input of the first channel attention unit is used to receive the first feature map; the output of the first channel attention unit is connected to the input of the three convolutional branches. Three convolutional branches are used to perform parallel convolution processing based on different adaptive dilation rates; The outputs of the three convolutional branches are processed by element-wise addition and then connected to the input of the convolutional unit; the output of the convolutional unit is connected to the Transformer module.
3. The medical image segmentation method based on multiple attention and multi-scale fusion according to claim 1, characterized in that, The Transformer module includes multiple transformer units arranged sequentially; each transformer unit includes a first normalization layer, an MSA multi-head self-attention mechanism layer, a second normalization layer, an MLP multilayer perceptron, and an adaptive channel equalization layer; The output of the first normalization layer is connected to the input of the MSA multi-head self-attention mechanism layer; after the output of the MSA multi-head self-attention mechanism layer is connected to the input of the first normalization layer, it is connected to the input of the second normalization layer. The output of the second normalization layer is connected to the input of the MLP multilayer perceptron; the output of the MLP multilayer perceptron is connected to the input of the adaptive channel equalization layer; the output of the adaptive channel equalization layer is connected to the input of the second normalization layer in a skip connection, and then connected to the upsampling fusion module.
4. The medical image segmentation method based on multiple attention and multi-scale fusion according to claim 3, characterized in that, The calculation formula for the adaptive channel equalization layer is: ; Where α∈[0,1] are adjustable coefficients, and X1 is the input feature of the adaptive channel equalization layer. To calculate the average value of X1 along the first dimension, while keeping the number of dimensions of the output tensor consistent with that of the input.
5. The medical image segmentation method based on multiple attention and multi-scale fusion according to claim 1, characterized in that, The dual-channel attention gating module includes a maximum pooling unit, a first convolutional unit, a second convolutional unit, a gating fusion unit, and a second-channel attention unit; The max pooling unit is used to extract global channel statistical features of low-level skip features; The output of the max pooling unit is connected to the input of the first convolutional unit and the input of the second convolutional unit, respectively; the first convolutional unit and the second convolutional unit are used to generate channel weights in two different directions, height and width, for the global channel statistical features. The output of the first convolutional unit and the output of the second convolutional unit are multiplied element-wise and then connected to the input of the gated fusion unit; the output of the gated fusion unit is connected to the input of the second channel attention unit; the output of the second channel attention unit and the output of the max pooling unit are added element-wise and then connected to the upsampling fusion module. The gated fusion unit is used to fuse channel features in two different directions, height and width, dynamically suppressing background noise and redundant channels to obtain edge structure and spatial positioning enhancement features.
6. The medical image segmentation method based on multiple attention and multi-scale fusion according to claim 1, characterized in that, The multi-scale global channel feature enhancement module includes a third convolutional unit, a fourth convolutional unit, a spatial-channel gating unit, and a cross-scale multi-head attention unit; The input of the third convolutional unit is used to receive high-level jump features; the output of the third convolutional unit is connected to the input of the cross-scale multi-head attention unit; the input of the fourth convolutional unit and the input of the spatial-channel gating unit are used to receive upsampled features collected by the upsampling fusion module; the output of the fourth convolutional unit and the output of the spatial-channel gating unit are connected to the input of the cross-scale multi-head attention unit after element-wise addition. The output of the cross-scale multi-head attention unit is connected to the upsampling fusion module; The third convolutional unit is used to extract the contextual information of the high-level jump features under different receptive fields in parallel through multi-scale convolutional paths, so as to achieve feature capture from local to global, and to obtain the projected features by using adaptive channel projection. The fourth convolutional unit is used to perform depthwise separable convolution on the upsampled features; the spatial-channel gating unit is used to adaptively filter key features from the upsampled features. The multi-scale attention unit is used to integrate the received features using an adaptive weighting strategy to enhance the discriminative expression of the lesion region and generate multi-scale semantic features.
7. The medical image segmentation method based on multiple attention and multi-scale fusion according to claim 1, characterized in that, The MAMF-Net model is trained using the historical medical image sample set to obtain a medical image segmentation model, including: The historical medical image sample set is input into the MAMF-Net model in a batch processing manner to obtain the predicted segmentation result for each historical medical image. The predicted segmentation results are compared with the corresponding segmentation target labels, and the value of the loss function is calculated. Based on the value of the loss function, the MAMF-Net model is optimized using the stochastic gradient descent algorithm, and a medical image segmentation model is obtained when the preset termination condition is met. The formula for the loss function is as follows: ;in, The value of the loss function. For cross-entropy loss, This is a loss for Dice.
8. A medical image segmentation system based on multiple attention and multi-scale fusion, employing the medical image segmentation method based on multiple attention and multi-scale fusion as described in any one of claims 1-7, characterized in that, The system includes: The model building module is used to build the MAMF-Net model. The MAMF-Net model includes an encoder and a decoder with multiple skip connections. The encoder adopts a hybrid architecture of convolution and Transformer and integrates an adaptive dilated convolution method. The decoder integrates dual-channel attention gating and multi-scale global channel feature enhancement methods to enhance the features transmitted by skip connections and combine them with the features extracted by the encoder to fuse and reconstruct the segmentation results. The sample acquisition module is used to acquire a historical medical image sample set; wherein each historical medical image sample includes the historical medical image and the corresponding segmentation target annotation; The model training module is used to train the MAMF-Net model using the historical medical image sample set to obtain a medical image segmentation model; The model application module is used to acquire any medical image to be identified and input the medical image to be identified into the medical image segmentation model to determine the corresponding segmentation result.
9. A computer device, comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that the processor executes the computer program to implement the medical image segmentation method based on multiple attention and multi-scale fusion as described in any one of claims 1-7.