Medical image multi-organ segmentation method based on global context interaction Transform

By using the global context interactive Transformer method in multi-organ segmentation of medical images, combining local and global self-attention modules, and using skip connection cross-attention modules, the problem of difficulty in extracting multi-organ details and global features in the existing technology is solved. High-precision segmentation of multi-organ medical images is achieved.

CN118570222APending Publication Date: 2024-08-30SHAANXI UNIV OF SCI & TECH

Patent Information

Application Number
CN202410708113.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-03
Publication Date
2024-08-30

AI Technical Summary

Technical Problem

Existing deep learning-based multi-organ segmentation methods for medical images are difficult to simultaneously extract and retain detailed information and global context semantic features of multiple organs, and the receptive field of convolution is limited, making it difficult to completely extract the boundary features of the organs to be segmented.

Method used

Using a medical image multi-organ segmentation method based on the global context interactive Transformer, the GCTNet network model is designed, including an encoder, a decoder, a skip connection cross-attention module and a context interactive Transformer module. Through local self-attention and global self-attention modules Combination, captures complex features in multi-organ medical images, and fuses features through skip connection cross-attention modules to extract complete boundary features of organs.

Benefits of technology

It improves the accuracy and performance of multi-organ medical image segmentation, can accurately locate and extract key features of organs, fully utilizes local and global information, and enhances the model's ability to extract and represent image features.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118570222A
    Figure CN118570222A
Patent Text Reader

Abstract

The invention discloses a medical image multi-organ segmentation method based on global context interaction Transform, and the method comprises the steps: 1, constructing a multi-organ medical image data set, carrying out the data enhancement, and dividing a training set, a verification set, and a test set; 2, constructing a medical image multi-organ segmentation model GCTNet based on global context interaction Transform, wherein the medical image multi-organ segmentation model GCTNet comprises an encoder, a decoder, a jump connection cross attention module, a linear projection layer and a bottleneck block; step 3, inputting the training set into the network model GCTNet, training the network model GCTNet and updating parameters; 4, inputting the verification set into the network model GCTNet to verify the performance of the network model GCTNet, and optimizing the parameters of the network model GCTNet to obtain an optimal network model GCTNet; and step 5, inputting the test set into the optimal network model GCTNet, and predicting a segmentation result. According to the method, the image feature extraction and expression capability of the model is improved, and the segmentation precision of each organ in the multi-organ medical image is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of image processing, and in particular is a medical image multi-organ segmentation method based on a global context interactive Transformer. Background Art

[0002] Medical image multi-organ segmentation technology aims to effectively separate the target organ area from the background in the medical image to form multiple non-intersecting connected areas. This not only helps in the early diagnosis of the disease and the precise positioning of the lesion area, but also improves the accuracy and reliability of the diagnosis. By accurately segmenting the organs of medical image data, personalized treatment plans can be formulated for each patient, which is of great significance in the fields of radiotherapy and surgical planning.

[0003] With the continuous development of deep learning technology, the application scenarios of multi-organ segmentation methods based on deep learning are becoming increasingly extensive, bringing unprecedented changes to the medical field, enabling doctors to interpret and analyze medical image data more efficiently and accurately. However, due to the scarcity of medical image data, differences in imaging equipment, organ tissue deformation, and imbalance of multiple organ categories, the multi-organ segmentation task still faces many challenges. Therefore, how to overcome the adverse effects of the above factors on the performance of multi-organ segmentation and ensure that all organs can be accurately and reliably segmented is crucial to improving the quality of medical images and clinical application effects.

[0004] In recent years, scholars have proposed many multi-organ segmentation methods based on deep learning, which mainly include two categories: multi-organ segmentation based on multi-scale information fusion and multi-organ segmentation based on attention mechanism.

[0005] Since different organs differ significantly in size, morphology, and structure, it is often difficult to fully capture the characteristics of each organ by relying solely on information at a single scale. Therefore, scholars have proposed a series of multi-organ segmentation methods based on multi-scale information fusion, aiming to improve the accuracy and robustness of segmentation by effectively integrating feature information at different scales. For example, Ronneberger et al. ingeniously designed the U-Net architecture, which directly transfers the deep features extracted from the downsampling layer to the upsampling layer by introducing jump connections, thereby achieving pixel-level precise positioning and significantly improving segmentation performance. However, the optimal network depth of U-Net has not yet been determined, and the limitation of jump connections means that it can only operate on feature maps of the same scale in the encoder and decoder subnets, and cannot fully fuse shallow and deep feature information. ; To overcome these limitations, Zhou et al. further proposed U-Net++, which consists of a series of U-Nets of different depths. It cleverly introduced nested and dense jump connections, effectively integrating shallow and deep feature information, not only reducing the semantic gap between the encoder and the decoder, but also significantly improving the overall segmentation performance of the model. However, U-Net++ loses edge information, especially in low-contrast images; In order to obtain sufficient feature information in the global scope, Li et al. proposed H-DenseUNet, which extracts semantic features within the slice and between different slices, makes full use of contextual information for feature fusion, and improves the segmentation accuracy of organ boundaries. However, the network structure is relatively complex, has a large number of parameters, and consumes a lot of memory resources. To address the above problems, Brügger et al. proposed a partially reversible U-Net architecture, which uses a single reversible sequence in the encoder and decoder to accurately restore the output of each layer from the output of the subsequent layer, avoiding the need to store a large number of activation values ​​for back propagation, thereby greatly reducing memory consumption. Although it can combine features of different scales to obtain features containing high-level semantic information and low-level detail information, thereby improving segmentation performance, it is difficult to achieve accurate positioning and feature extraction of segmentation targets, and it is impossible to focus on the key features of segmented organs, resulting in mis-segmented areas and irrelevant features in the segmentation results.

