Medical image segmentation model construction method based on spatial attention and variable convolution
By introducing spatial attention and variable convolution modules into the FCN model, combined with skip connection modules, the problem of poor segmentation results in complex medical image segmentation is solved, and efficient and accurate multi-organ and multi-lesion image segmentation is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHANGHAI UNIV
- Filing Date
- 2022-06-02
- Publication Date
- 2026-04-24
AI Technical Summary
Existing fully convolutional neural networks (FCNs) perform poorly in complex medical image segmentation tasks involving multiple organs and lesions, failing to meet clinical needs. Furthermore, improvement methods often involve increasing model parameters or ignoring medical image features, resulting in unsatisfactory segmentation results.
A medical image segmentation model based on spatial attention and variable convolution is constructed. By integrating spatial attention, variable convolution, and skip connection modules into the FCN model, adaptive convolution kernels are generated using prior information about the shape and size of the object to be segmented, thereby enhancing the local perception and global modeling capabilities of the segmentation model.
It significantly improves segmentation performance with lower computational cost, simplifies model structure, facilitates training and use, and enhances the accuracy and robustness of multi-organ and multi-lesion image segmentation.
Smart Images

Figure CN115526825B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of medical image segmentation technology, and specifically relates to a method for constructing a medical image segmentation model based on spatial attention and variable convolution. Background Technology
[0002] Accurate segmentation of medical images such as CT and MRI is fundamental for precise automatic lesion localization and high-quality 3D reconstruction, and is of great significance for realizing smart healthcare and accurate diagnosis. In recent years, deep learning models, represented by fully convolutional neural networks (FCNs), have been widely used in the field of medical image processing technology. They can achieve efficient medical image segmentation without human intervention and have surpassed traditional image processing methods in accuracy and robustness in some simple segmentation tasks involving single objects, thus being considered a promising medical image segmentation method. However, in complex medical image segmentation tasks such as those involving multiple organs or lesions, the segmentation results based on FCNs are still not ideal due to challenges such as complex backgrounds, blurred boundaries between objects to be segmented, and significant differences in shape and size, and cannot meet the needs of clinical applications.
[0003] To further improve the performance of FCN in complex medical image segmentation, common strategies involve modifying the FCN model structure to build a more powerful segmentation model. There are two main approaches: First, based on FCN, the network is combined or the dimensions of the convolutional kernels are expanded to construct a new backbone network. Typical new backbone networks include cascaded networks, 3D networks, and 2D-3D hybrid networks. These new backbone networks can utilize prior information about the anatomical structure of the object to be segmented or leverage the three-dimensional spatial information of the medical image to improve segmentation performance. Second, common network modules from the field of natural image processing are integrated into FCN, such as residual modules, dense convolutional modules, pyramid modules, and attention modules. This enhances the model's local perception or global modeling capabilities, thereby improving segmentation performance.
[0004] However, both of the above-mentioned segmentation model construction methods have limitations. The structure of the new backbone network obtained by the first method is often too complex and increases the number of model parameters, which makes it more expensive to use and not conducive to the promotion and application of this type of model. The second improvement method can improve the segmentation effect without increasing the cost of use too much and is more efficient in application. However, these improvement modules designed for natural images often ignore the structural nature of the objects to be segmented in medical images in terms of relative position and size. They are easily affected by complex backgrounds and blurred boundaries in medical images, resulting in poor segmentation results. Summary of the Invention
[0005] To overcome the shortcomings of existing technologies, this invention aims to provide a method for constructing a medical image segmentation model based on spatial attention and variable convolution. This method uses an FCN model as the backbone network and incorporates a spatial attention module, a variable convolution module, and a skip connection module. It can obtain prior information about the shape and size of the object to be segmented during feature extraction and utilize this prior information to obtain convolutional kernels capable of changing shape to adapt to variations in the object's shape and size. Simultaneously, the prior information and multi-scale features are passed to the segmentation model's decoder to better identify the boundaries of the object. The three modules involved have fewer trainable parameters, thus achieving better segmentation results at the cost of lower computational cost.
[0006] To achieve the above objectives, the present invention adopts the following technical solution:
[0007] A method for constructing a medical image segmentation model based on spatial attention and variable convolution includes the following steps:
[0008] Step 1: Construct the backbone network of the medical image segmentation model. The backbone network includes an encoder E with N+1 convolutional modules and a decoder D with N convolutional modules.
[0009] Step 2, in the i-th convolutional module of encoder E Afterwards, spatial attention module A is connected. i Let i = 1, 2, ..., N, and the i-th spatial attention module A i The i-th convolutional module of encoder E Output feature map As input, obtain the corresponding coarse segmentation result. and weighted feature maps weighted by spatial dimensions This provides prior information about the shape and size of the object to be segmented for subsequent network modules;
[0010] Step 3, convert the (N+1)th convolutional module of encoder E Replace it with a variable convolutional module F, which uses the Nth spatial attention module A N Output feature map As input, based on the feature map The provided prior information generates an offset field P, which in turn generates a convolution kernel whose shape changes with the object to be segmented, in order to adapt to changes in the shape and size of the object to be segmented.
[0011] Step 4, in the i-th convolutional module of decoder D Afterwards, the jump connection module S is connected. i Let i = 1, 2, ..., N, and the jump connection module S iThe multi-scale information obtained from encoder E is fused, and the fusion result is input into decoder D to provide multi-scale features and boundary information of the object to be segmented.
[0012] Step 5: Determine the number of channels R of each module in the backbone network based on the number I of the categories of objects to be segmented. i , where i = 1, 2, ..., 2·N+1, finally obtaining the medical image segmentation model based on spatial attention and variable convolution.
[0013] Preferably, the specific method for constructing the backbone network of the medical image segmentation model in step 1 is as follows:
[0014] Step 1-1: M convolutional operations and activation functions are alternately concatenated to form a convolutional module. The value of M can be taken as an integer between [1,4] based on experience. The kernel size of the convolutional operation is 3 and the stride is 1. The activation function can be either the ReLU function or the leaky-ReLU function.
[0015] Step 1-2: Concatenate N+1 convolutional modules from Step 1-1 using N pooling operations to construct encoder E, where the pooling operations concatenate the i-th convolutional module of encoder E. Output feature map The resolution is reduced to half of the original to obtain feature maps. As the (i+1)th convolutional module of encoder E The input is i = 1, 2, ..., N;
[0016] Steps 1-3 involve alternately concatenating N sets of deconvolution operations with the convolutional modules from step 1-1 to construct decoder D, where the deconvolution operation converts the i-th convolutional module of decoder D into a single unit. Output feature map The resolution is doubled to obtain feature maps. As the (i+1)th convolutional module of decoder D The input is i = 1, 2, ..., N-1;
[0017] Steps 1-4: Determine the value of N based on the length H and width W of the medical image, and obtain the feature map based on the value of N. The minimum side length should not be less than 16;
[0018] Steps 1-5 involve concatenating the encoder E, decoder D, and a Softmax function to construct the backbone network.
[0019] Preferably, in step 2, spatial attention module A i Obtain coarse segmentation results and weighted feature maps weighted by spatial dimensions The specific methods are as follows:
[0020] The i-th spatial attention module A i It includes a small convolutional network, a segmentation prediction operation, and a normalization operation; the small convolutional network has a structure similar to that of the backbone network, including an encoder with two convolutional modules and a decoder with one convolutional module; the segmentation prediction operation consists of a convolutional operation with a convolutional size of 1 and a Softmax function concatenated; the normalization operation consists of a convolutional operation with a convolutional kernel size of 1 and a Sigmoid function concatenated.
[0021] Step 2-1, transfer the feature map Input the i-th spatial attention module A i A small convolutional network, where n = 1, 2, ..., N, outputs the corresponding result Z. i ;
[0022] Step 2-2, use the segmentation prediction operation to divide Z i Transform into coarse segmentation results
[0023] Steps 2-3: Use normalization operations to normalize Z... i The pixel values are mapped to [0,1] to obtain the corresponding spatial attention map α. i The values of the object region to be segmented tend to be 1, while the values of the background region tend to be 0.
[0024] Steps 2-4: Use attention map α i For feature maps Perform weighting to obtain a weighted feature map.
[0025] Steps 2-5: The coarse segmentation results are processed. Weighted feature map By concatenating the feature maps along the channel dimension, the i-th spatial attention module A is obtained. i Output feature map
[0026] Preferably, the specific method for generating the offset field P and obtaining the convolution kernel with a shape that changes with the segmented object in step 3 is as follows:
[0027] The variable convolution module includes a static deformable convolution operation and a variable convolution operation; the kernel size of the variable convolution operation is k, and the i-th sampling point of the kernel has a fixed offset value d relative to the prediction center position p0. i Taking a convolution kernel of size 3 as an example, with a fixed offset value d iIt can be represented as {(-1,-1),(-1,0),…,(+1,+1)}; the static deformable convolution operation includes 2·k 2 A convolutional kernel of size l with an irregular shape, wherein the i-th sampling point of the irregularly shaped convolutional kernel has an offset s relative to the prediction center position p0. i =(Δx) i ,Δy i ), i = 1, 2, ..., l 2 , where Δx i and Δy i These represent the offsets along the x-axis and y-axis, respectively; all offsets s in the static variable convolution... i These are all trainable parameters of the segmentation model, which will be continuously updated during training but remain fixed when the segmentation model is applied, so as to extract the shape and size information of the object to be segmented in a large area.
[0028] Step 3-1, apply the static deformable convolution operation to the feature map. Perform feature extraction and generate feature maps. An offset field P with the same resolution, where each pixel position in offset field P corresponds to a length of 2k. 2 The process of obtaining the eigenvector P(p0) of the offset field P at the prediction center position p0 can be expressed by formula (1):
[0029]
[0030] in, For the i-th sampling point of the convolution kernel in the static deformable convolution operation;
[0031] Step 3-2: Extract feature vector P in a certain order each time. m The two eigenvalues in (p0) constitute the offset value p. i =(Δx) i ,Δy i ), i = 1, 2, ..., k 2 When calculating the feature map Y output by the variable convolution module F F The value Y at the prediction center location p0 F When (p0), it is represented by formula (2):
[0032]
[0033] in, The weight coefficients corresponding to the i-th sampling point of the convolution kernel in the variable convolution operation.
[0034] Preferably, in step 4, the jump connection module Si The specific method for fusing multi-scale information from the encoder and inputting the fusion result into the decoder is as follows:
[0035] Step 4-1, for the i-th jump connection module S i Using deconvolution operations, the spatial attention modules A from the (N+1-i)th to the Nth are... n The resolution is increased to match the i-th convolutional module of decoder D. Input feature map Similarly, a set of feature maps with the same resolution is obtained. Among them, i=1,2,…,N, n=N+1-i,Ni,…,N;
[0036] Step 4-2, combine the feature map set obtained in Step 4-1 All feature maps are concatenated along the channel dimension to obtain the concatenated feature map Q. i And use convolution operations to stitch together the feature map Q i Feature extraction is performed to obtain the fused feature map T. i ;
[0037] Step 4-3, fuse the feature map T i With the i-th convolutional module of decoder D Input feature map Feature maps are obtained by concatenating data along the channel dimension. Using feature maps Replacement feature map The input is fed into the i-th convolutional module of decoder D.
[0038] Compared with the prior art, the present invention has the following obvious and prominent substantive features and significant advantages:
[0039] 1. The spatial attention module, variable convolution module, and skip connection module used in the medical image segmentation model constructed in this invention are all lightweight modules with fewer trainable parameters. Therefore, compared with the basic FCN model, it can greatly improve the segmentation performance of the model at the cost of a small decrease in segmentation efficiency.
[0040] 2. The medical image segmentation model constructed in this invention improves both the local perception capability and the global modeling capability of the segmentation model. The variable convolution module uses deformable convolution kernels to enhance the local perception capability of the segmentation model, while the spatial attention module weights the feature map with the region of interest, thereby enhancing the segmentation model's ability to identify the object to be segmented from the global image.
[0041] 3. The medical image segmentation model constructed in this invention has a relatively simple structure, which does not increase the difficulty of model training and is convenient for relevant researchers to train and use. Attached Figure Description
[0042] Figure 1 This is a flowchart of the method of the present invention.
[0043] Figure 2 This is a schematic diagram of the backbone network.
[0044] Figure 3 This is a schematic diagram of the backbone network encoder E.
[0045] Figure 4 This is a schematic diagram of the backbone network decoder D.
[0046] Figure 5 To access spatial attention module A i A schematic diagram of the modified encoder E structure.
[0047] Figure 6 Spatial Attention Module A i A structural diagram.
[0048] Figure 7 This is a schematic diagram of the variable convolution module F.
[0049] Figure 8 For variable convolution operations, a fixed offset value d i A schematic diagram.
[0050] Figure 9 The offset s in the static deformable convolution operation i A schematic diagram.
[0051] Figure 10 The offset value p in the variable convolution operation i A schematic diagram.
[0052] Figure 11 This is a schematic diagram of the complete segmentation model.
[0053] Figure 12 For the jump connection module S i A structural diagram.
[0054] Figure 13 This is a flowchart for training and evaluating the segmentation model. Detailed Implementation
[0055] To make the technical problems, technical solutions, and beneficial effects of the embodiments of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be emphasized that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0056] like Figure 1 The illustration shows a medical image segmentation model construction method based on spatial attention and variable convolution provided in this embodiment. For the task of segmenting abdominal multi-organ CT images, where the segmentation objects are five organs—liver, gallbladder, pancreas, duodenum, and stomach—the segmentation model construction includes, but is not limited to, the following steps:
[0057] Step 1: Construct the backbone network of the medical image segmentation model based on the FCN model. This backbone network includes an encoder E with N+1 convolutional modules, a decoder D with N convolutional modules, and a softmax function. The specific implementation of this step is as follows:
[0058] Step 1-1: Alternately concatenate M sets of convolution operations and activation functions to form a convolution module, where the value of M can be taken as an integer between [1,4] based on experience. In this example, the value of M is taken as 2. The kernel size of the convolution operation is 3 and the stride is 1. The activation function can be either the ReLU function or the leaky-ReLU function.
[0059] Step 1-2: Concatenate N+1 convolutional modules from Step 1-1 using N pooling operations to construct encoder E, as follows: Figure 3 As shown, the pooling operation will convert the i-th convolutional module of encoder E into a single convolutional module. Output feature map The resolution is reduced to half of the original to obtain feature maps. As the (i+1)th convolutional module of encoder E The input is i = 1, 2, ..., N;
[0060] Steps 1-3: Alternately concatenate N sets of deconvolution operations and the convolution module in step 1-1 to construct decoder D, as follows: Figure 4 As shown, the deconvolution operation transforms the i-th convolutional module of decoder D. Output feature map The resolution is doubled to obtain feature maps. As the (i+1)th convolutional module of decoder D The input is i = 1, 2, ..., N-1;
[0061] Steps 1-4: Determine the value of N based on the length H and width W of the medical image, characterized in that the feature map obtained based on the value of N... The minimum side length should not be less than 16. In this embodiment, the length H and width W of the abdominal multi-organ CT image are both 512. Taking N as 4, the input medical image X undergoes 4 downsampling operations in encoder E to obtain the feature map. The minimum side length is 32;
[0062] Steps 1-5: Concatenate encoder E, decoder D, and a softmax function to construct, as follows: Figure 2 The backbone network shown.
[0063] Step 2, in the i-th convolutional module of encoder E Afterwards, spatial attention module A is connected. i If i = 1, 2, 3, 4, connect to spatial attention module A. i The encoder E structure is as follows Figure 5 As shown, the spatial attention module A i Structure such as Figure 6 As shown, it includes a small convolutional network, a segmentation prediction operation, and a normalization operation. The structure of the small convolutional network is similar to that of the backbone network of the segmentation model. Its encoder has two convolutional modules and a pooling operation, and its decoder includes a deconvolution operation and a convolutional module. The segmentation prediction operation consists of a convolutional operation with a convolutional size of 1 and a Softmax function concatenated together. The normalization operation consists of a convolutional operation with a convolutional kernel size of 1 and a Sigmoid function concatenated together.
[0064] In this example, step 2 is implemented as follows:
[0065] Step 2-1: The i-th spatial attention module A i The i-th convolutional module of encoder E Output feature map As input, the input feature map is processed using the small convolutional network. The corresponding result Z was obtained. i , where n = 1, 2, 3, 4;
[0066] Step 2-2, use the segmentation prediction operation to transform the result Z obtained in step 2-1. i Transform into coarse segmentation results
[0067] Step 2-3: Use normalization to transform the result Z obtained in step 2-1. i The pixel values are converted to [0,1] to obtain the corresponding spatial attention map α. i The values for segmented object regions tend to be 1, while the values for background regions tend to be 0.
[0068] Steps 2-4: Use attention map α i For feature maps Perform element-wise multiplication to obtain the weighted feature map.
[0069] Steps 2-5: Process the coarse segmentation results Weighted feature map By concatenating the feature maps along the channel dimension, the i-th spatial attention module A is obtained. i Output feature map Feature map The feature map contains the shape and size information of the object to be segmented. When input into subsequent network modules, it can provide the segmentation model with the corresponding prior information about the object to be segmented.
[0070] Step 3, convert the 5th convolutional module of encoder E to... Replaced with a variable convolutional module F, which uses the fourth spatial attention module A. 4 Output feature map As input, based on the feature map The provided prior information generates an offset field P, which in turn generates a convolution kernel whose shape changes with the object to be segmented, in order to adapt to changes in the shape and size of the object to be segmented.
[0071] In this example, the variable convolution module includes a static deformable convolution operation and a variable convolution operation, and its structure is as follows: Figure 7 As shown; the variable convolution operation has a kernel size of k, and the i-th sampling point of the kernel has a fixed offset value d relative to the prediction center position p0. i Taking a convolution kernel of size 3 as an example, the positions of each sampling point are as follows: Figure 8 As shown, the convolution kernel has a fixed offset of (0,0) at the prediction center position p0, and a fixed offset of d. i It can be represented as {(-1,-1),(-1,0),…,(+1,+1)}; the static deformable convolution operation includes 2·k 2 A convolutional kernel of size l with an irregular shape, wherein the i-th sampling point of the irregularly shaped convolutional kernel has an offset s relative to the prediction center position p0. i =Δx i ,Δy i ), i = 1, 2, ..., l 2 When l = 3, the location of its sampling point is as follows: Figure 9 As shown, where Δx i and Δy i These represent the offsets along the x-axis and y-axis, respectively; all offsets s in the static variable convolution... iThese are all trainable parameters of the segmentation model, which will be continuously updated during training but remain fixed when the segmentation model is applied, so as to extract the shape and size information of the object to be segmented in a large area.
[0072] The specific implementation method of step 3 in this example is as follows:
[0073] Step 3-1: Apply the static deformable convolution operation to the feature map. Perform feature extraction and generate feature maps. An offset field P with the same resolution, where each pixel position in offset field P corresponds to a length of 2k. 2 The process of obtaining the eigenvector P(p0) of the offset field P at the prediction center position p0 can be expressed by formula (1):
[0074]
[0075] in, The weight coefficients corresponding to the i-th sampling point of the convolution kernel in the static deformable convolution operation;
[0076] Step 3-2: Extract feature vector P in a certain order each time. m The two eigenvalues in (p0) constitute the offset value p. i =Δx i ,Δy i ), i = 1, 2, ..., k 2 Using offset value p i The sampling positions of the variable convolution operation kernel are shifted, and the shifted positions are as follows: Figure 10 As shown, when calculating the feature map Y output by the variable convolution module F... F The value Y at the prediction center location p0 F When (p0), it is represented by formula (2):
[0077]
[0078] in, The weight coefficients corresponding to the i-th sampling point of the convolution kernel in the variable convolution operation.
[0079] Step 4, in the i-th convolutional module of decoder D Afterwards, the jump connection module S is connected. i , i=1,2,3,4, such as Figure 11 The diagram shows the access jump connection module S. i The complete segmentation model structure, the jump connection module S iThe multi-scale information obtained from encoder E is fused, and the fusion result is input into decoder D to provide multi-scale features and boundary information of the object to be segmented.
[0080] The specific implementation method of step 4 in this example is as follows:
[0081] Step 4-1, for the i-th jump connection module S i Its structure is as follows Figure 12 As shown, deconvolution is used to process spatial attention modules A from the 5th to the 4th. n The resolution is increased to match the i-th convolutional module of decoder D. Input feature map Similarly, a set of feature maps with the same resolution is obtained. Where i=1,2,3,4, n=5-i,4-i,…,4;
[0082] Step 4-2, combine the feature map set obtained in Step 4-1 All feature maps are concatenated along the channel dimension to obtain the concatenated feature map Q. i And use convolution operations to stitch together the feature map Q i Feature extraction is performed to obtain the fused feature map T. i ;
[0083] Step 4-3, fuse the feature map T i With the i-th convolutional module of decoder D Input feature map Feature maps are obtained by concatenating data along the channel dimension. Using feature maps Replacement feature map The input is fed into the i-th convolutional module of decoder D.
[0084] Step 5: Determine the number of channels R of each module in the backbone network based on the number I of the categories of objects to be segmented. i Where i = 1, 2, ..., 8, 9, the medical image segmentation model based on spatial attention and variable convolution is finally obtained. The complete segmentation model structure is as follows: Figure 11 As shown.
[0085] The specific implementation method of step 5 in this embodiment is as follows:
[0086] Number of channels R in each module i Includes the number of input channels and number of output channels Two parts. The first convolutional module in the backbone network. Number of input channels This is equal to the number of channels in the segmentation model input X, which is 1 in this embodiment. Number of input channels up to F It can be calculated using formula (3):
[0087]
[0088] The first convolutional module in the backbone network Number of output channels The value can be set to 32 or 64 based on experience; in this embodiment, it is set to 32. The value is 32. Number of output channels to F It can be calculated using formula (4):
[0089]
[0090] to Number of input channels It can be calculated using formula (5):
[0091]
[0092] to Number of output channels It can be calculated using formula (6):
[0093]
[0094] The last convolutional module Number of output channels It is I+1, meaning it includes the background and 5 organs. The number of input channels for each module. and number of output channels Recorded in Table 1.
[0095] Table 1. Number of Channels in Each Module of the Backbone Network of the Present Invention
[0096]
[0097]
[0098] After the segmentation model is built, a corresponding medical image dataset and model optimization loss function can be constructed to train the segmentation model and evaluate its segmentation performance. The specific training and usage process is as follows: Figure 13 As shown, it includes:
[0099] 1) Collect medical images and prepare corresponding segmentation labels to construct a dataset. Normalize the medical images to convert the pixel values of the medical images to [-1,1]. Divide the dataset into training set, validation set and test set in a ratio of 6:2:2.
[0100] 2) Construct a joint loss based on DICE and cross-entropy loss as the objective function for optimization during model training. The objective function can be calculated using formula (7):
[0101]
[0102] Where N represents the number of spatial attention modules in the segmentation model; Y and These represent the final segmentation result output by the segmentation model and the corresponding ground truth label, respectively. For the i-th spatial attention module A i Obtain coarse segmentation results The corresponding truth value for a label of the same size. By Obtained by linear interpolation reduction; L seg The joint loss based on DICE and cross-entropy loss can be calculated using formula (8):
[0103]
[0104] Where I represents the number of categories of the object to be segmented; and x i This represents the model's prediction result for the i-th class of segmented objects and the corresponding ground truth label.
[0105] 3) The Adam optimizer is used to train the segmentation model end-to-end on the training set. At the same time, the loss function values of the segmentation model on the training set and validation set are monitored during training to obtain the training curve of the segmentation model. When the training curves on the training set and validation set converge, training is stopped and the parameters of each module in the segmentation model are saved.
[0106] 4) Use the trained segmentation model to make predictions on the test set, and use evaluation metrics such as DICE coefficient and Hausdorff distance to evaluate the segmentation effect of the segmentation model. Models whose performance meets the requirements can be used for subsequent practical applications.
[0107] In summary, the above embodiments of the present invention provide a method for constructing a medical image segmentation model based on spatial attention and variable convolution, comprising: constructing a backbone network for the medical image segmentation model, which includes an encoder E and a decoder D; and constructing N convolutional modules before the encoder E. Afterwards, spatial attention module A is connected. i This module generates coarse segmentation results. Weighted feature map To provide prior information about the shape and size of the object to be segmented; the (N+1)th convolutional module of encoder E Replaced with a variable convolutional module F, which generates an offset field P based on prior information about the object to be segmented and obtains a convolutional kernel whose shape changes with the object to be segmented, to adapt to changes in the shape and size of the object; in each convolutional module of the decoder D Afterwards, the jump connection module S is connected. i This module fuses the multi-scale information obtained from encoder E to provide multi-scale features and boundary information of the objects to be segmented; based on the number of categories I of the objects to be segmented, the number of channels R of each module is determined. i Ultimately, a medical image segmentation model was obtained.
[0108] The above description, in conjunction with specific / preferred embodiments, provides a further detailed explanation of the present invention. It should not be construed that the specific implementation of the present invention is limited to these descriptions. For those skilled in the art, various substitutions or modifications can be made to these described embodiments without departing from the inventive concept, and all such substitutions or modifications should be considered within the scope of protection of the present invention.
Claims
1. A method for constructing a medical image segmentation model based on spatial attention and variable convolution, characterized in that, Includes the following steps: Step 1: Construct the backbone network of the medical image segmentation model. The backbone network includes... N Encoder with +1 convolutional module E and have N Decoder of each convolutional module D ; Step 2, in the encoder E The i Convolutional modules Afterwards, spatial attention module is connected. A i , i= 1,2,..., N The first i Spatial attention module A i With encoder E The i Convolutional modules Output feature map As input, obtain the corresponding coarse segmentation result. and weighted feature maps weighted by spatial dimensions This provides prior information about the shape and size of the object to be segmented for subsequent network modules; Step 3, encoder E The N +1 convolutional module Replace with variable convolution module F The variable convolution module uses F No. N Spatial attention module A N Output feature map As input, based on the feature map The provided prior information generates the offset field. P This allows for the generation of convolution kernels that change shape with the object being segmented, adapting to variations in the shape and size of the object to be segmented. Step 4, in the decoder D The i 1 convolutional module After connecting the jump connection module S i1 , i 1=1,2,..., N The jump connection module S i1 encoder E The obtained multi-scale information is fused, and the fusion result is input into the decoder. D To provide multi-scale features and boundary information of the objects to be segmented; Step 5: Based on the number of categories of the objects to be segmented I Determine the number of channels for each module in the backbone network. R i2 ,in i 2 = 1, 2, ..., 2· N+ 1. Finally, the medical image segmentation model based on spatial attention and variable convolution is obtained.
2. The method for constructing a medical image segmentation model based on spatial attention and variable convolution according to claim 1, characterized in that, The specific method for step 1 is as follows: Step 1-1, alternating series connection M A convolutional module consists of group convolution operations and activation functions, where... M The value is empirically taken as an integer between [1, 4]; Steps 1-2, using N A series of pooling operations N+ Step 1-1, the convolution module, constructs the encoder. E ; Steps 1-3, alternating series connection N Grouping deconvolution operations and the convolution module in step 1-1 to build the decoder D ; Steps 1-4, based on the length of the medical image H Hekuan W Sure N The value, according to N The feature map obtained from the value The minimum side length should not be less than 16; Steps 1-5, serial encoder E decoder D A Softmax function is used to construct the backbone network.
3. The method for constructing a medical image segmentation model based on spatial attention and variable convolution according to claim 1, characterized in that, The specific method for step 2 is as follows: The first i Spatial attention module A i It includes a small convolutional network, a segmentation prediction operation, and a normalization operation; the small convolutional network contains three convolutional modules, a downsampling operation, and a deconvolution operation; the segmentation prediction operation consists of a convolutional operation and a Softmax function concatenated; the normalization operation consists of a convolutional operation and a Sigmoid function concatenated. Step 2-1, transfer the feature map Enter the first i Spatial attention module A i Small convolutional networks, in which n =1,2,..., N Output the corresponding results Z i ; Step 2-2, use segmentation prediction operation to... Z i Transform into coarse segmentation results ; Steps 2-3: Use normalization operations to... Z i The pixel values are mapped to [0,1] to obtain the corresponding spatial attention map. α i The values of the region to be segmented tend to be 1, while the values of the background region tend to be 0. Steps 2-4: Use attention maps α i For feature maps Perform weighting to obtain a weighted feature map. ; Steps 2-5: The coarse segmentation results are processed. Weighted feature map Perform concatenation along the channel dimension of the feature maps to obtain the first... i Spatial attention module A i Output feature map .
4. The method for constructing a medical image segmentation model based on spatial attention and variable convolution according to claim 1, characterized in that, The specific method for step 3 is as follows: The variable convolution module F It includes a static deformable convolution operation and a variable convolution operation; the kernel size of the variable convolution operation is... k And the first convolution kernel i’ Each sampling point relative to the predicted center location p 0 has a fixed offset value d i’ The static deformable convolution operation includes 2. k 2 Each size is l The irregularly shaped convolution kernel, the first... i’ Each sampling point has a position relative to the predicted center. p offset of 0 ,in and They represent x shaft and y Offset in the axial direction; Step 3-1, apply the static deformable convolution operation to the feature map. Perform feature extraction and generate feature maps. Offset fields with the same resolution P offset field P Each pixel position corresponds to a length of 2. k 2 From the eigenvectors, obtain the offset field. P At the center of the prediction p eigenvectors of 0 P ( p The process of 0) is represented by formula (1): (1); in, The first convolution kernel in the static deformable convolution operation i’ The corresponding weighting coefficients for each sampling point; Step 3-2: Extract feature vectors in a certain order each time. P m ( p The two eigenvalues in (0) constitute the offset value. ,in and They represent x shaft and y The offset in the axial direction, when calculating the variable convolution module F Output feature map Y F At the center of the prediction p Position value Y F ( p When 0), it is represented by formula (2): (2); in, The first convolution kernel in the variable convolution operation i’ The corresponding weight coefficients for each sampling point.
5. The method for constructing a medical image segmentation model based on spatial attention and variable convolution according to claim 1, characterized in that, The specific method for step 4 is as follows: Step 4-1, for the first i A jump connection module S i Using deconvolution operation to convert the first N +1— i To the N Spatial attention module A n Output feature map The resolution is increased to match the decoder. D The i 1 convolutional module Input feature map Similarly, a set of features with the same resolution is obtained. ,in i 1 = 1, 2, ..., N , n=N +1— i 1, N — i 1,..., N; Step 4-2, use the feature set obtained in Step 4-1 All feature maps are concatenated along the channel dimension to obtain a concatenated feature map. And use convolution operations to stitch together the feature maps Feature extraction is performed to obtain a fused feature map. ; Step 4-3, fuse the feature maps T i1 With decoder D The i 1 convolutional module Input feature map Feature maps are obtained by concatenating data along the channel dimension. Using feature maps Replacement feature map As a decoder D The i 1 convolutional module Input.
Citation Information
Patent Citations
Liver tumor CT image computer-aided diagnosis method
CN110265141A
Medical image segmentation method based on deep learning
CN112150428A