EMA-TransUNet medical image segmentation method based on efficient multi-scale attention

By combining ResNetV2, Transformer, and CNN using the EMA-TransUNet method, and leveraging an efficient multi-scale attention module to enhance feature extraction at U-Net skip connections, the problems of noise and irregular lesion shapes in medical image segmentation are solved, achieving more efficient and accurate lesion region segmentation.

CN121329980APending Publication Date: 2026-01-13HANGZHOU NORMAL UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410664519.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-27
Publication Date
2026-01-13

AI Technical Summary

Technical Problem

Existing medical image segmentation methods suffer from insufficient segmentation accuracy and require significant manpower for data annotation when dealing with noise, blur, and irregular lesion shapes.

Method used

A medical image segmentation method based on EMA-TransUNet is adopted, which combines ResNetV2, Transformer and CNN. It enhances feature extraction at the skip connections of U-Net through an efficient multi-scale attention module (EMA), uses multi-head self-attention to capture global and local information, and combines Dice loss and BCE loss for training.

Benefits of technology

It improves the accuracy and efficiency of medical image segmentation, better captures the boundaries and shapes of lesion areas, reduces blurring and low contrast, and is applicable to a variety of medical image datasets.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121329980A_ABST
    Figure CN121329980A_ABST
Patent Text Reader

Abstract

The invention relates to an EMA-TransUNet medical image segmentation method based on efficient multi-scale attention. According to the method, a segmentation model EMA-TransUNet is constructed, multi-scale feature maps are combined to output feature mapping with combinations of different receiving domain sizes, and multi-scale representation of the segmentation model is enhanced; a jump connection module is added, so that an encoder and a decoder participate in a crossing manner to more effectively save bottom layer features, and an efficient multi-scale attention mechanism EMA is applied to obtain channel information and spatial information of a multi-scale feature map for modeling, so that the weight ratio of target area features is improved. A training strategy and a loss function are set, and the model is trained; verifying the trained model; according to the method, the function that the Transform can remotely depend on and capture global information is combined with the function that the CNN can capture more detailed local information, and automatic segmentation of the focus part from the medical image is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the technical field of image segmentation, and relates to an EMA-TransUNet medical image segmentation method based on efficient multi-scale attention. BACKGROUND

[0002] Medical images are widely used in the medical field, which can provide important information about diseases for doctors and clinical medical experts, helping them to make accurate diagnosis and treatment plans. Medical images can come from various sources, including MRI, CT, X-ray and ultrasound imaging technology, as well as microscope images of tissue samples, etc. These images can provide structural and functional information about tumors, lesions and injuries, etc. diseases, supporting doctors in making diagnosis and treatment decisions. The application field of medical images is wide, including the diagnosis and treatment of various diseases such as cancer, cardiovascular disease, nervous system disease, etc. The traditional processing method of medical images is usually manual analysis by medical experts, so the processing result of the image is closely related to the experience of the medical expert. Modern medical image analysis not only can accurately process medical images, but also consumes very little time, providing great convenience for medical experts. In addition to traditional manual analysis, modern medical images usually use computer vision and machine learning technologies for automated analysis to improve the accuracy and efficiency of diagnosis. Among them, computer-aided diagnosis has been highly valued in clinical medicine, which mainly relies on the support of medical image segmentation technology. Stable and accurate medical image segmentation algorithms play an important role in helping doctors to monitor diseases in real time and subsequent treatment.

[0003] Nowadays, medical image segmentation has become one of the main challenges of computer vision. Unlike image classification and detection tasks, the purpose of image segmentation is to separate the specified part of the image from the background, which can provide more accurate and detailed pathological analysis for patients.