[0006] In order to effectively suppress useless information, enhance the attention to multi-organ regions, and focus on the key features of multi-organs, scholars have proposed many multi-organ segmentation methods based on attention mechanisms. For example, Hu et al. proposed SENet, which adaptively adjusts the channel weights of feature maps by introducing a channel attention mechanism, so that the network can focus more on high-level semantic features, thereby effectively weakening the potential interference of redundant features on network training. By optimizing the importance distribution of feature channels, SENet significantly improves the segmentation performance. However, the fully connected layer and activation functions such as ReLU and Sigmoid that SENet relies on inevitably increase the amount of calculation and parameters, which affects the model's operational efficiency and training cost to a certain extent. In addition, the dimensionality reduction operation also leads to the loss of feature information, which has a certain impact on the segmentation performance of the model. ; To overcome these limitations, Wang et al. proposed a lightweight channel attention module ECANet. This network not only maintains excellent performance through moderate cross-channel interaction, but also significantly simplifies the model structure, thereby greatly improving computational efficiency. However, ECANet still faces some challenges when segmenting multiple organs, such as blurred organ boundaries, confusion between segmented targets and backgrounds, etc. To address the above problems, Oktay et al. proposed AttentionU-Net. Based on U-Net, this network dynamically adjusts the importance of feature images by adding attention modules between different layers of the encoder and decoder, thereby enhancing the ability to integrate local and global information, better capturing organ boundaries and key features in the image, and thus improving the segmentation accuracy of organs of interest. However, AttentionU-Net The training and optimization process of U-Net is relatively complex, and there is a risk of overfitting. To solve these problems, Schlemper et al. proposed AG-Net, which combines the SE module with a gating mechanism. The gating unit dynamically controls the attention distribution of each channel in the feature map, thereby focusing on organ regions of different sizes and shapes, improving the attention to organ regions, and highlighting features that are useful for segmentation tasks. However, the network has problems such as high computational complexity, large number of parameters, and poor generalization ability.

[0007] As a type of attention mechanism, the self-attention mechanism allows the model to consider the relationship between each position in the sequence while processing sequence data. It is a core component of the Transformer. With the rise of the Transformer, the multi-organ segmentation algorithm based on the Transformer has also developed rapidly. In 2020, Google proposed the Vision Transformer (ViT), which divides the image into a series of small image blocks, uses the linear embedding sequence of these blocks as the network input, and then generates a vector representation representing the entire image after processing. This method can capture the global information in the image, thereby significantly improving the model performance. However, ViT has low processing efficiency for large-size images and has certain shortcomings in processing local information and details. To make up for this shortcoming, Liu et al. proposed the Swin Transformer, which performs feature extraction based on a layered window and shows strong feature expression ability and good scalability. However, in specific scenarios such as processing extremely small target organs or complex backgrounds, the segmentation performance of the Swin Transformer is still lacking. To address this problem, Gao et al. further proposed Swin-Unet based on the Swin Transformer, which transforms Swin Transformer has been successfully applied to the U-Net architecture. By introducing skip links to learn local and global semantic features, it has strong feature extraction capabilities, low computational complexity and good segmentation performance. However, Swin-Unet has a large demand for computing resources and time, and its generalization performance needs to be improved, which may cause overfitting. In order to compensate for the loss of image feature resolution that may be caused by Transformer during processing, TransUNet adopts a strategy that combines CNN feature extraction and global context information encoding. It uses CNN to extract low-level features and combines Transformer to encode global information. It has achieved remarkable results in image semantic modeling, but the segmentation performance of this method for small targets is still low. In response to the above problems, Huang et al. proposed the MISSFormcr model. By designing an enhanced Transformer context bridge module, it effectively captures the global and local information of the image, further improving the multi-organ segmentation performance. However, this model requires a large amount of labeled data and is sensitive to the distribution of training data. When facing different environments or data sets, the generalization ability of the model is very limited and the performance may decline.

[0008] In summary, the existing deep learning-based multi-organ segmentation methods for medical images still face two problems: first, they cannot simultaneously extract and retain the detailed information and global contextual semantic features of multiple organs; second, the receptive field of convolution is limited, making it difficult to fully extract the boundary features of the organs to be segmented. Summary of the invention

[0009] In view of the shortcomings of the prior art, the purpose of the present invention is to provide a medical image multi-organ segmentation method based on a global context interactive Transformer, which can accurately locate and extract the key features of organs and achieve accurate segmentation of multiple organs.

[0010] In order to achieve the above object, the present invention adopts the following technical solutions:

[0011] The multi-organ segmentation method of medical images based on global context interactive Transformer includes the following steps:

[0012] Step 1: Build a multi-organ medical image dataset and perform data enhancement, then divide it into training set, validation set and test set;

[0013] Step 2: Construct a medical image multi-organ segmentation model GCTNet based on global contextual interaction Transformer, which includes an encoder, a decoder, a jump connection cross attention module, a linear projection layer and a bottleneck block, wherein: the encoder includes a Patch Embedding and three sequentially stacked encoding blocks, each encoder module consists of two consecutive contextual interaction Transformer modules and a Patch Merging layer; the decoder Decoder includes three stacked decoding blocks, each decoding block consists of two consecutive contextual interaction Transformer modules and a Patch Expanding layer;

[0014] The contextual interactive Transformer module includes an external attention module that focuses on calculating the correlation between samples and a contextual self-attention module for building dependencies between different granularities. The contextual self-attention module includes a local self-attention module and a global self-attention module. The global self-attention module adopts Gaussian weighted axial attention to capture complex features in multi-organ medical images through a global and local combination strategy.

[0015] The jump connection cross attention module performs feature fusion on the output of the Patch Expanding layer and the output of the context interaction Transformer module in the encoder, and inputs the feature fusion into the context interaction Transformer module in the decoder;

[0016] Step 3: Input the training set into the network model GCTNet, train the network model GCTNet and update the parameters;

[0017] Step 4: Input the verification set into the network model GCTNet to verify its performance, optimize the parameters of the network model GCTNet, and obtain the optimal network model GCTNet;

[0018] Step 5: Input the test set into the optimal network model GCTNet to predict the segmentation result.

