A medical image segmentation method based on a distributed attention Swin Unet variant

By using the SASUNet model, a variant of the Swin Unet, combined with an encoder-decoder structure and a distraction attention module (CSA), the problems of noise, blur, and low contrast in medical image segmentation are solved, achieving efficient automatic segmentation of lesion regions and improving segmentation accuracy and robustness.

CN116524187BActive Publication Date: 2026-01-02HANGZHOU NORMAL UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310479849.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-28
Publication Date
2026-01-02
Estimated Expiration
2043-04-28

AI Technical Summary

Technical Problem

Existing medical image segmentation methods are not accurate enough when processing noisy, blurry, and low-contrast medical images. They are also difficult to acquire and label, making it hard to effectively capture changes in the shape and size of lesion areas. Furthermore, data security and labeling costs are high.

Method used

We employ a SASUNet model based on a variant of the Swing Unet, combining an encoder-decoder structure and a distraction attention module (CSA). By skipping the cross-connection module (SCCA) to preserve low-level features, we enhance the model's feature representation capability and robustness. We train the model using Dice loss and BCE loss to achieve automatic segmentation of lesion regions.

Benefits of technology

It improves the accuracy and efficiency of medical image segmentation, effectively handles large-scale images, reduces computational complexity, enhances the generalization performance of the model, and is applicable to different types of medical image datasets.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116524187B_ABST
    Figure CN116524187B_ABST
Patent Text Reader

Abstract

The present application relates to a kind of medical image segmentation methods based on attention dispersion Swin Unet variant.The present application is by constructing segmentation model SASUNet, combined with convolution and Transformer, reconstructs decoder, combines the feature map of different receiving field to output the feature mapping with different receiving field size combination, enhances the multiscale representation of SASUNet;Join the skip connection module, make the encoder and decoder cross participate to more effectively save underlying features, also apply effective attention mechanism to obtain multi-level representation for modeling, to improve the weight ratio of target area feature.Set training strategy and loss function, train the model;Verify the well-trained model;The present application effectively combines Swin Unet and CNN, the function of long-range dependence of Transformer can capture global information is combined with the function of CNN can capture more detailed local information, realizes the automatic segmentation of focus part from medical image.
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 a medical image segmentation method based on a Swin Unet variant with dispersed attention. BACKGROUND

[0002] Medical images are widely used in the medical field, which can provide important information about diseases for doctors and clinical 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 algorithm plays 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 a 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 achieved excellent results in segmentation tasks, the locality of convolutional layers limits the ability of these networks to capture shape and structure information, which is crucial for medical image segmentation. In order to solve these limitations, various network structures based on Transformer have been proposed, such as ViT (Vision Transformer) and Swin Unet, which use multi-head self-attention mechanisms, enabling 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. Acquisition of medical images: medical images are not like natural images, which are associated with patient information, making data security a major concern for hospitals. Therefore, it is very difficult to obtain medical image data from hospitals through normal channels. In addition, it is also very difficult to obtain image annotation from professionals. In addition, the content related to diagnosis also needs to be matched with clinical data, and the image-clinical data connection is more difficult. 3. Annotation of medical images: based on the acquisition of data, deep learning combined with prior knowledge to train the model, the training set needs to be annotated in advance. Because most of the annotation relies on manual recognition, data annotation will consume a large amount of manpower and time, and obtaining high-reliability annotation data in the medical image field has become one of the challenges. SUMMARY

[0006] The purpose of the present application is to provide a Swin Unet variant medical image segmentation method based on separate attention, which can accurately segment the lesion part in the medical image.

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

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

[0009] Collect medical images, pre-process these images, expand the sample size, and normalize the sample images;

[0010] Step two, constructing a segmentation model SASUNet:

[0011] The segmentation model SASUNet is constructed based on the encoder-decoder structure of U-Net, and includes an encoder, a decoder and a skip cross connection module SCCA.

[0012] The encoder part is the encoder part in Swin Unet, and the decoder part includes a scattered attention module CSA.

[0013] In the encoder:

[0014] The input medical image is segmented into non-overlapping patch blocks, and then each patch block is passed to a linear embedding layer to obtain new embedding feature representation after processing. The output of the linear embedding layer is processed by multiple consecutive Swin transformer blocks, and the feature information of the patch is input to the patch merging layer.

[0015] The patch merging layer connects adjacent patches, and integrates the feature information of adjacent patches through the linear layer in the patch merging layer, reduces the number of patches by half, and expands the channel dimension to twice the original; The output of the patch merging layer is processed by multiple consecutive Swin transformer blocks.

[0016] The function of the Swin transformer block is to convert the input feature map into a higher level feature representation, so that the model can better understand the input data. Through the processing of four patch merging layers + Swin transformer blocks, high-level features in the input image are gradually extracted, the depth and width of the model are increased, and the model has stronger representation ability and better generalization performance; effectively reduce the computational complexity, improve the efficiency and speed of the model. It is used to better process large-scale images, thereby improving the accuracy and efficiency of image segmentation.

[0017] The Swin transformer block includes a normalization layer LN, a window-based multi-head self-attention module W-MSA, a window-based multi-head self-attention module SW-MSA, a residual connection and a double-layer multi-layer perception layer MLP with an activation function GELU nonlinearity. Its calculation formula is as follows:

[0018]

[0019]

[0020] wherein, and z l denote the output of the l-th layer W-MSA and MLP, respectively; and z l+1 denote the output of the l+1-th layer SW-MSA and MLP, respectively;

[0021] The self-attention calculation of W-MSA and SM-MSA is as follows: wherein, denote the query, key and value matrices; M 2 and d represent the number of patch blocks of the window and the dimension of the query matrix or the key matrix, respectively; the value of B is taken from the bias matrix

[0022] The decoder block includes a plurality of dispersive attention blocks CSA and connection layers, and the connection layers are correspondingly arranged with patch merging layers. The output features of each patch merging layer are processed by a plurality of consecutive Swin transformer blocks, and then forwarded to the corresponding connection layer through a skip cross connection module SCCA.

[0023] In the decoder:

[0024] The output features X1 of each connection layer are used as the input features of the next CSA block, and the output features of the last Swin transformer block of the encoder are used as the input features of the first connection layer of the decoder.

[0025] The output features of the CSA block are connected with the output features of the corresponding skip cross connection module SCCA through the connection layer, and then used as the input features of the next CSA block. The output features of the last CSA block are converted into a binary segmentation mask through a layer of 1*1 Conv convolution and an activation function Sigmoid. This mask is used for comparison with the labeled data, so as to calculate the loss and update the model parameters.

[0026] The skip cross connection module SCCA cross participates in the features of the encoder and the decoder, so as to more effectively save the underlying features, help the model better perceive and capture important features, and thus improve the accuracy and robustness of medical image segmentation.

[0027] The skip cross connection module SCCA applies an effective attention mechanism, and the input of the query vector is the output X2 of a plurality of consecutive Swin transformer blocks forwarded by each skip connection module.

[0028] The output feature X1 of each connection layer is scaled to a vector X'1 of the same embedding dimension as the output X2 of the multiple consecutive Swin transformer blocks forwarded by the corresponding skip connection module through a linear layer within the CSA block. X'1 is mapped to the subspace of the key vector and the value vector, and the weight d of the key vector and the value vector of the pixel point is calculated k and d v X2 is mapped to the subspace of the query vector Q, and the weight d of the query vector of the pixel point is calculated q .

[0029] Then, the weight vector d k represented by the value vector K and the weight vector d q represented by the query vector Q are dot multiplied to obtain the global context vector G:d q *d k ;

[0030] Finally, the output vector E is obtained by dot multiplying the global context vector G and the weight vector d v represented by the key vector V.

[0031] The CSA module sets two feature groups to reduce the number of parameters of the entire network.

[0032] After the input features are processed by a 1x1 convolution, they are divided into two groups: one group is F1 and the other group is F2. Both groups of features undergo a 3x3 convolution. The output feature map of F2 is combined with the result of F1, and then undergoes another 3x3 convolution to receive semantic information from both split groups and expand the network's receptive field, thereby having stronger ability to extract global and local information from feature maps.

