A multi-scale polyp segmentation method and system based on context perception
By using a U-shaped polyp segmentation network, combined with a pyramid visual transformer, multi-scale interaction module, spatial attention enhancement module, and context-aware repair module, the problem of insufficient segmentation accuracy and generalization ability of small polyps is solved, achieving more accurate polyp segmentation and clinical relevance.
Patent Information
- Application Number
- CN202510135069.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-07
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2045-02-07
AI Technical Summary
Existing polyp segmentation methods have low segmentation accuracy when dealing with small or blurred polyps. The decoder cannot accurately locate the segmentation target, and the generalization ability is poor. They fail to fully consider the characteristics of polyp images, such as varying sizes and shapes.
A polyp segmentation network based on a U-shaped architecture is adopted, which combines a pyramid visual transformer, a multi-scale interaction module, a spatial attention enhancement module, and a context-aware repair module. Through multi-scale feature interaction, spatial attention enhancement, and edge region processing, the segmentation boundary is gradually optimized.
It achieves more precise polyp segmentation, improves segmentation robustness and accuracy, adapts to the diverse size and shape of polyps, and enhances the accuracy of segmentation and its relevance to clinical surgery.
Smart Images

Figure CN120259641B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of medical image processing, and more particularly to a multi-scale polyp segmentation method and system based on context perception. BACKGROUND
[0002] At present, the method based on convolutional neural network (CNN) is represented by UNet. UNet is composed of a contraction path (encoder) and a symmetric expansion path (decoder), which extracts features and captures context information through layer-by-layer convolution and pooling. The expansion path restores the image spatial resolution through upsampling and splicing, and its skip connection combines low-level and high-level features, which improves the segmentation effect. However, the encoder-decoder architecture of CNN has some problems. In the encoding stage, the reduction of feature scale leads to the loss of small targets and details; while in the decoding stage, the difficulty of restoring details increases. Although the skip connection can fuse low-resolution features to supplement details, the inconsistency of feature representation causes the semantic gap between the encoder and the decoder, and introduces background noise at the same time. Therefore, CNN performs well in capturing local details, but is relatively weak in summarizing global context, making it difficult to accurately segment small polyps.
[0003] In addition, the method based on pure Transformer uses self-attention mechanism to process long-distance dependence and perform efficient feature extraction. The input image is divided into windows, and self-attention is applied between each window to capture global features. This method uses an encoder-decoder structure to gradually restore the spatial resolution and realize image segmentation. However, pure Transformer usually relies on large-scale datasets for pre-training, and its position encoding and affinity matrix calculation requires more complex processing and computing resources. Although position encoding compensates for the lack of spatial position perception ability of Transformer to some extent, it is still not as effective as convolution operation. At the same time, although Transformer performs well in modeling global context and capturing long-distance dependence, it performs relatively poorly in segmenting object boundaries and handling subtle structures due to the lack of local inductive bias of CNN.
[0004] In addition, the method based on the hybrid architecture of CNN and Transformer takes advantage of the CNN's ability to capture local features and texture information, as well as the Transformer's ability to capture global context and long-distance dependence. Although these hybrid architectures have made great progress in feature extraction of polyp images, many methods only focus on improving the encoder part of the architecture, while the skip connection and decoder part are ignored. This leads to the decoder being unable to accurately locate the specific position of the segmentation target at the early stage of the decoding phase, and the lack of restoration of detailed information, making the segmentation result perform poorly when dealing with small or fuzzy boundary polyps.
[0005] In summary, the current polyp segmentation methods do not fully consider the characteristics of polyp images (such as different sizes, various shapes, and blurred boundaries), resulting in low segmentation accuracy. At the same time, these methods are disconnected from the actual clinical surgical process and fail to integrate the entire process of clinical polyp resection into the architecture design, resulting in poor performance. In addition, due to the diverse sources of polyp image datasets, the performance of some methods on different public datasets is inconsistent, and the generalization ability is poor.
[0006] Therefore, how to provide a context-aware multi-scale polyp segmentation method and system that can solve the above problems is a problem that needs to be solved by those skilled in the art. SUMMARY
[0007] Therefore, the present application provides a context-aware multi-scale polyp segmentation method and system, which solves the problem of loss of small polyps and flat polyps during segmentation, the deficiency of pure Transformer-based methods in detail processing, the defect of the decoder in accurately locating the segmentation target position when restoring the image, the challenge of accurately segmenting the polyp boundary, and the problem of poor generalization ability of the polyp segmentation network.
[0008] To achieve the above purpose, the present application provides the following technical solutions:
[0009] A context-aware multi-scale polyp segmentation method, comprising
[0010] Obtaining a to-be-segmented pathological image, inputting the to-be-segmented pathological image into a pre-constructed context-aware multi-scale polyp segmentation model, outputting a segmentation result, and completing polyp segmentation;
[0011] The context-aware multi-scale polyp segmentation model is based on a U-shaped architecture polyp segmentation network, which comprises a pyramid visual transformer as an encoder, a multi-scale interaction module as a skip connection, a spatial attention enhancement module and a context-aware repair module as a decoder.
[0012] The pyramid visual transformer extracts features from the input to-be-segmented pathological image;
[0013] The multi-scale interaction module performs multi-scale feature interaction processing on the features extracted by the pyramid visual transformer;
[0014] The spatial attention enhancement module highlights important regions in the extracted multi-scale features by fusing parallel global attention mechanism units and local attention mechanism units;
[0015] The context-aware repair module detects the edge region of the to-be-segmented pathological image and gradually processes the segmentation boundary.
[0016] Further, the pyramid vision transformer extracts features from the input pathological image to be segmented, obtains four different levels of semantic features, and then the features obtained by each layer are transmitted to the multi-scale interaction module of each layer. The multi-scale convolution module is used to realize cross learning between different receptive fields, and the following is obtained:
[0017] ;
[0018] In the formula, is a 3x3 convolution, is a 5x5 convolution, is a 1x1 convolution, is a multi-scale feature, and are features obtained by parallel operation of 3x3 convolution and 5x5 convolution, respectively.
[0019] Further, the multi-scale interaction module exchanges information between the two features, and combines the features obtained by multiplying the receptive field of 3 and the receptive field of 5. The specific process is expressed as:
[0020] ;
[0021] In the formula, is a feature obtained by complementary information under different receptive fields, represents matrix multiplication, cat represents splicing, CRB includes a 3x3 convolution, ReLU loss and batch normalization operation, is a combination of , and and adding the original feature to obtain the final output. Further, the global attention mechanism unit in the spatial attention enhancement module is specifically expressed as:
[0022] ;
[0023] In the formula, the feature processed by the multi-scale interaction module of the fourth layer is split into two sub-features and along the channel dimension, represents the input feature of the global spatial attention mechanism operation; Softmax represents the normalization operation; Flatten represents flattening the input two-dimensional feature map into a one-dimensional vector; represents applying convolution to the input feature map to obtain the context mask; GSA represents the global spatial attention module; AttG represents the global attention operation; represents matrix multiplication; the first layer of the MLP converts the input into a higher dimensional space, with an expansion ratio of 2, and the second layer restores the dimension to match the input.
[0024] Further, the local attention mechanism unit in the spatial attention enhancement module is specifically represented as:
[0025] ;
[0026] In the formula, represents the input feature of the local spatial attention mechanism operation; is a Sigmoid activation function, and AttL represents the local attention operation, represents element-wise multiplication, and LSA represents the local spatial attention module.
[0027] Further, the context-aware repair module is specifically represented as:
[0028] ;
[0029] In the formula, represents the generated foreground attention feature; represents an up-sampling operation, represents the prediction mask of the previous layer; is a Sigmoid activation function, represents element-wise multiplication, represents the feature of the current layer; represents the background attention feature.
[0030] A context-aware multi-scale polyp segmentation system, comprising:
[0031] A data acquisition module: acquiring a pathological image to be segmented;
[0032] A segmentation module: inputting the pathological image to be segmented into a pre-constructed context-aware multi-scale polyp segmentation model, outputting a segmentation result, and completing polyp segmentation;
[0033] The context-aware multi-scale polyp segmentation model is based on a U-shaped architecture polyp segmentation network, which comprises a pyramid visual transformer as an encoder, a multi-scale interaction module as a skip connection, and a spatial attention enhancement module and a context-aware repair module as a decoder.
[0034] The multi-scale interaction module performs multi-scale feature interaction processing on the features extracted by the pyramid visual transformer.
[0035] The spatial attention enhancement module highlights important regions in the extracted multi-scale features by fusing parallel global spatial attention mechanism units and local spatial attention mechanism units.
[0036] The context-aware repair module detects the edge region of the pathological image to be segmented and gradually processes the segmentation boundary.
[0037] Compared with the prior art, the application provides a multi-scale polyp segmentation method and system based on context awareness. The application combines the advantages of convolutional neural network (CNN) and Transformer, better adapts to the characteristics of polyps of different sizes, various shapes and fuzzy boundaries, and thus realizes more accurate segmentation. The pyramid vision transformer is used as an encoder, which can effectively capture the global information of the image. The multi-scale interactive convolution block in the skip connection realizes cross-learning between different receptive fields and enhances the feature expression capability. The decoder first performs preliminary spatial positioning on the features to be restored through the spatial attention enhancement module, and then the context-aware repair module focuses on the boundary region and gradually optimizes the accuracy of boundary segmentation. The specific beneficial effects are as follows:
[0038] (1) The application introduces a multi-scale interactive module based on the polyp segmentation network based on the U-shaped architecture. The features obtained by the encoder are further interactively learned through different receptive fields, further enhancing the representation ability of the features.
[0039] (2) The spatial attention enhancement module in the application emphasizes the important regions in the extracted features by fusing the parallel global attention mechanism and local attention mechanism, thereby preliminarily positioning the segmentation target.
[0040] (3) The context-aware repair module in the application focuses on the edge region of the segmented image through context awareness, and gradually improves the segmentation boundary to solve the problem of inaccurate segmentation caused by over-segmentation and under-segmentation.
[0041] (3) The entire decoder of the application is composed of weighted IoU (Intersection over Union) loss and weighted BCE (Binary Cross Entropy) loss to supervise each round of segmentation result, ensuring that the segmentation result is close to the true mask. BRIEF DESCRIPTION OF DRAWINGS
[0042] In order to more clearly illustrate the technical solutions in the embodiments of the application or the prior art, the drawings needed in the embodiments or the prior art description will be briefly introduced. Obviously, the drawings in the following description are only embodiments of the application, and those skilled in the art can obtain other drawings according to the provided drawings without creative labor.
[0043] Figure 1 The method flowchart of the application;
[0044] Figure 2 A schematic diagram of the overall architecture of the context-aware multi-scale polyp segmentation model provided by the present application is shown in the figure;
[0045] Figure 3(a) is a schematic diagram of the multi-scale interaction module provided by the present application;
[0046] Figure 3(b) is a schematic diagram of the spatial attention enhancement module provided by the present application;
[0047] Figure 3(c) is a schematic diagram of the context-aware repair module provided by the present application;
[0048] Figure 3(d) is a schematic diagram of the context exploration module provided by the present application;
[0049] Figure 4 A schematic diagram of the system structure of the present application is shown in the figure. DETAILED DESCRIPTION
[0050] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.
[0051] Referring to Figure 1 A context-aware multi-scale polyp segmentation method, comprising:
[0052] Obtaining a pathological image to be segmented, inputting the pathological image to be segmented into a pre-constructed context-aware multi-scale polyp segmentation model, outputting a segmentation result, and completing polyp segmentation;
[0053] The context-aware multi-scale polyp segmentation model is based on a U-shaped architecture polyp segmentation network, which comprises a pyramid visual transformer as an encoder, a multi-scale interaction module as a skip connection, and a spatial attention enhancement module and a context-aware repair module as a decoder.
[0054] The pyramid visual transformer extracts features from the input pathological image to be segmented;
[0055] The multi-scale interaction module performs multi-scale feature interaction processing on the features extracted by the pyramid visual transformer;
[0056] The spatial attention enhancement module highlights important regions in the extracted multi-scale features by fusing parallel global attention mechanism units and local attention mechanism units;
[0057] The context-aware repair module detects the edge region of the pathological image to be segmented and gradually processes the segmentation boundary.
[0058] In one specific embodiment, the overall architecture of the context-aware multi-scale polyp segmentation model is shown in Figure 2 As shown, a segmentation network based on a U-shaped architecture is adopted. The network is composed of a pyramid vision transformer as an encoder, a multi-scale interaction convolutional block as a skip connection, a spatial attention enhancement module and a context-aware repair module as a decoder. In addition, the loss function includes a weighted IoU loss and a weighted binary cross-entropy (BCE) loss. Specifically, the encoder is responsible for capturing the global context information of the input image; the skip connection establishes a direct feature channel between the encoder and the decoder, enabling the effective fusion of low-level detail features and high-level semantic features; the decoder gradually restores the spatial resolution of the image, and uses upsampling and feature concatenation techniques to generate a segmentation mask of the same size as the input image. At the same time, the loss function is used to supervise the segmentation results of each round of the decoder.
[0059] Specifically, in the first stage (observation), the embodiment uses a pyramid vision transformer as an encoder to extract features of the polyp image. The designed multi-scale interaction module further aggregates features at multiple scales through convolution to adapt to the scale and morphological changes of the target. In the second stage (positioning), at the fourth layer of the decoder, the embodiment uses a position attention enhancement module to locate the specific position of the polyp from the high-level features by combining global and local spatial information. In the third stage (focus), after obtaining the preliminary positioning, in order to achieve more accurate target segmentation, the embodiment uses a context-aware repair module at the first three layers of the decoder to perform multi-scale context exploration based on foreground and background attention features, in order to solve the problem of segmentation missing or over-segmentation, and thus obtain more accurate segmentation results. The overall architecture of the context-aware multi-scale polyp segmentation model of the present invention is shown in Figure 2 Figure 2 is a detailed diagram of the modules used in the context-aware multi-scale polyp segmentation model. The entire model uses a segmentation network with a U-shaped architecture, including an encoder, a decoder and a skip connection. By simulating the process of a clinician removing a polyp, the present invention designs a new architecture that effectively solves the problem of low polyp segmentation accuracy in existing methods and ensures that the segmentation results are consistent with the morphological features of actual medical images, thereby improving the robustness and accuracy of segmentation.
[0060] Figures 3(a)-(b) show the detailed flowchart of the context-aware multi-scale polyp segmentation model provided by this invention, illustrating the overall process from input image to segmentation result. Specifically, the resolution of the polyp images in the dataset is first adjusted to 352×352, and then input into the encoder. To better extract global features from the image and prevent the loss of features of small polyps, this embodiment of the encoder uses a pre-trained pyramid visual transformer to utilize the rich visual features obtained from its training on a large-scale dataset. The encoder extracts features from the input image to obtain four different levels of semantic features. Subsequently, the features obtained from each layer are passed to the multi-scale interaction module of each layer, as shown in Figure 3(a). Due to the diverse morphologies of polyps, relying on feature information extracted from a single receptive field will adversely affect image understanding and segmentation. In order to better adapt to the diverse morphologies of polyps, this embodiment adopts a multi-scale convolution module and introduces the concept of interaction, aiming to achieve cross-learning between different receptive fields and enhance the complementarity of features.
[0061] Specifically, this embodiment first focuses on the features. Use three independent 1×1 convolutions Three feature representations are obtained. Then, through parallel convolution operations with different receptive fields, the following is obtained: and Then, these two features undergo information interaction, followed by parallel convolution processing and element-wise multiplication, fully utilizing complementary information from different receptive fields to obtain... Next, this embodiment will obtain , and These are combined and then fed into the CRB module (which includes a 3×3 convolution, ReLU, and batch normalization). Finally, to preserve the original information, the original features are superimposed on it to obtain the final output. The entire process can be represented as:
[0062] ;
[0063] In the formula, It is a 3×3 convolution. It is a 5×5 convolution. For 1×1 convolution, For multi-scale features, and These are the features obtained through parallel operations of 3×3 convolution and 5×5 convolution, respectively. Features are obtained by using complementary information from different receptive fields. This represents matrix multiplication, `cat` represents concatenation, and CRB includes a 3×3 convolution, ReLU loss, and batch normalization. To be 、 and combine and add original features to get the final output.
[0064] In one specific embodiment, the processed features are fed into the decoder, and the spatial attention enhancement module is used in the fourth layer of the decoder to integrate the features of global and local spatial information to enhance the spatial features of the highest-level semantic information. This makes the location of the segmentation target in the feature map more prominent, which helps to preliminarily locate the segmentation target. As shown in FIG. 3(b), the present application designs this module to process the input in parallel through channel separation, which not only reduces the computational complexity but also allows the module to focus on different subsets of features.
[0065] In one specific embodiment, the feature map is divided into two sub-feature maps along the channel dimension, and then input into the global spatial attention module and the local spatial attention module, respectively. Finally, the features obtained by the two modules are fused together. Next, this embodiment will describe the global spatial attention module and the local spatial attention module in detail:
[0066] Specifically, the global spatial attention module (GSA): The global spatial attention module enables the model to dynamically adjust the weights of different parts of the feature map, enhance important features, and make the approximate location of the segmentation target more prominent. With as the input, the specific process can be represented as:
[0067] ;
[0068] wherein the feature processed by the multi-scale interaction module in the 4th layer is averaged and split into two sub-features and along the channel dimension, denotes the input feature of the global spatial attention mechanism operation; Softmax denotes the normalization operation; Flatten denotes flattening the input two-dimensional feature map into a one-dimensional vector; denotes applying convolution to the input feature map to obtain the context mask; GSA denotes the global spatial attention module; AttG denotes the global attention operation; denotes matrix multiplication; the first layer of the MLP converts the input into a higher-dimensional space with an expansion ratio of 2, and the second layer restores the dimension to match the input.
[0069] Specifically, the local spatial attention module (LSA): The local spatial attention module helps the model focus on key details in the image, addressing the limitations of the global spatial attention module. With For input, the specific process can be represented as:
[0070] ;
[0071] Here, represents the input feature of the local spatial attention mechanism operation; is a Sigmoid activation function, and AttL represents the local attention operation, represents element-wise multiplication, and LSA represents the local spatial attention module.
[0072] In one specific embodiment, polyps are often difficult to completely separate from surrounding normal tissue, resulting in irregular and blurred edges. This often leads to under-segmentation or over-segmentation in the initial segmentation process. The context-aware repair module is used in the first three layers of the decoder, as shown in FIG. 3(c), which aims to gradually improve these problems through context analysis, thereby improving segmentation accuracy. When humans assess the boundaries of ambiguous objects, they often repeatedly compare uncertain areas with clear areas and analyze from multiple angles to finally determine the boundaries. Inspired by this process, the present application introduces a context exploration mechanism in the predicted foreground and background regions. By using convolution kernels with different receptive fields to evaluate the ambiguous boundaries from multiple angles and cross-verify with the information of the surrounding areas. The context-aware repair module uses high-level predictions and current layer features to perform context exploration. By upsampling and normalizing the high-level predictions, they are combined with the current layer features to generate foreground attention features and background attention features . The specific process can be expressed as:
[0073] ;
[0074] In the formula, represents the generated foreground attention features; represents the upsampling operation, represents the prediction mask of the previous layer; is a Sigmoid activation function, represents element-wise multiplication, represents the current layer features; represents the background attention features.
[0075] In one specific embodiment, the and are input into the context exploration module (CE), which identifies and improves under-segmentation or over-segmentation problems through multi-scale convolution.
[0076] Specifically, as shown in FIG. 3(d), the CE consists of four parallel branches, each of which uses different size convolution kernels (1, 3, 5, 7) and dilated convolution (dilation rate 1, 2, 4, 8) to extract multi-scale features. The output of each layer is combined with the previous layer and spliced in the channel dimension, thereby generating a feature map with rich contextual information. After identifying the under-segmented or over-segmented regions, element-wise operations are used to correct the segmentation errors. For over-segmented regions, subtraction is used to suppress over-segmentation, while for under-segmented regions, addition is used to enhance insufficient segmentation. The process is as follows:
[0077] ;
[0078] where BR represents batch normalization and ReLU, and are learnable scaling parameters.
[0079] In one specific embodiment, in order to supervise the prediction quality of each stage of the decoder output, a multi-stage joint loss function is used. The loss function of this embodiment can be written as:
[0080] ;
[0081] The loss function of each stage is a combination function composed of weighted IoU (Intersection over Union) loss and weighted BCE (Binary Cross Entropy) loss, which can be represented as:
[0082] ;
[0083] where, G is the ground truth of the input training image. The present application evaluates the segmentation performance on five public polyp datasets, Kvasir-SEG, ClinicDB, ColonDB, Endoscene and ETIS, and the evaluation indexes include the average Dice, the average IoU and the mean absolute error (MAE). The average Dice coefficient is used to measure the overlap between the predicted segmentation region and the true label, and the closer the value is to 1, the better the segmentation effect; the average IoU calculates the ratio of the intersection to the union of the predicted segmentation region and the true segmentation region, and the larger the value is, the higher the segmentation accuracy is; and the MAE measures the average error between the predicted result and the true label, and the lower the value is, the more accurate the prediction is. On the Kvasir-SEG dataset, the average Dice, the average IoU and the mean absolute error (MAE) are 0.921, 0.875 and 0.022 respectively; on the ClinicDB dataset, the average Dice, the average IoU and the mean absolute error (MAE) are 0.940, 0.894 and 0.006 respectively; on the ColonDB dataset, the average Dice, the average IoU and the mean absolute error (MAE) are 0.816, 0.733 and 0.028 respectively; on the Endoscene dataset, the average Dice, the average IoU and the mean absolute error (MAE) are 0.911, 0.848 and 0.006 respectively; and on the ETIS dataset, the average Dice, the average IoU and the mean absolute error (MAE) are 0.801, 0.722 and 0.014 respectively.
[0084] In another aspect, referring to Figure 4 The embodiment also discloses a multi-scale polyp segmentation system based on context perception, as shown in the accompanying drawings, which comprises:
[0085] A data acquisition module is configured to acquire a pathological image to be segmented.
[0086] A detection and segmentation module is configured to input the pathological image to be segmented into a pre-constructed multi-scale segmentation model, output a segmentation result, and complete polyp segmentation.
[0087] The multi-scale segmentation model is based on a polyp segmentation network of a U-shaped architecture, and comprises a pyramid visual transformer as an encoder, a multi-scale interaction module as a skip connection, and a spatial attention enhancement module and a context perception repair module as a decoder.
[0088] The multi-scale interaction module performs multi-scale feature interaction processing on the features extracted by the pyramid visual transformer.
[0089] The spatial attention enhancement module learns and extracts important regions in the multi-scale features extracted by fusing the parallel global attention mechanism unit and the local attention mechanism unit.
[0090] The context-aware repair module detects the edge region of the pathological image to be segmented and gradually processes the segmentation boundary.
[0091] The context-aware multi-scale polyp segmentation model combines the advantages of convolutional neural networks and Transformers, better adapts to the characteristics of polyps of different sizes, various shapes and fuzzy boundaries, and thus realizes more accurate segmentation. The pyramid vision transformer is used as an encoder to effectively capture the global information of the image. The multi-scale interaction module used in the skip connection realizes cross learning between features of different receptive fields and enhances the feature expression capability. The decoder first performs preliminary spatial positioning on the features to be restored through the spatial attention enhancement module, and then the context-aware repair module focuses on the boundary region to gradually optimize the accuracy of boundary segmentation.
[0092] The method of the present application can be widely applied to polyp image segmentation in endoscopy and diagnosis of related diseases. By introducing the multi-scale interaction module, the spatial attention enhancement module and the context-aware repair module, the model significantly enhances the fine recognition ability of polyp morphology, which helps to improve the early detection and segmentation accuracy of polyps. This application not only improves the efficiency of medical image analysis, but also provides clinicians with clearer polyp location and boundary information, thereby providing strong support for subsequent treatment decisions and clinical intervention, further improving the prognosis and treatment effect of patients.
[0093] The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the difference from other embodiments. The same or similar parts between the various embodiments can be referred to each other. For the device disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple, and the related parts can be referred to the method part.
[0094] The above description of the disclosed embodiments enables a person skilled in the art to implement or use the present application. Various modifications to the embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A context-aware multi-scale polyp segmentation method, characterized in that, include: Obtain the pathological image to be segmented, input the pathological image to be segmented into a pre-constructed context-aware multi-scale polyp segmentation model, output the segmentation result, and complete the polyp segmentation; The context-aware multi-scale polyp segmentation model is a polyp segmentation network based on a U-shaped architecture, consisting of a pyramid visual transformer as an encoder, a multi-scale interaction module as a jump connection, a spatial attention enhancement module, and a context-aware repair module as a decoder. The pyramid visual transformer extracts features from the input pathological image to be segmented; The multi-scale interaction module performs multi-scale feature interaction processing on the features extracted by the pyramid visual transformer. The spatial attention enhancement module highlights important regions in the extracted multi-scale features by fusing parallel global attention mechanism units and local attention mechanism units. The context-aware repair module detects the edge regions of the pathological image to be segmented and processes the segmentation boundaries step by step. The specific process of the global attention mechanism unit in the spatial attention enhancement module is as follows: ; Among them, the features of the fourth layer after being processed by the multi-scale interaction module It is split into two sub-features along the channel dimension. and , The input features represent the global spatial attention mechanism operation; Softmax represents the normalization operation; Flatten represents flattening the input two-dimensional feature map into a one-dimensional vector. This indicates that convolution is applied to the input feature map to obtain a context mask; GSA represents the Global Spatial Attention Module; AttG represents the Global Attention Operation; This represents matrix multiplication; the first layer of the MLP transforms the input into a higher-dimensional space, expanding it by a factor of 2, and the second layer restores the dimension to match the input.
2. The context-aware multi-scale polyp segmentation method according to claim 1, characterized in that, The pyramid visual transformer extracts features from the input pathological image to be segmented, obtaining four different levels of semantic features. Subsequently, the features obtained from each layer are passed to the multi-scale interaction module of each layer. A multi-scale convolution module is used to achieve cross-learning between different receptive fields, resulting in: ; In the formula, It is a 3×3 convolution. It is a 5×5 convolution. For 1×1 convolution, For multi-scale features, and The features are obtained through parallel operations of 3×3 convolution and 5×5 convolution, respectively.
3. The context-aware multi-scale polyp segmentation method according to claim 2, characterized in that, The multi-scale interaction module performs information exchange between two features and multiplies them with convolutions of receptive fields of 3 and 5 to obtain feature combination. The specific process is expressed as follows: ; In the formula, Features are obtained by using complementary information from different receptive fields. This represents matrix multiplication, `cat` represents concatenation, and CRB includes a 3×3 convolution, ReLU loss, and batch normalization. To be , and Combined with original features Obtain the final output.
4. The context-aware multi-scale polyp segmentation method according to claim 1, characterized in that, The specific process of the local attention mechanism unit in the spatial attention enhancement module is as follows: ; In the formula, The input features representing the local spatial attention mechanism operation; It is the Sigmoid activation function, and AttL represents the local attention operation. This indicates element-wise multiplication, and LSA stands for Local Spatial Attention Module.
5. The context-aware multi-scale polyp segmentation method according to claim 1, characterized in that, According to claim 1, the context-aware multi-scale polyp segmentation method is characterized in that the specific process of the context-aware repair module is expressed as follows: ; In the formula, This represents the generated foreground attention features; Indicates an upsampling operation. This represents the prediction mask of the previous layer; It is the Sigmoid activation function. This indicates element-wise multiplication. Indicates the features of the current layer; This represents background attention features.
6. A context-aware multi-scale polyp segmentation system utilizing the context-aware multi-scale polyp segmentation method according to any one of claims 1-5, characterized in that, include: Data acquisition module: Acquires pathological images to be segmented; Segmentation module: Inputs the pathological image to be segmented into a pre-constructed context-aware multi-scale polyp segmentation model, outputs the segmentation result, and completes polyp segmentation; The context-aware multi-scale polyp segmentation model is a polyp segmentation network based on a U-shaped architecture, consisting of a pyramid visual transformer as an encoder, a multi-scale interaction module as a jump connection, a spatial attention enhancement module, and a context-aware repair module as a decoder. The pyramid visual transformer extracts features from the input pathological image to be segmented; The multi-scale interaction module performs multi-scale feature interaction processing on the features extracted by the pyramid visual transformer. The spatial attention enhancement module highlights important regions in the extracted multi-scale features by fusing parallel global spatial attention mechanism units and local spatial attention mechanism units. The context-aware repair module detects the edge regions of the pathological image to be segmented and processes the segmentation boundaries step by step. The specific process of the global attention mechanism unit in the spatial attention enhancement module is as follows: ; Among them, the features of the fourth layer after being processed by the multi-scale interaction module It is split into two sub-features along the channel dimension. and , The input features represent the global spatial attention mechanism operation; Softmax represents the normalization operation; Flatten represents flattening the input two-dimensional feature map into a one-dimensional vector. This indicates that convolution is applied to the input feature map to obtain a context mask; GSA represents the Global Spatial Attention Module; AttG represents the Global Attention Operation; This represents matrix multiplication; the first layer of the MLP transforms the input into a higher-dimensional space, expanding it by a factor of 2, and the second layer restores the dimension to match the input.
Citation Information
Patent Citations
Deep learning-based skin lesion image segmentation method and device, and storage medium
CN114066904A