3D medical image segmentation method and system based on paired attention

By introducing a paired attention transformer module into the 3D medical image segmentation model, and combining channel and spatial dependencies, the problem of high model complexity in existing methods is solved, and efficient 3D medical image segmentation is achieved.

CN116912498BActive Publication Date: 2025-11-18QILU UNIVERSITY OF TECHNOLOGY (SHANDONG ACADEMY OF SCIENCES)
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310921977.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-25
Publication Date
2025-11-18
Estimated Expiration
2043-07-25

AI Technical Summary

Technical Problem

Existing 3D medical image segmentation methods increase the number of model parameters and computational load while improving segmentation accuracy, resulting in poor model robustness and high computational resource requirements, which affects segmentation efficiency and accuracy.

Method used

A 3D medical image segmentation model is designed using a Paired Attention Transformer (PAT) module. The PAT module learns channel and spatial information in the 3D feature map, reduces dimensionality, and combines channel and spatial dependencies to reduce the number of model parameters and speed up computation.

Benefits of technology

While reducing the number of model parameters and computations, it improves segmentation results, captures image detail and texture information, and achieves more accurate segmentation, reducing the number of parameters and computations by more than 67%.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116912498B_ABST
    Figure CN116912498B_ABST
Patent Text Reader

Abstract

The application discloses a 3D medical image segmentation method and system based on paired attention, and belongs to the technical field of 3D medical image segmentation. The method comprises the following steps: obtaining a 3D medical image to be segmented; inputting the 3D medical image to be segmented into a 3D medical image segmentation model which is trained to obtain a segmentation result; wherein the 3D medical image segmentation model is designed based on a paired attention transformer module, can reduce the dimension of a spatial dimension and effectively learn channel and spatial information in a 3D feature map, and realizes the improvement of model segmentation performance while reducing the model parameter quantity and accelerating the model calculation speed. The method solves the problem of poor robustness of a medical image segmentation model and high demand for computing resources in the prior art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of 3D medical image segmentation technology, and in particular to a 3D medical image segmentation method and system based on paired attention. Background Technology

[0002] The statements in this section merely refer to the background art related to this invention and do not necessarily constitute prior art.

[0003] Convolutional Neural Networks (CNNs) are widely used in medical image segmentation tasks due to their powerful multi-scale representation capabilities and ability to capture local semantic and textural information. Several variants of U-Net, such as U-Net++, U-Net 3+, and Residual U-Net, have achieved good performance on various datasets by processing 3D voxel data into 2D slices. 3D U-Net extends the U-Net architecture by using 3D operations instead of 2D convolutions for segmentation in sparsely labeled volumetric images. Isensee et al. proposed an nnU-Net model based on U-Net with automated configuration and an adaptive framework, capable of extracting features from multi-level images. Furthermore, some works focus on learning local-global information through pure CNN architectures, such as deformable convolutions, depthwise separable convolutions, and large kernel convolutions.

[0004] Version Transformer successfully addresses the challenge of capturing long-range dependencies in medical image segmentation. Transformer utilizes a self-attention mechanism to learn the correlations between all input labels, thus enabling the capture of long-range dependencies. While much work has focused on improving the Transformer architecture for more accurate segmentation, few studies have addressed the computational complexity of the self-attention mechanism within the Transformer. Swin-Unet is a U-shaped encoder-decoder structure composed of SwinTransformer blocks. The nnFormer proposed by Zhou et al. still uses convolutional layers to extract local image details and employs a hierarchical structure to model multi-scale features.

[0005] Recently, some works have attempted to design hybrid architectures combining U-Net models with Transformers to extract local features using convolutions while learning global-local contextual information through global self-attention. TransUNet introduces an encoder with a hybrid CNN-Transformer architecture, improving segmentation performance by incorporating convolutional neural networks into the Transformer structure to recover local spatial information. UNETR introduces a novel Transformer-based approach for semantic segmentation of medical images, redefining the task as a one-dimensional sequence-to-sequence prediction problem. 3DUX-NET proposes a lightweight volumetric ConvNet module with large-kernel depthwise separable convolutions to tune hierarchical features for better volumetric segmentation.