[0004] In recent years, with the development of deep learning technology, biomedical image segmentation methods based on deep neural networks have made great progress. For example, the U-Net model adopts a symmetrical encoder-decoder structure, and realizes the transmission of feature maps through a skip connection, which can effectively solve the problem of information loss in the segmentation process. Mask local convolutional neural network (MaskR-CNN) combines fast regional convolutional neural network (Faster R-CNN) target detection with fully convolutional network, realizing the function of simultaneous target detection and segmentation. In addition, some improved network structures have also been proposed, such as dense connection network (DenseNet) and residual network (ResNet), which have shown better performance and robustness in segmentation tasks. However, although these network structures have shown excellent results in segmentation tasks, the locality of convolutional layers limits the ability of these networks to capture shape and structure information representation, which is crucial for medical image segmentation. In order to solve these limitations, various network structures based on Transformer+CNN have been proposed, such as Swin UNet and TransUNet through multi-head self-attention mechanism, which enables the network to capture long-term dependencies.

[0005] Based on the above, accurately segmenting the target region on medical images is still a challenging task: 1. The process of medical images: there are certain difficulties in the segmentation process of medical images, especially in extracting image features, which is more difficult than extracting ordinary RGB pictures. Because medical images are often affected by problems such as noise, blur, low contrast, etc., in addition, the shape and size of the lesion area also have an impact on the segmentation results; 2. Medical image annotation: based on the acquisition of data, deep learning combines prior knowledge to train the model, and the training set needs to be labeled in advance. Because most of the labeling relies on manual recognition, data labeling will consume a large amount of manpower and time, and obtaining high-reliability labeled data in the medical imaging field is also one of the challenges. SUMMARY

[0006] The purpose of the present application is to overcome the shortcomings of the prior art, and provide an EMA-TransUNet medical image segmentation method based on efficient multi-scale attention, which is used for accurately segmenting the lesion part in the medical image.

[0007] The specific implementation steps of the present application are as follows:

[0008] Step one, pre-process and enhance the data of medical images:

[0009] Collect medical CT images, pre-process the images, expand the sample size, and normalize the sample images to obtain a data set;

[0010] Step two, constructing the segmentation model EMA-TransUNet:

[0011] The segmentation model EMA-TransUNet is constructed based on the encoder-decoder structure of U-Net, and the segmentation model EMA-TransUNet includes an encoder, a decoder and an efficient multi-scale attention EMA module set at the jump connection;

[0012] The encoder includes a ResNetV2 layer, an Embeddings layer and a Transformer network; the ResNetV2 layer includes three residual blocks, and each residual block includes a 1x1 convolution layer, a 3x3 convolution layer and a 1x1 convolution layer connected in turn; the output feature maps of each residual block are input into the EMA module respectively, and the output feature map of the last residual block is input into the Embeddings layer;

[0013] The Embeddings layer performs Embedding operation on the output feature map of the last residual block in the ResNetV2 layer, and then inputs the obtained feature map into the Transformer network;

[0014] The Transformer network includes n cascaded Transformer layers. Each layer of the Transformer layer includes a normalization layer LN, a multi-head self-attention MSA and a multi-layer perceptron MLP connected in turn, and the multi-layer perceptron MLP includes a linear layer, an activation function ReLU and a Dropout layer;

[0015] The decoder includes a reshape layer, three decoder blocks, an up-sampling layer and a segmentation head layer, each decoder block includes an up-sampling layer and two 3x3 convolution layers, batch normalization BN and activation function ReLU connected in turn; the output feature maps of each residual block in the encoder are spliced with the results of the up-sampling layer of the decoder block after being processed by the EMA module;

[0016] In the encoder:

[0017] The input CT image is processed by ResNetV2 for three times of down-sampling, the image coding is converted into high-level feature representation, a feature map list is created, the three times of down-sampled feature maps are saved, and the results after the three times of down-sampling processing of ResNetV2 are output;

[0018] The result processed by ResNetV2 is input into the EMA module, which effectively captures spatial information of different scales by combining parallel subnetworks of 1x1 and 3x3 convolution kernels, while preserving precise spatial structure information. And through the cross-space learning method, the EMA module can effectively integrate feature information from different spatial positions, improving the richness and accuracy of feature representation;

