Prostate MRI image segmentation method and system based on adaptive multi-scale transformer optimization
Patent Information
- Application Number
- CN202210610244.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-31
- Publication Date
- 2026-10-30
- Estimated Expiration
- 2042-05-31
AI Technical Summary
磁共振成像(Magnetic resonance imaging,MRI)具有较高的组织分辨力,可很好地区分正常及病变组织信号,目前通过MRI影像特征对前列腺癌进行鉴别诊断,对医生的专业水平要求较高,但也存在一些问题:前列腺癌病灶与其周边正常组织的分界不明显,使得放射科医生单靠肉眼不易识别前列腺癌病灶,且难以对恶性程度进行准确判断,从而增加了误诊和漏诊风险
[0105]1、由于二维网络无法从临近的断面中获取有用的信息,三维网络由于MRI数据的各向异性(即平面分辨率远低于平面内分辨率),单独运用卷积方法表现不佳。本发明引入了自适应卷积自适应地调制卷积核全局互补信息;
Smart Images

Figure CN115272170B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of medical image processing, and more specifically, to a method and system for segmenting prostate MRI images based on adaptive multi-scale Transformer optimization. Background Technology
[0002] Early-stage prostate cancer lesions are difficult to detect on imaging, and more than half of prostate cancer patients are diagnosed at an advanced stage. To improve the cure rate, early and accurate screening is crucial for timely intervention and treatment. Magnetic resonance imaging (MRI) has high tissue resolution and can effectively distinguish between normal and diseased tissue signals. Currently, differential diagnosis of prostate cancer based on MRI imaging features requires a high level of expertise from physicians, but it also presents some challenges: the boundary between prostate cancer lesions and surrounding normal tissue is not clear, making it difficult for radiologists to identify prostate cancer lesions visually and accurately assess the degree of malignancy, thus increasing the risk of misdiagnosis and missed diagnosis. Therefore, research on prostate segmentation techniques is of great significance.
[0003] In recent years, with the gradual development of Artificial Intelligence (AI) and AI-based deep learning image processing technologies, deep learning algorithms have been widely used in the research and application of medical image-assisted diagnostic systems. Deep learning-based prostate segmentation technology can help radiologists improve image interpretation efficiency and reduce misdiagnosis and missed diagnosis rates. Generally, deep learning-based prostate MRI image segmentation technologies can be divided into five categories: segmentation techniques based on Convolutional Neural Networks (CNNs), segmentation techniques based on U-shaped networks, segmentation techniques based on resolution enhancement, segmentation techniques based on Generative Adversarial Networks (GANs), and segmentation techniques based on Transformers. The emergence of CNNs overcomes the limitation of traditional machine learning requiring manual feature extraction, automatically learning effective features from input images. Compared to image-level classification using CNNs, U-shaped networks employ a symmetric encoder-decoder structure with skip connections, gradually restoring the downsampled feature maps to their original size, thereby achieving pixel-level segmentation of medical images. Although the U-shaped network model has shown good performance in medical image segmentation, it still has the following problems when applied to prostate segmentation in MRI images: (1) The U-shaped network model improves the segmentation accuracy by increasing the network layers, but this often leads to gradient vanishing during backpropagation; (2) The pooling downsampling operation in the U-shaped network causes the loss of detailed information of the target edge, which affects the reconstruction of the feature map after upsampling and reduces the segmentation accuracy; (3) The glands to be segmented have different sizes and shapes, and the contrast between the gland tissue and the background is not high, making it difficult for the network to focus on learning the gland structure. Therefore, further improvements are needed. The segmentation technology based on GAN mainly consists of a segmentation network and a discriminant network. The segmentation network generates a segmentation prediction map, and the discriminant network determines whether the input comes from the real label or the segmentation prediction. At the same time, a receptive field block (RFB) is integrated into the segmentation network to acquire and fuse multi-scale information of deep features, improve the feature recognition rate and robustness, and improve the segmentation performance of the network. Recently, in order to better capture the local features of the image, the Transformer-based framework has been introduced more often into the task of medical image segmentation and has shown the best performance.
[0004] Patent document CN110188792A (application number: CN201910312296.3) discloses a method for obtaining image features from three-dimensional MRI images of the prostate. This invention automatically segments the prostate T2WI image to obtain the corresponding prostate organ region, and maps the segmentation results onto registered ADC and DWI images to obtain a multi-parameter prostate organ region as input to a discriminative model. This multi-parameter MRI image is then combined with a deep learning algorithm to obtain image features. However, this invention does not introduce adaptive convolution to adaptively modulate the global complementary information of the convolution kernel. Summary of the Invention
[0005] To address the shortcomings of existing technologies, the purpose of this invention is to provide a prostate MRI image segmentation method and system based on adaptive multi-scale Transformer optimization.
[0006] A prostate MRI image segmentation method based on adaptive multi-scale Transformer optimization provided by the present invention includes:
[0007] Step S1: Obtain the prostate MRI image dataset;
[0008] Step S2: Preprocess the MRI images in the dataset to obtain the preprocessed training set and test set;
[0009] Step S3: Initialize the parameters in the network, train the network with the Transformer module on the prostate organ region labeled in the prostate image, and update the parameters to obtain the automatic prostate segmentation model;
[0010] Step S4: Input the images from the test dataset into the trained network to obtain prostate segmentation images for each MRI image.
[0011] Preferably, in step S1:
[0012] The prostate MRI image dataset contains T1WI scan sequences, with the labeled areas on the images representing the extent of the prostate organ, obtained manually.
[0013] In step S2:
[0014] The preprocessing methods include histogram equalization of all MRI images in the training and test sets, and data augmentation of all MRI images in the training and test sets.
[0015] Preferably, in step S3:
[0016] The parameters in the network mainly include weights, biases, number of convolutional kernels, kernel size, number of Transformer modules, and number of Dropout layers;
[0017] The network with a Transformer module is trained using prostate organ regions annotated by doctors on prostate images. The parameters in the network are then updated to obtain an automatic prostate segmentation model. The model structure includes downsampling, upsampling, and an adaptive multi-scale attention module based on Transformer.
[0018] Preferably, step S3.1: the Transformer-based network includes N downsampling layers, N upsampling layers, 1 Leaky ReLU layer, and M Transformer modules;
[0019] Step S3.2: Perform K convolutions on the input prostate image to obtain a feature map with the same size as the input prostate image, and subtract the convolutional feature map from the input first image to obtain the first residual feature map, where K is a positive integer;
[0020] Step S3.3: Downsample the first residual feature map to obtain the first downsampled feature map; perform K convolutions on the first downsampled feature map to obtain a feature map with the same size as the first downsampled feature map; and subtract the feature map obtained after K convolutions of the first downsampled feature map from the first downsampled feature map to obtain the second residual feature map.
[0021] Step S3.4: Repeat step S3.3, perform one convolution downsampling on the nth residual feature map to obtain the nth downsampled feature map; then perform M convolutions on the nth downsampled feature map to obtain a feature map with the same size as the nth downsampled feature map; and subtract the feature map obtained after M convolutions of the nth downsampled feature map from the nth downsampled feature map to obtain the (n+1)th residual feature map; where the initial value of n is 2;
[0022] Step S3.5: Increment the value of n by 1 and repeat step S3.4 until n = N + 1, then proceed to step S3.6;
[0023] Step S3.6: After downsampling the image, the L-shaped tomographic stack of the input image is represented as a four-dimensional input:
[0024] x∈R l×h×w×c
[0025] Where h is the height of the feature map, w is the width, c is the number of channels, x is the input four-dimensional image, R is a positive real number, and l is the tomographic thickness;
[0026] By leveraging the high correlation between nearby pixels in the feature map and downsampling x using average pooling with a kernel size of k, a compressed feature map is generated.
[0027]
[0028] Where, x pool This is the four-dimensional input after pooling;
[0029] Step S3.7: Calculate the linear projection Q′ of the compressed feature map query and the linear projection K′ of the key, and express the linear projection of x in the number of channels as V. The calculation formula is as follows:
[0030] Q′=x pool W Q
[0031] K′=x pool W K
[0032] V = xW V
[0033] Among them, W Q For the linear projection weights of the query, W K W represents the linear projection weights of the keys. V The weights for the linear projection of V;
[0034] Step S3.8: Calculate the attention matrix A∈R l×l This matrix represents the level of attention that should be given to other sections when dividing the current section, and the calculation formula is as follows:
[0035]
[0036] Where Q represents the query and K represents the key;
[0037] The output of the cross-section attention block is y∈R l×h×w×c y = AV
[0038] Step S3.9: Embed the cross-section attention module into the Transformer module. The output of the Transformer module is z, and the formula for calculating z is:
[0039] z = Layer_Norm(GELU(z) int W+b)+z int )
[0040] Among them, z int This is the intermediate result output by the Transformer module, where W is the corresponding weight matrix and b is the bias.
[0041] Step S3.10: Upsample the (N+1)th residual feature map once to obtain the first upsampled feature map; and add the residual feature map from the first residual feature map to the (N+1)th residual feature map with the same size as the first upsampled feature map to obtain the first feature map;
[0042] Step S3.11: Perform K convolutions on the first feature map to obtain a feature map with the same size as the first feature map; and subtract the feature map after K convolutions from the first feature map to obtain the first upsampling residual feature map;
[0043] Step S3.12: Upsample the m-th upsampled residual feature map once to obtain the (m+1)-th upsampled feature map; and add the residual feature maps from the 1st to the (N+1)-th residual feature maps that have the same size as the (m+1)-th upsampled feature map to the (m+1)-th upsampled feature map to obtain the (m+1)-th feature map; where the initial value of m is 1;
[0044] Step S3.13: Perform K convolutions on the (m+1)th feature map to obtain a feature map with the same size as the (m+1)th feature map; and subtract the (m+1)th feature map from the feature map after K convolutions to obtain the (m+1)th upsampling residual feature map;
[0045] Step S3.14: Increment the value of m by 1 and repeat steps S3.12 and S3.13 until m = N, then proceed to step S3.15;
[0046] Step S3.15: Perform convolution, LeakyReLU activation function and unpooling on the N feature maps representing high-level feature information generated in the upsampling process to increase the size of the feature maps and obtain the network parameters;
[0047] The formula for calculating the loss function D is as follows:
[0048]
[0049] Where i is the x-coordinate of the pixel, j is the y-coordinate of the pixel, and p ij Let g be the pixel value at coordinate (i,j) in the binary image of the input prostate image after network segmentation. ij Let X be the pixel value at coordinate (i,j) in the standard segmented image corresponding to the image in the first image, where X and Y are the length and width of the target region in the standard segmented image, respectively.
[0050] Preferably, in step S4:
[0051] Semi-supervised learning was performed using the distribution information of the prostate region in MRI images from all data; the training consisted of two phases:
[0052] Phase 1: A generative network model is trained using data from manually labeled standard prostate segmentation images to predict prostate MRI images, and the prediction results are then fed into the initial training set.
[0053] Phase 2: Use all the data to perform integrated training and generate a network model;
[0054] Adaptive convolution is introduced to adaptively modulate the global complementary information of the convolution kernel, and an adaptive Transformer module is used to enhance the global semantic extraction capability and further simulate long-range dependencies. This module enables better performance on networks with skip connections of different scales.
[0055] A prostate MRI image segmentation system based on adaptive multi-scale Transformer optimization, provided by the present invention, includes:
[0056] Module M1: Acquire prostate MRI image dataset;
[0057] Module M2: Preprocesses the MRI images in the dataset to obtain preprocessed training and test sets;
[0058] Module M3: Initializes the parameters in the network, trains the network with the Transformer module on the prostate organ region labeled in the prostate image, and updates the parameters to obtain the automatic prostate segmentation model;
[0059] Module M4: Inputs the images from the test dataset into the trained network to obtain prostate segmentation images for each MRI image.
[0060] Preferably, in module M1:
[0061] The prostate MRI image dataset contains T1WI scan sequences, with the labeled areas on the images representing the extent of the prostate organ, obtained manually.
[0062] In module M2:
[0063] The preprocessing methods include histogram equalization of all MRI images in the training and test sets, and data augmentation of all MRI images in the training and test sets.
[0064] Preferably, in module M3:
[0065] The parameters in the network mainly include weights, biases, number of convolutional kernels, kernel size, number of Transformer modules, and number of Dropout layers;
[0066] The network with a Transformer module is trained using prostate organ regions annotated by doctors on prostate images. The parameters in the network are then updated to obtain an automatic prostate segmentation model. The model structure includes downsampling, upsampling, and an adaptive multi-scale attention module based on Transformer.
[0067] Preferably, module M3.1: the Transformer-based network includes N downsampling layers, N upsampling layers, 1 Leaky ReLU layer, and M Transformer modules;
[0068] Module M3.2: Performs K convolutions on the input prostate image to obtain a feature map of the same size as the input prostate image, and subtracts the convolutional feature map from the first input image to obtain the first residual feature map, where K is a positive integer;
[0069] Module M3.3: Downsample the first residual feature map to obtain the first downsampled feature map; perform K convolutions on the first downsampled feature map to obtain a feature map with the same size as the first downsampled feature map; and subtract the first downsampled feature map from the feature map obtained after K convolutions on the first downsampled feature map to obtain the second residual feature map;
[0070] Module M3.4: Repeat Module M3.3, performing a convolution downsampling on the nth residual feature map to obtain the nth downsampled feature map; then performing M convolutions on the nth downsampled feature map to obtain a feature map of the same size as the nth downsampled feature map; and subtracting the feature map obtained after M convolutions of the nth downsampled feature map from the nth downsampled feature map to obtain the (n+1)th residual feature map; where the initial value of n is 2;
[0071] Module M3.5: Increment the value of n by 1 and repeat the execution of module M3.4 until n = N + 1, then proceed to module M3.6;
[0072] Module M3.6: After downsampling the image, the L-shaped tomographic stack of the input image is represented as a four-dimensional input:
[0073] x∈R l×h×w×c
[0074] Where h is the height of the feature map, w is the width, c is the number of channels, x is the input four-dimensional image, R is a positive real number, and l is the tomographic thickness;
[0075] By leveraging the high correlation between nearby pixels in the feature map and downsampling x using average pooling with a kernel size of k, a compressed feature map is generated.
[0076]
[0077] Where, x pool This is the four-dimensional input after pooling;
[0078] Module M3.7: Calculates the linear projection Q′ of the compressed feature map query and the linear projection K′ of the key, and represents the linear projection of x in the number of channels as V. The calculation formula is as follows:
[0079] Q′=x pool W Q
[0080] K′=x pool W K
[0081] V = xW V
[0082] Among them, W Q For the linear projection weights of the query, W K W represents the linear projection weights of the keys. V The weights for the linear projection of V;
[0083] Module M3.8: Calculate the attention matrix A∈R l×l This matrix represents the level of attention that should be given to other sections when dividing the current section, and the calculation formula is as follows:
[0084]
[0085] Where Q represents the query and K represents the key;
[0086] The output of the cross-section attention block is y∈R l×h×w×c y = AV
[0087] Module M3.9: Embeds the cross-section attention module into the Transformer module. The output of the Transformer module is z, and the formula for calculating z is:
[0088] z = Layer_Norm(GELU(z) int W+b)+z int )
[0089] Among them, z int This is the intermediate result output by the Transformer module, where W is the corresponding weight matrix and b is the bias.
[0090] Module M3.10: Upsample the (N+1)th residual feature map once to obtain the first upsampled feature map; and add the residual feature maps from the first residual feature map to the (N+1)th residual feature map that have the same size as the first upsampled feature map to the first upsampled feature map to obtain the first feature map;
[0091] Module M3.11: Perform K convolutions on the first feature map to obtain a feature map with the same size as the first feature map; and subtract the feature map after K convolutions of the first feature map from the first feature map to obtain the first upsampling residual feature map;
[0092] Module M3.12: Upsample the m-th upsampled residual feature map once to obtain the (m+1)-th upsampled feature map; and add the residual feature maps from the 1st to the (N+1)th residual feature map that have the same size as the (m+1)-th upsampled feature map to the (m+1)-th upsampled feature map to obtain the (m+1)-th feature map; where the initial value of m is 1;
[0093] Module M3.13: Perform K convolutions on the (m+1)th feature map to obtain a feature map with the same size as the (m+1)th feature map; and subtract the (m+1)th feature map from the feature map after K convolutions on the (m+1)th feature map to obtain the (m+1)th upsampling residual feature map;
[0094] Module M3.14: Increment the value of m by 1 and then repeat the execution of modules M3.12 and M3.13 until m = N, then proceed to module M3.15;
[0095] Module M3.15: Convolves, LeakyReLU activation function and unpooling are applied to the N feature maps representing high-level feature information generated during the upsampling process to increase the feature map size and obtain the network parameters;
[0096] The formula for calculating the loss function D is as follows:
[0097]
[0098] Where i is the x-coordinate of the pixel, j is the y-coordinate of the pixel, and p ij Let g be the pixel value at coordinate (i,j) in the binary image of the input prostate image after network segmentation. ij Let X be the pixel value at coordinate (i,j) in the standard segmented image corresponding to the image in the first image, where X and Y are the length and width of the target region in the standard segmented image, respectively.
[0099] Preferably, in module M4:
[0100] Semi-supervised learning was performed using the distribution information of the prostate region in MRI images from all data; the training consisted of two phases:
[0101] Phase 1: A generative network model is trained using data from manually labeled standard prostate segmentation images to predict prostate MRI images, and the prediction results are then fed into the initial training set.
[0102] Phase 2: Use all the data to perform integrated training and generate a network model;
[0103] Adaptive convolution is introduced to adaptively modulate the global complementary information of the convolution kernel, and an adaptive Transformer module is used to enhance the global semantic extraction capability and further simulate long-range dependencies. This module enables better performance on networks with skip connections of different scales.
[0104] Compared with the prior art, the present invention has the following beneficial effects:
[0105] 1. Because two-dimensional networks cannot extract useful information from adjacent cross-sections, and three-dimensional networks perform poorly when using convolution methods alone due to the anisotropy of MRI data (i.e., planar resolution is much lower than in-plane resolution), this invention introduces adaptive convolution to adaptively modulate the globally complementary information of the convolution kernel;
[0106] 2. This invention employs an adaptive Transformer module to enhance global semantic extraction capabilities and further simulate long-range dependencies. This module performs better on networks with skip connections of different scales. Therefore, the adaptive Transformer module can improve U-shaped networks based on skip connections and enhance the segmentation effect on prostate MRI images.
[0107] 3. Based on a large amount of prostate MRI image data, this invention establishes an automatic prostate organ segmentation model, which reduces the interference of irrelevant background information on the discrimination model and provides a basis for improving the diagnostic efficiency and accuracy of prostate cancer. Attached Figure Description
[0108] Other features, objects, and advantages of the present invention will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings:
[0109] Figure 1 This is a flowchart of the present invention;
[0110] Figure 2 This is a flowchart of the prostate segmentation process based on adaptive multi-scale Transformer optimization according to the present invention;
[0111] Figure 3 This is a flowchart of the adaptive multi-scale attention module of the present invention;
[0112] Figure 4 This is a flowchart of the Transformer module of the present invention. Detailed Implementation
[0113] The present invention will now be described in detail with reference to specific embodiments. These embodiments will help those skilled in the art to further understand the present invention, but do not limit the invention in any way. It should be noted that those skilled in the art can make several changes and improvements without departing from the concept of the present invention. These all fall within the protection scope of the present invention.
[0114] Example 1:
[0115] According to the present invention, a prostate MRI image segmentation method based on adaptive multi-scale Transformer optimization is provided, such as... Figures 1-4 As shown, it includes:
[0116] Step S1: Obtain the prostate MRI image dataset;
[0117] Specifically, in step S1:
[0118] The prostate MRI image dataset contains T1WI scan sequences, with the labeled areas on the images representing the extent of the prostate organ, obtained manually.
[0119] Step S2: Preprocess the MRI images in the dataset to obtain the preprocessed training set and test set;
[0120] In step S2:
[0121] The preprocessing methods include histogram equalization of all MRI images in the training and test sets, and data augmentation of all MRI images in the training and test sets.
[0122] Step S3: Initialize the parameters in the network, train the network with the Transformer module on the prostate organ region labeled in the prostate image, and update the parameters to obtain the automatic prostate segmentation model;
[0123] Specifically, in step S3:
[0124] The parameters in the network mainly include weights, biases, number of convolutional kernels, kernel size, number of Transformer modules, and number of Dropout layers;
[0125] The network with a Transformer module is trained using prostate organ regions annotated by doctors on prostate images. The parameters in the network are then updated to obtain an automatic prostate segmentation model. The model structure includes downsampling, upsampling, and an adaptive multi-scale attention module based on Transformer.
[0126] Specifically, step S3.1: The Transformer-based network includes N downsampling layers, N upsampling layers, 1 Leaky ReLU layer, and M Transformer modules;
[0127] Step S3.2: Perform K convolutions on the input prostate image to obtain a feature map with the same size as the input prostate image, and subtract the convolutional feature map from the input first image to obtain the first residual feature map, where K is a positive integer;
[0128] Step S3.3: Downsample the first residual feature map to obtain the first downsampled feature map; perform K convolutions on the first downsampled feature map to obtain a feature map with the same size as the first downsampled feature map; and subtract the feature map obtained after K convolutions of the first downsampled feature map from the first downsampled feature map to obtain the second residual feature map.
[0129] Step S3.4: Repeat step S3.3, perform one convolution downsampling on the nth residual feature map to obtain the nth downsampled feature map; then perform M convolutions on the nth downsampled feature map to obtain a feature map with the same size as the nth downsampled feature map; and subtract the feature map obtained after M convolutions of the nth downsampled feature map from the nth downsampled feature map to obtain the (n+1)th residual feature map; where the initial value of n is 2;
[0130] Step S3.5: Increment the value of n by 1 and repeat step S3.4 until n = N + 1, then proceed to step S3.6;
[0131] Step S3.6: After downsampling the image, the L-shaped tomographic stack of the input image is represented as a four-dimensional input:
[0132] x∈R l×h×w×c
[0133] Where h is the height of the feature map, w is the width, c is the number of channels, x is the input four-dimensional image, R is a positive real number, and l is the tomographic thickness;
[0134] By leveraging the high correlation between nearby pixels in the feature map and downsampling x using average pooling with a kernel size of k, a compressed feature map is generated.
[0135]
[0136] Where, x pool This is the four-dimensional input after pooling;
[0137] Step S3.7: Calculate the linear projection Q′ of the compressed feature map query and the linear projection K′ of the key, and express the linear projection of x in the number of channels as V. The calculation formula is as follows:
[0138] Q′=x pool W Q
[0139] K′=x pool W K
[0140] V = xW V
[0141] Among them, W Q For the linear projection weights of the query, W K W represents the linear projection weights of the keys. V The weights for the linear projection of V;
[0142] Step S3.8: Calculate the attention matrix A∈R l×l This matrix represents the level of attention that should be given to other sections when dividing the current section, and the calculation formula is as follows:
[0143]
[0144] Where Q represents the query and K represents the key;
[0145] The output of the cross-section attention block is y∈R l×h×w×c y = AV
[0146] Step S3.9: Embed the cross-section attention module into the Transformer module. The output of the Transformer module is z, and the formula for calculating z is:
[0147] z = Layer_Norm(GELU(z) int W+b)+z int )
[0148] Among them, z int This is the intermediate result output by the Transformer module, where W is the corresponding weight matrix and b is the bias.
[0149] Step S3.10: Upsample the (N+1)th residual feature map once to obtain the first upsampled feature map; and add the residual feature map from the first residual feature map to the (N+1)th residual feature map with the same size as the first upsampled feature map to obtain the first feature map;
[0150] Step S3.11: Perform K convolutions on the first feature map to obtain a feature map with the same size as the first feature map; and subtract the feature map after K convolutions from the first feature map to obtain the first upsampling residual feature map;
[0151] Step S3.12: Upsample the m-th upsampled residual feature map once to obtain the (m+1)-th upsampled feature map; and add the residual feature maps from the 1st to the (N+1)-th residual feature maps that have the same size as the (m+1)-th upsampled feature map to the (m+1)-th upsampled feature map to obtain the (m+1)-th feature map; where the initial value of m is 1;
[0152] Step S3.13: Perform K convolutions on the (m+1)th feature map to obtain a feature map with the same size as the (m+1)th feature map; and subtract the (m+1)th feature map from the feature map after K convolutions to obtain the (m+1)th upsampling residual feature map;
[0153] Step S3.14: Increment the value of m by 1 and repeat steps S3.12 and S3.13 until m = N, then proceed to step S3.15;
[0154] Step S3.15: Perform convolution, LeakyReLU activation function and unpooling on the N feature maps representing high-level feature information generated in the upsampling process to increase the size of the feature maps and obtain the network parameters;
[0155] The formula for calculating the loss function D is as follows:
[0156]
[0157] Where i is the x-coordinate of the pixel, j is the y-coordinate of the pixel, and p ij Let g be the pixel value at coordinate (i,j) in the binary image of the input prostate image after network segmentation. ij Let X be the pixel value at coordinate (i,j) in the standard segmented image corresponding to the image in the first image, where X and Y are the length and width of the target region in the standard segmented image, respectively.
[0158] Step S4: Input the images from the test dataset into the trained network to obtain prostate segmentation images for each MRI image.
[0159] Specifically, in step S4:
[0160] Semi-supervised learning was performed using the distribution information of the prostate region in MRI images from all data; the training consisted of two phases:
[0161] Phase 1: A generative network model is trained using data from manually labeled standard prostate segmentation images to predict prostate MRI images, and the prediction results are then fed into the initial training set.
[0162] Phase 2: Using all the data, perform integrated training to generate a network model;
[0163] Adaptive convolution is introduced to adaptively modulate the global complementary information of the convolution kernel, and an adaptive Transformer module is used to enhance the global semantic extraction capability and further simulate long-range dependencies. This module enables better performance on networks with skip connections of different scales.
[0164] Example 2:
[0165] Example 2 is a preferred example of Example 1, and is used to illustrate the present invention in more detail.
[0166] Those skilled in the art can understand the prostate MRI image segmentation method based on adaptive multi-scale Transformer optimization provided by the present invention as a specific implementation of the prostate MRI image segmentation system based on adaptive multi-scale Transformer optimization. That is, the prostate MRI image segmentation system based on adaptive multi-scale Transformer optimization can be implemented by executing the steps of the prostate MRI image segmentation method based on adaptive multi-scale Transformer optimization.
[0167] A prostate MRI image segmentation system based on adaptive multi-scale Transformer optimization, provided by the present invention, includes:
[0168] Module M1: Acquire prostate MRI image dataset;
[0169] Specifically, in module M1:
[0170] The prostate MRI image dataset contains T1WI scan sequences, with the labeled areas on the images representing the extent of the prostate organ, obtained manually.
[0171] Module M2: Preprocesses the MRI images in the dataset to obtain preprocessed training and test sets;
[0172] In module M2:
[0173] The preprocessing methods include histogram equalization of all MRI images in the training and test sets, and data augmentation of all MRI images in the training and test sets.
[0174] Module M3: Initializes the parameters in the network, trains the network with the Transformer module on the prostate organ region labeled in the prostate image, and updates the parameters to obtain the automatic prostate segmentation model;
[0175] Specifically, in module M3:
[0176] The parameters in the network mainly include weights, biases, number of convolutional kernels, kernel size, number of Transformer modules, and number of Dropout layers;
[0177] The network with a Transformer module is trained using prostate organ regions annotated by doctors on prostate images. The parameters in the network are then updated to obtain an automatic prostate segmentation model. The model structure includes downsampling, upsampling, and an adaptive multi-scale attention module based on Transformer.
[0178] Specifically, module M3.1: The Transformer-based network includes N downsampling layers, N upsampling layers, 1 Leaky ReLU layer, and M Transformer modules;
[0179] Module M3.2: Performs K convolutions on the input prostate image to obtain a feature map of the same size as the input prostate image, and subtracts the convolutional feature map from the first input image to obtain the first residual feature map, where K is a positive integer;
[0180] Module M3.3: Downsample the first residual feature map to obtain the first downsampled feature map; perform K convolutions on the first downsampled feature map to obtain a feature map with the same size as the first downsampled feature map; and subtract the first downsampled feature map from the feature map obtained after K convolutions on the first downsampled feature map to obtain the second residual feature map;
[0181] Module M3.4: Repeat Module M3.3, performing a convolution downsampling on the nth residual feature map to obtain the nth downsampled feature map; then performing M convolutions on the nth downsampled feature map to obtain a feature map of the same size as the nth downsampled feature map; and subtracting the feature map obtained after M convolutions of the nth downsampled feature map from the nth downsampled feature map to obtain the (n+1)th residual feature map; where the initial value of n is 2;
[0182] Module M3.5: Increment the value of n by 1 and repeat the execution of module M3.4 until n = N + 1, then proceed to module M3.6;
[0183] Module M3.6: After downsampling the image, the L-shaped tomographic stack of the input image is represented as a four-dimensional input:
[0184] x∈R l×h×w×c
[0185] Where h is the height of the feature map, w is the width, c is the number of channels, x is the input four-dimensional image, R is a positive real number, and l is the tomographic thickness;
[0186] By leveraging the high correlation between nearby pixels in the feature map and downsampling x using average pooling with a kernel size of k, a compressed feature map is generated.
[0187]
[0188] Where, x pool This is the four-dimensional input after pooling;
[0189] Module M3.7: Calculates the linear projection Q′ of the compressed feature map query and the linear projection K′ of the key, and represents the linear projection of x in the number of channels as V. The calculation formula is as follows:
[0190] Q′=x pool W Q
[0191] K′=x pool W K
[0192] V = xW V
[0193] Among them, W Q For the linear projection weights of the query, W K W represents the linear projection weights of the keys. V The weights for the linear projection of V;
[0194] Module M3.8: Calculate the attention matrix A∈R l×l This matrix represents the level of attention that should be given to other sections when dividing the current section, and the calculation formula is as follows:
[0195]
[0196] Where Q represents the query and K represents the key;
[0197] The output of the cross-section attention block is y∈R l×h×w×c y = AV
[0198] Module M3.9: Embeds the cross-section attention module into the Transformer module. The output of the Transformer module is z, and the formula for calculating z is:
[0199] z = Layer_Norm(GELU(z) int W+b)+z int )
[0200] Among them, z int This is the intermediate result output by the Transformer module, where W is the corresponding weight matrix and b is the bias.
[0201] Module M3.10: Upsample the (N+1)th residual feature map once to obtain the first upsampled feature map; and add the residual feature maps from the first residual feature map to the (N+1)th residual feature map that have the same size as the first upsampled feature map to the first upsampled feature map to obtain the first feature map;
[0202] Module M3.11: Perform K convolutions on the first feature map to obtain a feature map with the same size as the first feature map; and subtract the feature map after K convolutions of the first feature map from the first feature map to obtain the first upsampling residual feature map;
[0203] Module M3.12: Upsample the m-th upsampled residual feature map once to obtain the (m+1)-th upsampled feature map; and add the residual feature maps from the 1st to the (N+1)th residual feature map that have the same size as the (m+1)-th upsampled feature map to the (m+1)-th upsampled feature map to obtain the (m+1)-th feature map; where the initial value of m is 1;
[0204] Module M3.13: Perform K convolutions on the (m+1)th feature map to obtain a feature map with the same size as the (m+1)th feature map; and subtract the (m+1)th feature map from the feature map after K convolutions on the (m+1)th feature map to obtain the (m+1)th upsampling residual feature map;
[0205] Module M3.14: Increment the value of m by 1 and then repeat the execution of modules M3.12 and M3.13 until m = N, then proceed to module M3.15;
[0206] Module M3.15: Convolves, LeakyReLU activation function and unpooling are applied to the N feature maps representing high-level feature information generated during the upsampling process to increase the feature map size and obtain the network parameters;
[0207] The formula for calculating the loss function D is as follows:
[0208]
[0209] Where i is the x-coordinate of the pixel, j is the y-coordinate of the pixel, and p ij Let g be the pixel value at coordinate (i,j) in the binary image of the input prostate image after network segmentation. ijLet X be the pixel value at coordinate (i,j) in the standard segmented image corresponding to the image in the first image, and let X and Y be the length and width of the target region in the standard segmented image, respectively.
[0210] Module M4: Inputs the images from the test dataset into the trained network to obtain prostate segmentation images for each MRI image.
[0211] Specifically, in module M4:
[0212] Semi-supervised learning was performed using the distribution information of the prostate region in MRI images from all data; the training consisted of two phases:
[0213] Phase 1: A generative network model is trained using data from manually labeled standard prostate segmentation images to predict prostate MRI images, and the prediction results are then fed into the initial training set.
[0214] Phase 2: Use all the data to perform integrated training and generate a network model;
[0215] Adaptive convolution is introduced to adaptively modulate the global complementary information of the convolution kernel, and an adaptive Transformer module is used to enhance the global semantic extraction capability and further simulate long-range dependencies. This module enables better performance on networks with skip connections of different scales.
[0216] Example 3:
[0217] Example 3 is a preferred example of Example 1, and is used to illustrate the present invention in more detail.
[0218] This invention discloses a prostate MRI image segmentation method based on adaptive multi-scale Transformer optimization. The invention proposes a Transformer-based 3D cross-sectional attention module to extract information between different sections for prostate region segmentation. The cross-sectional attention module improves the segmentation efficiency and accuracy of deep learning networks while effectively addressing overfitting. This invention automatically segments prostate images to obtain corresponding prostate organ regions. Based on a large amount of prostate MRI image data, this invention establishes an automatic prostate organ segmentation model, reducing interference from irrelevant background information on the discrimination model, and providing a basis for improving the diagnostic efficiency and accuracy of prostate cancer.
[0219] To meet the needs of radiologists for computer-aided diagnosis of prostate cancer, this invention proposes a prostate MRI image segmentation method based on adaptive multi-scale Transformer optimization. This method achieves more accurate segmentation results at edges and details, thus improving the prostate segmentation effect.
[0220] The technical solution adopted by this invention to solve the above-mentioned technical problems is: a prostate MRI image segmentation method based on adaptive multi-scale Transformer optimization, such as... Figure 1 As shown, it includes the following steps:
[0221] Step 1: Obtain the prostate MRI image dataset. The prostate MRI image dataset includes, but is not limited to, T1WI scan sequences. The marked areas on the images represent the extent of the prostate organ and are manually annotated.
[0222] Step 2: Preprocess all MRI images in the dataset to obtain the preprocessed training set and test set;
[0223] To address the issue of unclear tissue features in the original prostate images, the preprocessing method in step 2 includes histogram equalization of all MRI images in both the training and test sets. This operation enhances image detail and improves overall image brightness.
[0224] To address the overfitting issue caused by a small number of training samples, the preprocessing method in step 2 includes data augmentation by performing operations such as horizontal and vertical translation, scaling, scale transformation, and angle rotation on all MRI images in the training and test sets.
[0225] Step 3: Initialize the network parameters, which mainly include weights, biases, number of convolutional kernels, kernel size, number of Transformer modules, and number of Dropout layers. The network with Transformer modules is trained using prostate organ regions annotated by doctors on prostate images. The network parameters are continuously updated to obtain an automatic prostate segmentation model. The model structure includes downsampling, upsampling, and a Transformer-based adaptive multi-scale attention module.
[0226] Step 3-1: In this embodiment, the Transformer-based network includes N downsampling layers, N upsampling layers, 1 Leaky ReLU layer, and M Transformer modules. N and M are optimal positive integers determined through experiments. In this scheme, considering that the number of network layers N has a significant impact on the feature extraction effect, in order to find a suitable network layer, a preset value of N is used, and different network models with different layers are built and trained by gradually increasing the number of layers. The performance of different network models is evaluated and analyzed using various indicators such as Dice similarity coefficient (DSC), precision, and recall to find the most suitable network layer values N and M. When N=5 and M=2, the network has the best segmentation effect on the prostate region.
[0227] Step 3-2: Perform K convolutions on the input prostate image to obtain a feature map with the same size as the input prostate image. Subtract the convolutional feature map from the first input image to obtain the first residual feature map, where K is a positive integer.
[0228] Step 3-3: Downsample the first residual feature map to obtain the first downsampled feature map; then perform K convolutions on the first downsampled feature map to obtain a feature map with the same size as the first downsampled feature map; and subtract the feature map obtained after K convolutions of the first downsampled feature map from the first downsampled feature map to obtain the second residual feature map.
[0229] Step 3-4: Repeat step 3-3, performing a convolution downsampling on the nth residual feature map to obtain the nth downsampled feature map; then perform M convolutions on the nth downsampled feature map to obtain a feature map with the same size as the nth downsampled feature map; subtract the feature map obtained after M convolutions of the nth downsampled feature map from the nth downsampled feature map to obtain the (n+1)th residual feature map; where the initial value of n is 2.
[0230] Step 3-5: Increment the value of n by 1 and repeat step 3-4 until n = N + 1, then proceed to step 3-6;
[0231] Steps 3-6: After downsampling the image, the L-shaped tomographic stack of the input image is represented as a four-dimensional input x∈R. l×h×w×c The feature map has a height of h, a width of w, and c channels. A compressed feature map is generated by downsampling x using average pooling (kernel size k) and leveraging the high correlation between nearby pixels in the feature map.
[0232] Steps 3-7: Calculate the linear projections Q′ and K′ of the compressed feature map, and express the linear projection of x in the number of channels as V. The calculation formula is as follows:
[0233] Q′=x pool W Q
[0234] K′=x pool W K
[0235] V = xW V
[0236] Steps 3-8: Calculate the attention matrix A∈R l×l This matrix represents the level of attention that should be given to other sections when dividing the current section, and the calculation formula is as follows: The output of the cross-section attention block is y∈R l×h×w×c , where y = AV;
[0237] Steps 3-9: Embed the cross-section attention module into the Transformer module. The output of the Transformer module is z, and the formula for calculating z is: z = Layer_Norm(GELU(z) int W+b)+z int );
[0238] Step 3-10: Upsample the (N+1)th residual feature map once to obtain the first upsampled feature map; and add the residual feature maps with the same size as the first upsampled feature map in the (N+1)th residual feature map to the first upsampled feature map to obtain the first feature map;
[0239] Step 3-11: Perform K convolutions on the first feature map to obtain a feature map with the same size as the first feature map; and subtract the feature map after K convolutions from the first feature map to obtain the first upsampling residual feature map;
[0240] Step 3-12: Following the same method as in Step 3-10, upsample the m-th upsampled residual feature map again to obtain the (m+1)-th upsampled feature map; then add the residual feature maps from the 1st to the (N+1)th residual feature maps that have the same size as the (m+1)-th upsampled feature map to the (m+1)-th upsampled feature map to obtain the (m+1)-th feature map; where the initial value of m is 1;
[0241] Step 3-13: Following the same method as in Step 3-11, perform K convolutions on the (m+1)th feature map again to obtain the result.
[0242] The feature map with the same size as the (m+1)th feature map is then obtained by subtracting the (m+1)th feature map from the feature map after K convolutions of the (m+1)th feature map, thus obtaining the (m+1)th upsampling residual feature map.
[0243] Step 3-14: Increment the value of m by 1 and repeat steps 3-12 and 3-13 until m = N, then proceed to step 3-15;
[0244] Step 3-15: Convolve, perform LeakyReLU activation and unpooling on the N feature maps representing high-level feature information generated during the upsampling process to increase the feature map size and obtain the final network parameters;
[0245] The formula for calculating the loss function D is as follows:
[0246]
[0247] Where, p ij Let g be the pixel value at coordinate (i,j) in the binary image of the input prostate image after network segmentation. ij Let X be the pixel value at coordinate (i,j) in the standard segmented image corresponding to the image in the first image, and let X and Y be the length and width of the target region in the standard segmented image, respectively.
[0248] Step 4: Input the images from the test dataset into the trained network to obtain prostate segmentation images for each MRI image.
[0249] Considering the limitation of the number of images in the original dataset, semi-supervised learning can be performed by utilizing the distribution information of the prostate region in MRI images from all the data. The training is divided into two stages: the first stage mainly uses data from manually labeled standard prostate segmentation images to train and generate a network model, which then makes predictions on unlabeled prostate MRI images and puts the prediction results into the initial training set; the second stage uses all the data to perform integrated training and generate the final network model.
[0250] Meanwhile, because 2D networks cannot extract useful information from adjacent cross-sections, and 3D networks perform poorly when using convolution methods alone due to the anisotropy of MRI data (i.e., planar resolution is much lower than in-plane resolution), adaptive convolution is introduced to adaptively modulate the globally complementary information of the convolution kernel. An adaptive Transformer module is used to enhance global semantic extraction capabilities and further simulate long-range dependencies. This module performs better on networks with skip connections of different scales. Therefore, the adaptive Transformer module can improve U-shaped networks based on skip connections and enhance the segmentation effect of prostate MRI images.
[0251] Those skilled in the art will understand that, in addition to implementing the system, apparatus, and their modules provided by this invention in purely computer-readable program code, the same program can be implemented in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers by logically programming the method steps. Therefore, the system, apparatus, and their modules provided by this invention can be considered a hardware component, and the modules included therein for implementing various programs can also be considered structures within the hardware component; alternatively, modules for implementing various functions can be considered both software programs implementing the method and structures within the hardware component.
[0252] Specific embodiments of the present invention have been described above. It should be understood that the present invention is not limited to the specific embodiments described above, and those skilled in the art can make various changes or modifications within the scope of the claims, which do not affect the essence of the present invention. Unless otherwise specified, the embodiments and features described in this application can be arbitrarily combined with each other.
Claims
1. A prostate MRI image segmentation method based on adaptive multi-scale Transformer optimization, characterized in that, include: Step S1: Obtain the prostate MRI image dataset; Step S2: Preprocess the MRI images in the dataset to obtain the preprocessed training set and test set; Step S3: Initialize the parameters in the network, train the network with the Transformer module on the prostate organ region labeled in the prostate image, and update the parameters to obtain the automatic prostate segmentation model; Step S4: Input the images from the test dataset into the trained network to obtain prostate segmentation images for each MRI image; In step S3: The parameters in the network mainly include weights, biases, number of convolutional kernels, kernel size, number of Transformer modules, and number of Dropout layers; The network with a Transformer module is trained by combining the prostate organ region annotated by the doctor on the prostate image, and the parameters in the network are updated to obtain an automatic prostate segmentation model. The model structure includes downsampling, upsampling and an adaptive multi-scale attention module based on Transformer. Step S3.1: The Transformer-based network includes N Each downsampling layer, N One upsampling layer, one Leaky ReLU layer, and M One Transformer module; Step S3.2: Perform K convolutions on the input prostate image to obtain a feature map with the same size as the input prostate image, and subtract the convolutional feature map from the input first image to obtain the first residual feature map, where K is a positive integer; Step S3.3: Downsample the first residual feature map to obtain the first downsampled feature map; perform K convolutions on the first downsampled feature map to obtain a feature map with the same size as the first downsampled feature map; and subtract the feature map obtained after K convolutions of the first downsampled feature map from the first downsampled feature map to obtain the second residual feature map. Step S3.4: Perform a convolution downsampling on the nth residual feature map to obtain the nth downsampled feature map; then perform M convolutions on the nth downsampled feature map to obtain a feature map with the same size as the nth downsampled feature map; subtract the feature map obtained after M convolutions of the nth downsampled feature map from the nth downsampled feature map to obtain the (n+1)th residual feature map; where the initial value of n is 2; Step S3.5: Increment the value of n by 1 and repeat step S3.4 until n = N + 1, then proceed to step S3.6; Step S3.6: After downsampling the image, input the image... l The tomographic stack is represented as a four-dimensional input: in, h The height of the feature map, w For width, c For the number of channels, For input four-dimensional images, R It is a positive real number. The fault thickness; Utilizing the high correlation of nearby pixels in the feature map, and using average pooling to... x Perform downsampling, kernel size is k Generate compressed feature maps: in, This is the four-dimensional input after pooling; Step S3.7: Calculate the linear projection of the compressed feature map query. Linear projection of bonds and will x The linear projection in the number of channels is expressed as: V The calculation formula is as follows: in, For the linear projection weights of the query, The linear projection weights of the keys. for V Weights of linear projection; Step S3.8: Calculate the attention matrix This matrix represents the level of attention that should be given to other sections when dividing the current section, and the calculation formula is as follows: in, For query, For key; The output of the cross-section attention block is , Step S3.9: Embed the cross-section attention module into the Transformer module. The output of the Transformer module is... z , z The calculation formula is: in, This is the intermediate result output by the Transformer module. For the corresponding weight matrix, For bias; Step S3.10: Upsample the (N+1)th residual feature map once to obtain the first upsampled feature map; and add the residual feature map from the first residual feature map to the (N+1)th residual feature map with the same size as the first upsampled feature map to obtain the first feature map; Step S3.11: Perform K convolutions on the first feature map to obtain a feature map with the same size as the first feature map; and subtract the feature map after K convolutions from the first feature map to obtain the first upsampling residual feature map; Step S3.12: Upsample the m-th upsampled residual feature map once to obtain the (m+1)-th upsampled feature map; and add the residual feature maps from the 1st to the (N+1)-th residual feature maps that have the same size as the (m+1)-th upsampled feature map to the (m+1)-th upsampled feature map to obtain the (m+1)-th feature map; where the initial value of m is 1; Step S3.13: Perform K convolutions on the (m+1)th feature map to obtain a feature map with the same size as the (m+1)th feature map; and subtract the (m+1)th feature map from the feature map after K convolutions to obtain the (m+1)th upsampling residual feature map; Step S3.14: Increment the value of m by 1 and repeat steps S3.12 and S3.13 until m=N, then proceed to step S3.15; Step S3.15: The data generated during the upsampling process... N The feature maps representing high-level feature information are convolved, activated by LeakyReLU, and unpooled to increase the size of the feature maps and obtain the network parameters. Among them, the loss function D The calculation formula is: in, The x-coordinate of the pixel. The y-coordinate position of the pixel. The coordinates of the input prostate image in the binary image after network segmentation are: pixel values, The coordinates of the manually labeled standard segmentation image corresponding to this image in the first image are: pixel values, X and Y These are the length and width of the target region in the standard segmented image, which are manually labeled.
2. The prostate MRI image segmentation method based on adaptive multi-scale Transformer optimization according to claim 1, characterized in that: In step S1: The prostate MRI image dataset contains T1WI scan sequences, with the labeled areas on the images representing the extent of the prostate organ, obtained manually. In step S2: The preprocessing methods include histogram equalization of all MRI images in the training and test sets, and data augmentation of all MRI images in the training and test sets.
3. A prostate MRI image segmentation system based on adaptive multi-scale Transformer optimization, characterized in that, include: Module M1: Acquire prostate MRI image dataset; Module M2: Preprocesses the MRI images in the dataset to obtain preprocessed training and test sets; Module M3: Initializes the parameters in the network, trains the network with the Transformer module on the prostate organ region labeled in the prostate image, and updates the parameters to obtain the automatic prostate segmentation model; Module M4: Inputs the images from the test dataset into the trained network to obtain prostate segmentation images for each MRI image; In module M3: The parameters in the network mainly include weights, biases, number of convolutional kernels, kernel size, number of Transformer modules, and number of Dropout layers; The network with a Transformer module is trained by combining the prostate organ region annotated by the doctor on the prostate image, and the parameters in the network are updated to obtain an automatic prostate segmentation model. The model structure includes downsampling, upsampling and an adaptive multi-scale attention module based on Transformer. Module M3.1: Transformer-based networks include N Each downsampling layer, N One upsampling layer, one Leaky ReLU layer, and M One Transformer module; Module M3.2: Performs K convolutions on the input prostate image to obtain a feature map of the same size as the input prostate image, and subtracts the convolutional feature map from the first input image to obtain the first residual feature map, where K is a positive integer; Module M3.3: Downsample the first residual feature map to obtain the first downsampled feature map; perform K convolutions on the first downsampled feature map to obtain a feature map with the same size as the first downsampled feature map; and subtract the first downsampled feature map from the feature map obtained after K convolutions on the first downsampled feature map to obtain the second residual feature map; Module M3.4: Perform a convolution downsampling on the nth residual feature map to obtain the nth downsampled feature map; then perform M convolutions on the nth downsampled feature map to obtain a feature map with the same size as the nth downsampled feature map; and subtract the feature map obtained after M convolutions of the nth downsampled feature map from the nth downsampled feature map to obtain the (n+1)th residual feature map; where the initial value of n is 2; Module M3.5: Increment the value of n by 1 and repeat the execution of module M3.4 until n = N + 1, then proceed to module M3.6; Module M3.6: After downsampling the image, the input image... l The tomographic stack is represented as a four-dimensional input: in, h The height of the feature map, w For width, c For the number of channels, For input four-dimensional images, R It is a positive real number. The fault thickness; Utilizing the high correlation of nearby pixels in the feature map, and using average pooling to... x Perform downsampling, kernel size is k Generate compressed feature maps: in, This is the four-dimensional input after pooling; Module M3.7: Calculate the linear projection of the compressed feature map query Linear projection of bonds and will x The linear projection in the number of channels is expressed as: V The calculation formula is as follows: in, For the linear projection weights of the query, The linear projection weights of the keys. for V Weights of linear projection; Module M3.8: Calculate the attention matrix This matrix represents the level of attention that should be given to other sections when dividing the current section, and the calculation formula is as follows: in, For query, For key; The output of the cross-section attention block is , Module M3.9: Embeds the cross-section attention module into the Transformer module; the output of the Transformer module is... z , z The calculation formula is: in, This is the intermediate result output by the Transformer module. For the corresponding weight matrix, For bias; Module M3.10: Upsample the (N+1)th residual feature map once to obtain the first upsampled feature map; and add the residual feature maps from the first residual feature map to the (N+1)th residual feature map that have the same size as the first upsampled feature map to the first upsampled feature map to obtain the first feature map; Module M3.11: Perform K convolutions on the first feature map to obtain a feature map with the same size as the first feature map; and subtract the feature map after K convolutions of the first feature map from the first feature map to obtain the first upsampling residual feature map; Module M3.12: Upsample the m-th upsampled residual feature map once to obtain the (m+1)-th upsampled feature map; and add the residual feature maps from the 1st to the (N+1)th residual feature map that have the same size as the (m+1)-th upsampled feature map to the (m+1)-th upsampled feature map to obtain the (m+1)-th feature map; where the initial value of m is 1; Module M3.13: Perform K convolutions on the (m+1)th feature map to obtain a feature map with the same size as the (m+1)th feature map; and subtract the (m+1)th feature map from the feature map after K convolutions on the (m+1)th feature map to obtain the (m+1)th upsampling residual feature map; Module M3.14: Increment the value of m by 1 and repeat the execution of modules M3.12 and M3.13 until m=N, then proceed to module M3.15; Module M3.15: Generates data from the upsampling process. N The feature maps representing high-level feature information are convolved, activated by LeakyReLU, and unpooled to increase the size of the feature maps and obtain the network parameters. Among them, the loss function D The calculation formula is: in, The x-coordinate of the pixel. The y-coordinate position of the pixel. The coordinates of the input prostate image in the binary image after network segmentation are: pixel values, The coordinates of the manually labeled standard segmentation image corresponding to this image in the first image are: pixel values, X and Y These are the length and width of the target region in the standard segmented image, which are manually labeled.
4. The prostate MRI image segmentation system based on adaptive multi-scale Transformer optimization according to claim 3, characterized in that: In module M1: The prostate MRI image dataset contains T1WI scan sequences, with the labeled areas on the images representing the extent of the prostate organ, obtained manually. In module M2: The preprocessing methods include histogram equalization of all MRI images in the training and test sets, and data augmentation of all MRI images in the training and test sets.
Citation Information
Patent Citations
Image feature acquisition method of prostate MRI three-dimensional image
CN110188792A
Multi-organ instance segmentation method and system
CN114092439A