A dual-decoder-based edge-enhanced medical image segmentation method

By employing a dual-decoder structure and deep supervised learning, and combining saliency features and edge features, the problem of difficulty in locating polyp boundaries in existing methods is solved, achieving more efficient polyp segmentation results.

CN117911423BActive Publication Date: 2026-11-20SHANGHAI NORMAL UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311835985.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-28
Publication Date
2026-11-20
Estimated Expiration
2043-12-28

AI Technical Summary

Technical Problem

Existing deep learning-based polyp segmentation methods struggle to accurately locate polyp boundaries under complex conditions such as blurred edges and varying sizes. Furthermore, existing methods focus on region segmentation while neglecting boundary constraints, resulting in a high false negative rate.

Method used

A dual-decoder structure based on cross-attention mechanism and efficient grouping aggregation method is adopted. Combining saliency features and edge features, deep supervised learning is carried out through a pre-trained CNN encoder, a progressively upsampled CNN decoder and a decoder that guides edge refinement to generate multi-scale segmentation and edge masks.

Benefits of technology

It improves the accuracy and performance of polyp segmentation, enhances the representation ability of edge features, reduces feature redundancy, and improves the segmentation effect of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117911423B_ABST
    Figure CN117911423B_ABST
Patent Text Reader

Abstract

The application discloses an edge enhancement medical image segmentation method based on a double decoder, and belongs to the technical field of medical image processing. The method comprises the following steps: acquiring a skin mirror image dataset with labels and performing pretreatment; constructing an edge enhancement medical image segmentation network based on a double decoder; training the segmentation network; inputting a medical image to be segmented into the trained edge enhancement medical image segmentation network based on a decoder to obtain an image segmentation result. The application combines a cross attention mechanism and an efficient grouping aggregation method, effectively fuses high-level feature maps and low-level feature maps to realize better model performance. In addition, the correlation between significant features and edge features is analyzed based on the logical interrelation between a binary segmentation graph and an edge graph. Boundary clues are mined and refined, boundary prior knowledge is provided for the learning process of the model, and the segmentation performance is greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of medical image processing technology, and in particular to a method for edge enhancement medical image segmentation based on dual decoders. Background Technology

[0002] Colorectal cancer (CRC) is the third most common type of cancer worldwide. Therefore, preventing CRC through screening tests and removal of precancerous lesions (colorectal adenomas) is crucial and has become a global public health priority. Colonoscopy is an effective technique for screening and preventing CRC, providing information on the location and appearance of colorectal polyps, allowing doctors to remove them before they develop into CRC. Studies have shown that early colonoscopy can reduce the incidence of CRC by 30 percent. In clinical practice, segmenting polyps from colonoscopy images is essential as it provides valuable information for diagnosis and surgery. However, accurately segmenting polyps is challenging, primarily for two reasons: firstly, polyps of the same type vary in size, color, and texture; and secondly, the boundary between the polyp and its surrounding mucosa is not always clear. Therefore, an automated polyp segmentation method capable of accurately detecting all possible polyps at an early stage is of great significance for CRC prevention.

[0003] Early learning-based segmentation methods relied on extracted, handcrafted features such as color, texture, shape, appearance, or combinations thereof. These methods were typically used to train a classifier to distinguish polyps from their surroundings. However, due to the limited representational power of handcrafted features, these models often suffered from high false negative rates. In recent years, many deep learning-based methods have been developed for polyp segmentation and have achieved some progress, but they mostly rely on bounding boxes to detect polyps, thus failing to accurately locate the polyp boundaries. Various convolutional neural network (CNN)-based algorithms have performed well in polyp segmentation tasks due to their inherent advantage in local perception. However, under complex conditions where the segmentation target has blurred edges and varying sizes, these methods focus on segmenting the polyp region while ignoring boundary constraints. Furthermore, during convolutional encoding, positional and spatial detail information is inevitably lost, especially in near-edge regions with blurred boundaries, which detracts from pixel allocation during segmentation. Recovering salient regional detail information using only progressive upsampling decoding operations and simple skip connections is challenging. Therefore, utilizing salient regional and boundary features and learning to capture the relationship between polyp regions and polyp edges is crucial for improving polyp segmentation performance. Summary of the Invention

[0004] To address the shortcomings of existing technologies, this invention combines a cross-attention mechanism with an efficient grouping and aggregation method to effectively fuse high-level and low-level feature maps for improved model performance. Furthermore, it analyzes the correlation between salient features and edge features based on the logical interrelationship between the binary segmentation map and the edge map. Boundary cues are mined and refined to provide prior boundary knowledge for the model's learning process, significantly enhancing segmentation performance.

[0005] To achieve the above objectives, the present invention provides a medical image segmentation method for edge enhancement based on a dual-decoder, comprising the following steps:

