A medical image segmentation method based on self-attention

By introducing self-attention mechanism and multi-head attention module in medical image segmentation, combining hollow convolution and ResNet network, the problem of segmentation of lesions with multiple sizes and shapes is solved, and multi-scale feature extraction and semantic information enhancement are achieved, improving segmentation performance and efficiency.

CN114463339BActive Publication Date: 2024-10-22WUHAN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210019808.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-10
Publication Date
2024-10-22
Estimated Expiration
2042-01-10

AI Technical Summary

Technical Problem

In medical image segmentation, we face the problem of segmentation edge blur caused by difficulty in segmentation of multi-size lesion areas and the absence of fixed shape in the lesion areas. It is difficult for the prior art to effectively extract multi-scale features and accurately obtain edge semantic information.

Method used

Using the medical image segmentation method based on self-attention, using Unet as the benchmark model, multi-scale feature extraction coding structure and semantic feature enhancement structure are added, multi-scale feature extraction is achieved through the combination of multi-head attention and hollow convolution, and through the channel Self-attention and global space self-attention modules enhance semantic features, and combine the bottleneck layer of the ResNet network to realize module embedding.

Benefits of technology

Achieve multi-scale feature extraction and accurate marginal semantic information acquisition of medical images, improving segmentation performance and efficiency, especially in the case of large changes in size and changing shape of the lesion area, enhancing the accuracy and detailed information of segmentation results. Supplement.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114463339B_ABST
    Figure CN114463339B_ABST
Patent Text Reader

Abstract

The present invention discloses a medical image segmentation method based on self-attention, which can be applied to the field of medical image segmentation. The present invention uses Unet as a benchmark model, and realizes the ability to extract multi-scale features and obtain accurate edge semantic information by adding multi-scale feature extraction coding structure and semantic feature enhancement structure. The network model is mainly divided into three modules: encoder, semantic feature enhancement module, and decoder. This scheme is suitable for the problem of lesion area segmentation of medical images, and has the ability to extract multi-scale features and obtain accurate edge semantic information. Specifically, it can solve the problem of difficult segmentation of multi-size lesion areas and blurred segmentation edges caused by the lesion area having no fixed shape.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention can be applied to the field of medical image segmentation and utilize the self-attention mechanism to perform segmentation processing on medical images. Background Art

[0002] With the improvement of people's daily medical living standards, medical imaging technologies such as gastroscopy, colonoscopy and ultrasound imaging have given doctors a clearer and more intuitive understanding of the patient's condition, which is also the basis for subsequent continuous treatment. Image segmentation marks the boundary between the diseased area and the healthy area in the image. With the popularization of these technologies, manual segmentation by doctors obviously cannot cope with the huge amount of segmentation tasks. Therefore, how to analyze images quickly and efficiently and improve the work efficiency of doctors has become a very valuable research issue in the field of medical image analysis.

[0003] The methods for solving the medical image segmentation problem can be mainly divided into two categories, namely the use of traditional machine learning methods and the use of emerging deep learning methods. Deep learning methods, in particular, have made great progress in the past two years.

[0004] Traditional machine learning methods include many methods, such as the classic threshold-based image segmentation method such as the maximum inter-class variance method (reference Otsu NA Threshold Selection Method from Gray-Level Histograms [J]. Systems Man & Cybernetics IEEE Transactions on, 1979.), image segmentation is performed according to the threshold obtained by Otsu's method. Image segmentation method based on region growing (reference Shu Tianhui, Xu Bugong, Hu Zhanhu. Medical image segmentation based on region growing method [J]. Microcomputer Information, 2008, 24 (18): 3.) completes image segmentation by setting the position of the seed point, the growth criterion and the growth order. Clustering-based segmentation can also solve the problem, such as the MeanShift algorithm (reference Zhao Xiaojing, Chen Zhaoxue, Wang Zhizhen. Automatic segmentation of liver CT images based on the MeanShift method [J]. Chinese Medical Imaging Technology, 2010 (12): 4.), the Medoidshift algorithm (reference Gomathi VV, Karthikeyan SA Proposed Hybrid Medoid Shift with K-Means (HMSK) Segmentation Algorithm to Detect Tumor and Organs for Effective Radiotherapy [J]. Springer-Verlag New York, Inc. 2013.), etc. These methods apply the idea of ​​clustering to image segmentation, classify similar pixels together, and continuously iterate and correct to obtain a converged model.