[0033] The channel statistics information generated by the global average pooling of the input features processed as described above collects global spatial information: the cth component obtained by spatial dimension compression conversion output and calculation, wherein the cth component is based on channel soft attention, and the key information in the feature map is captured by segmentation and weighted combination.

[0034] Finally, the vector weighting result is connected with the residual, and normalized and activated to obtain the output feature map. Step three, set the training strategy and loss function, and train the model;

[0035] The preprocessed data set is divided into a training set, a test set and a validation set; the combination of Dice loss and BCE loss is used to train all models, and a regularization strategy is used to prevent overfitting; the back propagation algorithm is used in the SASUnet 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;

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

[0037] The segmented verification set is input into the trained segmentation model SASCAUNet, and after the segmentation of the model, the lesion part in the medical image is segmented out, the segmented image is compared and evaluated with the lesion area judged by experts, and the network model is verified.

[0038] Step five, input any medical image into the verified model to segment the lesion part.

[0039] Compared with the prior art, the above technical scheme has the following technical effects:

[0040] The present application effectively combines Swin Unet and CNN, combines the function of long-range dependence of Transformer to capture global information with the function of CNN to capture more detailed local information, enhances the functionality and flexibility of the traditional encoder-decoder architecture, and applies it to the field of medical image segmentation, and realizes the automatic segmentation of the lesion part from the medical image.

[0041] The encoder part of the present application applies the Swin Unet part. The multi-scale representation of Swin-Unet enhances the representation ability of features, but the spatial context is still limited in this process. In order to enhance the multi-scale representation of SASUNet, a CSA block with a multi-branch feature group with attention mechanism is constructed. The CSA block mainly has two groups, each group is composed of different number of convolutions, and uses attention mechanism to highlight meaningful features. Therefore, the CSA block can combine feature maps with different receptive fields to output feature maps with different receptive field size combinations.

[0042] Use the skip connection module SCCA to save more effective low-level features by applying effective attention mechanism, provide more effective spatial information for the decoder, so that it can recover fine-grained details when generating output mask; in medical images, the lesion area may have irregular boundary and discontinuous shape, so the generated medical segmentation image may have the 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 effective spatial information. BRIEF DESCRIPTION OF DRAWINGS

[0043] Figure 1 The structure diagram of the SASUnet network of the present application;

[0044] Figure 2 The structure diagram of the Swin transformer block;

[0045] Figure 3A structural diagram of a skip connection cross-attention module SCCA;

[0046] Figure 4 A structural diagram of a context scattering module CSA;

[0047] Figure 5 A medical image for testing;

[0048] Figure 6 A Figure 5 An image after lesion segmentation. DETAILED DESCRIPTION

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

[0050] A medical image segmentation method based on a context scattering Swin Unet variant, specifically comprising the following steps:

[0051] Step one, pre-process and enhance the data of the medical image:

[0052] In this example, the medical image Kvasir-SEG segmented by doctors and cross-validated by professional gastroenterology experts and the medical image CVC-ClinicDB dataset extracted from colonoscopy video frames are used to train the model, and then the images are rotated, cropped, scaled, grayscale, and normalized to expand the dataset, expand the sample size of the experiment, and finally normalize the images.

[0053] Step two, build a segmentation model SASUNet:

[0054] The segmentation model SASUNet is built based on the encoder-decoder structure of U-Net, and the segmentation model SASUNet includes an encoder, a decoder, and a skip cross-connection module SCCA.

[0055] As shown in Figure 1 , the encoder part is the encoder part in Swin Unet, and the decoder part includes a context scattering module CSA.

[0056] In the encoder:

[0057] The input medical image (384*384*3) is divided into 8x8 non-overlapping patch blocks, and then each patch block is passed to a linear embedding layer to obtain a new embedding feature representation after processing. The output of the linear embedding layer is processed by multiple consecutive Swin transformer blocks, and the feature information of the patch is input into the patch merging layer.

[0058] The patch merging layer connects adjacent patches, integrates the feature information of adjacent patches through a linear layer in the patch merging layer, reduces the number of patches by half, and expands the channel dimension to twice the original; the output of the patch merging layer passes through multiple consecutive Swin transformer blocks.