[0006] (1) Obtain a labeled medical image dataset and preprocess the labeled medical image dataset;

[0007] (2) Construct a medical image segmentation network for edge enhancement based on dual decoders, including a pre-trained CNN encoder, a grouping and aggregation module based on cross attention, and a dual decoder consisting of a decoder for guided edge refinement and a CNN decoder for progressive upsampling, and perform deep supervised learning.

[0008] (3) Train the edge enhancement medical image segmentation network based on dual decoders to obtain a trained edge enhancement medical image segmentation network based on dual decoders;

[0009] (4) Input the medical image to be segmented into the trained decoder-based edge enhancement medical image segmentation network to obtain the image segmentation result.

[0010] Furthermore, the preprocessing of the labeled medical image dataset includes:

[0011] The labeled medical image data is cropped to the same size to meet the requirements of the dual-decoder-based edge-enhanced medical image segmentation network;

[0012] The cropped, labeled medical image data is rotated and flipped for data augmentation.

[0013] The preprocessed labeled medical image dataset is randomly divided into training set, validation set and test set.

[0014] Furthermore, the decoder-based edge-enhancing medical image segmentation network specifically comprises:

[0015] The pre-trained CNN encoder is a ResNet50-based CNN encoder, comprising five encoder blocks. The symmetrical progressively upsampled CNN decoder comprises five decoder blocks, each of which further generates segmentation masks and edge masks. The guided edge refinement decoder comprises four edge guidance modules. The cross-attention-based group aggregation module comprises four group aggregation modules, namely the first group aggregation module to the fourth group aggregation module.

[0016] The pre-trained CNN encoder, the progressively upsampled CNN decoder, and the cross-attention-based grouping aggregation module interact with each other to learn salient features and generate multi-scale segmentation and edge masks.

[0017] In the guided edge refinement decoder, the edge guidance module and residual learning are combined based on the edge masks of each encoder block output of the pre-trained CNN encoder, the edge masks of each decoder block output of the progressively upsampled CNN decoder, and the segmentation mask of the last-level decoder block output, to mine salient features and enhance the extraction of features in near-edge regions.

[0018] Furthermore, the pre-trained CNN encoder, the progressively upsampled CNN decoder, and the cross-attention-based grouping aggregation module interact to learn salient features and generate multi-scale segmentation and edge masks, specifically as follows:

[0019] 1. The pre-trained CNN encoder, the progressively upsampled CNN decoder, and the cross-attention-based grouping aggregation module interact to learn salient features and generate multi-scale segmentation and edge masks, specifically as follows:

[0020] The output of the fifth encoder block of the pre-trained CNN encoder is fed to the first decoder block of the progressively upsampled CNN decoder, and the segmentation mask and edge mask of the output feature map are obtained based on its output. The output of the fifth encoder block of the pre-trained CNN encoder, the segmentation mask output by the first decoder block of the progressively upsampled CNN decoder, and the output of the fourth encoder block of the pre-trained CNN encoder are jointly input to the first grouping aggregation module. The output of the first grouping aggregation module is skip-connected with the output of the first decoder block of the progressively upsampled CNN decoder and then output to the second decoder block of the progressively upsampled CNN decoder, and the segmentation mask and edge mask of the output feature map are obtained based on its output. The output of the first grouping aggregation module, the segmentation mask output by the second decoder block of the progressively upsampled CNN decoder, and the output of the third encoder block of the pre-trained CNN encoder are jointly input to the second grouping aggregation module. The output of the second grouping aggregation module is skip-connected with the output of the second decoder block of the progressively upsampled CNN decoder and then output to the third decoder block of the progressively upsampled CNN decoder. And so on, to obtain the segmentation mask of the output feature map of the fifth decoder block of the progressively upsampled CNN decoder.

[0021] Furthermore, the five encoder blocks of the pre-trained CNN encoder are specifically as follows:

[0022] The first encoder block is a 7×7 convolution with a stride of 2 and 64 output channels. The resolution of the feature map f1 output by the first encoder block becomes half that of the original input.

[0023] The output of the first encoder block then passes through a 3×3 max pooling layer, reducing the feature map resolution to one-quarter of the original input, and is then input into the second encoder block.

[0024] In the second encoder block, the input feature map is passed through three cascaded bottleneck layers for residual learning without downsampling. Therefore, the resolution of the feature map f2 output by the second encoder block is still one-quarter of the original input, and the number of channels is expanded to 256 before being input into the third encoder block. The bottleneck layer includes a downsampling convolutional layer, a spatial convolutional layer, an upsampling convolutional layer, and a residual connection that connects the input and output.

[0025] The third, fourth, and fifth encoder blocks contain 4, 6, and 3 sets of cascaded bottleneck layers, respectively. The feature map output by the previous encoder block is input into the next encoder block. The feature maps obtained by the three encoder blocks are f3, f4, and f5, respectively. The output resolution of each encoder block becomes half of its input resolution, and the number of output channels is twice the number of input channels.