[0019] Furthermore, the data enhancement in step 1 is to perform data enhancement on all multi-organ medical image data in the multi-organ medical image dataset by using scale normalization, rotation and flipping operations.

[0020] Furthermore, the contextual self-attention module in step 2 comprehensively captures the complex relationship in the image data through the collaboration of the local self-attention module and the global self-attention module, and its output is expressed as:

[0021] z=Concat(z local ,Upsample(z global ))

[0022] In the formula, z local represents the output of the local self-attention module; z global represents the output of the global self-attention module, z local and z global Respectively expressed as:

[0023] z local =LSA(X)

[0024] z global =GSA(LDConv(z local ))

[0025] In the formula, LSA represents the local self-attention mechanism; GSA represents the global self-attention mechanism; LDConv() represents the aggregation function.

[0026] Furthermore, in step 2, the local self-attention module is responsible for calculating the correlation within each window, aggregating the patch tokens within each window into global patch tokens to represent the key information of the window. The size of each window is set to p=4, and the time complexity of the local self-attention module is O(n).

[0027] Furthermore, the final output of the global self-attention module at position (i, j) in step 2 is expressed as:

[0028]

[0029] In the formula, z i,j Represents the final output at position (i, j); represents the Gaussian weight, with a value of 0.5; σ is a learnable parameter, with a value of 1; S(q, K) refers to the similarity between q and K, and the matrix K i,j and Vi,j It is generated by the Patch tokens aggregated to position (i, j). This formula is equivalent to:

[0030]

[0031] In the formula, ω is used to represent The coefficient factor before is 0.5; Acts as a relative position offset.

[0032] Furthermore, the external attention module in step 2 includes two shared memory units M k and M v , M k and M v It exists in the form of learnable parameters and works together on all multi-organ medical image samples, capturing the key information in multi-organ medical image data through cross-sample learning.

[0033] Furthermore, the process in which the jump connection cross attention module in step 2 fuses the output of the Patch Expanding layer with the output of the context interaction Transformer module in the encoder is expressed as:

[0034] X′=FC(X1)

[0035] K, V = Proj(X′)

[0036] Q=Proj(X2)

[0037] E=ρ v (V)ρ k (K′)Q

[0038] Where FC() represents the full connection operation; X′ represents the feature graph after the full connection operation on X1; Proj is the linear projection; K and V represent the key and value corresponding to the linear projection of X1, respectively; K′ represents the key corresponding to the full connection operation on K; Q represents the query corresponding to the linear projection of X2; ρ v and ρ k is a normalization function; E represents the output of the skip connection cross attention module.

[0039] Furthermore, the process of training the network model GCTNet and updating the parameters in step 3 is as follows:

[0040] Step 3.1, input the training set into the GCTNet network model, use Adam as the optimizer to train the network model GCTNet, set the initial learning rate to 0.05, and set the training rounds to 100;

[0041] Step 3.2, Patch Embedding from the input spatial dimension H×W and the number of channels C of the multi-organ medical image X∈R H×W×C Obtain overlapping Patch tokens of size 4×4;

[0042] Step 3.3, the patch tokens are input into the context interaction Transformer module. The external attention module and the context self-attention module cooperate with each other to extract the local and global information of the multi-organ medical image X, and output the feature map X2. The patch merging layer merges the patch tokens to reduce the spatial dimension and double the channel dimension.

[0043] Step 3.4: The feature map output by the encoder passes through the bottleneck block and outputs the Patch Expanding layer of the decoder, and the Patch tokens are expanded at a speed of 2 times;

[0044] Step 3.5: The jump connection cross attention module fuses the output of the Patch Expanding layer with the output of the context interaction Transformer module in the encoder, and inputs it into the context interaction Transformer module in the decoder;

[0045] Step 3.6, the linear projection layer outputs the segmentation map;

[0046] Step 3.7, use the loss Loss to constrain the consistency between the output segmentation map and the true value Ground Truth. The output at the end of each round of training is expressed as:

[0047] Loss = 0.6 × L Dice +0.4×L CE

[0048] Where, L CE represents the cross entropy loss; L Dice represents Dice loss;

[0049] The Dice loss is expressed as:

[0050]

[0051] In the formula, C represents the number of organ categories, which is 4; N represents the number of voxel points in each image; p c (i) represents the predicted probability value of organ category c in each voxel; g c (i) represents the true value of the organ class c in each voxel;

[0052] The cross entropy loss L CEIt is expressed as:

[0053]

[0054] In the formula, y i represents the true label of sample i; p i It represents the probability value of sample i after Softmax processing; k refers to the number of categories in the image; N represents the total number of samples.

[0055] Furthermore, the process of step 4 is:

[0056] Step 4.1, input the validation set into the model, generate the Dice coefficient and HD index and save them;

[0057] Step 4.2, draw a line graph with the Dice coefficient and HD index as the ordinate and the training round as the abscissa;

[0058] Step 4.3: After each verification, save the weight parameters of the network model GCTNet of the current round;

[0059] Step 4.4: After repeatedly verifying the model, select the optimal network model GCTNet weight parameters according to the line graph to obtain the optimal network model GCTNet.

[0060] Compared with the prior art, the present invention has the following technical effects:

[0061] The medical image multi-organ segmentation network model GCTNet based on global contextual interactive Transformer proposed in the present invention, on the one hand, the designed contextual interactive Transformer module, by integrating the contextual self-attention module and the external attention module, can not only extract the relationship between the internal and external samples, but also effectively retain the detailed information and global contextual semantic features of multiple organs; on the other hand, the skip connection cross-attention module is designed to capture the hierarchical features of the input data, and then extract the complete boundary features of multiple organs, thereby improving the segmentation accuracy of multiple organs. In short, the GCTNet network proposed in the present invention makes full use of local and global information, improves the model's ability to extract and represent image features, and improves the segmentation accuracy of each organ in multi-organ medical images. BRIEF DESCRIPTION OF THE DRAWINGS

[0062] Figure 1 : Flowchart of the present invention;

