A medical image segmentation method based on cross-enhanced self-attention
By introducing a cross-enhanced self-attention module into the medical image segmentation network, the problem of difficulty in capturing long-distance dependencies and local relationships in the prior art is solved, and higher segmentation accuracy is achieved.
Patent Information
- Application Number
- CN202311370730.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-23
- Publication Date
- 2025-05-09
- Estimated Expiration
- 2043-10-23
AI Technical Summary
Existing medical image segmentation technology is difficult to effectively capture the long-distance dependencies and local relationships required in medical images, resulting in insufficient segmentation accuracy.
A codec network (CE-ED-Net) based on cross-enhanced self-attention is designed, which introduces a symmetric block fusion module and a cross-enhanced self-attention module on the encoder side to extract local and global features of the image.
By enhancing the self-attention mechanism, CE-ED-Net can more effectively capture long-distance dependencies and local relationships in medical images, significantly improving the accuracy of medical image segmentation.
Smart Images

Figure CN117495872B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of medical image processing, and in particular relates to a medical image segmentation method based on cross-enhancement self-attention. Background Art
[0002] Object segmentation in medical images is an important foundation in the field of medical image processing and analysis, and is an important means to provide basic information about anatomical regions. Accurate and reliable object segmentation can assist healthcare professionals in accurately identifying injuries, monitoring disease progression, and formulating appropriate treatment plans.
[0003] However, medical image segmentation is a very challenging task that requires accurate depiction of anatomical structures and organs with different shapes, different appearances, or different degrees of lesions. Convolutional neural networks (CNNs) have shown superior performance in various image segmentation tasks. The encoder-decoder architecture and jump connections adopted by fully convolutional networks (FCNs) achieve the fusion of deep semantic information and shallow appearance information, improving segmentation accuracy. Although CNN-based models have achieved success, they also have shortcomings such as limited receptive field, inductive bias, and inability to establish long-distance dependencies. In response to the above problems, some scholars have proposed to enhance significant semantic features by using dilated convolutions to expand the receptive field or adding attention modules. However, the above approach is still difficult to capture sufficient long-distance dependencies required for medical image segmentation.
[0004] In order to overcome the limitations of CNN in global modeling, in recent years, Dosovitskiy et al. developed a visual Transformer model ("An image is worth 16×16 words: Transformers for image recognition at scale, arXiv preprint arXiv:2010.11929, 2020") to capture long-distance dependencies. Transformer was originally developed for natural language processing and is built on a multi-head self-attention (MSA) mechanism for sequence-to-sequence prediction, which can learn the correlations between all input tokens and allow long-distance dependencies between input tokens to be modeled. Although Transformer shows good performance in modeling long-distance dependencies, it cannot learn short-distance dependencies and has limited ability to capture important local relationships between pixels. Summary of the invention
[0005] In view of the shortcomings and deficiencies of the prior art, the present invention provides a medical image segmentation method based on cross-enhanced self-attention. This method follows the network framework of encoding and decoding, and designs a symmetric block fusion module and a cross-enhanced self-attention module on the encoder side to fully extract local and global features of the image and improve segmentation accuracy.
[0006] A medical image segmentation method based on cross-enhanced self-attention, comprising the following steps:
[0007] (1) Establish a training dataset A containing original images and their corresponding segmentation gold standards;
[0008] (2) Construct a cross-enhanced self-attention based encoder-decoder network, called CE-ED-Net, which specifically includes:
[0009] (2-a) A codec structure with jump connections is used as the basic network framework. The encoder includes four cascaded encoding blocks, each of which is composed of a symmetric block fusion module and a cross-enhanced self-attention module connected in sequence; the decoder includes four decoding blocks, an addition operation and a softmax operation; the first decoding block is composed of a 1×1 convolution, a convolutional attention module, a 1×1 convolution and an upsampling operation with a step size of 16 connected in sequence, and the output of the fourth encoding block is used as the input of the first decoding block. The upsampling result is the output of the first decoding block; the second decoding block includes an upsampling operation with a step size of 2, an attention gate structure, a splicing operation, a convolutional attention module, a 1×1 convolution and an upsampling operation with a step size of 8. The specific structure includes: first, the output of the convolutional attention module in the first decoding block is upsampled with a step size of 2 to obtain a feature map The output of the third encoding block is then combined with Input the attention gate structure of the second decoding block together to obtain the feature map Then and Splice to get the feature map Last pair Convolutional attention, 1×1 convolution and upsampling with a step size of 8 are performed in sequence to obtain the output of the second decoding block; the third decoding block contains an upsampling operation with a step size of 2, an attention gate structure, a splicing operation, a convolutional attention module, a 1×1 convolution and an upsampling operation with a step size of 4. The specific structure includes: first, the output of the convolutional attention module in the second decoding block is upsampled with a step size of 2 to obtain the feature map The output of the second encoding block is then combined with Input the attention gate structure of the third decoding block together to obtain the feature map Then and Splice to get the feature map Last pair Convolutional attention, 1×1 convolution and upsampling with a step size of 4 are performed in sequence to obtain the output of the third decoding block; the fourth decoding block contains two upsampling operations with a step size of 2, an attention gate structure, a splicing operation, a convolutional attention module, and a 1×1 convolution. The specific structure includes: first, the output of the convolutional attention module in the third decoding block is upsampled with a step size of 2 to obtain the feature map The output of the first encoding block is then combined with Input the attention gate structure of the fourth decoding block together to obtain the feature map Then and Splice to get the feature map Last pair Convolutional attention, 1×1 convolution and upsampling with a step size of 2 are performed in sequence to obtain the output of the fourth decoding block; the outputs of the first decoding block, the second decoding block, the third decoding block and the fourth decoding block are added and fused, and the fusion result is input into the Softmax layer to obtain the final segmentation result;
[0010] (2-b) The symmetric block fusion module described in step (2-a), denoted as SPM, specifically includes: Perform 3×3 convolution with a step size of 1 and layer normalization in sequence to obtain the feature Then, a parallel two-branch structure is used to identify the features Downsampling is performed, and each branch contains a lossless downsampling operation, thereby obtaining the outputs of the two branches, which are and Finally, g0 and g1 are added and subtracted respectively to obtain the SPM output φ0 = g0-g1 and φ1 = g0+g1, and
[0011] (2-c) The lossless downsampling operation described in step (2-b), denoted as URDS, specifically includes: Perform 3×3 convolution with a step size of 2 and GeLU activation in sequence to obtain the feature Then, the feature Perform upsampling with a step size of 2 to obtain the features And subtract features r and r′ to get feature g m =rr′; then, for g m Morphological dilation and average pooling with a step size of 2 are performed in sequence to obtain the feature Finally, the features and By adding them together, we can get the output of the URDS module;
[0012] (2-d) The cross-enhanced self-attention module described in step (2-a), denoted as CE-SA, specifically includes: first, using N cascaded cross-connected self-attention modules to analyze the input features and Process and obtain features and The N is preferably a natural number between 3 and 8; then, the characteristic and Perform addition operation to obtain features The characteristics and Perform addition operation to obtain features Finally, Y 0 With Y 1 Splice to get the output features of CE-SA
[0013] (2-e) The cross-connected self-attention module described in step (2-d) is denoted as C-SA. The specific structure includes: firstly, two branches are constructed, wherein the first branch is composed of a self-attention module and a local enhancement module, and the second branch is composed of a focus module and a local enhancement module; then, a cross connection is introduced between the two branches, specifically, the input feature I 0 It is used not only as the input of the self-attention module in the first branch, but also as the input of the local enhancement module in the second branch; input feature I 1 It is not only used as the input of the focusing module in the second branch, but also as the input of the local enhancement module in the first branch; in addition, the output of the local enhancement module in the branch is the output of C-SA; based on the above description, C-SA contains two input features and two output features;
[0014] (2-f) The self-attention module described in step (2-e) is denoted as SA, which is composed of a normalization layer and a multi-head self-attention structure; the focus module described in step (2-e) is denoted as FA, which is characterized by being composed of a layer normalization and a focus modulation module; the local enhancement module described in step (2-e) is denoted as LE, which is characterized by the specific structure comprising: the output A of the current branch self-attention module is converted into p and the original input I of the other branch 1-p As input, A p and I 1-p Perform concatenation, layer normalization and cross-region learning to obtain feature H1, and then connect H1 with A through residual connection pPerform the addition operation to obtain the output F of LE p ;
[0015] (2-g) The focus modulation module described in step (2-f) specifically comprises:
[0016] (2-g-i) For input features First, obtain the feature matrix q through linear projection;
[0017] (2-g-ii) Use the context aggregation module to obtain feature Z out The specific process includes: using a linear projection matrix For input features Perform projection and obtain features And according to Z 0 , using deep convolution and GeLU activation operations to obtain Z l =GeLU(DWConv(Z (l-1) )), l∈{1,2,...,L+1}, where DWConv(·) represents a depthwise convolution operation, GeLU(·) represents a GeLU activation operation, Using a linear projection matrix For input features Perform projection and obtain features is the feature map of the lth channel in G; using the broadcast mechanism, Z l and G l Perform dot product summation to obtain features Where ⊙ represents the dot product;
[0018] (2-g-ⅲ) Use linear layers to aggregate context information Z out Compress to get the feature matrix m, and finally dot-multiply q and m to get the output of the focus modulation module;
[0019] (2-h) The cross-region learning described in step (2-f), denoted as CRL, is characterized in that for the input feature Cross-region learning results Ψ p It can be obtained by the following formula:
[0020]
[0021]
[0022] in, Representation feature map The i-th channel in Representation feature map The jth channel in Ω ij represents the learnable weight, b iis bias;
[0023] (2-i) The attention gate structure described in step (2-a), denoted as AG, specifically includes: for two input features I1 and I2, where I1 represents the upsampled output with a step size of 2 connected to the current attention gate, and I2 represents the output of the encoding block connected to the current attention gate, first construct two parallel branches, each branch contains a 1×1 convolution, batch normalization and ReLU activation function connected in sequence, and I1 and I2 are respectively used as inputs of the two branches; then the branch processing results are added and fused, and the added and fused results are sequentially performed with 1×1 convolution, batch normalization and Sigmoid activation to obtain feature O1; then O1 is dot-multiplied with the input feature I1 to obtain the output of the attention gate;
[0024] (2-j) The convolutional attention module described in step (2-a), denoted as CAM, specifically includes: first, constructing a two-branch structure, one branch includes global maximum pooling, 1×1 convolution, ReLU activation, 1×1 convolution in sequence, and the other branch includes global mean pooling, 1×1 convolution, ReLU activation, 1×1 convolution in sequence; inputting the input feature I3 into each branch for processing, and adding and merging the results obtained from each branch and performing Sigmoid activation to obtain the feature O2; finally, performing dot multiplication of O2 and I3 to obtain the output of the convolutional attention module;
[0025] (3) Using training data set A to train the CE-ED-Net network until the preset loss function converges to obtain a trained segmentation network; this embodiment preferably uses a hybrid loss function combining Dice and cross entropy as the objective function of network training;
[0026] (4) Use the trained network to test the image to be segmented and obtain the segmentation result. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 A framework diagram of a codec network based on cross-enhanced self-attention in an embodiment of the present invention
[0028] Figure 2 Schematic diagram of a symmetric block fusion module in an embodiment of the present invention
[0029] Figure 3 Schematic diagram of lossless downsampling operation in an embodiment of the present invention
[0030] Figure 4 Schematic diagram of the cross-enhanced self-attention module in an embodiment of the present invention
[0031] Figure 5 Schematic diagram of the self-attention module in an embodiment of the present invention
[0032] Figure 6 Schematic diagram of a local enhancement module in an embodiment of the present invention
[0033] Figure 7 Schematic diagram of a focus modulation module in an embodiment of the present invention
[0034] Figure 8 Schematic diagram of the attention gate structure in an embodiment of the present invention
[0035] Fig. 9 Schematic diagram of the convolutional attention module in an embodiment of the present invention
[0036] Fig.10 This is an example of the segmentation result of an embodiment of the present invention. Fig.10 (a)~ Fig.10 (c) are three original images of skin diseases randomly selected from the ISIC 2018 public dataset. Fig.10 (d)~ Fig.10 (f) is to adopt the embodiment of the present invention to Fig.10 (a)~ Fig.10 (c) Result of segmentation DETAILED DESCRIPTION
[0037] Example 1
[0038] A medical image segmentation method based on cross-enhanced self-attention, the specific implementation steps are as follows:
[0039] (1) Establish a training dataset A containing original images and their corresponding segmentation gold standards;
[0040] (2) Construct a cross-enhanced self-attention based encoder-decoder network, called CE-ED-Net, such as Figure 1
[0041] As shown, specifically including:
[0042] (2-a) A codec structure with jump connections is used as the basic network framework. The encoder includes four cascaded encoding blocks, each of which is composed of a symmetric block fusion module and a cross-enhanced self-attention module connected in sequence; the decoder includes four decoding blocks, an addition operation and a softmax operation; the first decoding block is composed of a 1×1 convolution, a convolutional attention module, a 1×1 convolution and an upsampling operation with a step size of 16 connected in sequence, and the output of the fourth encoding block is used as the input of the first decoding block. The upsampling result is the output of the first decoding block; the second decoding block includes an upsampling operation with a step size of 2, an attention gate structure, a splicing operation, a convolutional attention module, a 1×1 convolution and an upsampling operation with a step size of 8. The specific structure includes: first, the output of the convolutional attention module in the first decoding block is upsampled with a step size of 2 to obtain a feature map The output of the third encoding block is then combined with Input the attention gate structure of the second decoding block together to obtain the feature map Then and Splice to get the feature map Last pair Convolutional attention, 1×1 convolution and upsampling with a step size of 8 are performed in sequence to obtain the output of the second decoding block; the third decoding block contains an upsampling operation with a step size of 2, an attention gate structure, a splicing operation, a convolutional attention module, a 1×1 convolution and an upsampling operation with a step size of 4. The specific structure includes: first, the output of the convolutional attention module in the second decoding block is upsampled with a step size of 2 to obtain the feature map The output of the second encoding block is then combined with Input the attention gate structure of the third decoding block together to obtain the feature map Then and Splice to get the feature map Last pair Convolutional attention, 1×1 convolution and upsampling with a step size of 4 are performed in sequence to obtain the output of the third decoding block; the fourth decoding block contains two upsampling operations with a step size of 2, an attention gate structure, a splicing operation, a convolutional attention module, and a 1×1 convolution. The specific structure includes: first, the output of the convolutional attention module in the third decoding block is upsampled with a step size of 2 to obtain the feature map The output of the first encoding block is then combined with Input the attention gate structure of the fourth decoding block together to obtain the feature map Then and Splice to get the feature map Last pair Convolutional attention, 1×1 convolution and upsampling with a step size of 2 are performed in sequence to obtain the output of the fourth decoding block; the outputs of the first decoding block, the second decoding block, the third decoding block and the fourth decoding block are added and fused, and the fusion result is input into the Softmax layer to obtain the final segmentation result;
[0043] (2-b) The symmetric block fusion module described in step (2-a) is denoted as SPM, and its structure is as follows: Figure 2 As shown, specifically including: for input features Perform 3×3 convolution with a step size of 1 and layer normalization in sequence to obtain the feature Then, a parallel two-branch structure is used to identify the features Downsampling is performed, and each branch contains a lossless downsampling operation, thereby obtaining the outputs of the two branches, which are and Finally, g0 and g1 are added and subtracted respectively to obtain the SPM output φ0 = g0-g1 and φ1 = g0+g1, and
[0044] (2-c) The lossless downsampling operation described in step (2-b) is denoted as URDS, and its structure is as follows Figure 3 As shown, specifically including: for input features Perform 3×3 convolution with a step size of 2 and GeLU activation in sequence to obtain the feature Then, the feature Perform upsampling with a step size of 2 to obtain the features And subtract features r and r′ to get feature g m =rr′; then, for g m Morphological dilation and average pooling with a step size of 2 are performed in sequence to obtain the feature Finally, the features and By adding them together, we can get the output of the URDS module;
[0045] (2-d) The cross-enhanced self-attention module described in step (2-a) is denoted as CE-SA, and its structure is as follows Figure 4 As shown, it specifically includes: first, N cascaded cross-connected self-attention modules are used to input features and Process and obtain features and Then, the feature and Perform addition operation to obtain features The characteristics and Perform addition operation to obtain features Finally, Y 0 With Y 1 Splice to get the output features of CE-SA In this embodiment, N=4 is preferred;
[0046] (2-e) The cross-connected self-attention module described in step (2-d) is denoted as C-SA. The specific structure includes: firstly, two branches are constructed, wherein the first branch is composed of a self-attention module and a local enhancement module, and the second branch is composed of a focus module and a local enhancement module; then, a cross connection is introduced between the two branches, specifically, the input feature I 0 It is used not only as the input of the self-attention module in the first branch, but also as the input of the local enhancement module in the second branch; input feature I 1 It is not only used as the input of the focusing module in the second branch, but also as the input of the local enhancement module in the first branch; in addition, the output of the local enhancement module in the branch is the output of C-SA; based on the above description, C-SA contains two input features and two output features;
[0047] (2-f) The self-attention module described in step (2-e) is denoted as SA, and its structure is as follows Figure 5 As shown, it is composed of a normalization layer and a multi-head self-attention structure; the focusing module described in step (2-e) is denoted as FA, which is characterized by being composed of a layer normalization and a focus modulation module; the local enhancement module described in step (2-e) is denoted as LE, and its structure is as follows Figure 6 As shown, it is characterized in that the specific structure includes: the output A of the current branch self-attention module p and the original input I of the other branch 1-p As input, A p and I 1-p Perform concatenation, layer normalization and cross-region learning to obtain feature H1, and then connect H1 with A through residual connection p Perform the addition operation to obtain the output F of LE p ;
[0048] (2-g) The focus modulation module described in step (2-f) has a structure as follows: Figure 7 As shown, the specific structure includes:
[0049] (2-g-i) For input features First, obtain the feature matrix q through linear projection;
[0050] (2-g-ii) Use the context aggregation module to obtain feature Zout The specific process includes: using a linear projection matrix For input features Perform projection and obtain features And according to Z 0 , using deep convolution and GeLU activation operations to obtain Z l =GeLU(DWConv(Z (l-1) )), l∈{1,2,...,L+1}, where DWConv(·) represents a depthwise convolution operation, GeLU(·) represents a GeLU activation operation, Using a linear projection matrix For input features Perform projection and obtain features is the feature map of the lth channel in G; using the broadcast mechanism, Z l and G l Perform dot product summation to obtain features Where ⊙ represents the dot product;
[0051] (2-g-ⅲ) Use linear layers to aggregate context information Z out Compress to get the feature matrix m, and finally dot-multiply q and m to get the output of the focus modulation module;
[0052] (2-h) The cross-region learning described in step (2-f), denoted as CRL, is characterized in that for the input feature Cross-region learning results Ψ p It can be obtained by the following formula:
[0053]
[0054]
[0055] in, Representation feature map The i-th channel in Representation feature map The jth channel in Ω ij represents the learnable weight, b i is bias;
[0056] (2-i) The attention gate structure described in step (2-a) is denoted as AG, such as Figure 8As shown, specifically, it includes: for two input features I1 and I2, where I1 represents the upsampled output with a step size of 2 connected to the current attention gate, and I2 represents the output of the encoding block connected to the current attention gate, firstly, two parallel branches are constructed, each branch contains a 1×1 convolution, batch normalization and ReLU activation function connected in sequence, and I1 and I2 are respectively used as the input of the two branches; then, the branch processing results are added and fused, and 1×1 convolution, batch normalization and Sigmoid activation are performed on the added and fused results in sequence to obtain feature O1; then, O1 is dot-multiplied with the input feature I1 to obtain the output of the attention gate;
[0057] (2-i) The convolutional attention module described in step (2-a) is denoted as CAM, and its structure is as follows: Fig. 9 As shown in the figure, it specifically includes: firstly, construct a two-branch structure, in which one branch includes global maximum pooling, 1×1 convolution, ReLU activation, 1×1 convolution in sequence, and the other branch includes global mean pooling, 1×1 convolution, ReLU activation, and 1×1 convolution in sequence; input feature I3 is input into each branch for processing, and the results obtained from each branch are added, fused, and Sigmoid activated to obtain feature O2; finally, O2 is dot-multiplied with I3 to obtain the output of the convolutional attention module;
[0058] (3) Using training data set A to train the CE-ED-Net network until the preset loss function converges to obtain a trained segmentation network; this embodiment preferably uses a hybrid loss function combining Dice and cross entropy as the objective function of network training;
[0059] (4) Use the trained network to test the image to be segmented and obtain the segmentation result.
[0060] Example 2
[0061] The method in Example 1 is used to experiment with the ISIC 2018 public dataset. The ISIC 2018 dataset is a large-scale medical image dataset of skin diseases collected from different populations. The dataset contains a total of 3694 color images and corresponding segmentation masks. In the experiment, the data is divided into a test dataset and a training dataset in a ratio of 2:8.
[0062] Fig.10 Some experimental results on the test set are shown. Fig.10 (a)~ Fig.10 (c) are three original images randomly selected from the test data. Fig.10 (d)~ Fig.10 (f) is to adopt the method in Example 1 to Fig.10 (a)~ Fig.10(c) The test results show that the lesion areas are effectively segmented.
[0063] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A medical image segmentation method based on cross-enhanced self-attention, characterized in that: The following steps are involved: (1) Establish a training dataset A containing original images and their corresponding segmentation gold standards; (2) Construct a cross-enhanced self-attention based encoder-decoder network, called CE-ED-Net, which specifically includes: (2-a) A codec structure with jump connections is used as the basic network framework. The encoder includes four cascaded encoding blocks, each of which is composed of a symmetric block fusion module and a cross-enhanced self-attention module connected in sequence; the decoder includes four decoding blocks, an addition operation and a softmax operation; the first decoding block is composed of a 1×1 convolution, a convolutional attention module, a 1×1 convolution and an upsampling operation with a step size of 16 connected in sequence, and the output of the fourth encoding block is used as the input of the first decoding block. The upsampling result is the output of the first decoding block; the second decoding block includes an upsampling operation with a step size of 2, an attention gate structure, a splicing operation, a convolutional attention module, a 1×1 convolution and an upsampling operation with a step size of 8. The specific structure includes: first, the output of the convolutional attention module in the first decoding block is upsampled with a step size of 2 to obtain a feature map The output of the third encoding block is then combined with Input the attention gate structure of the second decoding block together to obtain the feature map Then and Splice to get the feature map Last pair Convolutional attention, 1×1 convolution and upsampling with a step size of 8 are performed in sequence to obtain the output of the second decoding block; the third decoding block contains an upsampling operation with a step size of 2, an attention gate structure, a splicing operation, a convolutional attention module, a 1×1 convolution and an upsampling operation with a step size of 4. The specific structure includes: first, the output of the convolutional attention module in the second decoding block is upsampled with a step size of 2 to obtain the feature map The output of the second encoding block is then combined with Input the attention gate structure of the third decoding block together to obtain the feature map Then and Splice to get the feature map Last pair Convolutional attention, 1×1 convolution and upsampling with a step size of 4 are performed in sequence to obtain the output of the third decoding block; the fourth decoding block contains two upsampling operations with a step size of 2, an attention gate structure, a splicing operation, a convolutional attention module, and a 1×1 convolution. The specific structure includes: first, the output of the convolutional attention module in the third decoding block is upsampled with a step size of 2 to obtain the feature map The output of the first encoding block is then combined with Input the attention gate structure of the fourth decoding block together to obtain the feature map Then and Splice to get the feature map Last pair Convolutional attention, 1×1 convolution and upsampling with a step size of 2 are performed in sequence to obtain the output of the fourth decoding block; the outputs of the first decoding block, the second decoding block, the third decoding block and the fourth decoding block are added and fused, and the fusion result is input into the Softmax layer to obtain the final segmentation result; the specific structure of the symmetric block fusion module includes: for the input feature Perform 3×3 convolution with a step size of 1 and layer normalization in sequence to obtain the feature Then, a parallel two-branch structure is used to identify the features Downsampling is performed, and each branch contains a lossless downsampling operation, thereby obtaining the outputs of the two branches, which are and Finally, g0 and g1 are added and subtracted respectively to obtain the outputs of the symmetric block fusion module φ0 = g0-g1 and φ1 = g0+g1, and The cross-enhanced self-attention module has the following structure: First, N cascaded cross-connected self-attention modules are used to analyze the input features. and Process and obtain features and Then, the feature and Perform addition operation to obtain features The characteristics and Perform addition operation to obtain features Finally, Y 0 With Y 1 Splice to get the output features of the cross-enhanced self-attention module (3) Using training data set A to train the CE-ED-Net network until the preset loss function converges, a trained segmentation network is obtained; (4) Use the trained network to test the image to be segmented and obtain the segmentation result.
2. A medical image segmentation method based on cross-enhanced self-attention as claimed in claim 1, characterized in that: The lossless downsampling operation includes the following specific structures: Perform 3×3 convolution with a step size of 2 and GeLU activation in sequence to obtain the feature Then, the feature Perform upsampling with a step size of 2 to obtain the features And subtract features r and r′ to get feature g m =rr′; then, for g m Morphological dilation and average pooling with a step size of 2 are performed in sequence to obtain the feature Finally, the features and Adding them together gives us the output of the lossless downsampling operation.
3. The medical image segmentation method based on cross-enhanced self-attention as claimed in claim 1, characterized in that: The cross-connected self-attention module has a specific structure comprising: firstly, constructing two branches, wherein the first branch is composed of a self-attention module and a local enhancement module, and the second branch is composed of a focus module and a local enhancement module; then, introducing a cross connection between the two branches, specifically, inputting feature I 0 It is not only used as the input of the self-attention module in the first branch, but also as the input of the local enhancement module in the second branch; input feature I 1 It serves not only as the input of the focusing module in the second branch, but also as the input of the local enhancement module in the first branch; in addition, the output of the local enhancement module in the branch is the output of the cross-connected self-attention module; based on the above description, the cross-connected self-attention module contains two input features and two output features.
4. A medical image segmentation method based on cross-enhanced self-attention as claimed in claim 3, characterized in that: The self-attention module is characterized by being composed of a layer normalization and a multi-head self-attention structure; the focus module is characterized by being composed of a layer normalization and a focus modulation module; the local enhancement module is characterized by the specific structure comprising: converting the output A of the current branch self-attention module p and the original input I of the other branch 1-p As input, A p and I 1-p Perform concatenation, layer normalization and cross-region learning to obtain feature H1, and then connect H1 with A through residual connection p Perform the addition operation to obtain the output F of LE p .
5. A medical image segmentation method based on cross-enhanced self-attention as claimed in claim 4, characterized in that: The focus modulation module is characterized in that the specific structure includes: (1) For input features First, obtain the feature matrix q through linear projection; (2) Use the context aggregation module to obtain feature Z out The specific process includes: using a linear projection matrix For input features Perform projection and obtain features And according to Z 0 , using deep convolution and GeLU activation operations to obtain Z l =GeLU(DWConv(Z (l-1) )), l∈{1,2,...,L+1}, where DWConv(·) represents a depthwise convolution operation, GeLU(·) represents a GeLU activation operation, Using a linear projection matrix For input features Perform projection and obtain features Using the broadcast mechanism, Z l and G l Perform dot product summation to obtain features Where ⊙ represents the dot product; (3) Use linear layers to aggregate context information Z out Compress it to get the feature matrix m, and finally dot-multiply q and m to get the output of the focus modulation module.
6. A medical image segmentation method based on cross-enhanced self-attention as claimed in claim 4, characterized in that: The cross-region learning is characterized in that for the input feature Cross-region learning results Ψ p It can be obtained by the following formula: in, Representation feature map The i-th channel in Representation feature map The jth channel in Ω ij represents the learnable weight, b i For bias.
7. The medical image segmentation method based on cross-enhanced self-attention as claimed in claim 1, characterized in that: The attention gate structure specifically includes: for two input features I1 and I2, where I1 represents the upsampled output with a step size of 2 connected to the current attention gate, and I2 represents the output of the encoding block connected to the current attention gate, first construct two parallel branches, each branch contains a 1×1 convolution, batch normalization and ReLU activation function connected in sequence, and I1 and I2 are respectively used as inputs of the two branches; then the branch processing results are added and fused, and the results of the addition and fusion are sequentially performed with 1×1 convolution, batch normalization and Sigmoid activation to obtain feature O1; then O1 is dot-multiplied with an input feature I1 to obtain the output of the attention gate.
8. The medical image segmentation method based on cross-enhanced self-attention as claimed in claim 1, characterized in that: The convolutional attention module is characterized in that it specifically includes: first constructing a two-branch structure, one branch sequentially includes global maximum pooling, 1×1 convolution, ReLU activation, and 1×1 convolution, and the other branch sequentially includes global mean pooling, 1×1 convolution, ReLU activation, and 1×1 convolution; inputting the input feature I3 into each branch for processing, and adding and fusion the results obtained from each branch and sigmoid activation to obtain feature O2; finally, performing a dot product of O2 and I3 to obtain the output of the convolutional attention module.
Citation Information
Patent Citations
Abdominal CT image multi-organ segmentation method based on deep learning
CN116721253A
Transformer target tracking method and tracker based on symmetric cross attention and position information enhancement
CN116862949A