[0026] Furthermore, the grouping and aggregation module includes a feature alignment part, a feature interaction part based on self-attention and cross-attention mechanisms, and a grouping and aggregation part; its inputs are a low-level feature map, a high-level feature map, and a segmentation mask generated in the decoder block, with the segmentation mask resolution matching that of the low-level feature map. Figure 1 To;

[0027] The feature alignment part inputs the high-level feature map into a 1×1 convolutional layer and a bilinear interpolation layer to align it with the low-level feature map in both spatial and channel dimensions.

[0028] The feature interaction part based on self-attention and cross-attention mechanism includes two branches: a feature interaction branch from high-level feature map to low-level feature map and a feature interaction branch from low-level feature map to high-level feature map.

[0029] The feature interaction branch from the high-level feature map to the low-level feature map will include the high-level feature map f. h Projecting the result onto the embedding space and then inputting it into the first multi-head self-attention block, the result is represented as follows: use Calculate the query vector, key vector, and value vector;

[0030] In the feature interaction branch from the low-level feature map to the high-level feature map, the low-level feature map f l Projecting the result into the embedding space and then inputting it into the third multi-head self-attention block, the result is represented as follows: use Calculate the query vector, key vector, and value vector;

[0031] The feature interaction branch from the high-level feature map to the low-level feature map will pass through the... The calculated query vector and the result after the above The calculated key vector and value vector are input into the second multi-head cross-attention block to obtain the feature vector after cross-attention fusion. Then, the feature vector is further processed by the feedforward layer, layer normalization and residual connection to obtain the first branch feature map.

[0032] The feature interaction branch from the low-level feature map to the high-level feature map will pass through the... The calculated query vector and the result after the above The calculated key vector and value vector are input into the fourth multi-head cross-attention block to obtain the feature vector after cross-attention fusion. Then, the feature vector is further processed by the feedforward layer, layer normalization and residual connection to obtain the second branch feature map.

[0033] In the grouping and aggregation section, the first branch feature maps and the second branch feature maps obtained from the two branches are equally divided into four groups along the channel dimension, and then spliced ​​together in pairs to obtain four groups of fused feature maps. At the same time, the segmentation mask is copied four times and spliced ​​with the fused feature maps respectively, and dilated convolutions with a kernel size of 3×3 and an inflation rate of {d=1, 2, 5, 7} are applied to each. Finally, the four feature maps are spliced ​​together and then input into a 1×1 convolutional layer to complete feature integration.

[0034] Furthermore, each decoder block in the progressively upsampled CNN decoder consists of a convolutional layer, an activation layer, a batch normalization layer, and an upsampling layer that recovers the number of channels, thereby gradually recovering the spatial and positional information of deep encoded features.

[0035] For each feature map generated by the decoder block, a multi-scale segmentation mask is generated using a 1×1 convolutional layer with 1 output channel. Then, the Sober operator is used to extract edge features from the segmentation masks generated by the first four decoder blocks to obtain different edge masks. The segmentation masks of the first to fourth decoder blocks are respectively input into the four grouping and aggregation modules. The segmentation mask generated by the fifth decoder block and all edge masks are input into the decoder that guides edge refinement for edge feature mining and learning.

[0036] Furthermore, the decoder for guiding edge refinement specifically includes:

[0037] The first edge refinement module in the guided edge refinement decoder takes the output feature map of the fourth encoder block of the pre-trained CNN encoder, the segmentation mask generated by the fifth encoder block of the progressively upsampled CNN encoder, and the edge mask generated by the first encoder block of the progressively upsampled CNN encoder as inputs. The output segmentation map is residually concatenated with the segmentation mask generated by the fifth encoder block of the progressively upsampled CNN encoder to obtain a new segmentation mask. This new mask is then input into the second edge guidance module in the guided edge refinement decoder and combined with the output feature map of the third encoder block of the pre-trained CNN encoder and the edge mask generated by the second encoder block of the progressively upsampled CNN encoder for further refinement of the segmentation. The output of the second edge guidance module in the guided edge refinement decoder is residually concatenated with the new segmentation mask to obtain another new segmentation mask. This process is repeated until the final new segmentation mask is generated as the final prediction result of the decoder-based edge enhancement medical image segmentation network.

[0038] Furthermore, the deep supervised learning includes:

[0039] The loss is calculated by comparing the segmentation mask output by the fifth encoder block of the progressive upsampling decoder with the real label;

[0040] The outputs of each edge guidance module and the final output in the decoder for edge refinement are all upsampled to the same resolution as the real label, and the loss is calculated with the real label.

[0041] Each loss is calculated by summing and averaging the IoU loss and the binary cross-entropy loss function, respectively;

