Polyp segmentation method and system based on edge refinement attention mechanism
The polyp segmentation method using the edge refinement attention mechanism solves the problems of edge blurring and image artifacts in polyp segmentation by utilizing an encoder, decoder, and edge refiner, achieving highly accurate and complete segmentation results.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-02
- Publication Date
- 2026-04-10
AI Technical Summary
Existing technologies struggle to effectively handle edge blurring and image artifacts, such as speckles and shadow noise, in polyp segmentation, resulting in insufficient segmentation accuracy.
A polyp segmentation method based on edge refinement attention mechanism is adopted. The encoder extracts features, the decoder generates a coarse segmentation map, the edge refiner refines the coarse segmentation map, and the edge refinement attention mechanism optimizes the segmentation result.
This improved the accuracy and completeness of polyp segmentation, generating highly reliable segmentation results.
Smart Images

Figure CN116843707B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of image processing, and particularly relates to a polypus segmentation method and system based on edge refinement attention mechanism. BACKGROUND
[0002] The statements in this section merely provide background information related to the present application and do not necessarily constitute the prior art.
[0003] Colorectal cancer usually originates from small benign polyps, which develop into malignant polyps over time, and this form of cancer accounts for a large proportion of cancer deaths worldwide. Using deep learning models to classify, detect, and segment polyps can potentially automate the workflow of highly skilled clinicians, improve the early detection and characterization of polyps, and thus help reduce mortality. Due to the indistinct edges of polyps and internal and external factors such as speckle and shadow noise, the accuracy of polyp segmentation for early diagnosis of polyps is challenging. In recent years, with the rapid development of deep learning technology, neural network-based methods have gradually become the mainstream method for polyp segmentation. These works are mainly based on convolutional neural networks. Deng-Ping Fan et al. proposed a parallel reverse attention network in “PraNet: Parallel Reverse Attention Network for Polyp Segmentation”, which uses a parallel partial decoder to aggregate features in high layers, and uses a reverse attention module to mine boundary clues. Kim et al. proposed an uncertainty augmented context attention network in “UACANet: Uncertainty Augmented Context Attention for Polyp Segmentation”, which considers the uncertain regions of the saliency map, computes the saliency map in each bottom-up stream prediction module, and propagates it to the next prediction module. In each prediction module, the previously predicted saliency map is used to compute foreground, background, and uncertain region maps, and the feature maps are aggregated into three region maps for each representation. As an alternative to convolutional neural networks in visual recognition, Transformers architecture has recently attracted great attention. Since the Transformers architecture can establish the long-range dependencies necessary for segmentation, many works have also introduced it into medical image segmentation tasks. Ailiang Lin et al. adopted a dual-scale encoder subnetwork based on Swin Transformer in “DS-TransUNet: Dual Swin Transformer U-Net for Medical Image Segmentation” to extract coarse-grained and fine-grained feature representations of different semantic scales. At the same time, a Transformer interaction fusion module was designed to effectively establish global dependencies between features of different scales, thus making full use of the obtained multi-scale feature representations.
[0004] The above method only processes edge information in a global or local perspective, and has the problem of being limited by the edge blur of polyps and internal and external factors such as image artifacts such as speckle and shadow noise, so it is difficult to solve the boundary blur characteristic only by relying on the local nature of the convolutional neural network or the global information capturing ability of the transformer. SUMMARY
[0005] In order to solve the problems of the prior art, the present application provides a polyp segmentation method and system based on an edge refinement attention mechanism; an edge refinement attention is proposed, and the features of the edge blur area are refined using the features of the polyp area with higher reliability. Finally, a complete and accurate polyp segmentation result is generated.
[0006] In a first aspect, the present application provides a polyp segmentation method based on an edge refinement attention mechanism;
[0007] The polyp segmentation method based on the edge refinement attention mechanism comprises:
[0008] obtaining an intestinal endoscopy image to be processed;
[0009] inputting the intestinal endoscopy image to be processed into a trained polyp segmentation model, and outputting a polyp segmentation result;
[0010] The trained polyp segmentation model comprises an encoder, a decoder and an edge refiner connected in sequence; the encoder is used to encode the intestinal endoscopy image and output extracted features; the decoder is used to decode the extracted features and generate a rough segmentation map; and the edge refiner is used to refine the rough segmentation map and generate a refined segmentation map.
[0011] In a second aspect, the present application provides a polyp segmentation system based on an edge refinement attention mechanism;
[0012] The polyp segmentation system based on the edge refinement attention mechanism comprises:
[0013] The acquisition module is configured to obtain an intestinal endoscopy image to be processed;
[0014] The segmentation module is configured to input the intestinal endoscopy image to be processed into a trained polyp segmentation model, and output a polyp segmentation result;
[0015] The trained polyp segmentation model comprises an encoder, a decoder and an edge refiner connected in sequence; the encoder is used to encode the intestinal endoscopy image and output extracted features; the decoder is used to decode the extracted features and generate a rough segmentation map; and the edge refiner is used to refine the rough segmentation map and generate a refined segmentation map.
[0016] In a third aspect, the present application provides an electronic device, comprising:
[0017] a memory for non-transitorily storing computer readable instructions; and
[0018] a processor for running the computer readable instructions,
[0019] wherein the computer readable instructions, when run by the processor, perform the method of the first aspect.
[0020] In a fourth aspect, the present application provides a storage medium, non-transitorily storing computer readable instructions, wherein the non-transitory computer readable instructions, when executed by a computer, perform the instructions of the method of the first aspect.
[0021] In a fifth aspect, the present application provides a computer program product comprising a computer program for performing the method of the first aspect when run on one or more processors.
[0022] Compared with the prior art, the present application has the following beneficial effects:
[0023] The present application extracts features of the enteroscope image through the encoder, decodes the extracted features through the decoder to obtain a rough segmentation map, and performs edge refinement processing on the rough segmentation map through the edge refiner to obtain a polyp segmentation map after edge refinement processing. The edge refiner adopts an edge refinement attention mechanism to optimize the initial rough segmentation result to obtain a segmentation result with high accuracy, completeness and credibility. BRIEF DESCRIPTION OF DRAWINGS
[0024] The drawings constituting a part of the specification of the present application are used to provide a further understanding of the present application, and the illustrative embodiments of the present application and the description thereof are used to explain the present application, and do not constitute an improper limitation on the present application.
[0025] Figure 1 An internal structure diagram of the polyp segmentation model of embodiment one;
[0026] Figure 2 An internal structure diagram of the first edge refinement attention module Refine1 of embodiment one;
[0027] Figure 3 An internal structure diagram of the spatial attention module of embodiment one;
[0028] Figure 4 An internal structure diagram of the channel attention module of embodiment one;
[0029] Figure 5A schematic diagram of an internal structure of the Swin Transformer Block of Embodiment One. DETAILED DESCRIPTION
[0030] It should be noted that the following detailed description is exemplary in nature and is intended to provide further description of the application. Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs.
[0031] It is also to be understood that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting, as the scope of the application will be limited only by the appended claims. Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. Unless otherwise required by context, singular terms shall include pluralities and vice versa. Plural elements can be separated by a hyphenated form of the element name, for example, "multiple components", unless in the context a singular sense is intended. As used herein, the term "or" as used herein, unless otherwise indicated, is intended to cover an inclusive "or" such that, for example, a condition A or B is satisfied by any one of the following: A is true (or satisfied) and B is false (or not satisfied); A is false (or not satisfied) and B is true (or satisfied); and both A and B are true (or satisfied). As used herein, the term "and / or" includes any and all combinations of one or more of the associated listed items. As used herein, the term "wherein" can be replaced by terms such as "where," "whereby," "wherein," "whereat," "whereby," "wherefrom," and "whereunder."
[0032] The embodiments in the application and the features in the embodiments can be combined with each other without conflict.
[0033] All data of the embodiments are obtained on the basis of compliance with laws and regulations and user consent, and legal application of the data.
[0034] Embodiment One
[0035] The embodiment provides a polyp segmentation method based on edge refinement attention mechanism.
[0036] The polyp segmentation method based on edge refinement attention mechanism comprises the following steps.
[0037] S101: Obtain an intestinal endoscopy image to be processed;
[0038] S102: Input the intestinal endoscopy image to be processed into a trained polyp segmentation model, and output a polyp segmentation result;
[0039] The trained polyp segmentation model comprises an encoder, a decoder and an edge refiner connected in sequence.
[0040] The encoder is configured to encode the intestinal endoscopy image and output extracted features.
[0041] The decoder is configured to decode the extracted features and generate a coarse segmentation map.
[0042] The edge refiner is configured to refine the coarse segmentation map and generate a refined segmentation map.
[0043] Further, as shown in Figure 1 The encoder comprises:
[0044] The stage0 module, the first down-sampling module, the stage1 module, the second down-sampling module, the stage2 module, the third down-sampling module and the stage3 module are connected in sequence.
[0045] The input end of the stage0 module is configured to input the enteroscopy image; and the output end of the stage0 module outputs a feature map E0.
[0046] The input end of the stage1 module is configured to input the feature map E0; and the output end of the stage1 module outputs a feature map E1.
[0047] The input end of the stage2 module is configured to input the feature map E1; and the output end of the stage2 module outputs a feature map E2.
[0048] The input end of the stage3 module is configured to input the feature map E2; and the output end of the stage3 module outputs a feature map E3.
[0049] Further, the stage0 module is implemented by a stage1 module in a Swin Transformer network.
[0050] The stage1 module is implemented by a stage2 module in the Swin Transformer network.
[0051] The stage2 module is implemented by a stage3 module in the Swin Transformer network.
[0052] The stage3 module is implemented by a stage4 module in the Swin Transformer network.
[0053] The stage0 module is composed of a fully connected layer, two Swin Transformer Block structures connected in sequence.
[0054] The stage1 module is composed of a Patch Merging unit, two Swin Transformer Block structures connected in sequence.
[0055] The stage2 module is composed of a Patch Merging unit, six Swin Transformer Block structures connected in sequence.
[0056] The stage3 module is composed of a Patch Merging unit, two Swin Transformer Block structures connected in sequence.
[0057] The Swin Transformer Block structure has an internal structure as shown in Figure 5 .
[0058] The Swin Transformer Block structure comprises a first swin transformer unit and a second swin transformer unit connected in sequence.
[0059] The first swin transformer unit comprises a first linear layer LN, a multi-head attention mechanism W-MSA, a first adder, a second linear layer LN, a multi-layer perception MLP and a second adder connected in sequence.
[0060] The second swin transformer unit comprises a third linear layer LN, a multi-head attention mechanism SW-MSA, a third adder, a fourth linear layer LN, a multi-layer perception MLP and a fourth adder connected in sequence; the third linear layer is connected with the second adder.
[0061] As shown in Figure 1 , first, input the original image I ∈ R H×W×3 , we send it into the four stages stage0, stage1, stage2, stage3 of the image encoder E to generate multi-scale features, which can be represented as , where 3 is the number of different scale features. The feature calculation of each layer is as follows:
[0062] E i = tage i (Down(E i-1 ))
[0063] Down(·) represents a downsampling operation.
[0064] Further, the decoder comprises:
[0065] a first upsampling module, a first adder, a second upsampling module, a second adder, a third upsampling module and a third adder connected in sequence.
[0066] The input end of the first upsampling module is the feature map E3; the feature map E3 is the intermediate layer feature D3; the first upsampling module processes the feature map E3 to obtain the feature map E3';
[0067] The feature map E2 and the feature map E3' are input into a first adder, and the first adder outputs an intermediate layer feature D2; a second up-sampling module processes the intermediate layer feature D2 to obtain an intermediate layer feature D2';
[0068] The feature map E1 and the intermediate layer feature D2' are input into a second adder, and the second adder outputs an intermediate layer feature D1; a third up-sampling module processes the intermediate layer feature D1 to obtain an intermediate layer feature D1';
[0069] The feature map E0 and the intermediate layer feature D1' are input into a third adder, and the third adder outputs an intermediate layer feature D0; the intermediate layer feature D0 is a coarse segmentation map.
[0070] It should be understood that the multi-scale features generated in the encoding process of the encoder are input into a decoder D to generate an initial coarse segmentation result P through decoding.
[0071] The intermediate layer features generated in the decoding process are represented as The calculation method in the decoding process is as follows:
[0072] D i =p(E i-1 )+ i
[0073] Wherein, Up(·) represents an up-sampling operation.
[0074] Further, the edge refiner comprises:
[0075] A first edge refinement attention module Refine1, a second edge refinement attention module Refine2, a third edge refinement attention module Refine3, a fourth edge refinement attention module Refine4, a fourth adder, a fifth adder and a sixth adder;
[0076] The coarse segmentation map is dilated to obtain a dilated map; the coarse segmentation map is eroded to obtain an eroded map; the eroded map is taken as a core region map; the dilated map and the eroded map are subtracted to obtain an edge region map;
[0077] The core region map, the edge region map and the intermediate layer feature D0 are input into the first edge refinement attention module Refine1, and a refined segmentation map F1 is output;
[0078] The core region map, the edge region map and the intermediate layer feature D1 are input into the second edge refinement attention module Refine2, and a refined segmentation map F2 is output;
[0079] The core region map, edge region map, and intermediate layer feature D2 are all input into the third edge refinement attention module Refine3, which outputs a refined segmentation map F3.
[0080] The core region map, edge region map, and intermediate layer feature D3 are all input into the fourth edge refinement attention module Refine4, which outputs a refined segmentation map F4; the refined segmentation map F4 is then upsampled to obtain a refined segmentation map F4'.
[0081] The refined segmentation image F4' and the refined segmentation image F3 are summed to obtain the refined segmentation image F3'; the refined segmentation image F3' is then upsampled to obtain the refined segmentation image F3”.
[0082] The refined segmentation image F3” is summed with the refined segmentation image F2 to obtain the refined segmentation image F2'; the refined segmentation image F2' is then upsampled to obtain the refined segmentation image F2”.
[0083] Summing the refined segmentation image F2” with the refined segmentation image F1 yields the refined segmentation image F1'; the refined segmentation image F1' is the final refined segmentation image.
[0084] It should be understood that, as Figure 2 As shown, the edge refinement attention calculation process first uses image morphology dilation and erosion operations to perform multiple erosion and dilation operations on the coarse segmentation result P, resulting in a segmentation result DM that shrinks the foreground target and a segmentation result EM that enlarges the foreground target. Then, subtracting DM from EM yields the edge regions with lower confidence, while the segmentation result DM that shrinks the foreground target represents the core region with higher confidence. Finally, the edge regions and core regions are used to refine the features at corresponding positions in the generated intermediate layer, generating the final refined segmentation result.
[0085] The intermediate layer features generated during the decoding process are represented as... The coarse segmentation result P is fed into the edge refiner for further refinement. The core component of the edge refiner is the edge refinement attention module, which is divided into channel attention and spatial attention. For example... Figure 2 As shown, in the edge refinement attention calculation process, the coarse segmentation result P is first subjected to multiple erosion and dilation operations using image morphology, resulting in a segmentation result DM that shrinks the foreground target and a segmentation result EM that enlarges the foreground target. Then, subtracting DM from EM yields the edge regions with lower confidence, while the segmentation result DM that shrinks the foreground target represents the core regions with higher confidence. Finally, the generated intermediate layer features are represented using the edge and core regions. The process is refined to generate the final refined segmentation result.
[0086] Further, the first edge refinement attention module Refine1, the second edge refinement attention module Refine2, the third edge refinement attention module Refine3, and the fourth edge refinement attention module Refine4 have the same internal structure; the first edge refinement attention module Refine1 includes a channel attention module and a spatial attention module connected in parallel.
[0087] Further, as shown in Figure 2 the first edge refinement attention module Refine1 includes:
[0088] The core region graph, the edge region graph, and the intermediate layer feature D0 are all input into the channel attention module, and the channel attention result is output;
[0089] The core region graph, the edge region graph, and the intermediate layer feature D0 are all input into the spatial attention module, and the spatial attention result is output;
[0090] The channel attention result and the spatial attention result are summed to obtain the refined segmentation graph F1.
[0091] The first edge refinement attention module Refine1 adopts a self-attention mechanism Multi-Head Self-Attention, abbreviated as MSA, which can be represented as:
[0092]
[0093] Further, as shown in Figure 3 the core region graph, the edge region graph, and the intermediate layer feature D0 are all input into the spatial attention module, and the spatial attention result is output, which specifically includes:
[0094] First, the intermediate layer feature is multiplied by the mask of the core region graph to obtain the feature of the core region;
[0095] The intermediate layer feature is multiplied by the mask of the edge region graph to obtain the feature of the edge region;
[0096] Then, the features outside the mask region are removed to obtain the denoised core region feature and the denoised edge region feature;
[0097] Then, the denoised core region feature is used as the spatial feature K HSF and V HSF , the denoised edge region feature is used as the spatial feature Q LSF , and the spatial attention F-SA(Q LSF , K HSF , V HSF ) is calculated, and the calculation process is defined as:
[0098]
[0099] Where, α SF Indicates to The normalization factor used in the normalization operation (to make the value of the product between 0 and 1) of the product, where T represents the normalization factor for tensor Q. LSF Transpose (e.g., K) HSF The dimension is C*HW, Q LSF For a matrix multiplication operation between two objects of dimension C*HW, Q needs to be... LSF A transpose operation is performed to transform C*HW into HW*C before matrix multiplication can be performed: (HW*C)*(C*HW) = HW*HW, and the result of the multiplication is a tensor of HW*HW.
[0100] Spatial self-attention in edge refinement attention mechanism is a self-attention mechanism that is computed in the spatial dimension.
[0101] Furthermore, such as Figure 4 As shown, the process of inputting the core region map, edge region map, and intermediate layer feature D0 into the channel attention module and outputting the channel attention result specifically includes:
[0102] First, the features of the intermediate layer are multiplied with the mask of the core region to obtain the features of the core region;
[0103] By multiplying the intermediate layer features with the mask of the edge region, the features of the edge region are obtained;
[0104] Then, the features of the core region are used as channel features K. HCF and V HCF The features of the edge region are used as channel features Q. LCF Then calculate the channel attention F-CA(Q) LCF ,K HCF V HCF The calculation process is defined as follows:
[0105]
[0106] Where, α CF Indicates to The normalization factor used in the normalization operation (to make the value of the product between 0 and 1) of the product, where T represents the normalization factor for tensor Q. LCF Perform a transpose operation.
[0107] Channel self-attention in edge refinement attention mechanism is a self-attention mechanism that is computed on the channel dimension.
[0108] Further, the trained polyp segmentation model, the training process comprises:
[0109] A training set, a test set and a validation set are constructed; wherein the training set, the test set and the validation set comprise colonoscopy images with known polyp segmentation results;
[0110] The training set is input into the polyp segmentation model, and the model is trained, and when the loss function value of the model stops decreasing, the training is stopped;
[0111] After training, the accuracy of the model is verified by using the validation set;
[0112] After verification, the stability of the model is tested by using the test set;
[0113] The model that passes the verification and the test is used as the trained polyp segmentation model.
[0114] Embodiment two
[0115] The embodiment provides a polyp segmentation system based on an edge refinement attention mechanism;
[0116] The polyp segmentation system based on the edge refinement attention mechanism comprises:
[0117] An acquisition module configured to acquire a colonoscopy image to be processed;
[0118] A segmentation module configured to input the colonoscopy image to be processed into the trained polyp segmentation model and output a polyp segmentation result;
[0119] The trained polyp segmentation model comprises an encoder, a decoder and an edge refiner connected in sequence; the encoder is configured to encode the colonoscopy image and output extracted features; the decoder is configured to decode the extracted features and generate a rough segmentation map; and the edge refiner is configured to refine the rough segmentation map and generate a refined segmentation map.
[0120] It should be noted that the acquisition module and the segmentation module correspond to steps S101 to S102 in Embodiment One, and the above modules have the same examples and application scenarios as the corresponding steps, but are not limited to the content disclosed in Embodiment One. It should be noted that the above modules as part of the system can be executed in a computer system such as a set of computer executable instructions.
[0121] The description of each embodiment in the above embodiments has its own emphasis, and the parts not described in detail in a certain embodiment can refer to the related description of other embodiments.
[0122] The proposed system can be implemented in other ways. For example, the system embodiments described above are only illustrative, and the division of the above modules is only a logical functional division. In actual implementation, there can be another division manner, for example, a plurality of modules can be combined or integrated into another system, or some features can be ignored or not executed.
[0123] Embodiment three
[0124] The embodiment also provides an electronic device, including one or more processors, one or more memories, and one or more computer programs; wherein the processor is connected with the memory, the one or more computer programs are stored in the memory, and when the electronic device is running, the processor executes the one or more computer programs stored in the memory, so that the electronic device executes the method in the above embodiment one.
[0125] It should be understood that, in the embodiment, the processor can be a central processing unit CPU, and the processor can also be other general-purpose processors, digital signal processors DSP, application-specific integrated circuits ASIC, ready programmable gate arrays FPGA or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor.
[0126] The memory can include read-only memory and random access memory, and provide instructions and data for the processor, and a part of the memory can also include non-volatile random access memory. For example, the memory can also store device type information.
[0127] In the implementation process, each step of the above method can be completed by integrated logic circuits of hardware in the processor or instructions in the form of software.
[0128] The method in the embodiment one can be directly embodied as hardware processor execution completion, or combined execution completion by hardware and software modules in the processor. The software modules can be located in random access memory, flash memory, read-only memory, programmable read-only memory, or electrically erasable programmable memory, registers, and other mature storage media in the field. The storage medium is located in the memory, and the processor reads the information in the memory and combines the hardware to complete the steps of the above method. To avoid repetition, it will not be described in detail here.
[0129] Those skilled in the art can understand that the units and algorithm steps of the examples described in combination with the embodiments can be realized in electronic hardware or in combination of computer software and electronic hardware. Whether the functions are realized in hardware or software manner depends on the specific application and design constraints of the technical solutions. The skilled person can use different methods to realize the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0130] Embodiment Four
[0131] The embodiment also provides a computer readable storage medium for storing computer instructions, which, when executed by a processor, complete the method described in Embodiment One.
[0132] The above only describes the preferred embodiments of the present application and is not intended to limit the present application. For those skilled in the art, the present application can have various modifications and changes. Any modification, equivalent replacement, improvement, etc. within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A polyp segmentation method based on edge refinement attention mechanism, characterized in that, The method comprises: acquiring an intestinal endoscopy image to be processed; inputting the intestinal endoscopy image to be processed into a trained polyp segmentation model to output a polyp segmentation result; wherein the trained polyp segmentation model comprises an encoder, a decoder and an edge refiner connected in sequence; the encoder is configured to encode the intestinal endoscopy image to output extracted features; the decoder is configured to decode the extracted features to generate a coarse segmentation map; and the edge refiner is configured to refine the coarse segmentation map to generate a refined segmentation map; the edge refiner comprises: a first edge refinement attention module Refine1, a second edge refinement attention module Refine2, a third edge refinement attention module Refine3, a fourth edge refinement attention module Refine4, a fourth adder, a fifth adder and a sixth adder; performing dilation processing on the coarse segmentation map to obtain a dilated map; performing erosion processing on the coarse segmentation map to obtain an eroded map; taking the eroded map as a core region map; and performing difference processing on the dilated map and the eroded map to obtain an edge region map; inputting the core region map, the edge region map and an intermediate layer feature D0 into the first edge refinement attention module Refine1 to output a refined segmentation map F1; inputting the core region map, the edge region map and an intermediate layer feature D1 into the second edge refinement attention module Refine2 to output a refined segmentation map F2; inputting the core region map, the edge region map and an intermediate layer feature D2 into the third edge refinement attention module Refine3 to output a refined segmentation map F3; inputting the core region map, the edge region map and an intermediate layer feature D3 into the fourth edge refinement attention module Refine4 to output a refined segmentation map F4; and performing up-sampling processing on the refined segmentation map F4 to obtain a refined segmentation map F4'; performing summation on the refined segmentation map F4' and the refined segmentation map F3 to obtain a refined segmentation map F3'; and performing up-sampling processing on the refined segmentation map F3' to obtain a refined segmentation map F3''; performing summation on the refined segmentation map F3'' and the refined segmentation map F2 to obtain a refined segmentation map F2'; and performing up-sampling processing on the refined segmentation map F2' to obtain a refined segmentation map F2''; performing summation on the refined segmentation map F2'' and the refined segmentation map F1 to obtain a refined segmentation map F1'; and the refined segmentation map F1' is a final refined segmentation map.
2. The polyp segmentation method based on edge refinement attention mechanism according to claim 1, characterized in that, The encoder comprises: a stage0 module, a first down-sampling module, a stage1 module, a second down-sampling module, a stage2 module, a third down-sampling module and a stage3 module connected in sequence; an input end of the stage0 module is configured to input the intestinal endoscopy image; and an output end of the stage0 module outputs a feature map E0; an input end of the stage1 module is configured to input the feature map E0; and an output end of the stage1 module outputs a feature map E1; an input end of the stage2 module is configured to input the feature map E1; and an output end of the stage2 module outputs a feature map E2; An input end of the stage3 module is configured to input the feature map E2; and an output end of the stage3 module is configured to output a feature map E3. 3.The polyp segmentation method based on edge refinement attention mechanism according to claim 1, characterized in that, The decoder comprises: a first upsampling module, a first adder, a second upsampling module, a second adder, a third upsampling module and a third adder connected in sequence; an input end of the first upsampling module is configured to input the feature map E3; the feature map E3 is an intermediate layer feature D3; the first upsampling module processes the feature map E3 to obtain a feature map E3'; the feature map E2 and the feature map E3' are input into the first adder, and the first adder outputs an intermediate layer feature D2; the second upsampling module processes the intermediate layer feature D2 to obtain an intermediate layer feature D2'; the feature map E1 and the intermediate layer feature D2' are input into the second adder, and the second adder outputs an intermediate layer feature D1; the third upsampling module processes the intermediate layer feature D1 to obtain an intermediate layer feature D1'; the feature map E0 and the intermediate layer feature D1' are input into the third adder, and the third adder outputs an intermediate layer feature D0; the intermediate layer feature D0 is a coarse segmentation map. 4.The polyp segmentation method based on edge refinement attention mechanism according to claim 1, characterized in that, The first edge refinement attention module Refine1 comprises: the core region map, the edge region map and the intermediate layer feature D0 are input into a channel attention module to output a channel attention result; the core region map, the edge region map and the intermediate layer feature D0 are input into a spatial attention module to output a spatial attention result; the channel attention result and the spatial attention result are summed to obtain a refined segmentation map F1. 5.The polyp segmentation method based on edge refinement attention mechanism according to claim 4, characterized in that, The core region map, the edge region map and the intermediate layer feature D0 are input into the spatial attention module to output the spatial attention result, and specifically comprising: first, the intermediate layer feature is multiplied by a mask of the core region map to obtain a feature of the core region; the intermediate layer feature is multiplied by a mask of the edge region map to obtain a feature of the edge region; then, features outside the mask region are removed to obtain a denoised core region feature and a denoised edge region feature; Then, the de-noised core region feature is used as the spatial feature and , the de-noised edge region feature is used as the spatial feature , and the spatial attention is calculated, and the calculation process is defined as: wherein, denotes a normalization factor in the process of normalizing the result of the product, denotes a normalization factor in the process of normalizing the result of the product, denotes a transposition of the tensor denotes a transposition of the tensor 6.The polyp segmentation method based on edge refinement attention mechanism according to claim 4, characterized in that, The core region map, the edge region map and the intermediate layer feature D0 are input into the channel attention module to output the channel attention result, and specifically comprising: first, the intermediate layer feature is multiplied by a mask of the core region to obtain a feature of the core region; the intermediate layer feature is multiplied by a mask of the edge region to obtain a feature of the edge region; Then, the features of the core region are used as channel features and the features of the edge region are used as channel features and then the channel attention is calculated The calculation process is defined as: wherein, denotes a normalization factor, denotes transposing the tensor denotes a transposition operation.
7. A polyp segmentation system based on edge-refined attention mechanism, characterized in that, comprising: an acquisition module configured to acquire an intestinal endoscopy image to be processed; a segmentation module configured to input the intestinal endoscopy image to be processed into a trained polyp segmentation model to output a polyp segmentation result; wherein the trained polyp segmentation model comprises an encoder, a decoder and an edge refiner connected in sequence; the encoder is configured to encode the intestinal endoscopy image to output extracted features; the decoder is configured to decode the extracted features to generate a coarse segmentation map; and the edge refiner is configured to refine the coarse segmentation map to generate a refined segmentation map; the edge refiner comprises: The first edge refinement attention module Refine1, the second edge refinement attention module Refine2, the third edge refinement attention module Refine3, the fourth edge refinement attention module Refine4, the fourth adder, the fifth adder, and the sixth adder; The rough segmentation map is dilated to obtain a dilated map, and the rough segmentation map is eroded to obtain an eroded map; the eroded map is taken as a core region map; and the dilated map and the eroded map are subtracted to obtain an edge region map; The core region map, the edge region map, and the intermediate layer feature D0 are all input into the first edge refinement attention module Refine1, and a refined segmentation map F1 is output; The core region map, the edge region map, and the intermediate layer feature D1 are all input into the second edge refinement attention module Refine2, and a refined segmentation map F2 is output; The core region map, the edge region map, and the intermediate layer feature D2 are all input into the third edge refinement attention module Refine3, and a refined segmentation map F3 is output; The core region map, the edge region map, and the intermediate layer feature D3 are all input into the fourth edge refinement attention module Refine4, and a refined segmentation map F4 is output; and the refined segmentation map F4 is up-sampled to obtain a refined segmentation map F4'; The refined segmentation map F4' and the refined segmentation map F3 are summed to obtain a refined segmentation map F3'; the refined segmentation map F3' is up-sampled to obtain a refined segmentation map F3''; The refined segmentation map F3'' and the refined segmentation map F2 are summed to obtain a refined segmentation map F2'; the refined segmentation map F2' is up-sampled to obtain a refined segmentation map F2''; The refined segmentation map F2'' and the refined segmentation map F1 are summed to obtain a refined segmentation map F1'; and the refined segmentation map F1' is a final refined segmentation map. 8.An electronic device, comprising: a memory configured to non-transitorily store computer-readable instructions; and a processor configured to execute the computer-readable instructions, wherein the computer-readable instructions, when executed by the processor, perform the method of any one of claims 1-7.
9. A storage medium characterized by, non-transitorily storing computer-readable instructions, wherein the non-transitory computer-readable instructions, when executed by a computer, perform the method of any one of claims 1-7.
Citation Information
Patent Citations
Remote sensing image lightweight semantic segmentation method based on edge decoupling
CN113159051A
Intestinal polyp boundary segmentation method based on sparse connection and global feature enhancement
CN115439495A