[0019] Then the feature map obtained after processing by the EMA module is subjected to Embedding operation, that is, the image is cut into patches of patch_size*patch_size size by using patch_size*patch_size, stride=patch_size convolution, and the channel number remains unchanged (where where N is the number of segmented image blocks), then through the Flatten operation and adding the feature information of each patch to its corresponding position information, and finally outputting the final feature map through the Dropout layer;

[0020] The feature map obtained after processing by the above Convolutional Neural Network (CNN) and its corresponding position information are input into the Transformer network, which will be processed by 12 consecutive transformer layers. The role of the Transformer network is to convert the input sequence into continuous representation, capture information in the input sequence and model its features. Through the Transformer network, the model can gradually extract features in the input sequence and use attention mechanisms to capture dependencies between positions in the input sequence. The role of the attention mechanism is to model the dependencies between positions in the input sequence. Through the attention mechanism, the model can consider the information of all positions in the input sequence at the same time, thereby better capturing global dependencies. Note that all Transformer trunks (i.e., ViT) are pre-trained on ImageNet;

[0021] The Transformer network is composed of normalization layer LN, Multi-head self-attention (MSA) and Multi-layer Perceptron (MLP) with linear layer, activation function ReLU and Dropout layer, and the calculation formula is as follows:

[0022] z′ k =MSA(LN(z k-1 ))+z k-1

[0023] z k =MLP(LN(z′k ))+z′ k

[0024] where z k is the output of the k-th MSA, z k-1 is the output of the k-1-th MSA, z k is the output of the k-th MLP, k = 1, 2,..., n.

[0025] The self-attention calculation formula of the MSA is:

[0026]

[0027] wherein, respectively represent the query (Query), key (Key) and value (Value) matrices; M 2 represents the number of patch blocks of the window, d represents the dimension of the query matrix or the key matrix, K T is the transpose matrix of K.

[0028] In the decoder:

[0029] The decoder includes three decoder blocks, one up-sampling layer and one segmentation head; each of the decoder blocks includes one up-sampling layer, two 3x3 convolution layers Conv + batch normalization BN + activation function ReLU.

[0030] The up-sampling processing is performed on the result of the Transformer network.

[0031] The three times down-sampled feature maps are sequentially processed by the EMA module in the skip connection to obtain the spatial information of different scales in different down-sampled feature maps, while the accurate spatial structure information is retained, then sequentially spliced with the up-sampling result, and then processed by a convolution layer, a BN layer and a ReLU layer to map the feature map to a low-dimensional space to obtain an output result, and the last output result is further up-sampled to restore the feature map to the size of the input image, and the final obtained feature map is converted into a segmentation image result by the Segmentation head layer and output.

[0032] Among them, the efficient multi-scale attention module EMA applies an effective attention mechanism, and different sizes of feature maps obtained by ResNetV2 three times down-sampling are input into the EMA module for processing, which is used for subsequent splicing operation with the up-sampling result.

[0033] In the efficient multi-scale attention module EMA, the 1D global average pooling for encoding global information along the horizontal dimension direction at the 1x1 convolution of the height H can be expressed as:

[0034]

[0035] where C denotes the number of input channels, H and W denote the spatial dimensions of input features, x c is the input feature at the c-th channel, c = 1, 2, …, n, x c (H, i) denotes the i-th feature value at height H in the input feature matrix x c .

[0036] In the EMA module of efficient multi-scale attention, the 1D global average pooling used to encode global information along the vertical dimension direction at the 1x1 convolution of width W can be represented as:

[0037]

[0038] where C denotes the number of input channels, H and W denote the spatial dimensions of input features, x c is the input feature at the c-th channel, c = 1, 2, …, n, x c (j, W) denotes the j-th feature value at width W in the input feature matrix x c .

[0039] The above global average pooling operation is used to model the cross-channel information, and the spatial position information is embedded into the channel attention map to enhance feature aggregation;

[0040] The average pooling of the other branch 3x3 convolution is:

[0041]