[0063] Figure 2 : A schematic diagram of the structure of the GCTNet network model of the present invention;

[0064] Figure 3: A schematic diagram of the structure of the contextual interaction Transformer module of the present invention;

[0065] Figure 4 : A schematic diagram of the structure of the contextual self-attention module of the present invention;

[0066] Figure 5 : A schematic diagram of the structure of the skip connection cross attention module of the present invention;

[0067] Figure 6 : Comparison of visual effects of the GCTNet network model of the present invention and the existing network model on the Synapse dataset;

[0068] Figure 7 : Comparison of the visual effects of the GCTNet network model of the present invention and the existing network model on the ACDC dataset. DETAILED DESCRIPTION

[0069] The specific contents of the present invention are further explained in detail below in conjunction with embodiments.

[0070] like Figure 1 As shown, a medical image multi-organ segmentation method based on global context interactive Transformer includes the following steps:

[0071] Step 1: Collect existing multi-organ medical images, construct a multi-organ medical image dataset, perform data enhancement on the multi-organ medical images, and divide them into training set, validation set and test set. The specific process is as follows:

[0072] Step 1.1, use scale normalization and rotation and flipping operations to perform data enhancement on multi-organ medical image data to obtain preprocessed images, and save them in npy format for easy reading by the network model GCTNet;

[0073] Step 1.2, divide the preprocessed images into training set, validation set and test set;

[0074] The multi-organ medical image data set includes unlabeled multi-organ medical image data and labeled multi-organ medical image data, and the ratio of the unlabeled multi-organ medical image data to the labeled multi-organ medical image data is 1:4;

[0075] Step 2: Build Figure 2 The medical image multi-organ segmentation model GCTNet based on the global context interaction Transformer shown in the figure includes an encoder, a decoder, a jump connection cross attention module SCCA, a linear projection layer Linear Projection and a bottleneck block Bottleneck, where:

[0076] The encoder includes a patch embedding module PatchEmbedding and three stacked encoding blocks, each encoder module consists of two consecutive context interaction Transformer modules and a Patch Merging layer;

[0077] The decoder includes three stacked decoding blocks, each of which consists of two consecutive context-interaction Transformer modules and a Patch Expanding layer, and the Patch tokens are expanded at a rate of 2 times in each block;

[0078] The structure of the context interaction Transformer module is as follows Figure 3 As shown in the figure, it includes an external attention module and a contextual self-attention module, where: the difference between the contextual self-attention module and the self-attention mechanism is that the contextual self-attention module uses a global and local combination strategy and introduces a Gaussian mask, so that the network focuses more on capturing local information, and can deeply mine local and global information, thereby calculating the information of all positions of the image, which can not only build dependencies between different granularities, but also deeply mine global and local information. Its core idea is local calculation;

[0079] like Figure 4 As shown in FIG. 1 , the contextual self-attention module includes a local self-attention module and a global self-attention module. Through the collaborative work of these two modules, the contextual interaction Transformer module can more comprehensively capture the complex relationships in the image data, thereby improving the performance of the network model, wherein:

[0080] The output z of the local self-attention module local It is expressed as:

[0081] z local =LSA(X)

[0082] In the formula, LSA represents the local self-attention mechanism;

[0083] The output of the global self-attention module is expressed as:

[0084] z global =GSA(LDConv(z local ))

[0085] In the formula, GSA represents the global self-attention mechanism;

[0086] Therefore, the output of the contextual self-attention module is expressed as:

[0087] z=Concat(z local ,Upsample(z global ))

[0088] The local self-attention module is responsible for calculating the correlation within each window, and uses lightweight dynamic convolution LDConv() as an aggregation function to aggregate the Pacth tokens in each window into global Pacth tokens to represent the key information of the window. In this embodiment, the window size is set to p=4. For the input feature map X∈R with a spatial dimension of H×W and a channel number of C, H×W×C After downsampling, it is easier to implement the global self-attention mechanism at a lower computational cost, thereby achieving more efficient data processing. The time complexity of the local self-attention module is O(n);

[0089] The global self-attention module adopts Gaussian weighted axial attention and uses a learnable Gaussian matrix to enhance the query matrix's perception of nearby patch tokens. At the same time, the use of axial attention effectively reduces the time complexity and optimizes the time complexity to Assuming that the query representation Q is obtained after the aggregation step, calculate each query q i,j And the corresponding key K i,j Sum value V i,j The Euclidean distance D between i,j , matrix K i,j and V i,j is generated by the Patch tokens aggregated to a specific row and column position (i, j); in addition, the similarity between the query Q and the key K can be further measured, so the final output at position (i, j) is expressed as:

[0090]

[0091] In the formula, z i,j Represents the final output at position (i, j); represents the Gaussian weight, with a value of 0.5; σ is a learnable parameter, with a value of 1; S(q i,j , K i,j ) refers to q i,j and K i,j The similarity between them can be expressed as follows:

[0092]

[0093] In the formula, ω is used to represent The coefficient factor before is 0.5; Acting as a relative position offset, it helps emphasize the position correlation in the contextual interaction Transformer module, thereby further improving the performance of the model;

[0094] The external attention module focuses on calculating the correlation between samples. It is different from self-attention. Self-attention focuses on the contextual information within a single input sequence, while external attention improves the learning ability of the model by learning across samples. There are significant differences in the operation mode and application scenarios of the two. In the external attention module, there are two shared memory units M k and M v , exists in the form of learnable parameters, works together on all samples, and aims to capture the key information in the data set; in addition, the query operation in the external attention module introduces an additional linear mapping to expand its channel dimension, thereby enhancing the representation and learning ability of the contextual self-attention module and more accurately capturing the complex structure and characteristics of the input data. Since the time complexity of the external attention module is O(n), the time complexity of the contextual interaction Transformer module is expressed as