[0005] Compared with traditional machine learning methods, deep learning-based methods can complete more complex tasks and have higher model generalization capabilities. For example, the Unet model (reference Ronneberger O, Fischer P, Brox TU-Net: Convolutional Networks for Biomedical Image Segmentation [C] / / International Conference on Medical Image Computing and Computer-Assisted Intervention. Springer International Publishing, 2015.) uses a U-shaped structure including an encoder and a decoder to achieve multi-scale feature fusion capabilities. The Unet++ model (reference Zhou Z, Siddiquee M, Tajbakhsh N, et al. UNet++: A Nested U-Net Architecture for Medical Image Segmentation [C] / / 4th Deep Learning in Medical Image Analysis (DLMIA) Workshop. 2018.) improves the skip connection structure based on the Unet model, achieves multi-level intercommunication capabilities, and improves the decoding accuracy; the TransUnet model (reference J Chen, Lu Y, Yu Q, et al. TransUNet: Transformers Make Strong Encoders for Medical Image Segmentation[J].2021.) For the first time, transformer was combined with Unet. Through the use of transformer, the ability to extract global semantic features was improved, greatly improving the performance of the model.

[0006] In summary, deep learning methods have become the mainstream in the field of medical image segmentation. By using Unet as a benchmark model, a series of improvement schemes for spatial information and semantic information have been proposed. With the addition of transformers, the relevant models have also achieved good results with the help of transformers' powerful global feature extraction capabilities.

[0007] However, for medical image segmentation tasks, there are always problems such as difficulty in segmenting multi-scale lesion regions and blurred segmentation edges caused by the lesion regions having no fixed shape. Therefore, the proposed medical image segmentation model should address these two problems and have the ability to extract multi-scale features and obtain accurate edge semantic information. Summary of the invention

[0008] In response to the above requirements, the present invention provides a medical image segmentation method based on self-attention, which uses Unet as a benchmark model and realizes the ability to extract multi-scale features and obtain accurate edge semantic information by adding a multi-scale feature extraction encoding structure and a semantic feature enhancement structure.

[0009] The self-attention-based medical image segmentation method of the present invention adopts the following technical solution: when the image passes through the encoder, the multi-scale feature extraction structure in the encoder is used to obtain multi-scale features, and a hidden feature map of 1 / 8 the size of the original image is obtained, and then the hidden feature map is input into the three-layer global semantic feature enhancement module to obtain semantic features, and then the semantic features are input into the decoder, and feature decoding is completed through convolution and upsampling of the decoding block. The upsampling levels are 1 / 8 of the original image, 1 / 4 of the original image, and 1 / 2 of the original image size, and after each upsampling, feature fusion is performed with the corresponding features of each layer in the encoder as a supplement to the detail information, and finally a two-channel feature map is output, which is the result map of the final segmentation.

[0010] Furthermore, the multi-scale feature extraction encoding structure uses a combination of multi-head attention and dilated convolution to complete the extraction of multi-scale features. The entire structure includes two 1x1 convolutions, one 3x3 convolution, and two multi-head attention modules implemented using dilated convolutions. The dilated rates of the two dilated convolutions are 1 and 2 respectively, which can obtain receptive fields of different scales, thereby enabling the extraction of multi-scale features. The input tensor feature1(B,C,H,W) first undergoes a 1x1 convolution to increase the feature dimension, and obtains the intermediate tensor feature2(B,4*C,H,W). Then the intermediate tensor passes through a three-branch structure, which is 3x3 convolution, multi-head self-attention with a dilation rate of 1 (MHSA 3x3) and multi-head self-attention with a dilation rate of 2 (MHSA 3x3). Features of different scales are extracted using receptive fields of different sizes. Then the tensors feature3(B,12*C,H,W) returned by the three branches are concatenated and passed through a 1x1 convolution to reduce the tensor dimension feature4(B,C,H,W), where B,C,H,W represent the number of inputs, the number of channels of the feature map, and the height and width of the feature map, respectively. The module is placed in the bottleneck layer of the ResNet network to achieve flexible embedding of the module. In this solution, after the features pass through this structure, multi-scale feature extraction can be achieved.