[0006] Convolutional Neural Networks (CNNs)-based methods have limitations in capturing the geometric and structural information of medical image data because convolutional operations are constrained by learning a limited range of dependencies between pixels. Transformer-based methods, however, introduce a self-attention mechanism, enabling them to learn long-range dependencies between pixels and addressing the limited receptive field issue in CNN-based U-Net variants. However, the performance improvements of this approach are typically accompanied by increased model complexity.

[0007] Recent research has attempted to design hybrid architectures combining U-Net models with Transformers, aiming to extract local features through convolutions while learning global-local contextual information through global self-attention. For example, UNETR uses a Transformer as the encoder and convolution and upsampling operations as the decoder. Models such as Swin-Unet and nnFormer have designed hybrid modules based on Transformers and convolutions, applying them to both the encoder and decoder. However, these studies primarily focus on improving the model's segmentation accuracy, but at the cost of increasing the number of parameters and computational cost, resulting in poor robustness and high computational resource requirements. Summary of the Invention

[0008] To address the shortcomings of existing technologies, this invention provides a 3D medical image segmentation method, system, electronic device, and computer-readable storage medium based on paired attention. The 3D medical image segmentation model is designed based on the Paired Attention Transformer (PAT) module, which reduces the spatial dimension and effectively learns channel and spatial information in the 3D feature map, thereby improving the model segmentation performance while reducing the number of model parameters and accelerating the model calculation speed.

[0009] In a first aspect, the present invention provides a 3D medical image segmentation method based on paired attention;

[0010] Paired attention-based 3D medical image segmentation methods include:

[0011] Acquire 3D medical images to be segmented;

[0012] The 3D medical image to be segmented is input into the trained 3D medical image segmentation model for processing to obtain the segmentation result;

[0013] The 3D medical image segmentation model includes an encoder and a decoder, which are connected. The encoder includes a first encoding module and multiple second encoding modules connected in sequence. The first encoding module consists of a patch embedding layer and a paired attention transformer module. Each of the second encoding modules consists of a paired attention transformer module and a downsampling layer. The decoder includes multiple decoding modules connected in sequence. Each decoding module consists of a skip connection module, a paired attention transformer module, and an upsampling module.

[0014] Furthermore, the paired attention transformer module consists of a normalization layer, a multilayer perceptron, and a multi-head paired attention module, wherein the data input to the paired attention transformer module passes sequentially through the normalization layer, the multi-head paired attention module, and the multilayer perceptron.

[0015] Preferably, the multi-head paired attention module is used to capture the channel dependencies of the input data through channel attention and obtain the channel attention output feature map, and to capture the spatial dependencies of the input data through spatial attention and obtain the spatial attention output feature map; the channel attention output feature map and the spatial attention output feature map are fused with the original 3D voxel features of the input data and 3D convolution is performed to obtain a deep feature representation of the input data.

[0016] Preferably, the channel attention formula in the multi-head paired attention module is expressed as:

[0017]

[0018] Among them, X C Q represents the output obtained after channel attention. channel K is the channel query vector. channel V is the channel key vector. channel Here, d represents the channel value, and d represents the size of each vector.

[0019] The spatial attention formula in the multi-head pairing attention module is expressed as follows:

[0020]

[0021] Among them, X s Q is the output obtained after spatial attention. spatial K is the projection of the spatial query vector. spatial_proj V is the projection of the vector of keys in space. spatial_proj d is the projection of the spatial values, and d is the size of each vector.

[0022] Furthermore, the first encoding module is used to embed and segment the 3D medical image to be segmented, obtain a 3D voxel feature map and add position encoding. Multiple second encoding modules are used to perform paired attention transformation and downsampling operations on the 3D voxel feature map to achieve sequential dimensionality reduction of the 3D voxel feature map. Multiple decoding modules are used to upsample the dimensionality-reduced 3D voxel feature map and concatenate it with 3D voxel feature maps of different dimensions, and then perform paired attention transformation to achieve sequential dimensionality increase of the concatenated 3D voxel feature map. After convolution operation, the predicted final segmentation result is output.

[0023] Furthermore, the step of inputting the 3D medical image to be segmented into the trained 3D medical image segmentation model for processing includes:

[0024] The 3D medical image to be segmented is embedded and segmented to obtain a 3D voxel feature map and add position encoding.

[0025] Paired attention transformation and downsampling operations are performed on the 3D voxel feature map to achieve sequential dimensionality reduction of the 3D voxel feature map;