[0095] The skip connection cross attention module SCCA structure is as follows Figure 5 As shown in the figure, it aims to more effectively preserve and fuse the feature information of the encoder and decoder. Different from the traditional simple feature connection, the jump connection cross attention module does not simply connect the features of the encoder and decoder, but enhances the feature representation by cross-processing these features, thereby more effectively preserving the underlying features. Specifically, the output of the Patch Expanding layer is fused with the output of the context interaction Transformer module in the encoder and input into the context interaction Transformer module in the decoder. In the jump connection cross attention module SCCA, the input feature X2 of the query Q comes from the output of the context interaction Transformer module in the encoder, and the input feature X1 of the key K and value V comes from the output of the lower decoder Patch Expanding layer, thereby allowing the network model to capture information from two different sources and perform feature fusion through a cross attention mechanism. Before feature fusion, X1 needs to be scaled through a linear layer to match the embedding dimension of X2. The operation process of the jump connection cross attention module SCCA is expressed as:

[0096] X′=FC(X1)

[0097] K, V = Proj(X′)

[0098] Q=Proj(X2)

[0099] E=ρ v (V)ρk (K′)Q

[0100] Where FC() represents the full connection operation; X′ represents the feature graph after the full connection operation on X1; Proj is the linear projection; K and V represent the key and value corresponding to the linear projection of X1, respectively; K′ represents the key corresponding to the full connection operation on K; Q represents the query corresponding to the linear projection of X2; ρ v and ρ k is a normalization function; E represents the output of the skip connection cross attention module.

[0101] Since the output of the encoder usually contains rich context information and multi-level feature representation of the input data, which is crucial for feature recovery and reconstruction of detail information in the decoding stage, this embodiment uses the output feature X2 from the context interaction Transformer module in the encoder as the input of the query Q, so that the network model can better understand and capture the hierarchical features in the input data, further improving the segmentation performance;

[0102] Step 3: Train the medical image multi-organ segmentation model GCTNet based on global context interactive Transformer and update the parameters. The specific process is as follows:

[0103] Step 3.1, input the training set into the GCTNet network model, use Adam as the optimizer to train the network model, set the initial learning rate to 0.05, and during the training process, the learning rate is adjusted according to the rounds, and the learning rate decays once every 100 rounds;

[0104] Step 3.2, Patch Embedding from the input spatial dimension H×W and the number of channels C of the multi-organ medical image X∈R H×W×C Obtain overlapping Patch tokens of size 4×4;

[0105] Step 3.3, the patch tokens are input into the contextual interaction Transformer module. The external attention module and the contextual self-attention module cooperate with each other to extract the local and global information of the multi-organ medical image X, and output the feature map X2. The patch merging layer merges the patch tokens to reduce the spatial dimension and doubles the channel dimension, so that the network model GCTNet can obtain multi-scale representation in a hierarchical form;

[0106] Step 3.4: The feature map output by the encoder is input to the PatchExpanding layer of the decoder through the bottleneck block Bottleneck, and the Patch tokens are expanded at a speed of 2 times;

[0107] Step 3.5: The skip connection cross attention module SCCA fuses the output of the Patch Expanding layer with the output of the context interaction Transformer module in the parallel encoder, and inputs it to the context interaction Transformer module in the decoder. The output of the context interaction Transformer module in the decoder is used as the input of the next PatchExpanding layer, and the output of the last Patch Expanding layer is used as the input of the linear projection layer LinearProjection.

[0108] Step 3.6, the linear projection layer outputs the segmentation map;

[0109] Step 3.7: Use the loss Loss to constrain the consistency between the output segmentation map and the true value Ground Truth. At the end of each round of training, output the Loss. When the downward trend of the Loss value gradually stabilizes, it means that the model training process is normal. The Loss is expressed as:

[0110] Loss = 0.6 × L Dice +0.4×L CE

[0111] Where, L CE represents the cross entropy loss; L Dice represents Dice loss; L Dice and L CE The weight sparse reference experimental settings of the existing network model DAE-Former;

[0112] The Dice loss focuses on the foreground area and ignores the background voxels in the image, which is expressed as:

[0113]

[0114] In the formula, C represents the number of organ categories, which is 4; N represents the number of voxel points in each image, and p c (i) represents the predicted probability value of organ category c in each voxel; g c (i) represents the true value of the organ class c in each voxel;

[0115] Although Dice loss performs well in dealing with sample imbalance, relying solely on Dice loss may lead to poor back propagation effect, making the training process extremely unstable. To make up for this deficiency, this embodiment introduces the cross entropy loss L which is particularly suitable for dealing with multi-classification problems. CE , expressed as:

[0116]

[0117] In the formula, y i represents the true label of sample i; p i represents the probability value of sample i after Softmax processing; k refers to the number of categories in the image; N represents the total number of samples;

[0118] Step 4: Input the validation set into the trained network model GCTNet to verify its segmentation performance. The specific process is as follows:

[0119] Step 4.1, input the validation set into the model, generate the Dice coefficient and HD (i.e., Hausdorff) index and save them;

[0120] Step 4.2, draw a line graph with the Dice coefficient and HD index as the ordinate and the training round as the abscissa;

[0121] Step 4.3: After each verification, save the weight parameters of the network model GCTNet of the current round;

[0122] Step 4.4, after repeated verification of the model, select the optimal network model GCTNet weight parameters according to the line graph, and obtain the optimal network model GCTNet;

[0123] Step 5: Input the test set into the network model GCTNet with the optimal weight and output the segmentation result. The specific process is as follows:

[0124] Step 5.1, input the test set into the model;

[0125] Step 5.2, the model generates Dice coefficient and HD index;

[0126] Step 5.3: The model outputs a segmentation mask image of the same size as the input image, i.e., the segmentation result.

[0127] In order to verify the performance of the network model GCTNet proposed in this embodiment in the multi-organ medical image segmentation process, the public data set Synapse is used for training and testing. In order to test the accuracy and superiority of the multi-organ segmentation method proposed in this embodiment, the following experiments are further explained:

[0128] The verification environment is as follows: CPU is Intel(R) Xeon(R) Gold 6326; memory is 50GB; GPU is Nvidia TeslaA30, video memory is 24GB; during the training process, GCTNet uses Adam optimizer, input image size is 224×224, batch size is 24, initial learning rate is 0.05, SGD optimizer is used for optimization, momentum is 0.9, weight decay is 0.0001, and the deep learning framework used by the network model GCTNet of this embodiment is PyTorch.

[0129] The segmentation performance is evaluated by the following indicator parameters:

[0130]

[0131] HD = max[h(A, B), h(B, A)]

[0132] h(A,B)=max(a∈A)min(b∈B)||ab||

[0133] h(B,A)=max(b∈B)min(a∈A)||ba||

[0134] Where TP is the number of pixels whose predicted category is target and whose actual category is also target, FP is the number of pixels whose predicted category is target and whose actual category is background, and FN is the number of pixels whose predicted category is background and whose actual category is target. ||·|| is the distance normal between point set A and point set B. The larger the value of Dice is, the higher the similarity between the two is, and the better the segmentation effect is. The smaller the value of HD is, the higher the segmentation performance is.

[0135] First, an ablation experiment is performed to verify the role of the local self-attention module, the global self-attention module, and the external attention module in the GCTNet proposed in this embodiment. The Vision Transformer is used as the baseline network, and the proposed components are gradually added to prove their effectiveness. The ablation experiment results are shown in Table 1. In Table 1, LSAM represents the local self-attention module, GSAM represents the global self-attention module, EAM represents the external attention module, "√" represents the application of the corresponding module, "×" represents the deletion of the corresponding module, and "○" represents the incomplete use of the corresponding module. The bold fonts in the table represent the optimal results of each item;

[0136] Table 1 Ablation experiment results of each component of GCTNet

[0137]

[0138] As shown in Table 1, after deleting GSAM, compared with the complete GCTNet network model, the two evaluation indicators of DSC and HD95 are reduced by 0.83% and 0.42mm respectively; after deleting LSAM, the two evaluation indicators of DSC and HD95 are reduced by 0.99% and 2.07mm respectively; it can be seen that GSAM and LSAM are crucial to GCTNet, and the LSAM and GSAM modules can help the network model GCTNet obtain more feature information and obtain more accurate segmentation effects; in order to verify the effectiveness of using Gaussian mask Gaussian in GSAM, detailed experimental data is also provided to support it. By comparing the data in the 5th and 6th rows in Table 1, it can be clearly seen that after the introduction of Gaussian mask, DSC and HD95 These two key evaluation indicators have achieved an improvement of 0.88% and 0.04mm respectively. This result shows that the application of Gaussian mask helps the network focus more on local areas, thereby improving the overall segmentation performance. Therefore, it is necessary and beneficial to use Gaussian mask in GSAM; it can be seen from the 4th and 6th rows of Table 1 that after using EAM, the DSC and HD95 of GCTNet are improved by 1.01% and 1.31mm respectively, indicating that EAM is also crucial for the network, which can help the network better learn the relationship between different samples and improve the learning ability of the network; in summary, the local self-attention module LSAM, the global self-attention module GSAM and the external attention module EAM all have a positive impact on the segmentation performance of the network model GCTNet.

[0139] Secondly, in order to further explore the impact of the change in the number of skip connections on the performance of the GCTNet proposed in this embodiment, an ablation experiment was conducted on the Synapse dataset. The results are shown in Table 2. Skip connections are added at different positions with resolutions of 1 / 4, 1 / 8, and 1 / 16 (see Figure 2 ), and through different connection combinations, the number of skip connections can be flexibly adjusted, including 0, 1, 2, and 3 connections, where "0" means no skip connection is added, and the bold font in the table indicates the optimal results;

[0140] Table 2 Ablation experiment results of the number and position of skip connections

[0141]

[0142] As can be seen from Table 2, with the increase in the number of skip connections, the segmentation performance of GCTNet shows a trend of gradual improvement. By introducing skip connections at all positions with resolutions of 1 / 4, 1 / 8, and 1 / 16, the best DSC and HD95 can be obtained. Therefore, this setting is adopted in GCTNet to enhance the network's ability to learn lower-level features, which is also the main reason why GCTNet can capture the characteristics of small organs;

[0143] Again, on the Synapse dataset, the segmentation results of GCTNet are compared with those of the existing network models TransUNet, Swin-Unet, MTUNet, TransDeeplab, HiFormer, MISSFormer, TransCeption and DAE-Former. The results are shown in Table 3. AO represents aorta, GB represents gallbladder, LK represents left kidney, RK represents right kidney, Liv represents liver, Pa represents pancreas, Sp represents spleen, and Sto represents stomach. The bold fonts in the table represent the best results. It can be seen that the performance of GCTNet on the Synapse dataset generally exceeds that of other comparison methods, and achieved the highest Dice score of 0.8240. Specifically, in the segmentation of different anatomical structures such as aorta, gallbladder, left kidney, right kidney, liver, pancreas, spleen and stomach, the Dice score of GCTNet is 0.8240. The Dice evaluation scores of 0.8831, 0.6976, 0.8804, 0.8369, 0.9526, 0.6352, 0.9204 and 0.8167 were achieved respectively, showing its excellent performance on various organs. Compared with other advanced segmentation methods, GCTNet improved the Dice coefficient by as much as 5.54% and as little as 0.1%. The performance improvements on the aorta, left kidney, right kidney, liver, pancreas and stomach were particularly significant, indicating that GCTNet can effectively improve the accuracy of multi-organ segmentation tasks.

[0144] Table 3 Performance comparison of different network models on the Synapse dataset

[0145]