[0059] As shown in Figure 2 The Swin transformer block includes a normalization layer LN, a window-based multi-head self-attention module W-MSA, a window-based multi-head self-attention module SW-MSA with displacement, a residual connection, and a double-layer multi-layer perception layer MLP with an activation function GELU nonlinearity. Its calculation formula is as follows:

[0060]

[0061]

[0062] wherein, and z l respectively represent the output of the lth layer W-MSA and MLP; and z l+1 respectively represent the output of the l+1th layer SW-MSA and MLP;

[0063] The self-attention calculation of W-MSA and SM-MSA is as follows: wherein, denotes the query, key and value matrices; M 2 and d respectively represent the number of patch blocks of the window and the dimension of the query matrix or the key matrix; the value of B is taken from the bias matrix

[0064] The decoder block includes multiple dispersive attention blocks CSA and connection layers, and the connection layers are correspondingly arranged with the patch merging layers. The output features of each patch merging layer are forwarded to the corresponding connection layer through the skip cross connection module SCCA after being processed by multiple consecutive Swin transformer blocks.

[0065] The output features X1 of each connection layer are used as the input features of the next CSA block, and the output features of the last Swin transformer block of the encoder are used as the input features of the first connection layer of the decoder.

[0066] The output features of the CSA block are connected with the output features of the corresponding skip cross connection module SCCA through the connection layer, and then used as the input features of the next CSA block. The output features of the last CSA block are converted into a binary segmentation mask through a layer of 1*1 Conv convolution and an activation function Sigmoid. This mask is used for comparison with the labeled data, so as to calculate the loss and update the model parameters.

[0067] As Figure 3 shown, the skip cross-connection module SCCA is not simply connected to the features of the encoder and decoder layers, but cross-participates in them to more effectively preserve the underlying features, helping the model to better perceive and capture important features, thereby improving the accuracy and robustness of medical image segmentation.

[0068] The skip cross-connection module SCCA applies an effective attention mechanism, and the input of the query vector is the output X2 of multiple consecutive Swin transformer blocks forwarded by each skip connection module.

[0069] The output features X1 of each connection layer are scaled to a vector X'1 of the same embedding dimension as the output X2 of the multiple consecutive Swin transformer blocks forwarded by the corresponding skip connection module through the linear layer within the CSA block. X'1 is mapped to the subspace of the key vector and the value vector, and the weight d k and d v of the key vector and the value vector of the pixel point are calculated, while X2 is mapped to the subspace of the query vector Q, and the weight d q of the query vector of the pixel point is calculated.

[0070] Then, the weight vector d k represented by the value vector K and the weight vector d q represented by the query vector Q are dot multiplied to obtain the global context vector G: d q *d k .

[0071] Finally, the global context vector G and the weight vector d v represented by the key vector V are dot multiplied to obtain the output vector E.

[0072] The specific calculation formula is as follows: X'1 = FC(X1), K, V = Proj(X'1), Q = Proj(X2), G = ρ k (K T )Q, E = ρ v (V)G.

[0073] Where ρ v , ρ k are normalization functions, n1 is the embedding dimension of the pixel point of X1, n2 is the embedding dimension of the pixel point of X2, d is the number of feature channels of the image, and Proj is the projection function.

[0074] As Figure 4 shown, the CSA module reduces the number of parameters of the entire network by setting two feature groups (N = 2).

[0075] After the input features are processed by a 1x1 convolution, they are divided into two groups: one group is F1 and the other group is F2. Both groups of features are subjected to a 3x3 convolution. The output feature map of F2 is combined with the result of F1, and then subjected to another 3x3 convolution to receive semantic information from the two split groups and expand the network's receptive field, thereby having stronger ability to extract global and local information from the feature map.

[0076] The channel statistics generated by the global average pooling of the input features processed as described above collect global spatial information: the output is converted by spatial dimension compression and the cth component is calculated, where the cth component is based on channel soft attention, and the key information in the feature map is captured by segmented weighted combination.

[0077] Finally, the resulting vector weighting result is connected with a residual, and normalized and activated to obtain the output feature map.