[0042] where i, j represent the position information on the feature map x c .

[0043] The attention weight descriptor used to extract the grouped feature map is a 3x3 convolution, which is used to capture local cross-channel interaction to expand the feature space. In this way, EMA not only encodes inter-channel information to adjust the importance of different channels, but also retains precise spatial structure information into the channel;

[0044] Then the results of the 3x3 convolution are fused with the results of the re-pooling of the two 1x1 convolutions, and the results after the Sigmoid function are obtained after the EMA module processing.

[0045] Step three, set the training strategy and loss function, train the model;

[0046] The data set obtained in step one is divided into a training set, a test set and a validation set; a combination of Dice loss and BCE loss is used to train the model, and a regularization strategy is used to prevent overfitting; the weights and biases in the EMA-TransUNet network model are updated using the backpropagation algorithm; and the loss function is used to update the parameters during the training iteration process.

[0047] Step four, verifying the trained network model:

[0048] The validation set is input into the segmentation model EMA-TransUNet trained in step three, the lesion part in the medical image is segmented out after the processing of the model, and the segmented image is compared and evaluated with the lesion area judged by experts, and the network model is verified.

[0049] Step five, inputting any medical image into the model verified in step four to segment the lesion part.

[0050] Preferably, the preprocessing in step one is specifically rotating, cropping, scaling, or graying the image, and unifying the sample image size.

[0051] Preferably, the input CT image in step two is a three-channel image; if the image collected in step one is a single-channel, the repeat function is used to duplicate twice to expand the channel to three channels.

[0052] Preferably, ResNetV2 is pre-trained on ImageNet to achieve better training effect and fewer training batches.

[0053] On the other hand, the present application provides a computer readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to execute the above method.

[0054] On the other hand, the present application provides a computing device comprising a memory and a processor, wherein the memory stores executable code, and the processor executes the executable code to implement the above method.

[0055] Compared with the prior art, the above technical scheme has the following advantages:

[0056] (1) The EMA module is arranged at the U-Net jump connection, which reduces the calculation cost while retaining the information of each channel, and the EMA module remolds part of the channels to the batch dimension and groups the channel dimension into multiple sub-features, so that the spatial semantic features are well distributed in each feature group, thereby improving the feature extraction capability of the model; through feature grouping and multi-scale structure processing on different spatial dimensions, short-range and long-range dependencies are effectively established, and the information in each channel is retained on the channel to achieve better performance. In medical images, the lesion area may have irregular boundaries and discontinuous shapes, so the generated medical segmentation image may have problems of blur and low contrast. The spatial information of the image is important information of the representative features of the lesion area, so the skip connection module is used to extract more and more effective spatial information.

[0057] (2) The application effectively combines Transformer and CNN, combines the function of capturing global information by long-range dependency of Transformer and the function of capturing more detailed local information by CNN, to enhance the functionality and flexibility of the traditional encoder-decoder architecture, and applies it to the medical image segmentation field, realizes the automatic segmentation of the lesion part from the medical image.

[0058] (3) The encoder part of the application applies ResNetV2 part and Transformer. ResNetV2 is a multi-scale feature extraction module that extracts low-level positioning detail information to make up for the lack of low-level positioning information of Transformer, and the Transformer block extracts global information to make up for the shortcomings of small receptive field and weak long-range dependency of CNN. BRIEF DESCRIPTION OF DRAWINGS

[0059] Figure 1 The structure diagram of the EMA-TransUNet network of the application is shown in the figure;

[0060] Figure 2 The structure diagram of the EMA module is shown in the figure;

[0061] Figure 3 The medical image used for testing is shown in the figure;

[0062] Figure 4 The image after segmenting the lesion is shown in the figure. Figure 3 DETAILED DESCRIPTION

[0063] The application will be further described below in conjunction with the accompanying drawings:

[0064] An EMA-TransUNet variant medical image segmentation method based on efficient multi-scale attention, specifically comprising the following steps: ​