[0042] All losses are integrated into the loss of the decoder-based edge enhancement medical image segmentation network for deep supervised learning.

[0043] The beneficial effects of this invention are:

[0044] 1. The constructed segmentation network adopts an interactive dual-decoder structure. A symmetrical progressive upsampling CNN decoder is proposed for the ResNet50-based encoder to learn salient features and generate multi-scale segmentation masks and edge masks; a decoder is designed to guide edge refinement to extract edge cues; and the interaction between the two is used to learn the correlation between salient features and edge features.

[0045] 2. A grouping and aggregation module based on interactive attention is designed to group high-level features, low-level features from the encoder and symmetric decoder, and the mask generated by the decoder, effectively fusing multi-scale information. A cross-attention mechanism is used to enhance the information flow between multi-level feature maps. In practice, it seamlessly integrates multi-level features while reducing feature redundancy.

[0046] 3. The proposed guided edge refinement decoder uses multiple edge guidance modules and residual connections to progressively refine the multi-scale edge mask and the intermediate feature map of the encoder obtained from the decoder that learns salient features, thereby enhancing the model's edge feature representation ability and improving the model's segmentation performance.

[0047] 4. Through deep supervised learning, the loss is calculated using the multi-scale segmentation mask generated by the decoder that guides edge refinement and the segmentation mask generated in the final stage of the progressive upsampling encoder, along with the real label, making the network easier to train and optimize. Attached Figure Description

[0048] Figure 1 This is a flowchart illustrating the edge enhancement medical image segmentation method based on dual decoders according to an embodiment of the present invention.

[0049] Figure 2 This is a schematic diagram of the overall structure of the edge enhancement medical image segmentation network based on dual decoders according to an embodiment of the present invention.

[0050] Figure 3 This is a schematic diagram of the grouping and aggregation module based on cross-attention in the model of an embodiment of the present invention.

[0051] Figure 4 This is a schematic diagram of the edge guidance module in the model of an embodiment of the present invention.

[0052] Figure 5 This is a schematic diagram showing the comparison between the visualized segmentation results and the actual labels in an embodiment of the present invention. Detailed Implementation

[0053] Embodiments of the present invention are described in detail below. Examples of these embodiments are illustrated in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.

[0054] This invention provides a medical image segmentation method for edge enhancement based on a dual-decoder, such as... Figure 1 As shown, the method includes the following steps:

[0055] S101. Obtain a labeled medical image dataset and preprocess the labeled medical image dataset;

[0056] In this embodiment, a labeled dermoscopy image dataset is selected as the medical image dataset, and then it is preprocessed:

[0057] All input dermoscopic image data were cropped to the same size to fit the network input.

[0058] Furthermore, image enhancement techniques such as flipping and rotation are employed to improve the generalization ability of the image segmentation model.

[0059] The preprocessed labeled dermoscopy image dataset was randomly divided into 80% for training, 10% for validation, and 10% for testing. The training and validation sets contain multiple sets of pre-labeled dermoscopy images, i.e., the original dermoscopy images and their corresponding segmentation maps, while the test set contains the dermoscopy images to be segmented, along with corresponding labels used to evaluate the segmentation performance of the comparison network.

[0060] S102. Construct a decoder-based edge enhancement medical image segmentation network, including a pre-trained CNN encoder, a cross-attention-based grouping aggregation module, and a dual decoder consisting of a decoder that guides edge refinement and a CNN decoder that performs progressive upsampling, and perform deep supervised learning.

[0061] like Figure 2As shown, the edge enhancement medical image segmentation network based on dual decoders includes a pre-trained CNN encoder based on ResNet50, comprising five encoder blocks; a symmetrical progressive upsampling CNN decoder comprising five decoder blocks, each of which further generates a segmentation mask and an edge mask; a cross-attention-based grouping aggregation module comprising four grouping aggregation modules; a decoder for guided edge refinement comprising four edge guidance modules; and a deep supervised learning method is also used.

[0062] Information is exchanged between the pre-trained CNN encoder, the progressively upsampled CNN decoder, and the cross-attention-based grouping aggregation module to learn salient features and generate the segmentation mask and edge mask at multiple scales.

[0063] The output of the fifth encoder block of the pre-trained CNN encoder is fed to the first decoder block of the progressively upsampled CNN decoder, and the segmentation mask and edge mask of the output feature map are obtained based on its output. The output of the fifth encoder block of the pre-trained CNN encoder, the segmentation mask output by the first decoder block of the progressively upsampled CNN decoder, and the output of the fourth encoder block of the pre-trained CNN encoder are input into the first grouping aggregation module. The output of the first grouping aggregation module is skip-connected with the output of the first decoder block of the progressively upsampled CNN decoder and then output to the second decoder block of the progressively upsampled CNN decoder, and the segmentation mask and edge mask of the output feature map are obtained based on its output. The output of the first grouping aggregation module, the segmentation mask output by the second decoder block of the progressively upsampled CNN decoder, and the output of the third encoder block of the pre-trained CNN encoder are input into the second grouping aggregation module. The output of the second grouping aggregation module is skip-connected with the output of the second decoder block of the progressively upsampled CNN decoder and then output to the third decoder block of the progressively upsampled CNN decoder. This process is repeated to obtain the segmentation mask of the output feature map of the fifth decoder block of the progressively upsampled CNN decoder.