[0026] The dimensionality-reduced 3D voxel feature map is upsampled and then concatenated with 3D voxel feature maps of different dimensions. Paired attention transformation is then performed to achieve sequential dimensionality increase of the concatenated 3D voxel feature map. Finally, the predicted segmentation result is output after convolution operation.

[0027] Furthermore, the training methods for the 3D medical image segmentation model include:

[0028] Obtain training data;

[0029] Configure the AdamW optimizer to adaptively adjust the learning rate;

[0030] The 3D medical image segmentation model is trained based on training data, learning rate, and a preset loss function.

[0031] Secondly, the present invention provides a 3D medical image segmentation system based on paired attention;

[0032] A 3D medical image segmentation system based on paired attention includes:

[0033] The acquisition module is used to acquire the 3D medical image to be segmented;

[0034] The 3D medical image segmentation module is used to input the 3D medical image to be segmented into the trained 3D medical image segmentation model for processing to obtain the segmentation result;

[0035] The 3D medical image segmentation model includes an encoder and a decoder, which are connected. The encoder includes a first encoding module and multiple second encoding modules connected in sequence. The first encoding module consists of a patch embedding layer and a paired attention transformer module. Each of the second encoding modules consists of a paired attention transformer module and a downsampling layer. The decoder includes multiple decoding modules connected in sequence. Each decoding module consists of a skip connection module, a paired attention transformer module, and an upsampling module.

[0036] Thirdly, the present invention provides an electronic device;

[0037] An electronic device includes a memory and a processor, as well as computer instructions stored in the memory and running on the processor, which, when executed by the processor, perform the steps of the above-described 3D medical image segmentation method based on paired attention.

[0038] Fourthly, the present invention provides a computer-readable storage medium;

[0039] A computer-readable storage medium for storing computer instructions, which, when executed by a processor, perform the steps of the above-described 3D medical image segmentation method based on paired attention.

[0040] Compared with the prior art, the beneficial effects of the present invention are:

[0041] The technical solution provided by this invention designs a 3D medical image segmentation model, PAT-Unet, based on the Paired Attention Transformer module. The Paired Attention Transformer module effectively combines inter-channel dependency information and rich information in spatial dimensions, and reduces the number of model parameters and speeds up model inference while improving segmentation performance.

[0042] Compared with existing methods, the technical solution provided by this invention can capture detailed texture information in images, and while obtaining more accurate segmentation maps, the model reduces the number of parameters and computations by more than 67%. Attached Figure Description

[0043] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an improper limitation of the invention.

[0044] Figure 1 This is a flowchart provided for an embodiment of the present invention;

[0045] Figure 2 A schematic diagram of the framework of the 3D medical image segmentation model provided in an embodiment of the present invention;

[0046] Figure 3 A schematic diagram of the framework of the Paired Attention Transformer module provided in an embodiment of the present invention;

[0047] Figure 4 A schematic diagram of the framework of the multi-head pairing attention module provided in an embodiment of the present invention;

[0048] Figure 5 A visualization comparison of the segmentation results of the method described in this invention with other models on the ACDC dataset, provided as an embodiment of this invention. Detailed Implementation

[0049] It should be noted that the following detailed descriptions are exemplary and intended to provide further illustration of the invention. Unless otherwise specified, all technical and scientific terms used in this invention have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.

[0050] It should be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the scope of exemplary embodiments of the invention. As used herein, unless the context clearly indicates otherwise, the singular form is intended to include the plural form as well. Furthermore, it should be understood that the terms “comprising” and “having”, and any variations thereof, are intended to cover non-exclusive inclusion, for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0051] Where there is no conflict, the embodiments and features in the embodiments of the present invention can be combined with each other.

[0052] Example 1

[0053] Existing 3D medical image segmentation methods focus on improving the segmentation accuracy of the model, but at the cost of increasing the number of model parameters and computational load, resulting in poor model robustness and high computational resource requirements; thus affecting the efficiency and accuracy of 3D medical image segmentation. Therefore, this invention provides a 3D medical image segmentation method based on paired attention.

[0054] Next, combined Figures 1-5 The paired attention-based 3D medical image segmentation method disclosed in this embodiment will be described in detail. This paired attention-based 3D medical image segmentation method includes the following steps:

[0055] S1. Obtain the 3D medical image to be segmented.

[0056] S2. The 3D medical image to be segmented is input into the trained 3D medical image segmentation model for processing to obtain the segmentation result. The 3D medical image segmentation model includes an encoder and a decoder, connected together. The encoder includes a first encoding module and three second encoding modules connected in sequence. The first encoding module consists of a patch embedding layer and a paired attention transform (PAT) module. Each second encoding module consists of a paired attention transform (PAT) module and a downsampling layer. The decoder includes four decoding modules connected in sequence. Each decoding module consists of a skip connection module, a paired attention transform (PAT) module, and an upsampling module.

[0057] The specific process of inputting the 3D medical image to be segmented into the trained 3D medical image segmentation model is as follows:

[0058] The 3D medical image to be segmented is input into the decoder, which processes the image, including the following steps:

[0059] In this embodiment, the 3D medical image to be segmented is a first 3D voxel feature map with a size of 128×128×64×1, i.e., Height×Width×Depth×Channel format, where 64 is the depth of the data volume, 128×128 represents the height and width of the data volume, and 1 is the number of channels of the feature image.

[0060] In the first stage of the encoder (i.e., the first encoding module), firstly, the first 3D voxel feature map is processed by patch embedding layer, which divides the 3D data volume into multiple small data blocks of low-dimensional representation, and adds positional encoding to these data blocks. Secondly, the encoded first 3D voxel feature map is input into the PairedAttention Transformer module for processing, which focuses and segments the medical image feature regions to obtain a second 3D voxel feature map with a size of 32×32×16×32.

[0061] In the second stage of the encoder (i.e. the first second encoder module), the second 3D voxel feature map first passes through a downsampling layer consisting of a 3D convolution with a stride of 2 and a kernel size of 3×3×3 and a normalization operation, and then is processed by the PairedAttention Transformer module to obtain a third 3D voxel feature map with a size of 16×16×8×64.

[0062] In the third stage of the encoder (i.e. the second second encoder module), the third 3D voxel feature map first passes through a downsampling layer consisting of a 3D convolution with a stride of 2 and a kernel size of 3×3×3 and a normalization operation, and then is processed by the PairedAttention Transformer module to obtain a fourth 3D voxel feature map with a size of 8×8×4×128.

[0063] In the fourth stage of the encoder (i.e. the third second encoder module), the fourth 3D voxel feature map first passes through a downsampling layer consisting of a 3D convolution with a stride of 2 and a kernel size of 3×3×3 and a normalization operation, and then is processed by the PairedAttention Transformer module to obtain a fifth 3D voxel feature map with a size of 4×4×2×256.

[0064] The processing of 3D voxel feature maps by the Paired Attention Transformer module here is the same as that of the Paired Attention Transformer module in the decoder section below, as detailed below, and will not be repeated here.

[0065] The first, second, third, fourth, and fifth 3D voxel feature maps obtained by the decoder are input into the decoder for processing. The processing steps are as follows: In the first stage of the decoder (the first decoding module), the fifth 3D voxel feature map is upsampled to a size of 8×8×4×128 through the upsampling layer. Then, it is concatenated with the fourth 3D voxel feature map through the skip connection module. Finally, it is processed by the Paired Attention Transformer module to obtain a sixth 3D voxel feature map with a size of 8×8×4×128.

[0066] In the second stage (second decoding module) of the decoder, the sixth 3D voxel feature map is first upsampled to a 3D voxel feature map of size 16×16×8×64 through an upsampling layer. Then, the upsampled 3D voxel feature map of size 16×16×8×64 is concatenated with the third 3D voxel feature map through a skip connection module. Finally, it is processed by the Paired AttentionTransformer module to obtain the seventh 3D voxel feature map of size 16×16×8×64.

[0067] In the third stage (third decoding module) of the decoder, the seventh 3D voxel feature map is first upsampled to a 3D voxel feature map of size 32×32×16×32 through an upsampling layer. Then, the upsampled 3D voxel feature map of size 32×32×16×32 is concatenated with the second 3D voxel feature map through a skip connection module. Finally, it is processed by the Paired AttentionTransformer module to obtain the eighth 3D voxel feature map of size 32×32×16×32.