[0065] Step one, pre-processing and enhancement of medical image data:

[0066] This example uses 30 abdominal CT scans in MICCAI 2015 multi-atlas abdominal label challenge, a total of 3779 axial enhanced abdominal clinical CT images are used for training model, then the images are rotated, cropped, scaled, grayscaled and normalized to expand the dataset, expand the sample size of the experiment, and finally normalize the images; The experimental report shows the average DSC and average Hausdorff distance (HD) of 8 abdominal organs (aorta, gallbladder, spleen, left kidney, right kidney, liver, pancreas, stomach), and 18 training cases (2212 axial slices) and 12 validation cases are randomly divided.

[0067] Step two, build segmentation model EMA-TransUNet:

[0068] The segmentation model EMA-TransUNet is built based on the encoder-decoder structure of U-Net, which includes an encoder, a decoder and a skip connection module EMA module.

[0069] As shown in Figure 1 , the encoder part is composed of ResNetV2 layers and Transformer network.

[0070] In the encoder:

[0071] The input medical image (224*224*3) is input into ResNetV2, the input is first processed by a convolution kernel with a size of 7x7 and a step of 2, at this time the medical image becomes a feature map of (112*112*64), then it is processed by GroupNorm layer, ReLU layer and MaxPool layer with a size of 3x3 and a step of 2, the medical image becomes a feature map of (56*56*64), wherein the GroupNorm layer divides the feature map into different groups, each group contains a certain number of feature channels. Then, the features in each group are normalized, rather than the whole batch or a single channel. This normalization method can reduce the performance degradation of Batch Norm and Layer Norm when the batch size is small or the number of feature channels is small. Finally, the first three blocks of ResNet50 are processed to obtain a feature map of (14*14*1024).

[0072] Then the result is input into the EMA block to retain the information of each channel and reshape part of the channel to the batch dimension and group the channel dimension into multiple sub-features, so that the spatial semantic features are well distributed in each feature group.

[0073] The feature map is then input into Embeddings, which uses a convolutional kernel of size p*p with a stride of p to divide the input image into patches and convert each patch into an embedding vector with a specified hidden size. p specifies the size of each patch. The embedding vector x is then flattened along the second dimension (usually the channel dimension) by Flatten, which straightens the embedding vector of each patch into a one-dimensional vector. The flattened embedding vector x is transposed to exchange the last two dimensions, so that the shape of the embedding vector becomes (B, n_patches, hidden), and then the transposed embedding vector x is added to the position embedding vector. The position embedding vector is a learned parameter that provides additional position information for each position. Finally, the embedding vector with the position embedding vector is subjected to a dropout operation to reduce overfitting, and the result is output.

[0074] The feature map obtained after the above CNN processing and its corresponding position information are input into the Transformer, which will be processed by a continuous 12-layer Transformer network. The Transformer network converts the input sequence into a continuous representation, captures the information in the input sequence and models its features. Through the Transformer network, the model can gradually extract the features in the input sequence and use the attention mechanism to capture the dependencies between positions in the input sequence. The attention mechanism models the dependencies between positions in the input sequence. Through the attention mechanism, the model can consider the information of all positions in the input sequence at the same time, so as to better capture global dependencies;

[0075] The Transformer network is composed of normalization layer LN, multi-head self-attention (MSA) and multi-layer perceptron (MLP) block with linear layer, activation function ReLU and Dropout layer, and the calculation formula is as follows:

[0076] z′ k =MSA(LN(z k-1 ))+z k-1

[0077] z k =MLP(LN(z′ k ))+z′ k

[0078] where z′ k and z k represent the output of the kth layer of MSA and MLP respectively;

[0079] The self-attention calculation of MSA is:

[0080]

[0081] in, Represents a query, key, and value matrix; M 2 d and d represent the number of patch blocks in the window and the dimension of the query matrix or key matrix, respectively.

[0082] In skip connections:

[0083] The downsampled feature maps are processed by the EMA module in the skip connection to obtain spatial information at different scales in different downsampled feature maps, while retaining accurate spatial structure information.