[0064] The CNN branch with ResNet50 as its backbone can be divided into five stages, corresponding to five encoder blocks. In the initial stage of ResNet50, the encoder block Conv1 is a 7×7 convolution with a stride of 2 and 64 output channels. After the first stage, the resolution of the output feature map f1 becomes half that of the original input, represented as H / 2×W / 2×C (C=64, H is the height of the original input feature map, and W is the width of the original input feature map). The output of the first stage then passes through a 3×3 max-pooling layer, reducing the resolution of the output feature map to one-quarter of the original input, before being input into the second stage encoder block. In the second stage encoder block Conv2_x, the feature map sequentially passes through three cascaded bottleneck layers for residual learning without downsampling. Therefore, the resolution of the output feature map f2 of Conv2_x remains one-quarter of the original input, but the number of channels is expanded to 256, represented as H / 4×W / 4×4C, before being input into the next stage encoder block. The subsequent encoder blocks contain 4, 6, and 3 bottleneck layers, respectively. The feature map output from the previous encoder block is input into the next encoder block, resulting in three feature maps f3, f4, and f5. The output resolution of each stage is half that of the input, and the number of output channels is twice the number of input channels. Each bottleneck layer contains a downsampling convolutional layer, a spatial convolutional layer, an upsampling convolutional layer, and a residual connection connecting the input and output. These feature maps, containing location and spatial information, are input into a cross-attention-based group aggregation module and an edge refinement decoder, respectively, to achieve multi-scale feature fusion and enhance edge feature representation capabilities in the encoder and decoder.

[0065] The grouping aggregation module in the cross-attention-based grouping aggregation module is used to enhance the information flow of multi-scale feature interactions in the encoder and the progressively upsampled CNN decoder. For example... Figure 3 As shown, this module mainly consists of three parts: a feature alignment part, a feature interaction part based on self-attention and cross-attention mechanisms, and a grouping and aggregation part; its inputs are low-level feature maps, high-level feature maps, and segmentation masks generated in the decoder block. The resolution of the segmentation mask is the same as that of the low-level feature maps. Figure 1 To.

[0066] In the feature alignment part, the high-level feature map is input into a 1×1 convolutional layer and a bilinear interpolation layer to align it with the low-level feature map in both spatial and channel dimensions.

[0067] The feature interaction part based on self-attention and cross-attention mechanisms is divided into two branches to model the information flow: from high-level feature map to low-level feature map and from low-level feature map to high-level feature map. The feature interaction branch from high-level feature map to low-level feature map will model the information flow from the high-level feature map f. hThe input is projected into the embedding space and then fed into the first multi-head self-attention block, causing it to focus on the correlations between different internal regions and refine its own representation. The result is expressed as follows: use Calculate the query vector, key vector, and value vector. In the feature interaction branch from the low-level feature map to the high-level feature map, the low-level feature map f... l Projecting the result into the embedding space and then inputting it into the third multi-head self-attention block, the result is represented as follows: use Calculate the query vector, key vector, and value vector. The feature interaction branch from the high-level feature map to the low-level feature map will pass through the aforementioned... The calculated query vector and the result after the above The calculated key vector and value vector are input into the second multi-head cross-attention block to obtain the feature vector after cross-attention fusion. This is then further processed using a feedforward layer, layer normalization, and residual connections to obtain the first branch feature map. The feature interaction branch from the low-level feature map to the high-level feature map will undergo the aforementioned... The calculated query vector and the result after the above The calculated key vector and value vector are input into the fourth multi-head cross-attention block to obtain the feature vector after cross-attention fusion. Then, the feature vector is further processed by the feedforward layer, layer normalization and residual connection to obtain the second branch feature map.

[0068] In the grouping and aggregation section, the first and second branch feature maps obtained from the two parallel feature interaction branches are equally divided into four groups along the channel dimension. The divided feature groups from the first and second branch feature maps are concatenated pairwise to obtain four sets of fused feature maps. Additionally, the input segmentation mask... i Four copies are made and concatenated with the fused feature map. This segmentation mask has the same resolution as the low-level feature map. To make the fused feature map more powerful while maintaining its resolution, dilated convolutions with a kernel size of 3×3 and a dilation rate of {d = 1, 2, 5, 7} are applied to these feature maps. Finally, the four feature maps are concatenated together and then fed into a 1×1 convolutional layer to complete feature integration.