[0078] The specific calculation formula is as follows: Where H, W, and C are the scale of the output feature map, represents the output feature;

[0079] Calculate the cth component, where c represents all components of each channel: Where a i is a (soft) assignment weight: Where represents the weight of the cth channel to the global spatial information S, and is quantified using two 1x1 convolutions and BatchNorm and ReLU activation.

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

[0081] The preprocessed data set is divided into training set, test set and validation set; the combination of Dice loss and BCE loss and an Adam optimizer with a learning rate of 1e-4 is used to train all models; set BatchSize, epoch and appropriate learning rate, and use regularization strategy to prevent overfitting; the back propagation algorithm is used in the SASUnet 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;

[0082] According to the set training strategy, the SASUnet network model is trained; in the training stage, SASUnet 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 the loss function, the combination of Dice loss (Dice Loss) and binary cross entropy loss (Binary Cross Entropy Loss) is used to train all networks;

[0083] Thus the loss function is:

[0084]

[0085]

[0086] Loii = aL Dice + βL BCE ;

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

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

[0089] The segmented verification set is input into the trained segmentation model SASUNet, 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;

[0090] Four widely used evaluation criteria are used to measure the performance of the SASUnet model; the evaluation indicators are as follows:

[0091] 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, V nT represents the true segmented area; TP, TN, FP, FN represent true positive, true negative, false positive, and false negative, respectively;

[0092]

[0093] Sensitivity (Sensitivity): SEN represents the percentage of correctly segmented lesion area;

[0094] Specificity (Specificity): SPE represents the percentage of correctly segmented non-lesion area;

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

[0096] Step 5: Input any medical data into the validated model, and output a medical image of the segmented lesion:

[0097] Select medical images for testing, such as Figure 5 As shown, medical images before segmentation are complex due to factors such as noise, shooting angle, and interference between different organs. This necessitates a model capable of accurately extracting these features for effective segmentation. The SASUNet model effectively extracts features from medical images, providing strong support for subsequent segmentation. Figure 6 As shown, in the segmented medical image, the SASUNet model can accurately segment the lesion area, clearly delineating it from the surrounding normal tissue. This result provides significant assistance to doctors in diagnosis and treatment.

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

[0099] 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 a distributed attention Swin Unet variant, the specific implementation steps are as follows Step one, pre-processing and enhancement of medical image data: Collect medical images, pre-process these images, expand the sample size, and normalize the sample images; Step two, build a segmentation model SASUNet: Build a segmentation model SASUNet based on the encoder-decoder structure of U-Net, which includes an encoder, a decoder, and a skip cross connection module SCCA; The encoder part is the encoder part in Swin Unet, and the decoder part includes a distributed attention module CSA; In the encoder: The input medical image is divided into non-overlapping patch blocks, and then each patch block is passed to a linear embedding layer to obtain new embedding feature representation after processing; The output of the linear embedding layer is processed by multiple consecutive Swin transformer blocks, and the feature information of the patch is input into the patch merging layer; The patch merging layer connects adjacent patches, integrates the feature information of adjacent patches through the linear layer in the patch merging layer, reduces the number of patches by half, and expands the channel dimension to twice the original; The output of the patch merging layer is processed by multiple consecutive Swin transformer blocks; The function of the Swin transformer block is to convert the input feature map into a higher level feature representation, so that the model can better understand the input data; Through four patch merging layers + Swin transformer blocks, high-level features in the input image are gradually extracted, the depth and width of the model are increased, and the model has stronger representation ability and better generalization performance; effectively reduce the computational complexity, improve the efficiency and speed of the model; It is used to better process large-scale images, thereby improving the accuracy and efficiency of image segmentation; The decoder block includes multiple distributed attention blocks CSA and connection layers, and the connection layers are correspondingly arranged with the patch merging layers. The output features of each patch merging layer are processed by multiple consecutive Swin transformer blocks, and then forwarded to the corresponding connection layer through the skip cross connection module SCCA. In the decoder: The output features X1 of each connection layer are used as the input features of the next CSA block, and the output features of the last Swin transformer block of the encoder are used as the input features of the first connection layer of the decoder; The output features of the CSA block are connected with the output features of the corresponding skip cross connection module SCCA through the connection layer, and then used as the input features of the next CSA block. The output features of the last CSA block are converted into a binary segmentation mask through a layer of 1*1Conv convolution and an activation function Sigmoid. This mask is used to compare with the labeled data to calculate the loss and update the model parameters; The skip cross connection module SCCA cross participates in the characteristics of the encoder and the decoder to more effectively save the underlying characteristics, help the model better perceive and capture important features, and thus improve the accuracy and robustness of medical image segmentation; Step three, set the training strategy and loss function, and train the model; The preprocessed data set is divided into a training set, a test set and a validation set; the model is trained using a combination of Dice loss and BCE loss, and a regularization strategy is used to prevent overfitting; the back propagation algorithm is used to update the weights and biases in the SASUnet network model; The loss function is used to update the parameters during the training iteration process; Step four, verify the trained network model: The segmented validation set is input into the trained segmentation model SASCAUNet, and the lesion part in the medical image is segmented out after the segmentation of the model, and the segmented image is compared and evaluated with the lesion area judged by experts, and the network model is verified. Step five, input any medical image into the verified model to segment the lesion part.