[0084] The efficient multi-scale attention module EMA applies an effective attention mechanism, which inputs feature maps of different sizes obtained by three downsampling operations of ResNetV2 into the EMA module for processing, and then concatenates them with the upsampling results.

[0085] like Figure 2 The diagram shown is a structural diagram of the EMA module. In the efficient multi-scale attention EMA module, a feature grouping strategy is adopted. For any given input feature map C×H×W, it is divided into three parallel paths C / / G×H×W along the channel dimension C, which are divided into three parallel paths: two 1×1 branches and one 3×3 branch. The input tensors are C / / G×1×W, C / / G×H×1, and C / / G×H×W, respectively.

[0086] The two 1×1 branches use two 1D global average pooling operations in the horizontal and vertical dimensions, respectively. The attention maps C / / G×1×(W+H) of the two channels in each group are aggregated by concat. Then, the output of the 1×1 convolution is decomposed into two vectors C / / G×1×W and C / / G×H×1. Then, a sigmoid activation function is used in the horizontal and vertical dimensions to fit the 2D binary distribution on the linear convolution. The tensors C / / G×H×W after grouping are reweighted and adjusted to output the result f0. This result, along with the result after normalization, average pooling, and softmax processing, and the result after processing by the 3×3 branch, is processed by Matmul to obtain the feature map f1.

[0087] The 3×3 branch captures local channel interactions through a 3×3 convolution to expand the feature space. After average pooling and softmax processing, it is processed with f0 using Matmul to obtain the feature map f2.

[0088] Finally, the feature map f1 is fused with the feature map f2, and then a Sigmoid activation function is used to fit the 2D binary distribution on the linear convolution, and the tensor C / / GxHxW after grouping is reweighted and adjusted to obtain the final output with a size of CxHxW.

[0089] Decoder part:

[0090] The decoder is composed of three identical decoder blocks, and the processing steps of the decoder block are as follows: the feature map x processed by the Transformer network is bilinearly upsampled to expand its size by two times along two dimensions, and then the skip connection feature map skip processed by the EMA module is spliced with the upsampled feature map x along the channel dimension; then the spliced feature map x is passed to two convolution layers for convolution operation to obtain the returned feature map, and then the result is input into the subsequent decoder block.

[0091] Finally, the feature map is restored to the size of 224x224 after one more upsampling, and then the result Segmentation head module converts the feature map to (224x224x3), where Segmentation head is a 3x3 convolution that converts the feature map to a segmentation result image.

[0092] Step three, set the training strategy and loss function, and train the model;

[0093] The preprocessed data set is divided into training set, test set and validation set; the combination of Dice loss and BCE loss is used to train the model, and the regularization strategy is used to prevent overfitting; the back propagation algorithm is used in the EMA-TransUNet network model to update the weights and biases in the network; the loss function is used to update the parameters during the training iteration process;

[0094] According to the set training strategy, the EMA-TransUNet network model is trained; in the training stage, EMA-TransUNet uses the objective function to train in an end-to-end manner; the loss function is used to update the parameters in the iteration process; in the selection of loss function, the combination of Dice loss and binary cross entropy loss is used to train all networks;

[0095] Therefore, the loss function is:

[0096]

[0097]

[0098] Loss=αLDice + βL BCE ;

[0099] where y i is the true probability of sample i, is the predicted probability of sample i; L Dice and L BCE respectively represent the dice loss and binary cross-entropy loss; Loss represents the final loss function, and α and β are weights; the dice loss and the binary cross-entropy loss are combined in one term, and L Dice is given more weight because it can better handle the class imbalance problem; therefore, in the embodiment, the value of α is 0.75, and the value of β is 0.25;

[0100] Step four, verify the trained network model:

[0101] The segmented verification set is input into the trained segmentation model EMA-TransUNet, and the lesion part in the medical image is segmented after the segmentation of the model. The segmented image is compared and evaluated with the lesion area judged by experts.