[0068] In the fourth stage (fourth decoding module) of the decoder, the eighth 3D voxel feature map is first upsampled to a size of 128×128×64×1 through an upsampling layer. Then, the upsampled 3D voxel feature map of size 128×128×64×1 is concatenated with the first 3D voxel feature map after 3D convolution with a kernel size of 3×3×3 through a skip connection module. The concatenated result is then processed by 3D convolution with a kernel size of 3×3×3 to obtain the final prediction output of the model, which is the final segmentation result of the medical feature region: the ninth 3D voxel feature map.

[0069] The Paired Attention Transformer module in the above operation is as follows: Figure 3 As shown, it mainly consists of a normalization layer (Layer Norm), a multilayer perceptron (MLP), and a multi-head paired attention (MPA) module. The multi-head paired attention module is as follows: Figure 4As shown, it consists of two parts: channel attention and spatial attention, which respectively capture channel dependencies and spatial dependencies.

[0070] In multi-head pairing attention, the channel attention operation first converts the vector Q... channel After transpose and vector K channel Perform a scaled dot product operation and use Softmax to measure the similarity between each feature and the features of the remaining channels to obtain a channel attention map. Then, combine the channel attention map with the vector V. channel The channel attention output is obtained by performing a dot product operation to capture the dependencies between channels in the feature map. The channel attention formula in multi-head paired attention is expressed as (1):

[0071]

[0072] (1) In the formula X C This represents the output obtained after channel attention. Q channel K channel and V channel These represent the channel query vector, channel keys vector, and channel value, respectively, with d being the size of each vector.

[0073] In multi-head paired attention, spatial attention operations first divide the V dimension into HWD×C. spatial With K spatial Projecting these onto a spatial dimension of size P×C, we obtain V respectively. spatial_proj and K spatial_pro Then, K with dimension P×C spatial_pro After transpose and Q spatial Perform a scaled dot product operation and use Softmax to obtain a spatial attention feature map of dimension HWD×P. Finally, compare the spatial attention feature map with the V obtained by projection. spatial_proj Perform a dot product operation to generate a spatial attention feature map of dimension HWD×C. The spatial attention formula in multi-head paired attention is expressed as (2):

[0074]

[0075] In equation (2), Q spatial K spatial_proj V spatial_proj These represent the projections of the spatial query vector, the spatial keys vector, and the spatial values, respectively, with d being the size of each vector.

[0076] The outputs after channel and spatial attention are summed and fused with the original 3D voxel features. The fused result is then subjected to 3D convolution to further extract deeper feature representations. The final output of the multi-head paired attention module is shown in equation (3):

[0077] X = Conv1( Conv3( ( X s +X c ) ) ) (3)

[0078] Among them, X C and X S The output feature maps for channel and spatial attention are represented respectively. Conv1 represents a 3D convolution with a kernel size of 1×1×1, and Conv3 represents a 3D convolution with a kernel size of 3×3×3.

[0079] Furthermore, training the 3D medical image segmentation model includes:

[0080] Step 1: Obtain training data.

[0081] Two publicly available 3D medical image segmentation datasets, Synapse and ACDC, were selected as training data.

[0082] The Synapse dataset consists of CT scans of abdominal organs from 30 patients. Following the TransUnet model's dataset partitioning approach, 18 datasets were used as the training set, and the remaining 12 as the test set. The experimental results section presents the Dice similarity scores (DSC) and 95% Hausdorff distance (HD95) for eight abdominal organs: spleen, left kidney, pancreas, stomach, aorta, liver, gallbladder, and right kidney. The Automated Cardiac Diagnosis Challenge dataset (ACDC) was split into 70 training samples, 10 validation samples, and 20 test samples.

[0083] Step 2: Data preprocessing and augmentation.

[0084] First, obtain the Synapse and ACDC datasets and crop the input 3D data volume to a size of 128×128×64.

[0085] Secondly, the cropped training images and their corresponding ground truth segmented images are subjected to random rotation and flipping with a 50% probability. This data preprocessing and augmentation effectively compensates for the limited number of training images in the original dataset, thereby enhancing the model's resistance to overfitting and improving its robustness.

[0086] Step 3: Input the augmented data into the 3D medical image segmentation model for processing to obtain the final model prediction map.

[0087] The loss is calculated by combining multiple loss functions, which are used to calculate the error between the model's predicted value and the actual segmented image.