[0146] Figure 6The visualization comparison of the segmentation results of different medical image multi-organ segmentation network models on the Synapse dataset shows that although MTUNet improves the segmentation accuracy by gradually aggregating global context information, its segmentation results are still quite different from the labeled images; Swin-Unet combines the U-Net structure for feature extraction, but the simple encoder structure limits its performance in extracting complex organ shapes, resulting in under-segmentation; in contrast, HiFormer effectively utilizes the global long-distance context information of Transformer and the local feature representation of CNN, and fuses coarse-grained and fine-grained features through the DLF module to produce a powerful feature representation. However, it can be observed from the segmentation visualization results that HiFormer may suffer from under-segmentation when dealing with complex shapes such as the pancreas and stomach; TransCeption integrates the Tr The ansformer and Inception structures can effectively handle long-distance dependencies and multi-scale features. By modeling complex relationships and capturing multi-scale information, their segmentation results are significantly improved compared to HiFormer. However, the segmentation accuracy of organs with complex shapes is still low. The GCTNet model proposed in this embodiment integrates the CSAM module and the SCCA module to significantly enhance the network's feature extraction ability for different organ regions and boundaries, thereby improving the segmentation accuracy. In particular, it shows excellent performance in the segmentation tasks of the aorta and stomach, which is consistent with the quantitative results in Table 3. Since GCTNet can balance the perception of local details and global information, it also shows obvious advantages over other advanced methods when processing organs with complex shapes (such as the liver and left kidney). In summary, the GCTNet model significantly improves the accuracy of multi-organ segmentation.

[0147] Finally, on the ACDC dataset, the segmentation results of GCTNet are compared with those of the existing network models Swin-Unet, TransUNet, MISSFormer, MTUNet, and DAE-Former. The comparative experimental results are shown in Table 4, where RV represents right ventricle, Myo represents myocardium, LV represents left ventricle, and the bold fonts in the table represent the best results.

[0148] Table 4 Performance comparison of different network models on the ACDC dataset

[0149]

[0150] From Table 4, we can clearly see that GCTNet has shown excellent segmentation performance on the ACDC dataset. It not only surpasses all other comparative methods, but also achieves remarkable results in the evaluation of the Dice score, reaching 0.8516. This shows that GCTNet can more accurately identify and segment the target organ area in the multi-organ medical image segmentation task, providing doctors with more reliable diagnosis basis. Specifically, GCTNet achieved Dice evaluation scores of 0.8305, 0.8462 and 0.8782 on the right ventricle, myocardium and left ventricle, respectively. This not only proves GCTNet's excellent ability in detail processing, but also reflects its stability in dealing with complex structures and shape changes. Compared with other advanced segmentation methods, GCTNet's Dice coefficient has increased significantly, with the highest increase of 4.12%, and even the smallest increase has reached 1.4%, which fully demonstrates the significant advantages of GCTNet in the multi-organ segmentation task. In summary, in the multi-organ segmentation task, GCTNet shows excellent accuracy and stability, and its segmentation performance is the best compared with the other six existing network models.

[0151] Figure 7 The segmentation results of GCTNet and other advanced medical image multi-organ segmentation models on the ACDC dataset are shown. It can be seen that although Swin-Unet uses a hierarchical Swin Transformer structure with a shift window as an encoder to efficiently extract contextual information in the image, in order to restore the spatial resolution of the feature map, a Swin Transformer is symmetrically designed as a decoder responsible for the upsampling operation of the Patch. This design makes Swin-Unet perform well in medical image segmentation tasks, but its segmentation results are quite different from those of the labeled images. In contrast, TransUNet uses the Transformer's self-attention mechanism to model the global information of the image while retaining the multi-scale feature fusion capability of U-Net. However, when dealing with organs with complex shapes such as the right atrium, TransUNet still suffers from under-segmentation. MTUNet further improves the accuracy of organ segmentation by mining the connections between different samples and modeling the contextual information of the image. However, this method may lead to over-segmentation when dealing with organs of different shapes. DAE-Former uses spatial and channel attention to obtain more spatial and channel information of feature maps, and its segmentation results are significantly improved compared to MTUNet. However, DAE-Former requires a large number of parameters and is prone to overfitting during the segmentation process. GCTNet can still accurately locate and segment the target area when the shape of the target area is relatively small, and obtain prediction results that are highly consistent with the actual target area.

Claims

1. A medical image multi-organ segmentation method based on global context interactive Transformer, characterized by: The steps include: Step 1: Build a multi-organ medical image dataset and perform data enhancement, then divide it into training set, validation set and test set; Step 2: Construct a medical image multi-organ segmentation model GCTNet based on global contextual interaction Transformer, which includes an encoder, a decoder, a jump connection cross attention module, a linear projection layer and a bottleneck block, wherein: the encoder includes a PatchEmbedding and three sequentially stacked encoding blocks, each encoder module consists of two consecutive contextual interaction Transformer modules and a PatchMerging layer; the decoder Decoder includes three stacked decoding blocks, each decoding block consists of two consecutive contextual interaction Transformer modules and a Patch Expanding layer; The contextual interactive Transformer module includes an external attention module that focuses on calculating the correlation between samples and a contextual self-attention module for building dependencies between different granularities. The contextual self-attention module includes a local self-attention module and a global self-attention module. The global self-attention module adopts Gaussian weighted axial attention to capture complex features in multi-organ medical images through a global and local combination strategy. The jump connection cross attention module performs feature fusion on the output of the Patch Expanding layer and the output of the context interaction Transformer module in the encoder, and inputs the feature fusion into the context interaction Transformer module in the decoder; Step 3: Input the training set into the network model GCTNet, train the network model GCTNet and update the parameters; Step 4: Input the verification set into the network model GCTNet to verify its performance, optimize the parameters of the network model GCTNet, and obtain the optimal network model GCTNet; Step 5: Input the test set into the optimal network model GCTNet to predict the segmentation result.

2. The method for multi-organ segmentation of medical images based on global context interactive Transformer according to claim 1, characterized in that: The data enhancement in step 1 is to perform data enhancement on all multi-organ medical image data in the multi-organ medical image dataset by using scale normalization, rotation and flipping operations.