[0011] The semantic feature enhancement structure includes two parts, namely the channel self-attention module and the global space self-attention module. In the implementation process, the feature tensor feature5 (B, C, H, W) is first input into the channel self-attention module. After linear mapping, the feature tensor is evenly divided into Q1, K1, V1 (B, H, C, W) according to the number of channels. Q1, K1, V1 are the abbreviations of Query, Key and Value respectively. In the following attention calculation process, the attention weight of the corresponding Key is queried in Query, and then multiplied with Value to obtain the attention weighted value. The calculation process is as follows: Q1 and K1 are matrix multiplied to obtain the attention feature map feature6 (B, H, C, C), the attention feature map is multiplied with V1, and after reshaping, the weighted feature feature7 (B, C, H, W) is obtained, thereby completing the channel self-attention calculation process. Then the feature tensor feature5(B,C,H,W) is added to the feature tensor feature7(B,C,H,W), and a residual connection is performed to obtain the feature feature8(B,C,H,W). The obtained feature feature8 is input into the global spatial self-attention module. Similarly, the feature is divided into three parts Q2, K2, and V2(B,H,C,W) after convolution mapping. Q2 and K2 are calculated to obtain the attention feature map feature9(B,heads,H*W,H*W). Heads means dividing the number of channels into heads to realize the calculation of multi-head attention. Then it is multiplied with V2 and reshaped to obtain the weighted feature feature10(B,C,H,W), thereby completing the global spatial self-attention calculation process.

[0012] Then, the feature tensor feature8 (B, C, H, W) is added to the feature tensor feature10 (B, C, H, W) for residual connection to obtain feature11 as the final output of the semantic information enhancement module, where B, C, H, and W represent the number of inputs, the number of channels of the feature map, and the height and width of the feature map, respectively. The whole is enhanced through the channel self-attention module and the global spatial self-attention module to complete the semantic information enhancement.

[0013] Furthermore, the self-attention-based medical image segmentation method uses the pytorch framework to write a deep learning model, and the loss function used in model training is as follows:

[0014] L=0.5*Dice_loss+0.5*CE_loss

[0015] Dice represents the set similarity measurement function, Dice_loss is 1-Dice, and CE_loss is the cross entropy classification loss.

[0016] Compared with the prior art, the present invention has the following advantages and beneficial effects:

[0017] (1) The self-attention-based medical image segmentation method provided by the present invention can achieve good segmentation performance on medical images such as gastric polyp images by using self-attention. For the input medical image tensor (C*H*W), the general number of channels (C) is 3. After preprocessing with 7x7 convolution, the output channel number is increased several times, and the height H and width W are reduced by 2 times. The tensor is then input into the encoder, which is composed of multiple basic blocks. Each basic block contains a bottleneck module and the multi-scale feature extraction encoding structure mentioned above, and these two parts are connected in series. The bottleneck module is composed of three layers of convolution and a residual connection. After passing through several bottleneck modules in series, the output is input into the multi-scale feature extraction encoding structure. The multi-scale feature extraction encoding structure splices the features of the three branches inside it, and after convolution, it is output as the feature tensor obtained for the entire block. At this time, the size of the feature tensor has been reduced by 8 times in height H and width W compared to the original image. The feature tensor is input into the semantic feature extractor. The semantic feature enhancer uses a multi-layer stacked semantic feature extraction structure to obtain the semantic features after channel and global space weighting. The features are then input into the decoding structure corresponding to the encoder. The semantic features are supplemented with spatial details by skip connections in the corresponding size parts. A single decoder module is completed by two layers of convolution and one upsampling module.

[0018] (2) Aiming at the fact that the size of the lesion area in medical images varies greatly and is difficult to segment, the present invention designs a multi-scale feature extraction structure based on self-attention. The multi-scale feature extraction structure based on self-attention is implemented by a multi-head self-attention structure and a dilated convolution. The dilated convolution module is used to obtain the features of multiple receptive fields of the image, and the multi-head self-attention structure is used to process the feature maps to suppress redundant information and enhance key structural features. This structure can not only use multiple dilated convolutions with different dilation rates to obtain the features of multiple receptive fields, but also use multi-head self-attention to suppress irrelevant and redundant information, thereby ensuring the effectiveness of the feature maps.