[0102] Four widely used evaluation criteria are used to measure the performance of the EMA-TransUNet model; the evaluation indexes are as follows:

[0103] Dice similarity coefficient (DSC): DSC is used to measure the similarity between the predicted lesion area and the fact, where V Seg represents the area segmented by the model algorithm, and V GT represents the true segmented area; TP, TN, FP, and FN represent true positive, true negative, false positive, and false negative, respectively.

[0104]

[0105] Sensitivity (SEN): SEN represents the percentage of correctly segmented lesion areas.

[0106] Specificity (SPE): SPE represents the percentage of correctly segmented non-lesion areas.

[0107] Positive predictive value (PRE): PRE represents the accuracy of the lesion area segmentation,

[0108] Step five, input any medical image into the verified model to output the segmented lesion medical image:

[0109] Select medical images for testing, such as Figure 3 As shown, this is the standard result for image segmentation. Figure 4 The results after model segmentation show that the EMA-TransUNet model can accurately segment the lesion area, clearly demarcating it from the surrounding normal tissue. This provides significant assistance to doctors in diagnosis and treatment.

[0110] Compared with traditional medical image segmentation methods, the EMA-TransUNet model has better performance, can segment lesion regions more accurately, and is also more suitable for different types of medical image datasets.

[0111] The accompanying drawings of the embodiments disclosed in this invention only involve structures relevant to the embodiments of this disclosure. However, the above description is merely a preferred embodiment of the present invention, and it can be fully applied to various fields suitable for the present invention. Therefore, without departing from the general concept defined by the claims and their equivalents, the present invention is not limited to the specific details and illustrations shown and described herein.

Claims

1. A medical image segmentation method based on efficient multi-scale attention using EMA-TransUNet, comprising the following steps: Step 1: Preprocessing and enhancing medical image data: Medical CT images were collected as samples, preprocessed to increase the sample size, and then normalized to obtain the dataset. Step 2: Construct the segmentation model EMA-TransUNet: Step 3: Set the training strategy and loss function, and train the segmentation model EMA-TransUNet; The dataset obtained in step one is divided into a training set, a test set, and a validation set. A regularization strategy is used to prevent overfitting during model training. The backpropagation algorithm is used in the segmentation model EMA-TransUNet to update the weights and biases in the network. During training iterations, the loss function is used to update the parameters; Step 4: Validate the segmentation model EMA-TransUNet trained in Step 3 using the validation set; Step 5: Input the medical image to be segmented into the segmentation model EMA-TransUNet validated in Step 4 to segment out the lesion part; Its features are, The segmentation model EMA-TransUNet is constructed based on the encoder-decoder structure of U-Net, which includes an encoder, a decoder, skip connections, and an efficient multi-scale attention EMA module. The encoder includes a ResNetV2 layer, an Embeddings layer, and a Transformer network; the ResNetV2 layer includes a cascaded 7x7 convolutional layer, a 3x3 MaxPool layer, a first residual unit, a second residual unit, and a third residual unit; The decoder includes a series of reshape layers, a first decoding block, a second decoding block, a third decoding block, an upsampling layer, and a segmentation head layer; The first residual unit is connected to the first decoding block via a jump connection, the second residual unit is connected to the second decoding block via a jump connection, and the third residual unit is connected to the third decoding block via a jump connection. A high-efficiency multi-scale attention EMA module is connected in series on the jump connection.

