Medical image segmentation model training methods, medical image segmentation methods and equipment
By employing feature extraction and upsampling techniques from the MSCMNet model, the problems of high computational complexity and insufficient local detail capture in medical image segmentation by Transformer are solved, achieving efficient and accurate medical image segmentation.
Patent Information
- Application Number
- CN202410070262.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-17
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2044-01-17
AI Technical Summary
Existing Transformer-based medical image segmentation models suffer from high computational complexity, require extensive pre-training data, and are unable to effectively capture local details, resulting in inaccurate medical image segmentation performance.
The MSCMNet model, including encoder, decoder and MSCM module, is adopted. It uses positional encoding, local feature extraction, multi-scale convolutional modulation and feature mapping, combined with PatchCombined and PatchDecompose methods for feature extraction and upsampling, which reduces computational complexity and improves local feature extraction capability.
It achieves efficient feature extraction, reduces the computational cost of Transformer, improves the efficiency and accuracy of medical image segmentation, and is suitable for medical image segmentation tasks with limited data.
Smart Images

Figure CN118097133B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing, and more particularly to a method for training a medical image segmentation model, a medical image segmentation method, and an apparatus. Background Technology
[0002] With the continuous development and innovation of deep learning technology, its application prospects in the field of smart healthcare are becoming increasingly broad. Medical image segmentation is an important component of smart healthcare, providing crucial information and support for medical diagnosis, treatment, and research. This includes precise lesion localization and segmentation, automated lesion detection and diagnosis, quantitative disease assessment and monitoring, intelligent image navigation, and surgical assistance, demonstrating significant clinical application value. Medical images typically possess complex structures and high levels of noise interference. Segmentation tasks aim to automatically separate tissues, lesions, or anatomical structures of interest from these complex medical images and isolate them from the background, finding wide application in many medical fields. However, due to the inherent characteristics of medical images, such as low contrast, noise, and image complexity, medical image segmentation still faces many challenges. Therefore, developing accurate, efficient, and robust medical image segmentation algorithms is of great significance for improving the accuracy and efficiency of medical image processing.
[0003] Automatic medical image segmentation technology plays an irreplaceable and crucial role in the vigorous development of smart healthcare systems. Currently, an increasing number of medical image segmentation models adopt Transformer as their underlying architecture. However, Transformer-based models also have some significant drawbacks: First, the computational complexity of the model often exhibits a quadratic relationship with the number of input sequences. Simultaneously, Transformer models often require substantial amounts of pre-training data to achieve good results, failing to leverage their advantages when data is insufficient, thus creating a performance bottleneck for existing Transformer-based models in the field of medical image segmentation. While Transformer can capture global dependencies, it cannot capture local details, which are crucial for medical images. Finally, Transformer typically requires a large amount of data to achieve satisfactory results, but acquiring such large amounts of data is extremely difficult in the field of medical images, and the annotation process demands high expertise and is prohibitively costly. Furthermore, Transformer cannot effectively extract local information from images, resulting in less accurate medical image segmentation. Summary of the Invention
[0004] This invention provides a medical image segmentation model training method, a medical image segmentation method, an apparatus, a computer device, and a storage medium to improve the efficiency of medical image segmentation.
[0005] To address the aforementioned technical problems, embodiments of this application provide a method for training a medical image segmentation model, comprising:
[0006] Obtain training sample images;
[0007] The training sample images are input into the initial medical image segmentation model, wherein the initial medical image segmentation model adopts the MSCMNet model, which includes an encoder, a decoder and an MSCM module. The MSCM module is used for feature extraction and consists of a location encoding module, a local feature extraction module, a multi-scale convolutional modulation module and a feature mapping module. The encoder also includes an InputStem module, and the decoder also includes a skip connection layer and an OutputStem module.
[0008] The initial medical image segmentation model is trained using the training sample images to obtain the target medical image segmentation model.
[0009] Optionally, training the initial medical image segmentation model using the training sample images to obtain the target medical image segmentation model includes feature extraction using the MSCM feature extraction module;
[0010] The feature extraction using the MSCM feature extraction module includes:
[0011] Position encoding information is added to the patch block of the input feature map through conditional position encoding;
[0012] Local features of the input feature map are extracted using ConvNeXt feature extraction blocks;
[0013] The local information is extracted by multiple branches of feature extraction at different scales, and then fused in the channel dimension.
[0014] A point convolutional layer for adaptive channel selection is placed after multi-scale fusion. The multi-scale fusion information guides the generation of convolutional modulation weights, a weight matrix is obtained, and the obtained local features are reweighted in spatial location based on the weight matrix.
[0015] Optionally, the InputStem module is composed of stacked a×a convolutions. The step of training the initial medical image segmentation model with the training sample images to obtain the target medical image segmentation model includes downsampling using a patch combination method. The downsampling using the patch combination method includes downsampling based on intra-group patch information fusion and inter-group channel information interaction.
[0016] Optionally, the downsampling based on intra-group patch information fusion and inter-group channel information interaction includes:
[0017] The input patch with a resolution of H×W and a number of channels of C is divided into 4 parts;
[0018] Group the patches in each part, with the number of groups equal to the number of channels C of the input patch;
[0019] Each group is mapped to a patch representation space with 2C channels by a depthwise convolution with a kernel size K≥(3×3).
[0020] Optionally, training the initial medical image segmentation model using the training sample images to obtain the target medical image segmentation model includes upsampling processing based on an improved PatchExpand method. This upsampling processing based on the improved PatchExpand operation includes:
[0021] The extracted feature maps are divided into C b Group;
[0022] The feature map representation space of each group is decomposed into 4 different subspaces (H×W×C→H×W×4C);
[0023] The acquired feature maps are rearranged and their resolution is doubled.
[0024] per C b Each channel is grouped into a set, and the space represented by each patch is compressed to [a specific size]. Representation space;
[0025] Finally, a point convolution is used to remodel the relationship between channels.
[0026] To address the aforementioned technical problems, embodiments of this application provide a medical image segmentation method, including:
[0027] Obtain the image to be segmented;
[0028] The image to be segmented is input into the target medical image segmentation model for recognition and segmentation to obtain the segmentation result.
[0029] To address the aforementioned technical problems, this application also provides a medical image segmentation model training device, comprising:
[0030] The sample acquisition module is used to acquire training sample images;
[0031] The sample input module is used to input the training sample images into the initial medical image segmentation model. The initial medical image segmentation model adopts the MSCMNet model, which includes an encoder, a decoder and an MSCM module. The MSCM module is used for feature extraction and includes a location encoding module, a local feature extraction module, a multi-scale convolutional modulation module and a feature mapping module. The encoder also includes an InputStem module, and the decoder also includes a skip connection layer and an OutputStem module.
[0032] The model training module is used to train the initial medical image segmentation model using the training sample images to obtain the target medical image segmentation model.
[0033] Optionally, the model training module includes a feature extraction submodule, which is used to extract features using the MSCM feature extraction module;
[0034] The feature extraction using the MSCM feature extraction module includes:
[0035] Position encoding information is added to the patch block of the input feature map through conditional position encoding;
[0036] Local features of the input feature map are extracted using ConvNeXt feature extraction blocks;
[0037] The local information is extracted by multiple branches of feature extraction at different scales, and then fused in the channel dimension.
[0038] A point convolutional layer for adaptive channel selection is placed after multi-scale fusion. The multi-scale fusion information guides the generation of convolutional modulation weights, a weight matrix is obtained, and the obtained local features are reweighted in spatial location based on the weight matrix.
[0039] Optionally, the model training module further includes:
[0040] The partitioning unit is used to divide the input patch with a resolution of H×W and a number of channels of C into 4 parts;
[0041] Grouping unit, used to group the patches in each part, the number of groups is equal to the number of channels C of the input patch;
[0042] The downsampling unit is used to map each group to a patch representation space with 2C channels through a depthwise convolution with a kernel size K≥(3×3).
[0043] Optionally, the model training module further includes an upsampling unit, which is used to perform upsampling processing based on the improved PatchExpand method;
[0044] The upsampling process based on the improved PatchExpand operation includes:
[0045] The extracted feature maps are divided into C b Group;
[0046] The feature map representation space of each group is decomposed into 4 different subspaces (H×W×C→H×W×4C);
[0047] The acquired feature maps are rearranged and their resolution is doubled.
[0048] per C b Each channel is grouped into a set, and the space represented by each patch is compressed to [a specific size]. Representation space;
[0049] Finally, a point convolution is used to remodel the relationship between channels.
[0050] To address the aforementioned technical problems, this application also provides a medical image segmentation apparatus, comprising:
[0051] The image acquisition module is used to acquire the image to be segmented;
[0052] The image segmentation module is used to input the image to be segmented into the target medical image segmentation model for recognition and segmentation, and to obtain the segmentation result.
[0053] To address the aforementioned technical problems, this application also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the aforementioned medical image segmentation model training method; or, when the processor executes the computer program, it implements the steps of the aforementioned medical image segmentation method.
[0054] To address the aforementioned technical problems, this application also provides a computer-readable storage medium storing a computer program. When executed by a processor, the computer program implements the steps of the aforementioned medical image segmentation model training method, or, when executed by a processor, the computer program implements the steps of the aforementioned medical image segmentation method.
[0055] The medical image segmentation model training method, medical image segmentation method, apparatus, computer equipment, and storage medium provided in this invention acquire training sample images and input them into an initial medical image segmentation model. The initial medical image segmentation model uses the MSCMNet model, which includes an encoder, a decoder, and an MSCM module. The MSCM module is used for feature extraction and consists of a location encoding module, a local feature extraction module, a multi-scale convolutional modulation module, and a feature mapping module. The encoder also includes an InputStem module, and the decoder includes skip connection layers and an OutputStem module. The initial medical image segmentation model is then trained using the training sample images to obtain a target medical image segmentation model. This method achieves efficient feature extraction with fewer parameters and less computation, guiding the generation of modulation weights through extracted multi-scale information. It effectively avoids the high computational cost and large amount of data required for pre-training of the Transformer architecture while achieving performance exceeding that of the Transformer structure, thus improving the efficiency of medical image segmentation. Attached Figure Description
[0056] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0057] Figure 1 This is an exemplary system architecture diagram to which this application can be applied;
[0058] Figure 2 This is a flowchart of one embodiment of the medical image segmentation model training method of this application;
[0059] Figure 3 This is a flowchart of one embodiment of the medical image segmentation method of this application;
[0060] Figure 4 This is a schematic diagram of the structure of an embodiment of the medical image segmentation model training device according to this application;
[0061] Figure 5 This is a schematic diagram of the structure of one embodiment of the medical image segmentation apparatus according to this application;
[0062] Figure 6 This is a schematic diagram of the structure of one embodiment of the computer device according to this application. Detailed Implementation
[0063] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains; the terminology used herein in the specification of the application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application; the terms "comprising" and "having," and any variations thereof, in the specification, claims, and foregoing drawings of this application, are intended to cover non-exclusive inclusion. The terms "first," "second," etc., in the specification, claims, or foregoing drawings of this application are used to distinguish different objects, not to describe a particular order.
[0064] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0065] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0066] Please see Figure 1 ,like Figure 1 As shown, system architecture 100 may include terminal devices 101, 102, and 103, a network 104, and a server 105. Network 104 serves as the medium for providing communication links between terminal devices 101, 102, and 103 and server 105. Network 104 may include various connection types, such as wired or wireless communication links, or fiber optic cables, etc.
[0067] Users can use terminal devices 101, 102, and 103 to interact with server 105 via network 104 to receive or send messages, etc.
[0068] Terminal devices 101, 102, and 103 can be various electronic devices with displays and support web browsing, including but not limited to smartphones, tablets, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III), MP4 players (Moving Picture Experts Group Audio Layer IV), laptops, and desktop computers, etc.
[0069] Server 105 can be a server that provides various services, such as a backend server that supports the pages displayed on terminal devices 101, 102, and 103.
[0070] It should be noted that the medical image segmentation model training method provided in this application embodiment is executed by the server, and correspondingly, the medical image segmentation model training device is set in the server.
[0071] It should be understood that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included. The terminal devices 101, 102, and 103 in this embodiment can specifically correspond to application systems in actual production.
[0072] Please see Figure 2 , Figure 2 This invention illustrates a method for training a medical image segmentation model, as provided in an embodiment of the present invention, which is then applied to... Figure 1 Taking the server-side as an example, the details are as follows:
[0073] S201: Obtain training sample images.
[0074] S202: Input the training sample images into the initial medical image segmentation model, which adopts the MSCMNet model, including an encoder, a decoder and an MSCM module. The MSCM module is used for feature extraction and consists of a location encoding module, a local feature extraction module, a multi-scale convolutional modulation module and a feature mapping module. The encoder also includes an InputStem module, and the decoder also includes a skip connection layer and an OutputStem module.
[0075] Specifically, in this embodiment, the MSCMNet model follows the encoder and decoder structure of the U-Net standard. Compared to U-Net and its previous improvements, this embodiment adds an InputStem module at the encoder input to extract global structured information of the input image and reduce resolution, thereby reducing the computational complexity of subsequent processes and further improving the model's running efficiency. An OutputStem module is added at the end of the decoder to obtain the segmentation results. Immediately after the InputStem module, overlapping patch embedding representations are applied to the feature maps. The basic building blocks are changed from the 3×3 convolution of U-Net to MSCM modules. The encoder consists of four stages. Each stage first performs downsampling, then uses two MSCM modules to extract features. Except for the first stage which uses patch embedding representation to reduce resolution, downsampling is achieved at the beginning of each of the other stages by combining patches. Upsampling is achieved in the decoder using patch decomposition.
[0076] Furthermore, the MSCM module employs convolutional modulation and large-kernel convolution, while simultaneously introducing a multi-scale information extraction strategy. It comprehensively utilizes information from different scales to guide the generation process of convolutional modulation weights, making the generated weights more reliable and thus promoting a more efficient feature extraction process. Position encoding is added to the input of each module. Specifically, the MSCM module consists of four parts: a position encoding module, a local feature extraction module, a multi-scale convolutional modulation module, and a feature mapping module.
[0077] Positional encoding can significantly improve the feature representation capability of Transformer structures that divide feature maps into patches. Commonly used positional encoding methods include absolute positional encoding, relative positional encoding, and conditional positional encoding. Absolute positional encoding requires a fixed input image size and cannot adapt to input images of arbitrary resolution. Relative positional encoding depends on the selection of reference points. Conditional positional encoding is simple and efficient, requiring only a depthwise convolution with a kernel greater than or equal to 3 and padding values of 0. Experiments have shown that it has good positional information representation capability. This example, based on ConvNeXt, explores the impact of porting positional encoding from the Transformer structure to a convolutional neural network on the model.
[0078] The local feature extraction module is mainly used to extract local region features. Compared with the local feature extraction module in the SegNeXt model, which consists of only a simple 5×5 depthwise convolution and does not consider the information interaction between channel dimensions, this embodiment is based on the feature extraction method in ConvNeXt. While extracting local features, it better considers the information interaction between feature map channel dimensions, more fully mines the features of the image, and effectively extracts local features.
[0079] The multi-scale convolutional modulation module, building upon the local feature extraction module, extracts local information from larger regions at different scales through multiple large-kernel convolutions. This module first extracts features at different scales through multiple feature extraction branches. Specifically, it consists of a basic DW3×3 branch and multiple large-kernel convolution branches at different scales. Large-kernel convolution indicates that a K×K (K>3) large-kernel convolution can be decomposed into a convolution with an expansion rate of d and a kernel size of... The calculation process is shown in Equation (1): a depthwise convolution with a kernel size of (2d-1)×(2d-1) and a pointwise convolution with adaptive channel selection.
[0080]
[0081] Furthermore, in this embodiment, the last point convolution used for adaptive channel selection is extracted and placed after multi-scale fusion to model the channel relationships between feature maps of different scales. In this way, the generation of convolutional modulation weights is guided by multi-scale fusion information, thereby obtaining a more accurate weight matrix. Finally, the generated convolutional modulation weights are multiplied element-wise with the input feature map to obtain a spatially weighted feature map. The weighting process of the modulation weights is shown in formula (2):
[0082]
[0083] ci = PW (1×1) (msf)
[0084] attn = Dropout(ci)
[0085] y=attn⊙msf (2)
[0086] Where n represents the number of large kernel convolution branches, DW represents depthwise convolution, PW represents pointwise convolution, and ⊙ represents the Hadamard product. It is particularly important to emphasize the criticality of Dropout. Dropout is typically used to prevent model overfitting, but this embodiment demonstrates through experiments that randomly discarding a portion of the generated modulation weights via Dropout and updating only a portion of the weight values during each training iteration can improve the accuracy of spatial attention weights, significantly enhancing the model's generalization ability while avoiding overfitting. It should be noted that the number of input channels and output channels remain consistent throughout the processing of a single MSCM module. In summary, the overall calculation process of the MSCM module is shown in formula (3):
[0087] x = CPE(x) + x
[0088] lf = LocalFeature(norm(x))
[0089] lf (attn) =MSCM(lf)
[0090] y = Projection(lf (attn) )+x (3)
[0091] S203: Train the initial medical image segmentation model using training sample images to obtain the target medical image segmentation model.
[0092] In one specific optional implementation, training an initial medical image segmentation model using training sample images to obtain a target medical image segmentation model includes feature extraction using the MSCM feature extraction module;
[0093] The feature extraction using the MSCM feature extraction module includes:
[0094] Position encoding information is added to the patch block of the input feature map through conditional position encoding;
[0095] Local features of the input feature map are extracted using ConvNeXt feature extraction blocks;
[0096] The local information is extracted by multiple branches of feature extraction at different scales, and then fused in the channel dimension.
[0097] A point convolutional layer for adaptive channel selection is placed after multi-scale fusion. The multi-scale fusion information guides the generation of convolutional modulation weights, a weight matrix is obtained, and the obtained local features are reweighted in spatial location based on the weight matrix.
[0098] In one specific optional implementation, the InputStem module is composed of stacked a×a convolutions. The initial medical image segmentation model is trained using training sample images to obtain the target medical image segmentation model. This includes downsampling using a patch combination method. Downsampling using the patch combination method includes downsampling based on intra-group patch information fusion and inter-group channel information interaction.
[0099] Where a is a positive integer greater than 1, and in this embodiment, the preferred value is 3.
[0100] In one specific optional implementation, downsampling based on intra-group patch information fusion and inter-group channel information interaction includes:
[0101] The input patch with a resolution of H×W and a number of channels of C is divided into 4 parts;
[0102] Group the patches in each part, with the number of groups equal to the number of channels C of the input patch;
[0103] Each group is mapped to a patch representation space with 2C channels by a depthwise convolution with a kernel size K≥(3×3).
[0104] In one specific optional implementation, training an initial medical image segmentation model using training sample images to obtain a target medical image segmentation model includes upsampling processing based on an improved PatchExpand method. Upsampling processing based on the improved PatchExpand operation includes:
[0105] The extracted feature maps are divided into C b Group;
[0106] The feature map representation space of each group is decomposed into 4 different subspaces (H×W×C→H×W×4C);
[0107] The acquired feature maps are rearranged and their resolution is doubled.
[0108] per C b Each channel is grouped into a set, and the space represented by each patch is compressed to [a specific size]. Representation space;
[0109] Finally, a point convolution is used to remodel the relationship between channels.
[0110] Specifically, previous studies using patch partitioning tended to directly embed the input image into patches, resulting in the model's inability to effectively extract global feature representations. These global feature representations are crucial for the training and inference of subsequent network modules because they contain the global structured information of the input image, which is essential for semantic segmentation tasks. Therefore, in this embodiment, the input image in the MSCMNet model first passes through the InputStem module, which consists of three stacked 3×3 convolutions. Stacking expands the effective receptive field of the convolutional kernels, better extracting the global structured information of the input image. The middle 3×3 convolution also halves the resolution of the input feature map, significantly reducing the computational complexity of subsequent modules.
[0111] CNN networks commonly use pooling or convolutional operations with a stride of 2 for downsampling, while visual Transformer models use patch merging. The merging method between patches significantly impacts the model's generalization ability, a crucial issue that requires careful consideration during model architecture design. Existing methods disclose a PatchMerging approach for downsampling. Specifically, the input patch is first divided into four distinct parts, then concatenated along the channel dimension, halving the resolution and quadrupling the number of channels. Finally, a linear layer reduces the number of channels to twice the number of channels in the input feature map. However, this merging method doesn't consider the information exchange between patches in the same feature map, resulting in relatively weak generalization ability.
[0112] In this embodiment, a novel and efficient patch combination method (PatchCombined) is designed based on PatchMerging to achieve downsampling. Specifically, PatchCombined consists of two parts: intra-group patch information fusion and inter-group channel information interaction. After dividing the input patch with resolution H×W and number of channels C into 4 parts, this embodiment first groups them, with the number of groups equal to the number of channels C of the input patch (i.e., one channel feature of each input patch corresponds to one group, which also corresponds to the 4 parts after division). Then, each group is mapped to a patch representation space with 2C channels through a depthwise convolution with kernel size K≥(3×3) (i.e., intra-group transformation is...). In this way, not only can information exchange be achieved between local regions in the feature maps that are divided into the same parts during the combination process, but also the patches between the four parts of the same local region correspond to a larger region between the original input patches. That is, each patch in the final combined feature map is the result of information exchange between patches in a larger region of the input feature map, thus obtaining a patch representation containing richer semantic information and significantly improving the model's generalization ability. Finally, a point convolution is used to realize information exchange between the feature map channels.
[0113] Furthermore, the decoder in this embodiment includes the PatchDecompose module, the SkipLayer module, and the OutputStem module.
[0114] This embodiment is an improvement on PatchExpand, named PatchDecompose. Its main idea is to divide the feature map into C... bThe feature map representation space of each group is decomposed into four distinct subspaces (H×W×C→H×W×4C). The acquired feature maps are then rearranged, doubling the resolution in the process (H×W×4C→2H×2W×C). Then, each C... b Each channel is grouped into a set, and the space represented by each patch is compressed to [a specific size]. This allows for the representation of space, thereby halving the number of channels. Finally, a point convolution is used to model the relationship between channels. The specific implementation process is shown in formula (4):
[0115] x (fac) =DW (1×1) (x,groups=C b )
[0116] x (res) =Restructure(x (fac) )
[0117] x (com) =DW (3×3) (x (res) ,groups=C b )
[0118] y = PW (1×1) (x (com) ) (4)
[0119] As shown in formula (4), in this specific implementation, this embodiment uses a kernel with a size K = (1×1) and a group number C. b The depthwise convolution achieves the decomposition process of multiple sets of feature maps, where C b (C b ≤C) represents the number of channels when the patch is embedded, i.e., the number of groups in each PatchDecompose is fixed. A kernel size K = (1×1) and the number of groups C are used. bThe deep convolution implements the process of reconstructing and compressing multiple patches, making the compressed feature representation more helpful for segmentation tasks. Finally, this embodiment uses a 1×1 point convolution to model the relationship between channels. It should be noted that the last PatchDecompose operation in the model sets the number of groups to C during channel compression, without changing the number of input channels. In order to adapt to the convolutional network structure implemented by the patch partitioning method, the SkipLayer in this embodiment is different from the original skip connection and includes two parts. The first is a feature connection part, which is used to connect low-level features and high-level features. The two are connected in the channel dimension. This part is the original skip connection. The second is a feature mapping part, which is implemented by a deep convolution to map the connected feature map channels to a lower dimension. The feature map is compressed in the channel dimension, which facilitates the subsequent feature processing by the MSCM module. As shown in formula (5):
[0120] y = PW (1×1) (Concat(x,skipx)) (5)
[0121] Among them PW (1×1) denoted as depthwise convolution (1×1 convolution), x represents the input feature map of the decoder, and skippx represents the output feature map of the corresponding stage of the encoder.
[0122] Some existing models use a 4x PatchExpand to directly increase the feature map resolution by 4 times. This approach may reduce the model's accuracy. Therefore, this embodiment uses an OutputStem module corresponding to InputStem to gradually restore the feature map resolution and avoid potential accuracy loss. It uses transposed convolution to increase the feature map resolution by 2 times.
[0123] In this embodiment, training sample images are acquired and input into an initial medical image segmentation model. This initial model employs the MSCMNet model, which includes an encoder, a decoder, and an MSCM module. The MSCM module, used for feature extraction, comprises a location encoding module, a local feature extraction module, a multi-scale convolutional modulation module, and a feature mapping module. The encoder also includes an InputStem module, and the decoder includes skip connection layers and an OutputStem module. The initial medical image segmentation model is then trained using the training sample images to obtain the target medical image segmentation model. This module achieves efficient feature extraction with fewer parameters and less computation, effectively avoiding the high computational cost and large amount of pre-training required by the Transformer architecture while surpassing its performance, thus improving the efficiency of medical image segmentation.
[0124] Please see Figure 3 , Figure 3 This invention illustrates a medical image segmentation method provided by an embodiment of the present invention, which is applied to... Figure 1 Taking the server-side as an example, the details are as follows:
[0125] Obtain the image to be segmented;
[0126] The image to be segmented is input into the target medical image segmentation model for recognition and segmentation, and the segmentation result is obtained.
[0127] In this embodiment, a trained target medical image segmentation model is used to quickly identify and segment the image to be segmented, thereby improving the efficiency of medical image segmentation.
[0128] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0129] Figure 4 A schematic diagram of a medical image segmentation model training device is shown, corresponding one-to-one with the medical image segmentation model training method described in the above embodiments. For example... Figure 4 As shown, the medical image segmentation model training device comprises a sample acquisition module 31, a sample input module 32, and a model training module 33. Detailed descriptions of each functional module are as follows:
[0130] Sample acquisition module 31 is used to acquire training sample images;
[0131] The sample input module 32 is used to input training sample images into the initial medical image segmentation model. The initial medical image segmentation model adopts the MSCMNet model, which includes an encoder, a decoder and an MSCM module. The MSCM module is used for feature extraction and consists of a location encoding module, a local feature extraction module, a multi-scale convolutional modulation module and a feature mapping module. The encoder also includes an InputStem module, and the decoder also includes a skip connection layer and an OutputStem module.
[0132] The model training module 33 is used to train the initial medical image segmentation model using training sample images to obtain the target medical image segmentation model.
[0133] Optionally, the model training module includes a feature extraction submodule, which is used to extract features using the MSCM feature extraction module;
[0134] The feature extraction using the MSCM feature extraction module includes:
[0135] Position encoding information is added to the patch block of the input feature map through conditional position encoding;
[0136] Local features of the input feature map are extracted using ConvNeXt feature extraction blocks;
[0137] The local information is extracted by multiple branches of feature extraction at different scales, and then fused in the channel dimension.
[0138] A point convolutional layer for adaptive channel selection is placed after multi-scale fusion. The multi-scale fusion information guides the generation of convolutional modulation weights, a weight matrix is obtained, and the obtained local features are reweighted in spatial location based on the weight matrix.
[0139] Optionally, the model training module further includes:
[0140] The partitioning unit is used to divide the input patch with a resolution of H×W and a number of channels of C into 4 parts;
[0141] Grouping unit, used to group the patches in each part, the number of groups is equal to the number of channels C of the input patch;
[0142] The downsampling unit is used to map each group to a patch representation space with 2C channels through a depthwise convolution with a kernel size K≥(3×3).
[0143] Optionally, the model training module further includes an upsampling unit, which is used to perform upsampling processing based on the improved PatchExpand method;
[0144] Upsampling based on the improved PatchExpand operation includes:
[0145] The extracted feature maps are divided into C b Group;
[0146] The feature map representation space of each group is decomposed into 4 different subspaces (H×W×C→H×W×4C);
[0147] The acquired feature maps are rearranged and their resolution is doubled.
[0148] per C b Each channel is grouped into a set, and the space represented by each patch is compressed to [a specific size]. Representation space;
[0149] Finally, a point convolution is used to remodel the relationship between channels.
[0150] Figure 5 A schematic block diagram of a medical image segmentation apparatus corresponding to the medical image segmentation methods described in the above embodiments is shown. For example... Figure 5 As shown, the medical image segmentation device includes a data image acquisition module 34 and an image segmentation module 35. Detailed descriptions of each functional module are as follows:
[0151] Image acquisition module 34 is used to acquire the image to be segmented;
[0152] The image segmentation module 35 is used to input the image to be segmented into the target medical image segmentation model for recognition and segmentation, and obtain the segmentation result.
[0153] Specific limitations regarding the medical image segmentation model training device / medical image segmentation apparatus can be found in the limitations regarding the medical image segmentation model training method / medical image segmentation method described above, and will not be repeated here. Each module in the aforementioned medical image segmentation model training device / medical image segmentation apparatus can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the corresponding operations of each module.
[0154] To address the aforementioned technical problems, embodiments of this application also provide a computer device. Please refer to [link / reference needed] for details. Figure 5 , Figure 5 This is a basic structural block diagram of the computer device in this embodiment.
[0155] The computer device 4 includes a memory 41, a processor 42, and a network interface 43 that are interconnected via a system bus. It should be noted that only the computer device 4 with components connected to the memory 41, processor 42, and network interface 43 is shown in the figure; however, it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented alternatively. Those skilled in the art will understand that the computer device described here is a device capable of automatically performing numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes, but is not limited to, microprocessors, application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), digital signal processors (DSPs), embedded devices, etc.
[0156] The computer device can be a desktop computer, laptop, handheld computer, or cloud server, etc. The computer device can interact with the user via a keyboard, mouse, remote control, touchpad, or voice control.
[0157] The memory 41 includes at least one type of readable storage medium, including flash memory, hard disk, multimedia card, card-type memory (e.g., SD or D-interface display memory), random access memory (RAM), static random access memory (SRAM), and read-only memory.
[0158] ROM, electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 41 may be an internal storage unit of the computer device 4, such as the hard disk or memory of the computer device 4. In other embodiments, the memory 41 may also be an external storage device of the computer device 4, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the computer device 4. Of course, the memory 41 may include both the internal storage unit and its external storage device of the computer device 4. In this embodiment, the memory 41 is typically used to store the operating system and various application software installed on the computer device 4, such as the program code of a medical image segmentation model training method. In addition, the memory 41 may also be used to temporarily store various types of data that have been output or will be output.
[0159] In some embodiments, the processor 42 may be a central processing unit (CPU), controller, microcontroller, microprocessor, or other data processing chip. The processor 42 is typically used to control the overall operation of the computer device 4. In this embodiment, the processor 42 is used to run program code stored in the memory 41 or process data, for example, to run program code for a medical image segmentation model training method.
[0160] The network interface 43 may include a wireless network interface or a wired network interface, which is typically used to establish communication connections between the computer device 4 and other electronic devices.
[0161] This application also provides another embodiment, namely, a computer-readable storage medium storing an interface display program that can be executed by at least one processor to cause the at least one processor to perform the steps of the medical image segmentation model training method described above.
[0162] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0163] Obviously, the embodiments described above are only some embodiments of this application, not all embodiments. The accompanying drawings show preferred embodiments of this application, but do not limit the patent scope of this application. This application can be implemented in many different forms; rather, the purpose of providing these embodiments is to provide a more thorough and comprehensive understanding of the disclosure of this application. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing specific embodiments, or make equivalent substitutions for some of the technical features. Any equivalent structures made using the content of this application's specification and drawings, directly or indirectly applied to other related technical fields, are similarly within the scope of patent protection of this application.
Claims
1. A method for training a medical image segmentation model, characterized in that, include: Obtain training sample images; The training sample images are input into the initial medical image segmentation model, wherein the initial medical image segmentation model adopts the MSCMNet model, which includes an encoder, a decoder and an MSCM module. The MSCM module is used for feature extraction and consists of a location encoding module, a local feature extraction module, a multi-scale convolutional modulation module and a feature mapping module. The encoder also includes an InputStem module, and the decoder also includes a skip connection layer and an OutputStem module. The initial medical image segmentation model is trained using the training sample images to obtain the target medical image segmentation model; The step of training the initial medical image segmentation model using the training sample images to obtain the target medical image segmentation model includes feature extraction using the MSCM module; The feature extraction using the MSCM module includes: Position encoding information is added to the patch block of the input feature map through conditional position encoding; Local features of the input feature map are extracted using ConvNeXt feature extraction blocks; The local information is extracted by multiple branches of feature extraction at different scales, and then fused in the channel dimension. A point convolutional layer for adaptive channel selection is placed after multi-scale fusion. The multi-scale fusion information guides the generation of convolutional modulation weights, a weight matrix is obtained, and the obtained local features are reweighted in spatial location based on the weight matrix.
2. The medical image segmentation model training method as described in claim 1, characterized in that, The InputStem module is composed of stacked a×a convolutions. The step of training the initial medical image segmentation model using the training sample images to obtain the target medical image segmentation model includes downsampling using a patch combination method. The downsampling using the patch combination method includes downsampling based on intra-group patch information fusion and inter-group channel information interaction.
3. The medical image segmentation model training method as described in claim 2, characterized in that, The downsampling based on intra-group patch information fusion and inter-group channel information interaction includes: With resolution The number of channels is The input patch is divided into 4 parts; Group the patches in each section, with the number of groups equal to the number of channels in the input patch. ; Each group is passed through a kernel size. Depth convolution maps to channels with The patch represents the space.
4. The medical image segmentation model training method as described in claim 1, characterized in that, The step of training the initial medical image segmentation model using the training sample images to obtain the target medical image segmentation model includes upsampling processing based on an improved PatchExpand method. This upsampling processing based on the improved PatchExpand method includes: The extracted feature maps are divided into Group; The feature map representation space of each group is decomposed into 4 different subspaces; The acquired feature maps are rearranged and their resolution is doubled. With each Each channel is grouped into a set, and the space represented by each patch is compressed to [a specific size]. Representation space; Finally, a point convolution is used to remodel the relationship between channels.
5. A medical image segmentation method, characterized in that, include: Obtain the image to be segmented; The image to be segmented is input into the target medical image segmentation model for recognition and segmentation to obtain the segmentation result, wherein the target medical image segmentation model is trained according to the medical image segmentation model training method according to any one of claims 1 to 4.
6. A medical image segmentation model training device, characterized in that, The method for training a medical image segmentation model according to claim 1 includes: The sample acquisition module is used to acquire training sample images; The sample input module is used to input the training sample images into the initial medical image segmentation model. The initial medical image segmentation model adopts the MSCMNet model, which includes an encoder, a decoder and an MSCM module. The MSCM module is used for feature extraction and includes a location encoding module, a local feature extraction module, a multi-scale convolutional modulation module and a feature mapping module. The encoder also includes an InputStem module, and the decoder also includes a skip connection layer and an OutputStem module. The model training module is used to train the initial medical image segmentation model using the training sample images to obtain the target medical image segmentation model.
7. A medical image segmentation device, characterized in that, include: The image acquisition module is used to acquire the image to be segmented; An image segmentation module is used to input the image to be segmented into a target medical image segmentation model for recognition and segmentation to obtain a segmentation result, wherein the target medical image segmentation model is trained according to the medical image segmentation model training method according to any one of claims 1 to 4.
8. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the medical image segmentation model training method as described in any one of claims 1 to 4.
9. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the medical image segmentation model training method as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Lightweight image segmentation method and system, medium, terminal and application
CN114612477A