[0019] (3) Aiming at the fact that the shape of the lesion area in medical images is changeable and difficult to learn, the present invention designs a semantic feature enhancement structure based on self-attention. The semantic feature extraction structure based on self-attention is implemented by a channel self-attention module and a global spatial self-attention module. The channel self-attention module is used to select the semantic features of each channel of the feature map, enhance the channels related to the lesion area, and suppress the channels unrelated to the lesion area; the global spatial self-attention module is used to select the spatial features of each area of ​​the feature map, enhance the spatial information related to the lesion area, suppress the spatial information channels unrelated to the lesion area, and strengthen the edge information that is difficult to separate. This structure can not only use the channel self-attention module to ensure the effectiveness of the semantic features in the channel, but also use the global spatial self-attention module to ensure the criticality of the semantic features in space. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 This is a schematic diagram of the “medical image segmentation based on self-attention” paradigm network in an embodiment of the present invention.

[0021] Figure 2 It is a schematic diagram of the structure of the encoder-semantic feature enhancer-decoder module in an embodiment of the present invention.

[0022] Figure 3 2 is a schematic diagram of a multi-scale coding structure in an embodiment of the present invention.

[0023] Figure 4 2 is a schematic diagram of a semantic feature enhancement block structure in an embodiment of the present invention.

[0024] Figure 5 2 is a schematic diagram of a multi-scale coding structure block structure in an embodiment of the present invention. DETAILED DESCRIPTION

[0025] The specific medical image segmentation process is explained below with reference to examples and drawings, but the present invention is not limited to this example.

[0026] Using 3x512x512 medical images as training images, and also using 3x512x512 medical images as training images, the main steps include:

[0027] 1. Data preprocessing and model training hyperparameter setting:

[0028] 1.1 This example uses Kvasir-seg to demonstrate. 1000 gastric polyp images and the corresponding mask images are divided into training set, validation set and test set according to 8:1:1. Training is performed on the training set, and the optimal model is found on the validation set. The final segmentation accuracy is calculated on the test set.

[0029] 1.2 The training set images are input into the network model as 3x512x512 tensors with a batch size of 4 for training. All data are iterated 150 times. The loss function used for training is:

[0030] L=0.5*Dice_loss+0.5*CE_loss

[0031] Dice represents the set similarity measurement function, Dice_loss is 1-Dice, and CE_loss is the cross entropy classification loss. The weight of the loss function can be changed, and 0.5 is generally used.

[0032] 2. Coding:

[0033] The original 4x3x512x512 image tensor first passes through an encoder network consisting of multiple blocks such as Figure 2 As shown in Figure 1, the encoder blocks are connected in series. Each basic block contains several bottleneck modules and a multi-scale feature extraction encoding structure based on self-attention, as shown in Figure 1. Figure 5 As shown in Figure 2, the bottleneck module and the multi-scale feature extraction encoding structure are connected in series. The bottleneck module consists of three layers of convolution and a residual connection. After passing through several bottleneck modules in series, the output is input into the multi-scale feature extraction encoding structure, as shown in Figure 2. Figure 3 As shown in Figure 1, the multi-scale feature extraction encoding structure concatenates the features of the three internal branches and outputs them as the feature tensor obtained by the entire block after convolution.

[0034] The multi-scale feature extraction encoding structure uses a combination of multi-head attention and dilated convolution to extract multi-scale features. The entire structure contains two 1x1 convolutions, one 3x3 convolution, and two multi-head attention modules implemented using dilated convolutions. The dilated rates of the two dilated convolutions are 1 and 2, respectively, which can obtain receptive fields of different scales, thereby enabling the extraction of multi-scale features. The input tensor feature1(B,C,H,W) first undergoes a 1x1 convolution to increase the feature dimension, and obtains the intermediate tensor feature2(B,4*C,H,W). Then the intermediate tensor passes through a three-branch structure, which is 3x3 convolution, multi-head self-attention with a dilation rate of 1 (MHSA 3x3) and multi-head self-attention with a dilation rate of 2 (MHSA 3x3). Features of different scales are extracted using receptive fields of different sizes, and then the tensors feature3(B,12*C,H,W) returned by the three branches are concatenated and passed through a 1x1 convolution to reduce the tensor dimension feature4(B,C,H,W). This module is placed in the bottleneck layer of the ResNet network to achieve flexible embedding of the module. In this solution, after the features pass through this structure, multi-scale feature extraction can be achieved.

