A polyp segmentation method and system based on boundary constraints
By introducing the boundary feature extraction module and attention mechanism into the polyp segmentation network, the problem of insufficient polyp segmentation accuracy in the existing technology is solved, and accurate segmentation of polyps of different shapes, colors, and sizes is achieved, as well as rich capture of detailed information.
Patent Information
- Application Number
- CN202311662571.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-05
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2043-12-05
AI Technical Summary
Existing polyp segmentation algorithms based on deep learning cannot accurately segment polyps of different shapes, colors, and sizes, and due to the loss of detail information due to continuous downsampling operations, they cannot effectively capture polyp image boundary details.
The polyp segmentation method based on boundary constraints is adopted, and the network is constructed by introducing the boundary feature extraction module. It combines the Res2Net-50 backbone network, mutual optimization module, convolution attention module and output module to perform feature mapping, optimization and edge feature extraction on polyp images. and spatial attention feature extraction, fusion processing to improve segmentation accuracy.
It achieves accurate segmentation of polyps of different shapes, colors, and sizes, enriches the detailed information of polyp images, improves the ability to capture polyp image boundary details, and enhances the robustness of the segmentation network and the expression of detailed information.
Smart Images

Figure CN117830226B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image recognition segmentation processing, and in particular to a polyp segmentation method and system based on boundary constraints. Background Art
[0002] Currently, colonoscopy is one of the most common methods for detecting polyps. However, due to the heavy workload of doctors and limited resources, the time for colonoscopy is often short, resulting in a high rate of missed polyps, which leads to failure to detect the presence of polyps in time and increases the risk of colorectal cancer in patients. Although the current polyp segmentation algorithm based on machine learning avoids traditional manual detection, it relies on manual feature extraction, resulting in a high missed detection rate. The current polyp detection technology based on deep learning methods can learn features end-to-end and complete segmentation, but due to the loss of detailed information caused by continuous downsampling operations and insufficient representation of polyp boundaries, the existing polyp segmentation algorithm based on deep learning is usually unable to accurately segment polyps of different shapes, colors, and sizes. Summary of the invention
[0003] In order to solve the above technical problems, the purpose of the present invention is to provide a polyp segmentation method and system based on boundary constraints, which can accurately segment polyps of different shapes, colors and sizes by capturing the boundary details of polyp images.
[0004] The first technical solution adopted by the present invention is: a polyp segmentation method based on boundary constraints, comprising the following steps:
[0005] Acquire a polyp image and perform data preprocessing to obtain a preprocessed polyp image;
[0006] Introduce the boundary feature extraction module and construct a polyp segmentation network based on boundary constraints;
[0007] The preprocessed polyp image is subjected to recognition and segmentation processing by the polyp segmentation network based on boundary constraints to obtain a segmented polyp image, wherein the segmented polyp image includes a plurality of polyp segmentation images.
[0008] Furthermore, the step of acquiring the polyp image and performing data preprocessing to obtain the preprocessed polyp image specifically includes:
[0009] Acquire images of polyps;
[0010] Performing de-reflection processing on the polyp image to obtain a de-reflected polyp image;
[0011] Data enhancement processing is performed on the dereflected polyp image to obtain a preprocessed polyp image.
[0012] Furthermore, the boundary constraint-based polyp segmentation network includes several Res2Net-50 backbone network modules, several mutual optimization modules, several convolutional attention modules, boundary feature extraction modules and several output modules. The first output ends of several Res2Net-50 backbone network modules are connected to the input ends of several mutual optimization modules, the second output end of the first Res2Net-50 backbone network module is connected to the input end of the boundary feature extraction module, the output ends of several mutual optimization modules and the output ends of the boundary feature extraction module are respectively connected to the input ends of several convolutional attention modules, and the output ends of several convolutional attention modules are connected to the input ends of several output modules.
[0013] Furthermore, the step of performing recognition and segmentation processing on the preprocessed polyp image by the polyp segmentation network based on boundary constraints to obtain a segmented polyp image specifically includes:
[0014] Inputting the preprocessed polyp image into the boundary constraint-based polyp segmentation network;
[0015] Based on the Res2Net-50 backbone network module, feature mapping is performed on the preprocessed polyp image to obtain a polyp feature image;
[0016] Based on the mutual optimization module, the polyp feature image is subjected to feature optimization processing to obtain a mutually optimized polyp feature image;
[0017] Based on the boundary feature extraction module, edge feature extraction processing is performed on the polyp feature image to obtain a boundary polyp feature image and a boundary polyp prediction image;
[0018] Performing feature fusion processing on the boundary polyp feature image and the mutually optimized polyp feature image to obtain a polyp feature image with boundary feature information;
[0019] Based on the convolutional attention module, a spatial attention feature extraction process is performed on the polyp feature image with boundary feature information to obtain a polyp attention feature image with boundary feature information;
[0020] Fusing the polyp attention feature image with boundary feature information with the boundary polyp prediction image to obtain a fused boundary polyp attention feature image;
[0021] Based on the output module, feature extraction processing is performed on the fused boundary polyp attention feature image to obtain a segmented polyp image.
[0022] Further, the step of performing feature optimization processing on the polyp feature image based on the mutual optimization module to obtain a mutually optimized polyp feature image specifically includes:
[0023] Inputting the polyp feature image into the mutual optimization module, the mutual optimization module includes a first convolution layer, a first batch of normalization layers, a first ReLU activation function, an upsampling layer and a downsampling layer;
[0024] Based on the first convolution layer, convolution processing is performed on the polyp feature image to obtain a convolved polyp feature image;
[0025] Based on the first batch of normalization layers, batch normalization processing is performed on the convolved polyp feature image to obtain a batch normalized polyp feature image;
[0026] Based on the first ReLU activation function, performing nonlinear mapping processing on the batch-normalized polyp feature image to obtain an activated polyp feature image;
[0027] Based on the upsampling layer, upsampling the activated polyp feature image to obtain an upsampled polyp feature image;
[0028] Based on the downsampling layer, the upsampled polyp feature image is downsampled to obtain a mutually optimized polyp feature image.
[0029] Further, the step of performing edge feature extraction processing on the polyp feature image based on the boundary feature extraction module to obtain a boundary polyp feature image and a boundary polyp prediction image specifically includes:
[0030] Inputting the polyp feature image into the boundary feature extraction module, the boundary feature extraction module includes a first structure first branch convolution layer, a first structure second branch convolution layer, a second structure first branch convolution layer, a second structure second branch convolution layer, a third structure first branch convolution layer and a third structure second branch convolution layer;
[0031] Based on the first branch convolution layer of the first structure, convolution processing is performed on the polyp feature image to obtain a first horizontal axis polyp feature image;
[0032] Based on the second branch convolution layer of the first structure, convolution processing is performed on the polyp feature image to obtain a first longitudinal polyp feature image;
[0033] Fusing the first transverse-axis polyp characteristic image with the first longitudinal-axis polyp characteristic image to obtain a first fused polyp characteristic image;
[0034] Based on the first branch convolution layer of the second structure, convolution processing is performed on the first fused polyp feature image to obtain a second horizontal axis polyp feature image;
[0035] Based on the second branch convolution layer of the second structure, convolution processing is performed on the first fused polyp feature image to obtain a second longitudinal axis polyp feature image;
[0036] Fusing the second transverse-axis polyp characteristic image with the second longitudinal-axis polyp characteristic image to obtain a second fused polyp characteristic image;
[0037] Based on the first branch convolution layer of the third structure, convolution processing is performed on the second fused polyp feature image to obtain a third horizontal axis polyp feature image;
[0038] Based on the second branch convolution layer of the third structure, convolution processing is performed on the second fused polyp feature image to obtain a third longitudinal axis polyp feature image;
[0039] The third horizontal axis polyp feature image and the third vertical axis polyp feature image are fused to obtain a third fused polyp feature image, wherein the third fused polyp feature image includes a boundary polyp feature image and a boundary polyp prediction image.
[0040] Further, the step of performing spatial attention feature extraction processing on the polyp feature image with boundary feature information based on the convolutional attention module to obtain the polyp attention feature image with boundary feature information specifically includes:
[0041] Inputting the polyp feature image with boundary feature information into the convolutional attention module, wherein the convolutional attention module includes a channel attention submodule and a spatial attention submodule;
[0042] Based on the channel attention submodule, a channel attention extraction process is performed on the polyp feature image with boundary feature information to obtain a polyp channel attention feature image with boundary feature information;
[0043] Performing element-by-element multiplication processing on the polyp channel attention feature image with boundary feature information and the polyp feature image with boundary feature information to obtain a preliminary polyp attention feature image with boundary feature information;
[0044] Based on the spatial attention submodule, performing spatial attention extraction processing on the preliminary polyp attention feature image with boundary feature information to obtain a polyp spatial attention feature image with boundary feature information;
[0045] The preliminary polyp attention feature image with boundary feature information is multiplied element by element with the polyp spatial attention feature image with boundary feature information to obtain a polyp attention feature image with boundary feature information.
[0046] Further, the step of performing feature extraction processing on the fused boundary polyp attention feature image based on the output module to obtain a segmented polyp image specifically includes:
[0047] Inputting the fused border polyp attention feature image into the output module, wherein the output module includes a second convolutional layer, a second batch normalization layer and a second ReLU activation function;
[0048] Based on the second convolutional layer, convolution processing is performed on the fused boundary polyp attention feature image to obtain a convolved boundary polyp attention feature image;
[0049] Based on the second batch normalization layer, performing batch normalization processing on the convolved boundary polyp attention feature image to obtain a batch normalized boundary polyp attention feature image;
[0050] Based on the second ReLU activation function, feature mapping processing is performed on the batch-normalized boundary polyp attention feature image to obtain a segmented polyp image.
[0051] Furthermore, the loss function of the boundary-constrained polyp segmentation network includes a weighted binary cross entropy loss function, a dice loss function, and a consistency enhancement loss function.
[0052] The second technical solution adopted by the present invention is: a polyp segmentation system based on boundary constraints, comprising:
[0053] A preprocessing module, used for acquiring a polyp image and performing data preprocessing to obtain a preprocessed polyp image;
[0054] A construction module is used to introduce a boundary feature extraction module and construct a polyp segmentation network based on boundary constraints;
[0055] The segmentation module is used to perform recognition and segmentation processing on the pre-processed polyp image through the polyp segmentation network based on boundary constraints to obtain a segmented polyp image, and the segmented polyp image includes a plurality of polyp segmentation images.
[0056] The beneficial effects of the method and system of the present invention are as follows: the present invention acquires polyp images and performs data preprocessing, and further introduces a boundary feature extraction module as an independent branch to construct a polyp segmentation network based on boundary constraints, performs recognition and segmentation processing on the preprocessed polyp images, and performs feature extraction and fusion processing on the polyp images from the horizontal and vertical axis directions through the boundary feature extraction module, thereby improving the capture of polyp image boundary details by the polyp segmentation network, enriching the detailed information of the polyp images, and being able to achieve accurate segmentation of polyps of different shapes, colors, and sizes. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] Figure 1 is a flow chart of steps of a polyp segmentation method based on boundary constraints according to an embodiment of the present invention;
[0058] Figure 2 is a structural block diagram of a polyp segmentation system based on boundary constraints according to an embodiment of the present invention;
[0059] Figure 3 is a schematic diagram of the structure of a polyp segmentation network based on boundary constraints in a specific embodiment of the present invention;
[0060] Figure 4 It is a structural schematic diagram of a boundary feature extraction module in a specific embodiment of the present invention;
[0061] Figure 5 It is a schematic diagram of the result output of the polyp segmentation network with boundary constraints according to a specific embodiment of the present invention.
[0062] Figure numerals: 1. Res2Net-50 backbone network module; 2. Mutual optimization module; 3. Boundary feature extraction module; 4. Convolutional attention module; 5. Output module. DETAILED DESCRIPTION
[0063] The present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. The step numbers in the following embodiments are only provided for the convenience of explanation and description, and the order between the steps is not limited in any way. The execution order of each step in the embodiment can be adaptively adjusted according to the understanding of those skilled in the art.
[0064] First, the boundary constraint-based polyp segmentation network constructed in this paper is implemented based on Pytorch, and both training and testing data are performed on an NVIDIA RTX 2080Ti GPU. Res2Net-50 is used to initialize the parameters of the network backbone, while the rest of the network is initialized using a random initialization strategy. The size of all input images is adjusted to 352×352, and the number of channels in the middle layer of the network is 64. The Adam optimization algorithm is used to optimize the parameters of the entire network, and the learning rate is set to 1×10-4 ,The final output is the network segmentation result with high-level semantic information and minimal detail loss.
[0065] Reference Figure 1 The present invention provides a polyp segmentation method based on boundary constraints, the method comprising the following steps:
[0066] S1, acquiring a polyp image and performing data preprocessing to obtain a preprocessed polyp image;
[0067] Specifically, a polyp image is acquired; a de-reflection process is performed on the polyp image to obtain a de-reflection polyp image; and a data enhancement process is performed on the de-reflection polyp image to obtain a pre-processed polyp image.
[0068] In this embodiment, the polyp image is first de-reflected to eliminate the influence of the highlight part of the polyp image on the network, and then data enhancement methods such as random inversion, random cropping, and image scaling are used.
[0069] S2, introduce the boundary feature extraction module and build a polyp segmentation network based on boundary constraints;
[0070] Specifically, Figure 3 As shown, the polyp segmentation network based on boundary constraints includes several Res2Net-50 backbone network modules 1, several mutual optimization modules 2, several convolutional attention modules 4, boundary feature extraction modules 3 and several output modules 5, the first output ends of the several Res2Net-50 backbone network modules are connected to the input ends of the several mutual optimization modules, the second output end of the first Res2Net-50 backbone network module is connected to the input end of the boundary feature extraction module, the output ends of the several mutual optimization modules and the output ends of the boundary feature extraction module are respectively connected to the input ends of the several convolutional attention modules, and the output ends of the several convolutional attention modules are connected to the input ends of the several output modules.
[0071] It should be noted that the Res2Net-50 backbone network module in the embodiment of the present invention has a small receptive field, a large resolution, and low-level features containing a large amount of noise, which requires a lot of calculations. Therefore, only the features of the last four layers are used, i.e., corresponding to Figure 3 Therefore, the above several values in the specific embodiment of the present invention are 4.
[0072] S3. Perform recognition and segmentation processing on the preprocessed polyp image through a polyp segmentation network based on boundary constraints to obtain a segmented polyp image, which includes a plurality of polyp segmentation images.
[0073] S31, inputting the preprocessed polyp image into a polyp segmentation network based on boundary constraints;
[0074] S32, based on the Res2Net-50 backbone network module, performing feature mapping processing on the preprocessed polyp image to obtain a polyp feature image;
[0075] S33, performing feature optimization processing on the polyp feature image based on the mutual optimization module to obtain a mutually optimized polyp feature image;
[0076] Specifically, the polyp feature image is input into a mutual optimization module, which includes a first convolutional layer, a first normalization layer, a first ReLU activation function, an upsampling layer, and a downsampling layer;
[0077] Furthermore, based on the first convolutional layer, the polyp feature image is convolved to obtain a convolved polyp feature image; based on the first normalization layer, the convolved polyp feature image is batch normalized to obtain a batch normalized polyp feature image; based on the first ReLU activation function, the batch normalized polyp feature image is nonlinearly mapped to obtain an activated polyp feature image; based on the upsampling layer, the activated polyp feature image is upsampled to obtain an upsampled polyp feature image; based on the downsampling layer, the upsampled polyp feature image is downsampled to obtain a mutually optimized polyp feature image.
[0078] In this embodiment, OOM is a mutual optimization module, which mainly includes convolution layer, BN (batchNormalization, BN) layer, ReLU activation function, upsampling and downsampling operations. For each layer, the convolution layer, BN layer and ReLU layer are first used for further feature extraction, and then the feature map size of the remaining three layers is upsampled / downsampled to the same size as the current layer, and then the features are fused through the Concat operation, and finally a mutually optimized feature map is obtained, which contains both rich detail information and high-level semantic information.
[0079] S34, performing edge feature extraction processing on the polyp feature image based on the boundary feature extraction module to obtain a boundary polyp feature image and a boundary polyp prediction image;
[0080] Specifically, the polyp feature image is input into a boundary feature extraction module, which includes a first structure first branch convolution layer, a first structure second branch convolution layer, a second structure first branch convolution layer, a second structure second branch convolution layer, a third structure first branch convolution layer and a third structure second branch convolution layer;
[0081] Further, based on the first branch convolution layer of the first structure, the polyp feature image is convolved to obtain a first horizontal axis polyp feature image; based on the second branch convolution layer of the first structure, the polyp feature image is convolved to obtain a first vertical axis polyp feature image; the first horizontal axis polyp feature image and the first vertical axis polyp feature image are fused to obtain a first fused polyp feature image; based on the first branch convolution layer of the second structure, the first fused polyp feature image is convolved to obtain a second horizontal axis polyp feature image; based on the second branch convolution layer of the second structure, the first fused polyp feature image is convolved to obtain a second vertical axis polyp feature image. The invention relates to a method for obtaining a first fused polyp feature image of a first horizontal axis polyp; a second fused polyp feature image of a second vertical axis polyp is fused with the second horizontal axis polyp feature image; a second fused polyp feature image of a first horizontal axis polyp is fused with the second vertical axis polyp feature image to obtain a second fused polyp feature image; a third fused polyp feature image of a first horizontal axis polyp is fused with the second vertical axis polyp feature image to obtain a third fused polyp feature image; a third fused polyp feature image of a first horizontal axis polyp is fused with the third vertical axis polyp feature image to obtain a third fused polyp feature image, wherein the third fused polyp feature image includes a boundary polyp feature image and a boundary polyp prediction image.
[0082] In this example, the contrast between the polyp and the surrounding tissue mucosa is poor, and the boundary is blurred, which leads to poor segmentation of the polyp boundary by the segmentation network. Therefore, we propose a BFEM (Boundary Feature extract module), which first determines the boundary of the polyp and then guides the network to segment the polyp. BFEM can be regarded as a branch network of the segmentation network, which can generate boundary feature maps and boundary prediction maps. Figure 4 As shown in the figure, the convolution kernel size of 3 is first decomposed into 1×3 and 3×1, that is, the first branch convolution layer of the first structure and the second branch convolution layer of the first structure, to obtain the features on the horizontal axis and the vertical axis, and then the features on the horizontal axis and the vertical axis are fused. The convolution kernel sizes used in turn are 3, 5, and 7, that is, Figure 4 The second structure has a first branch convolution layer of 5×1, the second structure has a second branch convolution layer of 1×5, the third structure has a first branch convolution layer of 7×1, and the third structure has a second branch convolution layer of 1×7. The receptive fields obtained by using different convolution kernel sizes are also different. Continuous use and fusion can obtain multi-scale features, which contain rich boundary features.
[0083] S35, performing feature fusion processing on the boundary polyp feature image and the mutually optimized polyp feature image to obtain a polyp feature image with boundary feature information;
[0084] S36, based on the convolutional attention module, performing spatial attention feature extraction processing on the polyp feature image with boundary feature information to obtain a polyp attention feature image with boundary feature information;
[0085] Specifically, the polyp feature image with boundary feature information is input into a convolutional attention module, which includes a channel attention submodule and a spatial attention submodule;
[0086] Furthermore, based on the channel attention submodule, channel attention extraction processing is performed on the polyp feature image with boundary feature information to obtain a polyp channel attention feature image with boundary feature information; the polyp channel attention feature image with boundary feature information is multiplied element by element with the polyp feature image with boundary feature information to obtain a preliminary polyp attention feature image with boundary feature information; based on the spatial attention submodule, spatial attention extraction processing is performed on the preliminary polyp attention feature image with boundary feature information to obtain a polyp spatial attention feature image with boundary feature information; the preliminary polyp attention feature image with boundary feature information is multiplied element by element with the polyp spatial attention feature image with boundary feature information to obtain a polyp attention feature image with boundary feature information.
[0087] In this embodiment, CBAM is a Convolutional Block Attention Module, which is an attention mechanism module that combines channel and spatial. The feature map first passes through the channel attention submodule, and then the output is multiplied element-by-element with the original feature map, and then used as the input of the spatial attention module. Finally, the result of the element-by-element multiplication of the channel attention module and the original feature map is multiplied element-by-element with the output of the spatial attention module again to obtain the attention map.
[0088] S37, fusing the polyp attention feature image with boundary feature information with the boundary polyp prediction image to obtain a fused boundary polyp attention feature image;
[0089] S38. Based on the output module, feature extraction is performed on the fused boundary polyp attention feature image to obtain a segmented polyp image.
[0090] Specifically, the fused boundary polyp attention feature image is input into an output module, which includes a second convolutional layer, a second batch normalization layer, and a second ReLU activation function;
[0091] Furthermore, based on the second convolutional layer, the fused boundary polyp attention feature image is convolved to obtain a convolved boundary polyp attention feature image; based on the second batch normalization layer, the convolved boundary polyp attention feature image is batch normalized to obtain a batch normalized boundary polyp attention feature image; based on the second ReLU activation function, the batch normalized boundary polyp attention feature image is feature mapped to obtain a segmented polyp image.
[0092] In summary, in the polyp image segmentation network, the embodiment of the present invention uses Res2Net-50 as the backbone network, which can obtain better segmentation results than VGG, ResNet, and ConvxNet as the backbone network. Res2Net-50 can represent multi-scale features at a finer level, generate feature maps with a pyramid structure, and extract five levels of features from low to high. However, due to the small receptive field and large resolution, low-level features contain a lot of noise and require a lot of calculations. Therefore, only the features of the last four layers L=L1, L2, L3, L4 are used. The network structure is as follows Figure 3As shown, four feature maps of different sizes are obtained through the backbone network, and then the feature channel number is processed by the U module to be unified to 64, where L1 is used as the input of the boundary feature extraction module, and the other three layers are processed by the mutual optimization module (OOM) to obtain the optimized module, OOM is the mutual optimization module, CBAM is the Convolutional Block Attention Module, and BFEM is the boundary feature extraction module. Considering the number of parameters and the amount of calculation, the embodiment of the present invention first processes the output of the four backbone networks with a unified channel number of 64, where the output L1 of the first layer is used as the input of the boundary feature extraction module, and the output of the boundary feature map and the boundary prediction map is obtained through the boundary feature extraction module. The feature map of each layer is further scaled / expanded to a specified multiple and fused with the other features to obtain low-level detail features and high-level semantic features (O1, O2, O3 and O4), where the low-level detail features include detail features such as boundaries, shapes, and colors, and the high-level features contain polyp semantic features. Then we scale the output boundary feature map of the boundary feature extraction module to a specified multiple and fuse it with the mutually optimized features to obtain feature maps F1, F2, F3 and F4 containing rich feature information; secondly, the attention mechanism CBAM is used to further optimize the feature map, so that the network pays more attention to the polyp area and suppresses some noise in the background and feature map. The feature map is then fused with the output boundary prediction map of the boundary feature extraction module, so that the boundary prediction map can guide and supervise the feature map prediction. Then, a convolution layer, a BN (batchnormalization, BN) layer and a ReLU activation function are used to further extract the fused features. Finally, the network output is obtained, of which one is the main output Output1 and the other three are auxiliary outputs Output2, Output3 and Output4.
[0093] Among them, auxiliary outputs Output2, Output3, and Output4 can capture information at different scales. Objects in an image may have different features at different scales. Therefore, by introducing outputs of multiple scales in the network, this information can be better captured, improving the model's ability to capture object boundaries and details. It can also reduce the risk of overfitting, accelerate convergence, and improve the robustness of the network.
[0094] It should be noted that the loss function of the polyp segmentation network based on boundary constraints in the embodiment of the present invention includes a weighted binary cross entropy loss function, a dice loss function and a consistency enhancement loss function.
[0095] Among them, the loss function is used to supervise the training process of a network. The network continuously adjusts its own parameters through the value of the loss function to obtain better performance and learning ability. Weighted binary cross entropy loss function (BCE), dice loss function (Dice), and consistency enhancement loss function (CEL) are used as loss functions. The Dice loss function is equivalent to global supervision, while the BCE loss is supervised on a pixel-by-pixel basis, and the two loss functions can be complementary. At the same time, the BCE loss can also serve as a guide for the Dice loss. CEL allows the model to highlight the foreground target area as smoothly as possible and is able to handle sample imbalance problems. Deep supervision is performed using outputs O1, O2, O3, O4, and boundary prediction outputs, and each prediction map is upsampled to the same size as Ground-Truth (GT).
[0096] Finally, if Figure 5 As shown, the present invention constructs a polyp segmentation network based on boundary constraints, obtains better weight results after training, and uses the weights obtained by training for prediction. First, the detected image is subjected to the same preprocessing operation as in the training process. Then it is sent to the polyp segmentation network based on boundary constraints for detection; the predicted result finally obtained has clear and accurate boundaries. Therefore, the present invention solves the problem of inaccurate segmentation of polyp boundaries and surrounding tissue areas by traditional polyp segmentation methods, uses decomposed convolution to extract multi-scale boundary features, extracts from the horizontal and vertical axes respectively, and fuses them to improve the capture of boundary details, further solve the problem of insufficient feature extraction, and uses mutually optimized fusion features to enhance the expression of details and semantics.
[0097] Reference Figure 2 , a polyp segmentation system based on boundary constraints, comprising:
[0098] A preprocessing module, used for acquiring a polyp image and performing data preprocessing to obtain a preprocessed polyp image;
[0099] A construction module is used to introduce a boundary feature extraction module and construct a polyp segmentation network based on boundary constraints;
[0100] The segmentation module is used to perform recognition and segmentation processing on the pre-processed polyp image through a polyp segmentation network based on boundary constraints to obtain a segmented polyp image, and the segmented polyp image includes a plurality of polyp segmentation images.
[0101] The contents of the above method embodiments are all applicable to the present system embodiments. The functions specifically implemented by the present system embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0102] The above is a specific description of the preferred implementation of the present invention, but the invention is not limited to the embodiments. Those skilled in the art may make various equivalent modifications or substitutions without violating the spirit of the present invention. These equivalent modifications or substitutions are all included in the scope defined by the claims of this application.
Claims
1. A polyp segmentation method based on boundary constraints, characterized in that: The following steps are involved: Acquire a polyp image and perform data preprocessing to obtain a preprocessed polyp image; Introduce a boundary feature extraction module to construct a polyp segmentation network based on boundary constraints, wherein the polyp segmentation network based on boundary constraints includes several Res2Net-50 backbone network modules, several mutual optimization modules, several convolutional attention modules, boundary feature extraction modules and several output modules, the first output ends of several Res2Net-50 backbone network modules are connected to the input ends of several mutual optimization modules, the second output end of the first Res2Net-50 backbone network module is connected to the input end of the boundary feature extraction module, the output ends of several mutual optimization modules and the output ends of the boundary feature extraction module are respectively connected to the input ends of several convolutional attention modules, and the output ends of several convolutional attention modules are connected to the input ends of several output modules; Inputting the preprocessed polyp image into the boundary constraint-based polyp segmentation network; Based on the Res2Net-50 backbone network module, feature mapping is performed on the preprocessed polyp image to obtain a polyp feature image; Based on the mutual optimization module, the polyp feature image is subjected to feature optimization processing to obtain a mutually optimized polyp feature image; Inputting the polyp feature image into the boundary feature extraction module, the boundary feature extraction module includes a first structure first branch convolution layer, a first structure second branch convolution layer, a second structure first branch convolution layer, a second structure second branch convolution layer, a third structure first branch convolution layer and a third structure second branch convolution layer; Based on the first branch convolution layer of the first structure, convolution processing is performed on the polyp feature image to obtain a first horizontal axis polyp feature image; Based on the second branch convolution layer of the first structure, convolution processing is performed on the polyp feature image to obtain a first longitudinal polyp feature image; Fusing the first transverse-axis polyp characteristic image with the first longitudinal-axis polyp characteristic image to obtain a first fused polyp characteristic image; Based on the first branch convolution layer of the second structure, convolution processing is performed on the first fused polyp feature image to obtain a second horizontal axis polyp feature image; Based on the second branch convolution layer of the second structure, convolution processing is performed on the first fused polyp feature image to obtain a second longitudinal axis polyp feature image; Fusing the second transverse-axis polyp characteristic image with the second longitudinal-axis polyp characteristic image to obtain a second fused polyp characteristic image; Based on the first branch convolution layer of the third structure, convolution processing is performed on the second fused polyp feature image to obtain a third horizontal axis polyp feature image; Based on the second branch convolution layer of the third structure, convolution processing is performed on the second fused polyp feature image to obtain a third longitudinal axis polyp feature image; The third horizontal axis polyp feature image is fused with the third vertical axis polyp feature image to obtain a third fused polyp feature image, wherein the third fused polyp feature image includes a boundary polyp feature image and a boundary polyp prediction image; Performing feature fusion processing on the boundary polyp feature image and the mutually optimized polyp feature image to obtain a polyp feature image with boundary feature information; Based on the convolutional attention module, a spatial attention feature extraction process is performed on the polyp feature image with boundary feature information to obtain a polyp attention feature image with boundary feature information; Fusing the polyp attention feature image with boundary feature information with the boundary polyp prediction image to obtain a fused boundary polyp attention feature image; Based on the output module, feature extraction processing is performed on the fused boundary polyp attention feature image to obtain a segmented polyp image, and the segmented polyp image includes a plurality of polyp segmentation images.
2. The polyp segmentation method based on boundary constraints according to claim 1, characterized in that: The step of acquiring a polyp image and performing data preprocessing to obtain a preprocessed polyp image specifically includes: Acquire images of polyps; Performing de-reflection processing on the polyp image to obtain a de-reflected polyp image; Data enhancement processing is performed on the dereflected polyp image to obtain a preprocessed polyp image.
3. The polyp segmentation method based on boundary constraints according to claim 1, characterized in that: The step of performing feature optimization processing on the polyp feature image based on the mutual optimization module to obtain a mutually optimized polyp feature image specifically includes: Inputting the polyp feature image into the mutual optimization module, the mutual optimization module includes a first convolution layer, a first batch of normalization layers, a first ReLU activation function, an upsampling layer and a downsampling layer; Based on the first convolution layer, convolution processing is performed on the polyp feature image to obtain a convolved polyp feature image; Based on the first batch of normalization layers, batch normalization processing is performed on the convolved polyp feature image to obtain a batch normalized polyp feature image; Based on the first ReLU activation function, performing nonlinear mapping processing on the batch-normalized polyp feature image to obtain an activated polyp feature image; Based on the upsampling layer, upsampling the activated polyp feature image to obtain an upsampled polyp feature image; Based on the downsampling layer, the upsampled polyp feature image is downsampled to obtain a mutually optimized polyp feature image.
4. The polyp segmentation method based on boundary constraints according to claim 1, characterized in that: The step of performing spatial attention feature extraction processing on the polyp feature image with boundary feature information based on the convolutional attention module to obtain the polyp attention feature image with boundary feature information specifically includes: Inputting the polyp feature image with boundary feature information into the convolutional attention module, wherein the convolutional attention module includes a channel attention submodule and a spatial attention submodule; Based on the channel attention submodule, a channel attention extraction process is performed on the polyp feature image with boundary feature information to obtain a polyp channel attention feature image with boundary feature information; Performing element-by-element multiplication processing on the polyp channel attention feature image with boundary feature information and the polyp feature image with boundary feature information to obtain a preliminary polyp attention feature image with boundary feature information; Based on the spatial attention submodule, performing spatial attention extraction processing on the preliminary polyp attention feature image with boundary feature information to obtain a polyp spatial attention feature image with boundary feature information; The preliminary polyp attention feature image with boundary feature information is multiplied element by element with the polyp spatial attention feature image with boundary feature information to obtain a polyp attention feature image with boundary feature information.
5. The polyp segmentation method based on boundary constraints according to claim 1, characterized in that: The step of performing feature extraction processing on the fused boundary polyp attention feature image based on the output module to obtain a segmented polyp image specifically includes: Inputting the fused border polyp attention feature image into the output module, wherein the output module includes a second convolutional layer, a second batch normalization layer and a second ReLU activation function; Based on the second convolutional layer, convolution processing is performed on the fused boundary polyp attention feature image to obtain a convolved boundary polyp attention feature image; Based on the second batch normalization layer, performing batch normalization processing on the convolved boundary polyp attention feature image to obtain a batch normalized boundary polyp attention feature image; Based on the second ReLU activation function, feature mapping processing is performed on the batch-normalized boundary polyp attention feature image to obtain a segmented polyp image.
6. The polyp segmentation method based on boundary constraints according to claim 1, characterized in that: The loss functions of the boundary-constrained polyp segmentation network include a weighted binary cross entropy loss function, a dice loss function, and a consistency enhancement loss function.
7. A polyp segmentation system based on boundary constraints, characterized in that: Includes the following modules: A preprocessing module, used for acquiring a polyp image and performing data preprocessing to obtain a preprocessed polyp image; A construction module is used to introduce a boundary feature extraction module to construct a polyp segmentation network based on boundary constraints, wherein the polyp segmentation network based on boundary constraints includes several Res2Net-50 backbone network modules, several mutual optimization modules, several convolutional attention modules, boundary feature extraction modules and several output modules, the first output ends of several Res2Net-50 backbone network modules are connected to the input ends of several mutual optimization modules, the second output end of the first Res2Net-50 backbone network module is connected to the input end of the boundary feature extraction module, the output ends of several mutual optimization modules and the output ends of the boundary feature extraction module are respectively connected to the input ends of several convolutional attention modules, and the output ends of several convolutional attention modules are connected to the input ends of several output modules; A segmentation module, used for inputting the preprocessed polyp image into the boundary constraint-based polyp segmentation network; Based on the Res2Net-50 backbone network module, feature mapping is performed on the preprocessed polyp image to obtain a polyp feature image; Based on the mutual optimization module, the polyp feature image is subjected to feature optimization processing to obtain a mutually optimized polyp feature image; Inputting the polyp feature image into the boundary feature extraction module, the boundary feature extraction module includes a first structure first branch convolution layer, a first structure second branch convolution layer, a second structure first branch convolution layer, a second structure second branch convolution layer, a third structure first branch convolution layer and a third structure second branch convolution layer; Based on the first branch convolution layer of the first structure, convolution processing is performed on the polyp feature image to obtain a first horizontal axis polyp feature image; Based on the second branch convolution layer of the first structure, convolution processing is performed on the polyp feature image to obtain a first longitudinal polyp feature image; Fusing the first transverse-axis polyp characteristic image with the first longitudinal-axis polyp characteristic image to obtain a first fused polyp characteristic image; Based on the first branch convolution layer of the second structure, convolution processing is performed on the first fused polyp feature image to obtain a second horizontal axis polyp feature image; Based on the second branch convolution layer of the second structure, convolution processing is performed on the first fused polyp feature image to obtain a second longitudinal axis polyp feature image; Fusing the second transverse-axis polyp characteristic image with the second longitudinal-axis polyp characteristic image to obtain a second fused polyp characteristic image; Based on the first branch convolution layer of the third structure, convolution processing is performed on the second fused polyp feature image to obtain a third horizontal axis polyp feature image; Based on the second branch convolution layer of the third structure, convolution processing is performed on the second fused polyp feature image to obtain a third longitudinal axis polyp feature image; The third horizontal axis polyp feature image is fused with the third vertical axis polyp feature image to obtain a third fused polyp feature image, wherein the third fused polyp feature image includes a boundary polyp feature image and a boundary polyp prediction image; Performing feature fusion processing on the boundary polyp feature image and the mutually optimized polyp feature image to obtain a polyp feature image with boundary feature information; Based on the convolutional attention module, a spatial attention feature extraction process is performed on the polyp feature image with boundary feature information to obtain a polyp attention feature image with boundary feature information; Fusing the polyp attention feature image with boundary feature information with the boundary polyp prediction image to obtain a fused boundary polyp attention feature image; Based on the output module, feature extraction processing is performed on the fused boundary polyp attention feature image to obtain a segmented polyp image, and the segmented polyp image includes a plurality of polyp segmentation images.