3. The medical image multi-organ segmentation method based on global context interactive Transformer according to claim 1 is characterized in that: The contextual self-attention module in step 2 comprehensively captures the complex relationship in the image data through the collaboration of the local self-attention module and the global self-attention module, and its output is expressed as: z=Concat(z local ,Upsample(from global )) In the formula, z local represents the output of the local self-attention module; z global represents the output of the global self-attention module, z local and z global Respectively expressed as: z local =LSA(X) With global =GSA(LDConv(from local )) In the formula, LSA represents the local self-attention mechanism; GSA represents the global self-attention mechanism; LDConv() represents the aggregation function.

4. The medical image multi-organ segmentation method based on global context interactive Transformer according to claim 3 is characterized in that: In step 2, the local self-attention module is responsible for calculating the correlation within each window, aggregating the patch tokens in each window into global patch tokens to represent the key information of the window. The size of each window is set to p=4, and the time complexity of the local self-attention module is O(n).

5. The medical image multi-organ segmentation method based on global context interactive Transformer according to claim 3 is characterized in that: In step 2, the global self-attention module uses Gaussian weighted axial attention to optimize the time complexity to At the same time, a learnable Gaussian matrix is ​​used to enhance the query matrix’s perception of nearby patch tokens. Its final output at position (i, j) is expressed as: In the formula, z i,j Represents the final output at position (i, j); represents the Gaussian weight, with a value of 0.5; σ is a learnable parameter, with a value of 1; S(q i,j , K i,j ) refers to q i,j and K i,j The similarity between i,j represents the query at position (i, j), matrix K i,j and V i,j It is generated by the Patch tokens aggregated to position (i, j). This formula is equivalent to: In the formula, ω is used to represent The coefficient factor before is 0.5; Acts as a relative position offset.

6. The medical image multi-organ segmentation method based on global context interactive Transformer according to claim 1, characterized in that: The external attention module in step 2 includes two shared memory units M k and M v , M k and M v It exists in the form of learnable parameters and works together on all multi-organ medical image samples, capturing the key information in multi-organ medical image data through cross-sample learning.

7. The method for multi-organ segmentation of medical images based on global context interactive Transformer according to claim 5, characterized in that: The process in which the jump connection cross attention module in step 2 fuses the output of the Patch Expanding layer with the output of the context interaction Transformer module in the encoder is expressed as: X′=FC(X1) K, V = Proj(X′) Q=Proj(X2) E=ρ v (V)r k (K′)Q Where FC() represents the full connection operation; X′ represents the feature graph after the full connection operation on X1; Proj is the linear projection; K and V represent the key and value corresponding to the linear projection of X1, respectively; K′ represents the key corresponding to the full connection operation on K; Q represents the query corresponding to the linear projection of X2; ρ v and ρ k is a normalization function; E represents the output of the skip connection cross attention module.

8. The method for multi-organ segmentation of medical images based on global context interactive Transformer according to claim 5, characterized in that: The process of step 3 training the network model GCTNet and updating the parameters is as follows: Step 3.1, input the training set into the GCTNet network model, use Adam as the optimizer to train the network model GCTNet, set the initial learning rate to 0.05, and set the training rounds to 100; Step 3.2, Patch Embedding from the input spatial dimension H×W and the number of channels C of the multi-organ medical image X∈R H×W×C Obtain overlapping Patch tokens of size 4×4; Step 3.3, the patch tokens are input into the context interaction Transformer module. The external attention module and the context self-attention module cooperate with each other to extract the local and global information of the multi-organ medical image X, and output the feature map X2. The patch merging layer merges the patch tokens to reduce the spatial dimension and double the channel dimension. Step 3.4: The feature map output by the encoder is input into the Patch Expanding layer of the decoder through the bottleneck block, and the Patchtokens are expanded at a speed of 2 times; Step 3.5: The jump connection cross attention module fuses the output of the Patch Expanding layer with the output of the context interaction Transformer module in the encoder, and inputs it to the context interaction Transformer module in the decoder. The output of the context interaction Transformer module in the decoder is used as the input of the next Patch Expanding layer, and the output of the last Patch Expanding layer is used as the input of the linear projection layer. Step 3.6, the linear projection layer outputs the segmentation map; Step 3.7, use the loss Loss to constrain the consistency between the output segmentation map and the true value Ground Truth. The output at the end of each round of training is expressed as: Loss=0.6×L Dice +0.4×L CE Where, L CE represents the cross entropy loss; L Dice represents Dice loss; The Dice loss is expressed as: In the formula, C represents the number of organ categories, which is 4; N represents the number of voxel points in each image; p c (i) represents the predicted probability value of organ category c in each voxel; g c (i) represents the true value of the organ class c in each voxel; The cross entropy loss L CE It is expressed as: In the formula, y i represents the true label of sample i; p i It represents the probability value of sample i after Softmax processing; k refers to the number of categories in the image; N represents the total number of samples.

9. The medical image multi-organ segmentation method based on global context interactive Transformer according to claim 1, characterized in that: The process of step 4 is: Step 4.1, input the validation set into the model, generate the Dice coefficient and HD index and save them; Step 4.2, draw a line graph with the Dice coefficient and HD index as the ordinate and the training round as the abscissa; Step 4.3: After each verification, save the weight parameters of the network model GCTNet of the current round; Step 4.4: After repeatedly verifying the model, select the optimal network model GCTNet weight parameters according to the line graph to obtain the optimal network model GCTNet.

Citation Information

Patent Citations

  • Distraction-based Swin Unet variant medical image segmentation method

    CN116524187A

  • Medical image segmentation method based on MATT-UNet

    CN117495879A

  • Method for accurately segmenting medical image

    CN117994517A

Cited By

  • Colonoscope polyp image segmentation method based on hybrid model

    CN119048763A

  • Abdominal CT image segmentation method based on branch growth neural network architecture search

    CN119131064A

  • Abdomen multi-organ image segmentation method fusing multi-scale features

    CN119205824A

  • Earthquake fault identification method, storage medium and equipment

    CN119375955A

  • A method, storage medium and device for identifying earthquake faults

    CN119375955B