Brain tumor MRI image segmentation method based on Swinin-PSAxialNet
By using the Swin-PSAxialNet method in three-dimensional medical image segmentation, using the PSAA block to perform Transformer attention calculation in three dimensions, the problem of high computing complexity in the prior art is solved, and the segmentation effect of high precision and low computing cost is achieved.
Patent Information
- Application Number
- CN202411263195.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-10
- Publication Date
- 2025-02-25
AI Technical Summary
The existing three-dimensional medical image segmentation method has high computational complexity when processing three-dimensional image data, resulting in long inference time and it is difficult to reduce computing costs while ensuring high network accuracy.
The Swin-PSAxialNet-based brain tumor MRI image segmentation method was used to perform Transformer attention calculations in three dimensions and use Parameter ShareAxis-Attention Block (PSAA block) to reduce the computational complexity.
While ensuring high accuracy of the network, it effectively reduces computing costs, improves training speed, and can effectively learn rich global features and improves segmentation accuracy.
Smart Images

Figure CN119515891A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of machine learning and three-dimensional medical image segmentation, and in particular relates to a brain tumor MRI image segmentation method based on Swin-PSAxialNet. Background Art
[0002] 3D medical segmentation is a medical image analysis method based on computer vision and image processing technology. It is an important step in many clinical tasks such as disease diagnosis, surgical planning and prognosis assessment. Therefore, accurately and robustly segmenting target organs and lesions from medical images plays a vital role in many clinical applications. Compared with common natural images, many common medical images such as CT and MRI are three-dimensional images, that is, there is a z-axis in addition to the two dimensions of x and y. The task aims to automatically or semi-automatically extract the anatomical structure or lesion area of interest from the three-dimensional medical image. This technology has a wide range of applications in medical diagnosis, surgical planning and treatment monitoring.
[0003] In 3D medical segmentation, it is first necessary to obtain medical image data, such as CT (computed tomography), MRI (magnetic resonance imaging) or PET (positron emission tomography), etc. These image data are usually represented in the form of voxels (three-dimensional pixels), and each voxel contains information about tissue density, signal intensity or metabolic activity.
[0004] In traditional image processing, an important method for image segmentation is based on threshold segmentation. This method divides the pixels in the image into different categories by setting one or more thresholds. For example, thresholds can be used to segment tissues such as bones, muscles, and fat in CT images. However, the threshold-based method may not be accurate enough for complex images and lesion areas.
[0005] Another commonly used method is edge detection based segmentation. This method segments different structures by detecting edges or contours in the image. For example, in MRI images, edge detection algorithms can be used to segment the cortex and white matter of the brain. However, edge detection methods may produce inaccurate results due to factors such as noise and image quality.
[0006] In addition, there are methods based on region growing, graph cuts, and active contours for 3D medical segmentation. The region growing method starts from a seed point and expands the segmentation region by iteratively merging adjacent pixels. The graph cut method transforms the image segmentation problem into a graph theory problem and solves it using the minimum cut maximum flow algorithm. The active contour method is based on the principle of energy minimization and achieves segmentation by iteratively adjusting the contour shape.
[0007] In recent years, deep learning technology has made significant progress in three-dimensional medical segmentation. Deep learning models, such as convolutional neural networks (CNN) and U-Net, can automatically learn feature representations through a large amount of training data and achieve highly accurate segmentation results. FCN, the originator of deep learning segmentation methods in the field of semantic segmentation, uses a fully convolutional pooling network to extract low-resolution features with deep semantic information in images, which broadens the ideas for later work. Then the U-Net series and DeepLab series quickly occupied a place in the field of image segmentation with the encoder-decoder network structure. Through continuous convolutional network feature extraction and expansion of the receptive field to obtain more global spatial information, the segmentation accuracy has been greatly improved compared to FCN. Most of the subsequent work is carried out around U-Net, and the training accuracy is improved by stacking and deepening the number of layers and complicating the network.
[0008] A major cost of Transformer is the global calculation based on the Patch block, which is too computationally intensive and takes a long time to infer, especially when applied to 3D image data. 3D image data is larger than 2D image data and has an extra z direction. If it is directly applied, the complexity will be O(n 3 ), the cost is relatively high. Therefore, how to effectively reduce the computational cost while ensuring the high accuracy of the network is the key issue for the successful application of Transformer in the field of 3D medical image segmentation. Specifically, the complexity of Transformer is usually proportional to the square of the length of the input data. When processing 3D data, the input length increases and the computational complexity increases significantly. For 3D image data, the volume of the input data (usually large, directly using Transformer will result in a computational complexity of O((xyz)), which places very high demands on computing resources. 3D image data requires a lot of memory to store features and gradient information, especially during training, when the graphics memory requirements may exceed the capabilities of ordinary hardware. Due to the large amount of computation, the inference time will also be extended accordingly, which is unacceptable in real-time applications or scenarios that require fast feedback. Summary of the invention
[0009] Purpose of the invention: The purpose of the present invention is to provide a brain tumor MRI image segmentation method based on Swin-PSAxialNet. The PSAA block based on Transformer performs operations in three dimensions respectively, which effectively reduces the computational cost while ensuring the high accuracy of the network.
[0010] Technical solution: The brain tumor MRI image segmentation method based on Swin-PSAxialNet of the present invention comprises the following steps:
[0011] S1. Acquire 3D brain tumor MRI images;
[0012] S2, performing data preprocessing on the 3D brain tumor MRI image to obtain preprocessed data;
[0013] S3, Swin-Unet and 2D XialAttention are integrated to build a segmentation network model; the 3D brain tumor MRI image is first converted into a sequence through Patch block encoding; then it is downsampled through several blocks and the original PSAA block is used for deep feature extraction; at the same time, each layer is fused with the features from the bottom layer input to ensure the fusion of local feature information and global feature information; finally, after several blocks of upsampling to restore the image size, the final brain tumor segmentation prediction result is obtained through the Head layer;
[0014] S4, the preprocessed data is input into the segmentation network model for brain tumor image segmentation;
[0015] S5. Complete image segmentation and output the model segmentation prediction results.
[0016] The specific process of S1 and S2 is as follows:
[0017] S1.1. Collect the BraTS2021 public brain tumor dataset as the training and testing MRI dataset for this experiment;
[0018] S2.1, BraTS2021 consists of mpMRI scans of 2000 patients, each of which consists of four modal data, namely flair, t1ce, t1, t2, and the data size of each modality is 240x 240x 155, and the segmentation labels are shared;
[0019] S2.2, In the data preprocessing process of NNUnet, the purpose of converting the original data into "cropped", "decathlon" and "preprocessed" data is to adapt to different training and evaluation needs, as well as to improve model performance and training results. "Cropped" data can decompose the original image into multiple small blocks, which helps the model learn more detailed features and improve the perception of boundaries and local structures; "Decathlon" data is designed to match the specifications of the Decathlon competition to maintain the consistency of data input to the network; "Preprocessed" data is subjected to additional preprocessing operations to further optimize the data quality and model performance, including histogram equalization, intensity normalization, spatial normalization, etc.;
[0020] S2.3. Considering that the background accounts for a large proportion of the image, the data is cropped to improve network efficiency. The cropped image size is 155x 160x 160. Then the images of the four modalities are merged into a 4D image (C x H x WxD, C=4), where the four modalities are spliced from the same object and the same area based on different magnetic resonance images and used as the input of the network.
[0021] Furthermore, the specific process of S3 is as follows:
[0022] S3.1. The general architecture of the network is U-shaped. The encoder and decoder structures perform local feature extraction and feature concatenation of large-grained and small-grained images respectively:
[0023] S3.1.1. In the downsampling part, the downsampling block and the PSAA block are combined into a Downsampling body.
[0024] S3.1.2, the encoder contains four stages:
[0025] The first layer contains Patch Embedding, which divides the 3D volume data into 3D Patches (P1, P2, P3) are non-overlapping patches. Represents the sequence length of 3D patches. Next, N patches are projected into C channels. The original number of channels is 4 channels, representing the four modal features of the original image. After Patch Embedding and PSAA blocks, the resolution of the 3D feature map is reduced by 4 times, and C becomes 48. For the remaining three-layer encoder stage, the Downsampling body of non-overlapping convolution is used, the resolution is reduced by 2 times, and C is increased by 2 times.
[0026] S3.1.3, the decoder contains four stages:
[0027] Similar to the encoder, the decoder also contains four stages. Each decoder stage contains an upsampling body consisting of an upsampling block and a PSAA block. After one layer, the resolution of the feature map is increased by 2 times. Between every two decoder stages, the number of channels is reduced by two times. At the same time, in order to restore spatial information and enhance feature representation, feature fusion of large-scale and small-scale images will be performed before the upsampling block. The final upsampled output will pass through the Head layer to output the segmentation label, and the final output image is (H xW x D x C, C = 3).
[0028] S3.2. In order to make local feature extraction more global, the traditional image segmentation CNN module was transformed, and the PSAA module (Parameter ShareAxis-Attention Block) was created. AxialAttention was used in three-dimensional medical image processing, and Transformer attention calculations were performed in three dimensions: H (Height), W (Width), and D (Depth). The k and q parameter weights were shared in the three dimensions to improve the network training speed:
[0029] S3.2.1. PSAA network overall description:
[0030] Compared with the traditional CNN network, the proposed PSAA block can more effectively perform global information attention and more efficiently perform network learning and training, thereby capturing richer image and spatial features. The PSAA block includes AxialAttention learning in three dimensions: Height, Width, and Depth. Compared with the traditional Attention mechanism that performs attention learning on each pixel of the image, Axial Attention has a huge advantage in speed and efficiency. It only performs attention learning in a single dimension, reducing the complexity of self-attention from quadratic to linear. On the other hand, the use of a learnable keys-queries parameter sharing mechanism allows the network to perform attention mechanisms concurrently in three dimensions while also greatly improving the speed of self-attention, resulting in faster, better, and more effective feature representations.
[0031] S3.2.2, PSAA block implementation details:
[0032] 3D medical imaging data will be put into the PSAA block for self-attention calculation in its three dimensions. In each dimension, there are three learnable parameters K, Q, and V. Among them, Keys and Queries are the attention parameter weights shared by the three dimensions, and Values is unique to each module. The calculation method of the self-attention module is:
[0033]
[0034] and They represent the degree of self-attention in three dimensions, f is the attention calculation module, Q shared , K shared is the shared matrix parameter, V Height , V Width , V DepthThe values are unique to the three dimensions. When calculating self-attention, the three dimensions are calculated simultaneously with high concurrency. It is hoped that the complexity of attention calculation will be reduced from the original O(n 2 ) is reduced to O(np), where n is the number of tokens and p is the dimension of the projection vector. It speeds up the training while learning more rich global features as efficiently as possible. Given a normalized vector X of shape HWD×C, five linear layers are used to calculate Q shared , K shared And the V values in three dimensions, we get Q shared =W Q ·X, K shared =W K ·X, V m =W m ·X, where m represents the three dimensions of Height, Width, and Depth. After obtaining the weight parameters of these five parameters, the W after Transpose is K With W Q Dot-product and f function are used to calculate the sequence matrix, and then Softmax is used to measure the feature similarity between each feature and other tokens as a standard. The self-attention calculation is:
[0035]
[0036] Where m represents the three dimensions of Height, Width, and Depth, Q shared , K shared Represents the shared parameter weight, and d represents the size of each incoming vector. After performing self-attention calculations in three dimensions, the three-dimensional results are feature fused, and the fused results are passed to the subsequent convolution module. In the final convolution module, kernel_size is determined based on the input of the subsequent network. First, a conv Block is performed, followed by a 1×1×1 convolution operation to adapt the network and increase the nonlinearity of the network. The final output of the PSAA module is:
[0037]
[0038] Where m represents the three dimensions of Height, Width, and Depth.
[0039] S3.3, loss function:
[0040] As an important part of neural network, the loss function is of great importance. It uses a combination of dual loss functions, which is the sum of the loss function based on the Dice coefficient and the cross entropy loss. These two functions are used at the same time to achieve complementary advantages. It is defined as:
[0041]
[0042] Where I represents the number of categories, V represents the number of tokens, and Y v,i and P v,i Represent the ground truths and output probabilities of class i at v respectively.
[0043] The present invention also discloses a computer device, comprising a memory, a processor and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of the method of the present invention.
[0044] The present invention also discloses a computer-readable storage medium on which a computer program / instruction is stored. When the computer program / instruction is executed by a processor, the steps of the method of the present invention are implemented.
[0045] The present invention also discloses a computer program product, comprising a computer program / instruction, which implements the steps of the method of the present invention when executed by a processor.
[0046] Beneficial effects: Compared with the prior art, the present invention has the following significant advantages:
[0047] The present invention proposes a novel PSAA feature extraction block based on the combination of AxialNet and Params sharing strategy, and adopts a multi-scale image fusion method to obtain detail information and spatial feature information. Using three-dimensional channel k, q context sharing for Axis calculation can achieve good learning effect with low computational complexity, and the global feature information is rich. The Axial Transformer with high semantic aggregation models the correlation between foreground and GT semantics respectively and further improves the segmentation accuracy by soft aggregation of feature vectors. Finally, the present invention also designs a method based on the combination of dual loss functions to provide a more accurate discrimination criterion for the model. The network can achieve optimal performance while ensuring training accuracy while maintaining low Params and FLOPs. A combination of dual loss functions is used, which is the sum of the loss function based on the Dice coefficient and the cross entropy loss, and these two are used at the same time to achieve complementary advantages. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1 This is the overall flow chart of brain tumor segmentation based on Swin-AxialNet;
[0049] Figure 2 This is the Swin-AxialNet network architecture diagram. DETAILED DESCRIPTION
[0050] The technical solution of the present invention is further described below in conjunction with the accompanying drawings.
[0051] See also Figure 1 and Figure 2 The present invention provides a technical solution based on the Swin-AxialNet brain tumor segmentation method, comprising the following steps:
[0052] Step 1: References are collected to obtain commonly used MRI datasets for 3D brain tumor medicine. Commonly used datasets include BraTS (Multimodal Brain Tumor Segmentation Challenge), ISLES (Ischemic StrokeLesion Segmentation), IBSR (Internet Brain Segmentation Repository), etc. The dataset used in the present invention is BraTS, which is more commonly used in 3D medical segmentation.
[0053] Step 2: Preprocess the image. Due to the differences in the original image, such as the resolution, the number of 3D slices, etc., data preprocessing converts the original data raw_data into three types of data formats: cropped, decathlon, and preprocessed. The original 3D data is relatively large, contains a lot of unnecessary information, and needs to focus on specific areas of interest. The crop operation will cut out the required area and convert it into npz and pkl medical information files; Decathlon refers to the data format related to medical image processing and analysis. Converting to this format facilitates score comparison with other deep learning models; the preprocessed file processes the data into network-adapted npy and pkl files, and then performs two-stage training, using a mixed high- and low-precision training method;
[0054] Step 3, the present invention is a brain tumor segmentation algorithm based on Swin-AxialNet, which is characterized by a Swin structure network fused with PSAA blocks. Figure 2 As shown in the figure, the overall U-net network architecture is still based on U-Net, and PSAA blocks are included after its DownsamplingBlock and Upsampling Block. At the same time, the feature fusion block can well integrate the high-scale image information of multi-stage features, and fuse the image features after the first layer of Patch Embedding to obtain the primary fusion representation. In progress m represents the self-attention calculations in three different dimensions. Finally, after the PSAA network, the resolution is reduced to half of the original, and the number of channels is doubled. After the three blocks of self-attention are completed concurrently, the output is obtained to obtain the secondary fusion representation After forward propagation and backward propagation of the network, the output dimension of the network is H x W x D x 24. Finally, the Head layer outputs the final result H x W x D x 3, restoring the original image size.
[0055] After obtaining the segmentation Mask, the present invention uses two indicators as indicators for evaluating the model: DiceSimilarity Score (DSC) and 95% Hausdorff Distance (HD95). Preferably, the present invention uses DSC to measure the overlap between the voxel segmentation prediction and GT, and uses 95% HD to measure the overlap between the voxel segmentation prediction boundary and GT, while filtering out 5% of outliers. DSC is defined as follows:
[0056]
[0057] Where T and P represent the GT value of all voxels and the possible prediction value of all voxels, respectively. The 95% HD is defined as follows:
[0058]
[0059] where d T’P’ is the maximum HD between GT and predicted voxels 95 The percentile distance, d P’T’ To predict the maximum HD between voxel and GT 95 percentile distance.
[0060] Furthermore, in this example, the specific content of the PSAA network in step 3 is:
[0061] The image data will be put into the PSAA block for self-attention calculation in three dimensions. In each dimension, there are three learnable parameters K, Q, and V, where Keys and Queries are the weights of the attention parameters shared by the three dimensions, and Values is unique to each module. The three dimensions are calculated simultaneously with high concurrency during self-attention calculation. This invention hopes to reduce the complexity of attention calculation from the original O(n 2 ) is reduced to O(np), where n is the number of tokens and p is the dimension of the projection vector. This speeds up the training while learning more rich global features as efficiently as possible. Given a normalized vector X of shape HWD×C, the present invention uses five linear layers to calculate Q shared , K shared And the V values in three dimensions, we get Q shared =W Q ·X, K shared =W K ·X, V m =W mX, where m represents the three dimensions of Height, Width, and Depth. After obtaining the weight parameters of these five parameters, the present invention converts the W after Transpose into K With W Q Dot-product and f function are used to calculate the sequence matrix, and then Softmax is used to measure the feature similarity between each feature and other tokens as a standard. The self-attention calculation is:
[0062]
[0063] Where m represents the three dimensions of Height, Width, and Depth, Q shared , K shared Represents the shared parameter weight, and d represents the size of each incoming vector. After performing self-attention calculations in three dimensions, the three-dimensional results are feature fused, and the fused results are passed to the subsequent convolution module. In the final convolution module, the kernel_size of the present invention is determined based on the input of the subsequent network. First, a convBlock is performed, followed by a 1×1×1 convolution operation to adapt the network and increase the nonlinearity of the network. The final output after the PSAA module is:
[0064]
[0065] Where m represents the three dimensions of Height, Width, and Depth.
[0066] Step 4: Put the preprocessed data batches into the network for network training to obtain 3D brain tumor segmentation images, with the number of iters being 100,000 times;
[0067] Step 5: Get the segmentation results for data analysis and compare the network model effects.
[0068] Table 1. Comparison of network model indicators
[0069]
[0070] In order to effectively reduce the computational cost while ensuring high network accuracy, methods such as patch-based approach, dimensionality reduction, and hybrid model architecture can be considered. The patch-based approach divides the 3D image into smaller patches and processes them separately. This method can reduce the complexity of a single calculation, but an effective strategy needs to be designed to fuse the information of these patches. Using hierarchical processing, local patches are processed first, and then their results are integrated for global calculation. Dimensionality reduction Before the input data enters the Transformer, methods such as convolutional neural networks (CNNs) are used to reduce the dimensionality of the data to reduce the number of input features. Variants of the attention mechanism, such as sparse attention, are used to calculate only the relationship between important areas. Model compression and acceleration use techniques such as knowledge distillation, weight quantization, and pruning to compress the model and reduce the amount of calculation. Lightweight Transformer variants such as MobileViT and Swin Transformer are used, which are designed with computational efficiency in mind. The hybrid model architecture combines the advantages of convolutional neural networks (CNN) and Transformer, using CNN to process local information and Transformer to process global information. This hybrid architecture can significantly reduce computational costs while maintaining accuracy.
[0071] Multi-scale feature extraction: Extract features at different scales and use multi-scale information to improve the robustness and accuracy of the model while optimizing computational efficiency.
[0072] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A brain tumor MRI image segmentation method based on Swin-PSAxialNet, characterized in that: The steps include: S1. Acquire 3D brain tumor MRI images; S2, performing data preprocessing on the 3D brain tumor MRI image to obtain preprocessed data; S3, Swin-Unet and 2D XialAttention are integrated to build a segmentation network model; the 3D brain tumor MRI image is first converted into a sequence through Patch block encoding; then it is downsampled through several blocks and the original PSAA block is used for deep feature extraction; at the same time, each layer is fused with the features from the bottom layer input to ensure the fusion of local feature information and global feature information; finally, after several blocks of upsampling to restore the image size, the final brain tumor segmentation prediction result is obtained through the Head layer; S4, the preprocessed data is input into the segmentation network model for brain tumor image segmentation; S5. Complete image segmentation and output the model segmentation prediction results.
2. The brain tumor MRI image segmentation method based on Swin-PSAxialNet according to claim 1, characterized in that: The specific process of S1 and S2 is as follows: S1.
1. Collect the BraTS2021 public brain tumor dataset as a training and testing MRI dataset; S2.1, BraTS2021 consists of mpMRI scans, where each data consists of four modal data, namely flair, t1ce, t1, and t2. The data size of each modality is the same and the segmentation labels are shared; In the data preprocessing process of S2.2, nn-Unet, the original data is converted into three types of data: Cropped, Decathlon, and Preprocessed. The Cropped data can decompose the original image into multiple small blocks. The Decathlon data is designed to match the specifications of the Decathlon competition and maintain the consistency of the data input network. The Preprocessed data undergoes additional preprocessing operations to further optimize the data quality and model performance, including histogram equalization, intensity normalization, and spatial normalization. S2.
3. Crop the data to improve network efficiency, then merge the images of the four modalities into a 4D image, C xH x W x D, C=4, where the four modalities are spliced from different MRI images of the same object and the same area and used as the input of the network.
3. The brain tumor MRI image segmentation method based on Swin-PSAxialNet according to claim 1, characterized in that: The specific process of S3 is as follows: S3.
1. The general architecture of the network is U-shaped. The encoder structure and the decoder structure perform local feature extraction and feature concatenation of large-grained and small-grained images respectively: S3.
2. Modify the image segmentation CNN module to make local feature extraction more global, build the PSAA module Parameter ShareAxis-Attention Block, use AxialAttention in three-dimensional medical image processing, perform Transformer attention calculations in the three dimensions of Height, Width, and Depth, and share k and q parameter weights in the three dimensions to improve network training speed; S3.
3. Set the loss function.
4. The brain tumor MRI image segmentation method based on Swin-PSAxialNet according to claim 3, characterized in that: The S3.1 specifically includes the following steps: S3.1.1, in the downsampling part, the downsampling block and the PSAA block are combined into a Downsampling body; S3.1.2, the encoder contains four stages: The first layer contains Patch Embedding, which divides the 3D volume data into 3D Patches P1, P2, and P3 are non-overlapping patches. Represents the sequence length of 3D Patches; N Patches are projected into C channels. The original number of channels is 4 channels, representing the four modal features of the original image. After PatchEmbedding and PSAA blocks, the resolution of the 3D feature map is reduced by 4 times, and C becomes 48; For the remaining three-layer encoder stage, the Downsampling body of non-overlapping convolution is used, the resolution is reduced by 2 times, and C is increased by 2 times; S3.1.3, the decoder contains four stages: The decoder also consists of four stages, where each decoder stage contains an Upsampling body consisting of an upsampling block and a PSAA block. After one layer, the resolution of the feature map is increased by 2 times; between every two decoder stages, the number of channels is reduced by two times; in order to restore spatial information and enhance feature representation, feature fusion of large-grained and small-grained images will be performed before the upsampling block, and the final upsampling output will pass through the Head layer to output the segmentation label. The final output image is H x W x D x C, C = 3.
5. The brain tumor MRI image segmentation method based on Swin-PSAxialNet according to claim 3, characterized in that: The S3.2 specifically includes the following steps: S3.2.
1. PSAA network as a whole: The PSAA block includes AxialAttention learning in three dimensions: Height, Width, and Depth. It uses a learnable keys-queries parameter sharing mechanism to enable the network to perform attention mechanisms concurrently in three dimensions while improving the speed of self-attention. S3.2.2, PSAA block implementation: 3D medical imaging data will put its three dimensions into the PSAA block for self-attention calculation. In each dimension, there are three learnable parameters K, Q, and V. Among them, Keys and Queries are the attention parameter weights shared by the three dimensions, and Values is unique to each module. The calculation method of the self-attention module is: and They represent the degree of self-attention in three dimensions, f is the attention calculation module, Q shared , K shared is the shared matrix parameter, V Height , V Width , V Depth The values are unique to the three dimensions. The three dimensions are calculated simultaneously with high concurrency during self-attention calculation. The goal is to reduce the complexity of attention calculation from the original O(n 2 ) is reduced to O(np), where n is the number of tokens and p is the dimension of the projection vector; while speeding up the training, more rich global features are learned. Given a normalized vector X of shape HWD×C, five linear layers are used to calculate Q shared , K shared And the V values in three dimensions, we get Q shared =W Q ·X, K shared =W K ·X, V m =W m ·X; where m represents the three dimensions of Height, Width, and Depth. After obtaining the weight parameters of these five parameters, the W after Transpose is K With W Q Dot-product and f function are used to calculate the sequence matrix, and then Softmax is used to measure the feature similarity between each feature and other tokens as a standard. The self-attention calculation is: Where m represents the three dimensions of Height, Width, and Depth, Q shared , K shared Represents the shared parameter weight, d represents the size of each incoming vector, after self-attention calculation in three dimensions, the three-dimensional results are feature fused, and the fused results are passed to the subsequent convolution module. In the final convolution module, kernel_size is determined according to the input of the subsequent network. First, a conv Block is performed, followed by a 1×1×1 convolution operation to adapt the network and increase the nonlinearity of the network. The final output of the PSAA module is: Where m represents the three dimensions of Height, Width, and Depth.
6. The brain tumor MRI image segmentation method based on Swin-PSAxialNet according to claim 3, characterized in that: The S3.3 specifically includes the following steps: A combination of dual loss functions is used, based on the sum of the Dice coefficient loss function and the cross entropy loss, and these two are used simultaneously to achieve complementary advantages, defined as: Where I represents the number of categories, V represents the number of tokens, and Y v,i and P v,i Represent the groundtruths and output probabilities of class i at v respectively.
7. A computer device comprising a memory, a processor and a computer program stored in the memory, characterized in that: The processor executes the computer program to implement the steps of the method of claim 1.
8. A computer-readable storage medium having a computer program / instruction stored thereon, characterized in that: When the computer program / instructions are executed by a processor, the steps of the method according to claim 1 are implemented.
9. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of the method according to claim 1 are implemented.