[0069] The decoder section employs an interactive dual-decoder architecture. A symmetrical progressive upsampling CNN decoder is proposed for the five downsampling blocks of the encoder to learn salient features. A guided edge refinement decoder is used to learn edge features, and the correlation between the two decoders is learned through their interaction. The progressively upsampling CNN decoder contains five decoder blocks. Each decoder block consists of a convolutional layer recovering the number of channels, an activation layer, a batch normalization layer, and an upsampling layer recovering spatial detail information, progressively recovering the spatial and positional information of deep encoded features. For the feature map generated at each stage, a multi-scale segmentation mask is generated using a 1×1 convolutional layer with one output channel, denoted as {mask}. i The segmentation mask {mask} generated in the first four stages is then processed using the Sober operator. i Extracting edge features from the {i = 1, 2, ..., 4} yields different edge masks. i {i = 1, 2, ..., 4}. The segmentation masks {mask} for the first to fourth stages of the decoder. i The values ​​of i = 1, 2, ..., 4 are input into four cross-attention-based group aggregation modules, and the final stage generates a segmentation mask mask5 and all edge masks {edge mask}. i The values ​​of i = 1, 2, ..., 4 are input into the guided edge refinement decoder for edge feature mining and learning. In the guided edge refinement decoder, residual learning and an edge guidance module are combined to progressively mine salient features and enhance the extraction of features near the edges. More specifically, the first edge refinement module takes the coarse segmentation map mask5 generated in the final stage of the encoder (f4 progressively upsampled) and the edge mask edge mask1 generated in the first stage as input. The output segmentation map is residually concatenated with mask5 and then input into the next edge guidance module, combining f3 and edge mask2 to generate a further refined segmentation. This iterative feature refinement gradually reduces the error between the predicted map and the true label, guiding the network to refine and extract edge features. The final generated segmentation mask Output serves as the network's final prediction result.

[0070] The segmentation mask output by the fifth encoder block of the progressive upsampling decoder is used to calculate the loss with the real label; the outputs of each edge guidance module in the guided edge refinement decoder and the final output are all upsampled to the same resolution as the real label and used to calculate the loss with the real label; each loss is calculated by summing and averaging the IoU loss and the binary cross-entropy loss function; all losses are integrated into the loss of the decoder-based edge enhancement medical image segmentation network for deep supervised learning.

[0071] S103. Train the decoder-based edge enhancement medical image segmentation network to obtain the trained decoder-based edge enhancement medical image segmentation network.

[0072] After setting the initial training parameters, the processed training and validation samples are used as inputs to train and optimize the segmentation network, resulting in a trained image segmentation model.

[0073] When training a segmentation network, the training parameters include:

[0074] The input image has dimensions of 224×224×3, representing the height, width, and number of channels of a two-dimensional image, respectively. The Adam optimization algorithm is used to optimize the overall parameters. The initial learning rate of the network is set to 1e-4, and the learning rate gradually decreases with the number of iterations. The batch size is 16. The loss function is the sum of the weighted IoU loss and the binary cross-entropy (BCE) loss function. The settings of other network parameters can be understood conventionally and will not be elaborated here. When the segmentation network's model performance reaches the preset accuracy requirement, the segmentation network is used as the image segmentation model. Model performance can be judged using common evaluation parameters such as segmentation accuracy, or the segmentation effect can be judged manually based on the generated segmentation map.

[0075] S104. Input the medical image to be segmented into the trained decoder-based edge enhancement medical image segmentation network to obtain the image segmentation result.

[0076] Before inputting the medical image to be segmented into the trained decoder-based edge enhancement medical image segmentation network, the target image needs to be preprocessed to adapt to the network input, including operations such as cropping size and denoising.

[0077] This invention provides a dual-decoder-based edge enhancement medical image segmentation method. It effectively fuses multi-level features from the encoder and decoder through a cross-attention-based grouping and aggregation module, enhancing the information flow between these features. Furthermore, considering the actual diagnostic process, edge information is indispensable for accurate segmentation. However, existing polyp segmentation algorithms mostly focus on extracting salient features such as texture and location. Meanwhile, there is a logical relationship between binary segmentation masks and edge masks; exploring and learning the correlation between salient features and edge features helps improve the model's representational ability. Therefore, we propose an interactive dual-decoder structure, used to learn salient features and edge features respectively. The correlation between the two features is learned during the interaction between the two decoders, improving the network's representational ability and segmentation performance.

[0078] The preferred embodiments of the present invention have been described in detail above. It should be understood that those skilled in the art can make numerous modifications and variations based on the concept of the present invention without creative effort. Therefore, all technical solutions that can be obtained by those skilled in the art based on the concept of the present invention through logical analysis, reasoning, or limited experimentation on the basis of existing technology should be within the scope of protection defined by the claims.