2. The EMA-TransUNet medical image segmentation method based on efficient multi-scale attention as described in claim 1, characterized in that, In the efficient multi-scale attention EMA module, a feature grouping strategy is adopted. For any given input feature map C×H×W, it is divided into three parallel paths C / / G×H×W in the channel dimension C, which are two 1×1 branches and one 3×3 branch. The input tensors are C / / G×1×W, C / / G×H×1 and C / / G×H×W, respectively. The two 1×1 branches use two 1D global average pooling operations in the horizontal and vertical dimensions, respectively. The attention maps C / / G×1×(W+H) of the two channels in each group are aggregated by concat. Then, the output of the 1×1 convolution is decomposed into two vectors C / / G×1×W and C / / G×H×1. Then, a sigmoid activation function is used in the horizontal and vertical dimensions to fit the 2D binary distribution on the linear convolution. The tensors C / / G×H×W after grouping are reweighted and adjusted to output the result f0. This result, along with the result after normalization, average pooling, and softmax processing, and the result after processing by the 3×3 branch, is processed by Matmul to obtain the feature map f1. The 3×3 branch captures local channel interactions through a 3×3 convolution to expand the feature space. After average pooling and softmax processing, it is processed with f0 using Matmul to obtain the feature map f2. Finally, feature map f1 and feature map f2 are fused, and then a 2D binary distribution on the linear convolution is fitted by the Sigmoid activation function. The 2D binary distribution is then reweighted and adjusted with the grouped tensor C / / G×H×W to obtain the final output of size C×H×W.

3. The EMA-TransUNet medical image segmentation method based on efficient multi-scale attention as described in claim 1, characterized in that, The first residual unit includes three residual blocks connected in series, the second residual unit includes four residual blocks connected in series, and the third residual unit includes six residual blocks connected in series; the residual blocks include a 1x1 convolutional layer, a 3x3 convolutional layer and a 1x1 convolutional layer cascaded in sequence.

4. The EMA-TransUNet medical image segmentation method based on efficient multi-scale attention as described in claim 1, characterized in that, The specific implementation process of the encoder is as follows: The ResNetV2 downsamples the input three-channel image three times, transforming the image encoding into a high-level feature representation; The Embeddings layer performs an embedding operation on the output feature map of the last residual unit in the ResNetV2 layer after it has been processed by an efficient multi-scale attention EMA module, thereby realizing image serialization and location information embedding. The Transformer network is used to transform the output of the Embeddings layer from the input sequence into a continuous representation, capture the features in the input sequence, and use the attention mechanism to capture the dependencies between various positions in the input sequence, thereby better capturing global dependencies.

5. The EMA-TransUNet medical image segmentation method based on efficient multi-scale attention as described in claim 1, characterized in that, The specific implementation process of the decoder is as follows: The Reshape layer is used to reshape the output of the encoder to restore it to a specific spatial size; The third decoding block decodes the output of the Reshape layer after it has been processed by 3×3 convolution, normalization, and activation function to obtain the feature map q1. The second decoding block performs a decoding operation on the output of the third decoding block to obtain feature map q2; The first decoding block performs a decoding operation on the output of the second decoding block to obtain feature map q3; The upsampling layer restores the output feature map of the first decoding block to its original size; The segmentation head layer segments the result of the upsampling layer to obtain the desired segmented image.

6. The EMA-TransUNet medical image segmentation method based on efficient multi-scale attention as described in claim 1, characterized in that, The first decoding block, the second decoding block, and the third decoding block have the same structure, each including an upsampling layer, a splicing layer, and two cascaded convolutional layers; The upsampling layer upsamples the output of the previous decoded block; The splicing layer splices the output feature map of the residual unit and the output of the decoding block located in the same layer; The two concatenated convolutional layers perform convolution operations on the results of the splicing layer and output them to the next decoding block.

7. The EMA-TransUNet medical image segmentation method based on efficient multi-scale attention as described in claim 6, characterized in that, The convolutional layer comprises cascaded 3x3 convolutional blocks, batch normalization (BN), and the activation function ReLU.

8. The EMA-TransUNet medical image segmentation method based on efficient multi-scale attention as described in claim 1, characterized in that, The CT image input in step two is a three-channel image; if the image collected in step one is a single-channel image, it is copied twice using the repeat function to expand the channels to three channels.

9. A computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to perform the method of any one of claims 1-8.

10. A computing device comprising a memory and a processor, wherein the memory stores executable code, and the processor, when executing the executable code, implements the method of any one of claims 1-8.