[0035] Relying on the characteristics of dilated convolution, this design can obtain multi-scale features, and can remove redundancy and enhance effective features through the self-attention mechanism. After passing through the encoder, the size of the feature tensor at this time has been reduced by 8 times compared to the original image in height H and width W, and the number of channels has been increased to 256, that is, the output is 4x256x64x64.

[0036] 3. Semantic feature enhancement:

[0037] Input the 4x256x64x64 tensor into the semantic feature enhancement module for semantic enhancement, as shown in the attached figure. Figure 4 As shown in the figure, the semantic feature enhancement module mainly uses the multi-head self-attention mechanism to enhance the attention of features. The following formula is the calculation formula of self-attention.

[0038]

[0039] The feature tensor feature5 is enhanced through the channel self-attention module. First, through linear mapping, the feature tensor feature5 is divided into three tensors Q1, K1, and V1 (B, H, C, W). Q1, K1, and V1 are the abbreviations of Query, Key, and Value, respectively. In the following attention calculation process, the attention weight of the corresponding Key is queried in Query, and then multiplied with Value to obtain the attention weighted value. The calculation process is as follows: Q1 and K1 are matrix multiplied to obtain the attention feature map feature6 (B, H, C, C), and the attention feature map is multiplied with V1 and reshaped to obtain the weighted feature feature7 (B, C, H, W), thereby completing the channel self-attention calculation process. Then the feature tensor feature5(B,C,H,W) is added to the feature tensor feature7(B,C,H,W), and a residual connection is performed to obtain feature8(B,C,H,W). The obtained feature feature8 is input into the global spatial self-attention module. Similarly, the feature is divided into three parts Q2, K2, and V2(B,H,C,W) after convolution mapping. Q2 and K2 are calculated to obtain the attention feature map feature9(B,heads,H*W,H*W). Heads means dividing the number of channels into heads to realize the calculation of multi-head attention. Then it is multiplied with V2 and reshaped to obtain the weighted feature feature10(B,C,H,W), thereby completing the global spatial self-attention calculation process.

[0040] Then, the feature tensor feature8 (B, C, H, W) is added to the feature tensor feature10 (B, C, H, W) for residual connection to obtain feature feature11 as the final output of the semantic information enhancement module. The whole is enhanced through the channel self-attention module and the global space self-attention module. The output feature tensor size is 4x512x32x32.

[0041] 4. Decoding

[0042] Then the semantic features are input into the decoder, as shown in the attached Figure 1As shown. The 4x512x32x32 tensor enters the decoder composed of 3 decoding blocks. Each decoding block consists of an upsampling module, a skip connection structure connected to the features of the same size in the encoder, and a convolution module. At each layer of decoding, upsampling doubles the size of the tensor. The skip connection structure concatenates the semantic features with the spatial texture features obtained by the encoder of the corresponding size, and uses the texture features obtained by the encoder to supplement the lack of details in the semantic features, and removes the noise generated during the upsampling process. After that, the convolution module is used to interactively supplement the information between channels, and gradually transfer the information between channels to the spatial dimension. Finally, a 4x2x512x512 tensor is obtained to complete the segmentation of medical images.

[0043] 5. Testing

[0044] The image to be segmented in the test set is input into the trained image segmentation model to obtain the segmentation result.

[0045] The present invention is mainly embodied in two parts in the network model, a multi-scale feature extraction module in the encoder and a subsequent semantic information enhancement module. The proposed network structure has a segmented image mdice of 93% and mIou of 88% on the Kvasir-seg dataset.

[0046] The specific embodiments described herein are merely examples of the spirit of the present invention. Those skilled in the art may make various modifications or additions to the specific embodiments described or replace them in similar ways, but they will not deviate from the spirit of the present invention or exceed the scope defined by the appended claims.

Claims