Claims

1. A medical image segmentation method for edge enhancement based on dual decoders, characterized in that, Includes the following steps: (1) Obtain a labeled medical image dataset and preprocess the labeled medical image dataset; (2) Construct a medical image segmentation network for edge enhancement based on dual decoders, including a pre-trained CNN encoder, a grouping and aggregation module based on cross attention, and a dual decoder consisting of a decoder for guided edge refinement and a CNN decoder for progressive upsampling, and perform deep supervised learning. The pre-trained CNN encoder is a ResNet50-based CNN encoder, comprising five encoder blocks. The symmetrical progressively upsampled CNN decoder comprises five decoder blocks, each of which further generates segmentation masks and edge masks. The guided edge refinement decoder comprises four edge guidance modules. The cross-attention-based group aggregation module comprises four group aggregation modules, namely the first group aggregation module to the fourth group aggregation module. The pre-trained CNN encoder, the progressively upsampled CNN decoder, and the cross-attention-based grouping aggregation module interact with each other to learn salient features and generate multi-scale segmentation and edge masks. In the guided edge refinement decoder, the edge guidance module and residual learning are combined based on the edge masks of each encoder block output of the pre-trained CNN encoder, the edge masks of each decoder block output of the progressively upsampled CNN decoder, and the segmentation mask of the last-level decoder block output, to mine salient features and enhance the extraction of features in near-edge regions. The pre-trained CNN encoder, the progressively upsampled CNN decoder, and the cross-attention-based grouping aggregation module interact to learn salient features and generate multi-scale segmentation and edge masks. The output of the fifth encoder block of the pre-trained CNN encoder is fed to the first decoder block of the progressively upsampled CNN decoder, and the segmentation mask and edge mask of the output feature map are obtained based on its output; the output of the fifth encoder block of the pre-trained CNN encoder, the segmentation mask output by the first decoder block of the progressively upsampled CNN decoder, and the output of the fourth encoder block of the pre-trained CNN encoder are jointly input into the first grouping aggregation module. The output of the first group aggregation module is skip-connected with the output of the first decoder block of the progressively upsampled CNN decoder and then output to the second decoder block of the progressively upsampled CNN decoder. The segmentation mask and edge mask of the output feature map are obtained based on the output of the second decoder block of the progressively upsampled CNN decoder. The output of the first group aggregation module, the segmentation mask output by the second decoder block of the progressively upsampled CNN decoder, and the output of the third encoder block of the pre-trained CNN encoder are all input into the second group aggregation module. The output of the second group aggregation module is connected to the output of the second decoder block of the progressively upsampled CNN decoder via a skip connection and then output to the third decoder block of the progressively upsampled CNN decoder. By analogy, the segmentation mask of the output feature map of the fifth decoder block of the progressively upsampled CNN decoder is obtained; (3) Train the edge enhancement medical image segmentation network based on dual decoders to obtain the trained edge enhancement medical image segmentation network based on dual decoders; (4) Input the medical image to be segmented into the trained decoder-based edge enhancement medical image segmentation network to obtain the image segmentation result.

2. The edge enhancement medical image segmentation method based on dual decoders according to claim 1, characterized in that, The preprocessing of the labeled medical image dataset includes: The labeled medical image data is cropped to the same size to meet the requirements of the dual-decoder-based edge-enhanced medical image segmentation network; The cropped, labeled medical image data is rotated and flipped for data augmentation. The preprocessed labeled medical image dataset is randomly divided into training set, validation set and test set.

3. The edge enhancement medical image segmentation method based on dual decoders according to claim 1, characterized in that: The five encoder blocks of the pre-trained CNN encoder are specifically as follows: The first encoder block is a 7×7 convolution with a stride of 2 and 64 output channels. The feature map output by the first encoder block... The resolution becomes half of the original input; The output of the first encoder block then passes through a 3×3 max pooling layer, reducing the feature map resolution to one-quarter of the original input, and is then input into the second encoder block. In the second encoder block, the input feature map is sequentially passed through three cascaded bottleneck layers for residual learning, without downsampling. Therefore, the feature map output by the second encoder block... The resolution remains one-quarter of the original input, the number of channels is expanded to 256, and the input is fed into the third encoder block; wherein the bottleneck layer contains a downsampled convolutional layer, a spatial convolutional layer, an upsampled convolutional layer, and a residual connection that connects the input and output; The third, fourth, and fifth encoder blocks each contain 4, 6, and 3 cascaded bottleneck layers, respectively. The feature map output from the previous encoder block is input into the next encoder block; the feature maps obtained from the three encoder blocks are respectively... , , The output resolution of each encoder block becomes half of its input resolution, and the number of output channels is twice the number of input channels.