2. The attention-based Swin Unet variant medical image segmentation method of claim 1, wherein: The step one image preprocessing specifically rotates, crops, scales or grays the image.

3. The medical image segmentation method based on the attention-based Swin Unet variant of claim 1, wherein: The Swin transformer block of step two includes a normalization layer LN, a window-based multi-head self-attention module W-MSA, a window-based multi-head self-attention module SW-MSA with displacement, a residual connection, and a double-layer multi-layer perception layer MLP with an activation function GELU nonlinearity; the calculation formula is as follows: wherein, and z l denote the output of the l-th layer W-MSA and MLP, respectively; and z l+1 denote the output of the l+1-th layer SW-MSA and MLP, respectively; The self-attention calculation of W-MSA and SM-MSA is: wherein, denote the query, key, and value matrices; M 2 and d represent the number of patch blocks of the window and the dimension of the query matrix or the key matrix, respectively; the value of B is taken from the bias matrix 4. The attention-based Swin Unet variant medical image segmentation method of claim 1, wherein: The skip cross connection module SCCA of step two applies an effective attention mechanism, and the input of the query vector is the output X2 of multiple consecutive Swin transformer blocks forwarded by each skip connection module; The output feature X1 of each connection layer is scaled to a vector X1' of the same embedding dimension as the output X2 of the plurality of consecutive Swin transformer blocks forwarded by the corresponding skip connection module through a linear layer within the CSA block; X1' is mapped to a subspace of key vectors and value vectors to calculate the weight d of the key vector and the value vector of the pixel point k and d v , and X2 is mapped to a subspace of query vectors Q to calculate the weight d of the query vector of the pixel point q ; Then, the weight vector d represented by the value vector K k and the weight vector d represented by the query vector Q q The dot product operation is performed to obtain the global context vector G:d q *d k ; Finally, the global context vector G and the key vector V represent the weight vector d v The dot product operation is performed to obtain the output vector E.

5. The distraction Swin Unet variant medical image segmentation method of claim 1, wherein: The CSA module of step two reduces the number of parameters in the entire network by setting two feature groups; After the input features are passed through a 1x1 convolution, they are divided into two groups: one group is F1 and the other group is F2; both groups of features are subjected to a 3x3 convolution; the output feature map of F2 is combined with the result of F1, and then subjected to another 3x3 convolution to receive semantic information from both split groups, expand the network's receptive field, and thus have stronger ability to extract global and local information from the feature map; The channel statistical information generated by the global average pooling of the input features processed as described above collects global spatial information: the output is converted through spatial dimension compression and the cth component is calculated, where the cth component is based on channel soft attention, and the key information in the feature map is captured through segmentation and weighted combination; Finally, the resulting vector weighting result is subjected to residual connection, normalization and activation operation to obtain the output feature map.

Citation Information

Patent Citations

  • Transform and U-Net combined medical image liver segmentation method and system

    CN115965633A

  • Medical image segmentation method based on u-net

    US20220309674A1