1. A medical image segmentation method based on self-attention, It is characterized in that The steps include: First, an image segmentation model is constructed and trained. The image segmentation model includes an encoder, a semantic feature enhancement module and a decoder. The specific processing process is as follows; Step 1, using the multi-scale feature extraction structure in the encoder to obtain the multi-scale features of the image and obtain a hidden feature map; Step 2: Input the hidden feature map into the global semantic feature enhancement module to obtain the semantic feature; The semantic feature enhancement module includes two parts, namely, a channel self-attention module and a global space self-attention module; in the implementation process, the feature tensor feature5 (B, C, H, W) is first input into the channel self-attention module, and after linear mapping, the feature tensor is evenly divided into Q1, K1, V1 (B, H, C, W) according to the number of channels, Q1, K1, V1 are the abbreviations of Query, Key and Value respectively, in the following attention calculation process, the attention weight of the corresponding Key is queried in Query, and then multiplied with Value to obtain the attention weighted value. The calculation process is as follows: Q1 and K1 are matrix multiplied to obtain the attention feature map feature6 (B, H, C, C), the attention feature map is multiplied with V1, and after reshaping, the weighted feature feature7 (B, C, H, W) is obtained, thereby completing the channel self-attention calculation process; Then add the feature tensor feature5(B,C,H,W) to the feature tensor feature7(B,C,H,W), perform residual connection to obtain feature feature8(B,C,H,W), input the obtained feature feature8 into the global space self-attention module, and divide the feature into three parts Q2, K2, and V2(B,H,C,W) after convolution mapping. Calculate Q2 and K2 to obtain the attention feature map feature9(B,heads,H*W,H*W), where heads means dividing the number of channels into heads to realize the calculation of multi-head attention, and then multiply it with V2 and reshape it to obtain the weighted feature feature10(B,C,H,W), thus completing the global space self-attention calculation process; Then the feature tensor feature8(B,C,H,W) is added to the feature tensor feature10(B,C,H,W) for residual connection to obtain feature11 as the final output of the semantic feature enhancement module, where (·,·,·,·) is used to indicate the size of the tensor or feature or feature map, and B, C, H, W represent the number of inputs, the number of channels of the feature map, and the height and width of the feature map, respectively. Step 3: Input the semantic features into the decoder and complete feature decoding through multiple decoding blocks. Each decoding block includes an upsampling module and a convolution module. After each upsampling, it performs a skip connection with the corresponding layer features in the encoder to achieve feature fusion and output a two-channel feature map, which is the final segmentation result map. Input the image to be segmented into the trained image segmentation model to obtain the segmentation result.

2. A medical image segmentation method based on self-attention as claimed in claim 1, Features: In step 1, the encoder consists of multiple encoding blocks, and each encoding block is connected in series. Each basic encoding block contains a bottleneck module and a multi-scale feature extraction encoding structure based on self-attention. The bottleneck module consists of three layers of convolution and a residual connection.

3. The medical image segmentation method based on self-attention as claimed in claim 1, Features: The multi-scale feature extraction structure uses a combination of multi-head attention and dilated convolution to extract multi-scale features. The entire structure includes two 1x1 convolutions, one 3x3 convolution, and two multi-head attention modules implemented using dilated convolutions. The dilated rates of the two dilated convolutions are 1 and 2, respectively, which can obtain receptive fields of different scales, thereby realizing the extraction of multi-scale features. The input tensor feature1(B,C,H,W) first undergoes a 1x1 convolution to increase the feature dimension, and obtains the intermediate tensor feature2(B,4*C,H,W). Then the intermediate tensor feature2 undergoes a three-branch structure, namely 3x3 convolution, multi-head self-attention with a void rate of 1, and multi-head self-attention with a void rate of 2. Features of different scales are extracted using receptive fields of different sizes. Then the tensors feature3(B,12*C,H,W) returned by the three branches are concatenated and reduced in dimension by a 1x1 convolution to obtain the tensor feature4(B,C,H,W), where (·,·,·,·) is used to illustrate the size of the tensor, and B, C, H, W represent the number of inputs, the number of channels of the feature map, and the height and width of the feature map, respectively.

4. The medical image segmentation method based on self-attention as claimed in claim 1, Features: The loss function used in model training is as follows: L=a*Dice_loss+(1-a)*CE_loss Among them, Dice represents the set similarity measurement function, Dice_loss is 1-Dice, CE_loss is the cross entropy classification loss, and a is the weight value.

5. The medical image segmentation method based on self-attention as claimed in claim 1, Features: The decoder consists of three decoding blocks, and the upsampling levels in the decoding blocks are 1 / 8, 1 / 4, and 1 / 2 of the original image size.

6. A medical image segmentation method based on self-attention as claimed in claim 4, Features: The value of a is 0.5.