4. The edge enhancement medical image segmentation method based on dual decoders according to claim 1, characterized in that: The grouping and aggregation module includes a feature alignment part, a feature interaction part based on self-attention and cross-attention mechanisms, and a grouping and aggregation part. Its input consists of a low-level feature map, a high-level feature map, and a segmentation mask generated in the decoder block. The resolution of the segmentation mask is the same as that of the low-level feature map. The feature alignment part inputs the high-level feature map into a 1×1 convolutional layer and a bilinear interpolation layer to align it with the low-level feature map in both spatial and channel dimensions. The feature interaction part based on self-attention and cross-attention mechanism includes two branches: a feature interaction branch from high-level feature map to low-level feature map and a feature interaction branch from low-level feature map to high-level feature map. The feature interaction branch from the high-level feature map to the low-level feature map will include the high-level feature map. Projecting the result onto the embedding space and then inputting it into the first multi-head self-attention block, the result is represented as follows: ,use Calculate the query vector, key vector, and value vector; The feature interaction branch from the low-level feature map to the high-level feature map will include the low-level feature map. Projecting the result into the embedding space and then inputting it into the third multi-head self-attention block, the result is represented as follows: ,use Calculate the query vector, key vector, and value vector; The feature interaction branch from the high-level feature map to the low-level feature map will pass through the... The calculated query vector and the result after the above The calculated key vector and value vector are input into the second multi-head cross-attention block to obtain the feature vector after cross-attention fusion. Then, the feature vector is further processed by the feedforward layer, layer normalization and residual connection to obtain the first branch feature map. The feature interaction branch from the low-level feature map to the high-level feature map will pass through the... The calculated query vector and the result after the above The calculated key vector and value vector are input into the fourth multi-head cross-attention block to obtain the feature vector after cross-attention fusion. Then, the feature vector is further processed by the feedforward layer, layer normalization and residual connection to obtain the second branch feature map. In the grouping and aggregation section, the first branch feature maps and the second branch feature maps obtained from the two branches are equally divided into four groups along the channel dimension, and then spliced ​​together in pairs to obtain four groups of fused feature maps. At the same time, the segmentation mask is copied four times and spliced ​​with the fused feature maps respectively, and dilated convolutions with a kernel size of 3×3 and an inflation rate of {d=1, 2, 5, 7} are applied to each. Finally, the four feature maps are spliced ​​together and then input into a 1×1 convolutional layer to complete feature integration.

5. The edge enhancement medical image segmentation method based on dual decoders according to claim 1, characterized in that: Each decoder block in the progressively upsampled CNN decoder consists of a convolutional layer, an activation layer, a batch normalization layer, and an upsampling layer that recovers spatial detail information to gradually recover the spatial and positional information of deep encoded features. For each feature map generated by the decoder block, a multi-scale segmentation mask is generated using a 1×1 convolutional layer with 1 output channel. The Sober operator is then used to extract edge features from the segmentation masks generated by the first four decoder blocks to obtain different edge masks. The segmentation masks from the first to the fourth decoder blocks are respectively input into the four grouping and aggregation modules. The segmentation mask generated by the fifth decoder block and all edge masks are input into the decoder that guides edge refinement for edge feature mining and learning.

6. The edge enhancement medical image segmentation method based on dual decoders according to claim 1, characterized in that, The decoder for guiding edge refinement is specifically: The first edge refinement module in the guided edge refinement decoder takes the output feature map of the fourth encoder block of the pre-trained CNN encoder, the segmentation mask generated by the fifth encoder block of the progressively upsampled CNN encoder, and the edge mask generated by the first encoder block of the progressively upsampled CNN encoder as inputs. The output segmentation map is residually concatenated with the segmentation mask generated by the fifth encoder block of the progressively upsampled CNN encoder to obtain a new segmentation mask. This new mask is then input into the second edge guidance module in the guided edge refinement decoder and combined with the output feature map of the third encoder block of the pre-trained CNN encoder and the edge mask generated by the second encoder block of the progressively upsampled CNN encoder for further refinement of the segmentation. The output of the second edge guidance module in the guided edge refinement decoder is residually concatenated with the new segmentation mask to obtain another new segmentation mask. This process is repeated until the final new segmentation mask is generated as the final prediction result of the decoder-based edge enhancement medical image segmentation network.

7. The edge enhancement medical image segmentation method based on dual decoders according to claim 6, characterized in that, The deep supervised learning includes: The loss is calculated by comparing the segmentation mask output by the fifth encoder block of the progressive upsampling decoder with the real label; The outputs of each edge guidance module and the final output in the decoder for edge refinement are upsampled to the same resolution as the real label, and the loss is calculated with the real label. Each loss is calculated by summing and averaging the IoU loss and the binary cross-entropy loss function, respectively; All losses are integrated into the loss of the decoder-based edge enhancement medical image segmentation network for deep supervised learning.