[0088] In this embodiment, the sum of cross-entropy loss and soft Dice loss is used to calculate the loss between the model's predicted 3D voxel results and the true values, thus combining the advantages of both loss functions. The loss function is shown in Equation (4):

[0089]

[0090] (4) In the formula, V is the total number of 3D voxel feature maps, N is the number of predicted categories, and Z is the number of predicted categories. v,j P is the true value of the j-th category at voxel v. v,j It is the predicted probability of the j-th class at voxel v, as output by the model.

[0091] Set up the AdamW optimizer with an initial learning rate of 0.001 and a weight decay of 3e-5. Setting the weight decay coefficient can prevent the model from overfitting, and adaptive learning rate adjustment can speed up the convergence of the model.

[0092] The loss between the model's segmentation prediction map and the actual result is calculated based on the combined loss function. The AdamW optimizer is used for gradient updates and adaptive learning rate adjustment. Eight samples are trained at a time, for a total of 1000 training epochs. For the Synapse dataset, the average Dice score and 95% Hausdorff distance are provided as evaluation metrics. For the ACDC dataset, only the average Dice score is used as the evaluation metric.

[0093] The comparative models used in the experiment are the current state-of-the-art medical image segmentation models UNETR and nnFormer. The experimental comparison data with these models is shown in Table 1. Visual comparisons with other models on the ACDC dataset are shown below. Figure 5 As shown.

[0094] Table 1. Experimental comparison results of this method with other models.

[0095]

[0096] Example 2

[0097] This embodiment discloses a 3D medical image segmentation system based on paired attention, including:

[0098] The acquisition module is used to acquire the 3D medical image to be segmented;

[0099] The 3D medical image segmentation module is used to input the 3D medical image to be segmented into the trained 3D medical image segmentation model for processing to obtain the segmentation result;

[0100] The 3D medical image segmentation model includes an encoder and a decoder, which are connected. The encoder includes a first encoding module and multiple second encoding modules connected in sequence. The first encoding module consists of a patch embedding layer and a paired attention transformer module. Each of the second encoding modules consists of a paired attention transformer module and a downsampling layer. The decoder includes multiple decoding modules connected in sequence. Each decoding module consists of a skip connection module, a paired attention transformer module, and an upsampling module.

[0101] It should be noted that the acquisition module and the 3D medical image segmentation module described above correspond to the steps in Embodiment 1. The examples and application scenarios implemented by these modules and their corresponding steps are the same, but they are not limited to the content disclosed in Embodiment 1. It should also be noted that these modules, as part of the system, can be executed in a computer system, such as a set of computer-executable instructions.

[0102] Example 3

[0103] Embodiment 3 of the present invention provides an electronic device, including a memory and a processor, as well as computer instructions stored in the memory and running on the processor. When the computer instructions are executed by the processor, they complete the steps of the above-described 3D medical image segmentation method based on paired attention.

[0104] Example 4

[0105] Embodiment 4 of the present invention provides a computer-readable storage medium for storing computer instructions, which, when executed by a processor, complete the steps of the above-described 3D medical image segmentation method based on paired attention.

[0106] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0107] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0108] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment, whereby a series of operational steps are performed to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0109] The descriptions of each embodiment in the above embodiments have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.

[0110] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A 3D medical image segmentation method based on paired attention, characterized in that, include: Acquire 3D medical images to be segmented; The 3D medical image to be segmented is input into the trained 3D medical image segmentation model for processing to obtain the segmentation result; The 3D medical image segmentation model includes an encoder and a decoder, which are connected. The encoder includes a first encoding module and multiple second encoding modules connected in sequence. The first encoding module consists of a patch embedding layer and a paired attention transformer module. Each second encoding module consists of a paired attention transformer module and a downsampling layer. The decoder includes multiple decoding modules connected in sequence. Each decoding module consists of a skip connection module, a paired attention transformer module, and an upsampling module. The paired attention transformer module consists of a normalization layer, a multilayer perceptron, and a multi-head paired attention module. The data input to the paired attention transformer module passes through the normalization layer, the multi-head paired attention module, and the multilayer perceptron in sequence. The multi-head paired attention module is used to capture the channel dependencies of the input data through channel attention and obtain the channel attention output feature map, and to capture the spatial dependencies of the input data through spatial attention and obtain the spatial attention output feature map. The channel attention output feature map and the spatial attention output feature map are fused with the original 3D voxel features of the input data and 3D convolution is performed to obtain a deep feature representation of the input data.

2. The 3D medical image segmentation method based on paired attention as described in claim 1, characterized in that, The channel attention formula in the multi-head pairing attention module is expressed as follows: Among them, X C Q represents the output obtained after channel attention. channel K is the channel query vector. channel V is the channel key vector. channel Here, d represents the channel value, and d represents the size of each vector. The spatial attention formula in the multi-head pairing attention module is expressed as follows: in, Q is the output obtained after spatial attention. spatial K is the projection of the spatial query vector. spatial_proj V is the projection of the vector of keys in space. spatial_proj d is the projection of the spatial values, and d is the size of each vector.

3. The 3D medical image segmentation method based on paired attention as described in claim 1, characterized in that, The first encoding module is used to embed and segment the 3D medical image to be segmented, obtain a 3D voxel feature map and add position encoding. Multiple second encoding modules are used to perform paired attention transformation and downsampling operations on the 3D voxel feature map to achieve sequential dimensionality reduction of the 3D voxel feature map. Multiple decoding modules are used to upsample the dimensionality-reduced 3D voxel feature map and concatenate it with 3D voxel feature maps of different dimensions, and then perform paired attention transformation to achieve sequential dimensionality increase of the concatenated 3D voxel feature map. After convolution operation, the predicted final segmentation result is output.

4. The 3D medical image segmentation method based on paired attention as described in claim 1, characterized in that, The process of inputting the 3D medical image to be segmented into the trained 3D medical image segmentation model includes: The 3D medical image to be segmented is embedded and segmented to obtain a 3D voxel feature map and add position encoding. Paired attention transformation and downsampling operations are performed on the 3D voxel feature map to achieve sequential dimensionality reduction of the 3D voxel feature map; The dimensionality-reduced 3D voxel feature map is upsampled and then concatenated with 3D voxel feature maps of different dimensions. Paired attention transformation is then performed to achieve sequential dimensionality increase of the concatenated 3D voxel feature map. Finally, the predicted segmentation result is output after convolution operation.

5. The 3D medical image segmentation method based on paired attention as described in claim 1, characterized in that, The training methods for the 3D medical image segmentation model include: Obtain training data; Configure the AdamW optimizer to adaptively adjust the learning rate; The 3D medical image segmentation model is trained based on training data, learning rate, and a preset loss function.

6. A 3D medical image segmentation system based on paired attention, characterized in that, include: The acquisition module is used to acquire the 3D medical image to be segmented; The 3D medical image segmentation module is used to input the 3D medical image to be segmented into the trained 3D medical image segmentation model for processing to obtain the segmentation result; The 3D medical image segmentation model includes an encoder and a decoder, which are connected. The encoder includes a first encoding module and multiple second encoding modules connected in sequence. The first encoding module consists of a patch embedding layer and a paired attention transformer module. Each second encoding module consists of a paired attention transformer module and a downsampling layer. The decoder includes multiple decoding modules connected in sequence. Each decoding module consists of a skip connection module, a paired attention transformer module, and an upsampling module. The paired attention transformer module consists of a normalization layer, a multilayer perceptron, and a multi-head paired attention module. The data input to the paired attention transformer module passes through the normalization layer, the multi-head paired attention module, and the multilayer perceptron in sequence. The multi-head paired attention module is used to capture the channel dependencies of the input data through channel attention and obtain the channel attention output feature map, and to capture the spatial dependencies of the input data through spatial attention and obtain the spatial attention output feature map. The channel attention output feature map and the spatial attention output feature map are fused with the original 3D voxel features of the input data and 3D convolution is performed to obtain a deep feature representation of the input data.

7. An electronic device, characterized in that, It includes a memory and a processor, as well as computer instructions stored in the memory and running on the processor, which, when executed by the processor, perform the steps described in any one of claims 1-5.

8. A computer-readable storage medium, characterized in that, Used to store computer instructions, which, when executed by a processor, perform the steps described in any one of claims 1-5.

Citation Information

Patent Citations

  • Medical image segmentation method and device, electronic equipment and storage medium

    CN115375698A

  • Event communication platform for mobile device users

    US20090012841A1