Extremely light neural network structure for real-time segmentation of colorectal polyps in single-core CPU and construction method thereof

By constructing an extremely lightweight neural network structure, the problems of real-time high accuracy and multi-center multimodal adaptability in colorectal polyp segmentation on a single-core CPU were solved, achieving efficient and stable polyp segmentation results on a single-core CPU.

CN122114009APending Publication Date: 2026-05-29GUANGDONG UNIV OF EDUCATION
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
GUANGDONG UNIV OF EDUCATION
Filing Date
2026-01-30
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

Existing colorectal polyp segmentation models struggle to achieve real-time, high-precision segmentation on a single-core CPU and lack generalization ability across different medical centers and imaging devices.

Method used

An extremely lightweight neural network structure is designed, employing a five-level encoder and decoder, combined with an enhanced dilated convolution module, a group shuffle fusion module, a dual deep supervision mechanism, and an attention-guided fusion module. The construction method does not require external pre-trained weights and is suitable for real-time segmentation on a single-core CPU.

Benefits of technology

It achieves real-time inference speeds exceeding 90 FPS on a single-core CPU and segmentation accuracy of over 0.79 on multiple datasets, meeting clinical needs while maintaining stable segmentation performance in multi-center and multimodal images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122114009A_ABST
    Figure CN122114009A_ABST
Patent Text Reader

Abstract

The application discloses a very light neural network structure for real-time colorectal polyp segmentation of a single-core CPU and a construction method thereof, the structure comprising a five-stage encoder, a five-stage decoder and a skip connection connecting the corresponding level encoder and the decoder; the channel width of the encoder and the decoder is in a trumpet shape from narrow in front to wide in back, and is 8, 16, 48, 64 and 96 in sequence, two enhanced hollow convolution modules are arranged in series in the third stage of the encoder, and a group shuffling fusion module is connected after each stage of the decoder. The overall parameter quantity of the neural network is less than 0.3M, and the typical value is 0.108M or 0.130M. The application can effectively overcome the defects that the existing mainstream model cannot realize real-time high-precision segmentation on a resource-limited single-core CPU platform due to the large volume and complex calculation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of medical image segmentation technology, specifically, it relates to an extremely lightweight neural network structure for real-time colorectal polyp segmentation on a single-core CPU and its construction method. Background Technology

[0002] Early screening for colorectal cancer relies on the accurate detection and segmentation of polyps during colonoscopy. Deep learning-based colorectal polyp segmentation technology has shown clinical potential, effectively improving the accuracy of lesion detection and localization.

[0003] Significant progress has been made in colorectal polyp segmentation models based on convolutional neural networks (CNNs) or Transformers (such as U-Net and its variants, Swin-Unet, etc.). However, in pursuit of high accuracy, these models are typically designed with a huge number of parameters (usually over 10M) and computationally complex structures, and their inference process heavily relies on high-performance hardware such as graphics processing units (GPUs). This results in high deployment costs, making it difficult to widely apply them in grassroots hospitals, mobile medical devices, or embedded endoscopic systems.

[0004] To lower the deployment threshold, existing research mainly focuses on compressing large models (e.g., pruning, distillation) or designing lightweight networks. However, these methods have significant limitations: First, the number of parameters after model compression is usually still over 1M, which cannot meet the stringent computational constraints of achieving video-level real-time inference (e.g., >30FPS) on a single-core CPU; second, the compression process often results in a significant loss of segmentation accuracy, making it difficult to reach clinically usable standards; third, existing lightweight models have insufficient generalization ability when faced with multi-center, multi-modal (e.g., white light, narrowband light, blue light imaging) images generated by different hospitals and different brands of endoscopic equipment.

[0005] Therefore, there is an urgent need to study a novel network architecture that can maintain high segmentation accuracy and real-time CPU inference capability with extremely low parameter count (<0.3M) to meet the clinical deployment needs of resource-constrained scenarios. Summary of the Invention

[0006] The primary objective of this invention is to overcome the shortcomings and deficiencies of existing technologies and provide an extremely lightweight neural network structure for real-time colorectal polyp segmentation on a single-core CPU, thus solving the problem that existing models are difficult to achieve real-time high-precision segmentation on a single-core CPU platform due to their large size and computational power requirements.

[0007] The second objective of this invention is to provide a method for constructing an extremely lightweight neural network structure for real-time colorectal polyp segmentation on a single-core CPU.

[0008] The objective of this invention is achieved through the following technical solution: an extremely lightweight neural network structure for real-time colorectal polyp segmentation on a single-core CPU, comprising a five-level encoder, a five-level decoder, and jump connections connecting the encoder and decoder at corresponding levels.

[0009] The channel widths of the encoder and decoder are 8, 16, 48, 64, and 96 in sequence from input to output. Two enhanced dilated convolutional modules are connected in series in the third stage of the encoder. Each stage of the decoder is connected to a shuffle fusion module. The overall parameter count of the neural network structure is less than 0.3M.

[0010] Preferably, the enhanced dilated convolution module includes:

[0011] The first grouping unit is used to divide the input feature map into K groups equally along the channel dimension;

[0012] There are K parallel branch units. Each branch unit uses a convolutional layer with a grouped convolutional kernel size of 3×3 and a group number equal to the number of corresponding branch channels to process one of the groups. Each branch is configured with a different hole ratio.

[0013] A splicing unit is used to splice the outputs of the K parallel branch units in the channel dimension;

[0014] The fusion unit is used to fuse the features output by the splicing unit with the input feature map through learnable residual weights.

[0015] Preferably, the group shuffle fusion module includes:

[0016] The second grouping unit is used to evenly divide the input feature map into N groups along the channel dimension;

[0017] N spatial gating units, each spatial gating unit corresponding to a set of features, are used to generate a spatial gating map with the same resolution as the input feature map and to spatially modulate the set of features;

[0018] The channel rearrangement unit is used to rearrange and splice the modulated N sets of features in a preset order.

[0019] Preferably, the decoder is configured with a dual depth supervision mechanism for predicting signals in four different spatial resolution output regions and predicting signals at three different spatial resolution output edges.

[0020] Preferably, the dual deep supervision mechanism is implemented through a region prediction generator and a dual prediction generator;

[0021] The region prediction generator is positioned after the deepest decoder and is used to generate the deepest region prediction signal.

[0022] The dual prediction generator is positioned after the decoders of other layers and is used to simultaneously generate the region prediction signal and the edge prediction signal of the corresponding layer.

[0023] Preferably, it also includes a prediction gating fusion module, which is used to adaptively fuse the same-layer region prediction probability map and the edge prediction probability map generated by the dual depth supervision mechanism back to the jump connection as spatial gating.

[0024] Preferably, an attention-guided fusion module and a simplified spatial attention module are also integrated between the third-level feature map and the fourth-level feature map of the encoder.

[0025] Preferably, the total number of parameters in the neural network structure is 0.108M.

[0026] Preferably, the total number of parameters of the neural network structure is 0.130M.

[0027] A method for constructing an extremely lightweight neural network for real-time colorectal polyp segmentation on a single-core CPU includes the following steps:

[0028] Construct the neural network structure as described above;

[0029] Obtain a training dataset containing images of colorectal polyps and their corresponding segmentation annotations;

[0030] Based on the segmentation annotation, generate edge supervision labels;

[0031] The constructed neural network is trained using a dual deep supervision loss function, which simultaneously constrains the final output region segmentation result, as well as the region prediction signal generated by the dual deep supervision mechanism at four different spatial resolutions and the edge prediction signal generated at three different spatial resolutions.

[0032] The training begins from a randomly initialized state and does not rely on external pre-trained model weights.

[0033] The present invention has the following advantages and effects compared with the prior art:

[0034] (1) This invention provides an extremely lightweight neural network structure for real-time colorectal polyp segmentation on a single-core CPU. By adopting a trumpet-shaped channel distribution with a narrow front and wide back (8, 16, 48, 64, and 96 channels respectively) and integrating an enhanced dilated convolution module and a group shuffle fusion module, the total number of network parameters is compressed to less than 0.3M (typically 0.108M / 0.130M). This design enables the model to achieve a real-time inference speed of over 90 FPS on a 256×256 input image on a single-core CPU. At the same time, the average segmentation accuracy (Dice coefficient) on multiple public datasets reaches over 0.79. For the first time, the accuracy of a lightweight model has been improved to a clinically usable level under the constraint of <0.3M parameters, meeting the stringent requirements of real-time clinical auxiliary diagnosis.

[0035] (2) By optionally introducing an attention-guided fusion module and a simplified spatial attention module, the present invention enables the model to adaptively fuse features at different levels and perform spatial recalibration. When faced with colonoscopy images from different medical centers, different imaging devices and modalities, the segmentation performance remains stable, effectively alleviating the performance degradation problem caused by inter-domain differences.

[0036] (3) This invention uses a dual deep supervision mechanism implemented by a region prediction generator and a dual prediction generator in the decoder, and uses a prediction gating fusion module to feed the generated region and edge prediction probability map back to the network as a spatial gating, so that the model pays attention to the overall region and detailed edge of the polyp during training, which greatly improves the accuracy and continuity of the boundary in the segmentation result.

[0037] (4) The model of the present invention has a very low number of parameters and a small size, and can be directly embedded into existing endoscope system firmware or mobile devices. The construction method adopts a strategy of training from random initialization, which eliminates the dependence on large-scale external pre-trained models, simplifies the training process, reduces the deployment threshold and copyright risks, and provides a feasible solution for the popularization of AI-assisted colorectal endoscopy screening in primary hospitals and mobile diagnosis and treatment scenarios with limited computing power. Attached Figure Description

[0038] Figure 1 This is a schematic diagram of the overall structure of an embodiment of the present invention (UltraSeg-130K).

[0039] Figure 2 This is a schematic diagram of the Group Shuffle Fusion Module (GSF) of the present invention.

[0040] Figure 3 for Figure 2 A schematic diagram of the structure of the Space Gated Unit (SGU).

[0041] Figure 4 This is a schematic diagram of the structure of the Enhanced Dilated Convolution Module (EDB) of the present invention.

[0042] Figure 5 This is a schematic diagram of the Attention-Guided Fusion Module (AGF) of the present invention.

[0043] Figure 6 This is a schematic diagram of the simplified spatial attention module (SSA) of the present invention.

[0044] Figure 7 This is a schematic diagram of the Predictive Gated Fusion Module (PGF) of the present invention.

[0045] Figure 8 This is a schematic diagram of the structure of the Region Prediction Generator (RPG) of the present invention.

[0046] Figure 9 This is a schematic diagram of the dual prediction generator (DPG) of the present invention.

[0047] Figure 10 The following is a scatter plot comparing the performance of the embodiments of the present invention and the comparative model, wherein (a) is a scatter plot of the number of different model parameters - average segmentation Dice index, and (b) is a scatter plot of the number of frames per second (FPS) that can be run under single-core CPU inference - average segmentation Dice index.

[0048] Figure 11 This is a visual comparison of the segmentation performance of the embodiment of the present invention and the comparison model on the test set.

[0049] Figure 12 The bar chart shows the performance comparison of the embodiments of the present invention and the baseline model on the PolypDB and PolypGen datasets; where (a) is the PolypDB sample mean; (b) is the PolypDB extended modal mean; (c) is the PolypGen sample mean; and (d) is the PolypGen extended modal mean. Detailed Implementation

[0050] The present invention will be further described in detail below with reference to the embodiments and accompanying drawings, but the embodiments of the present invention are not limited thereto.

[0051] Example 1

[0052] like Figure 1 As shown, the present invention provides an extremely lightweight neural network structure for real-time colorectal polyp segmentation on a single-core CPU. The structure adopts an encoder-decoder (U-Net) basic framework, including a five-level encoder, a five-level decoder, and jump connections connecting the encoder and decoder at corresponding levels.

[0053] Channel configuration: The channel widths of the encoder and decoder are distributed in a trumpet shape, narrower at the beginning and wider at the end, from input to output, as follows: Stage 1: 8 channels, Stage 2: 16 channels, Stage 3: 48 channels, Stage 4: 64 channels, Stage 5 (bottleneck layer): 96 channels. This design concentrates approximately 70% of the parameters in the deep network with the richest semantic information, improving parameter efficiency.

[0054] Enhanced dilated convolutional module (EDB): such as Figure 4 As shown, the encoder's third stage (Stage 3) contains two enhanced dilated convolutional modules connected in series. Each EDB divides the input features into K groups (e.g., k=3) and performs depthwise separable convolutions with different dilation rates (e.g., d=1, 2, 3) in parallel. Then, it is fused with the input features through learnable residual weights to expand the equivalent receptive field of the Stage 3 features with minimal parameter cost, thereby enhancing the multi-scale context awareness capability.

[0055] Group Shuffle Fusion Module (GSF): such as Figure 2 As shown, a group shuffle fusion module is embedded after each upsampling stage of the decoder. This module divides the input features into N groups (e.g., N=4) along the channel dimension, and each group passes through an independent spatial gating unit (SGU). Figure 3 Local feature enhancement is performed, and then the parts are reassembled in a fixed order (e.g., 2-4-1-3) to achieve cross-group information exchange and local receptive field correction with extremely low computational overhead, effectively enhancing edge details.

[0056] Dual Deep Supervision Mechanism and Predictive Gating Fusion Module (PGF): To achieve efficient dual deep supervision, this invention designs two lightweight prediction generators. Dual Predictive Generator (DPG, Figure 9 The Region Prediction Generator (RPG) is deployed in multiple intermediate layers of the decoder (such as layers 2, 3, and 4) to simultaneously parse the region and edge prediction probability maps for that layer from a common input feature. Figure 8 These generators are deployed at the deepest layer of the network (the bottleneck layer) to generate the coarsest global region predictions. The outputs of these generators directly participate in loss calculations, providing deep supervision signals; on the other hand, they are fed into the prediction-gated fusion module (PGF). Figure 7 PGF uses the region prediction probability map and the edge prediction probability map as spatial attention weights to adaptively modulate the skip connection features, forming a closed loop where the supervision signal serves as both loss and input, eliminating the need for manually setting fusion coefficients.

[0057] Attention-Guided Fusion Module (AGF) and Simplified Spatial Attention Module (SSA): In the enhanced implementation (UltraSeg-130K), an AGF is added between Stage 3 and Stage 4. Figure 5 ) and SSA ( Figure 6 The module consists of two parts. AGF adaptively fuses features from two stages using learnable pixel-level weights. SSA generates a spatial attention map using global average pooling and a sigmoid activation function to spatially recalibrate the features. Integrating these two modules forms UltraSeg-130K (0.130M parameters), further improving the model's generalization ability to multi-center, multi-modal data. Without this component, it forms UltraSeg-108K (0.108M parameters).

[0058] The total number of network parameters in this invention is strictly controlled to be below 0.3M, as shown in Table 1 for specific comparisons.

[0059] Table 1 Comparison of Model Parameter Quantity / Computational Cost

[0060]

[0061] As shown in Table 1, the UltraSeg-108K / 130K of this invention has only 0.108M / 0.130M parameters, which is much lower than the benchmark segmentation UNet-Base model and the lightweight segmentation general model FastSCNN and MobileUNet, laying the parameter foundation for realizing real-time inference on a single-core CPU.

[0062] Based on the above design, as shown in Table 2, the UltraSeg-130K of this invention achieves an average Dice coefficient of 0.7926 on five public datasets and an inference speed of over 90 FPS on a single-core CPU platform. For the first time, it simultaneously meets the triple requirements of high accuracy, real-time performance, and low-resource deployment for clinical auxiliary diagnosis under the strict constraint of less than 0.3M parameters.

[0063] Description of the dataset used in this embodiment:

[0064] The CVC dataset contains 612 images from a single endoscopy device at a single medical center, representing a classic single-center, single-device polyp segmentation benchmark dataset.

[0065] The Kvasir-SEG dataset contains 1000 images, which are also polyp segmentation data collected from a single center and a single device. Together with CVC, it forms a standard test set for evaluating the basic performance of the model.

[0066] The PolypGen dataset contains 1,537 images, aggregating colonoscopy images from six different medical institutions, and is used to validate the model's generalization ability under multicenter data distribution.

[0067] The PolypDB dataset contains 3,934 images covering five different imaging modalities: blue light imaging (BLI), flexible intelligent color enhancement (FICE), linked color imaging (LCI), narrowband imaging (NBI), and white light imaging (WLI). It comes from three independent medical centers, and both the training and test sets exhibit severe class imbalance, posing a significant challenge to the model's learning and generalization.

[0068] The Kvasir-Instrument dataset contains 590 images, which are segmentation data of digestive endoscopy instruments collected by a single center and a single device. It is used to evaluate the model's general segmentation ability under colonoscopy imaging conditions. The task objective is to detect surgical instruments such as snares, balloons, and biopsy forceps.

[0069] The datasets described above consist of independent static frame images rather than continuous video sequences. This embodiment follows the image segmentation standard evaluation protocol, randomly dividing each dataset into training and test sets at an 8:2 ratio to ensure unbiased evaluation of the model on uniformly distributed but unseen samples. All of the above datasets are publicly available, authoritative segmentation datasets in the field of colonoscopy.

[0070] Table 2. Average Performance Comparison Across Multiple Datasets

[0071]

[0072] like Figure 1 The overall design diagram of the UltraSeg-130K is shown.

[0073] Input and preprocessing: The network input consists of three-channel colonoscopy images, with a uniform resolution of 256×256.

[0074] Encoder path (including five levels of downsampling):

[0075] Stage 1: Outputs 8 channels, size 128×128.

[0076] Stage 2: Outputs 16 channels, size 64×64.

[0077] Stage 3: Outputs 48 channels, 32×32 pixels. Two Enhanced Dilated Convolutional Modules (EDBs) are cascaded at this level. Figure 4The processing flow includes: (1) receiving the input feature map from the previous layer, with C = 48 channels; (2) dividing the input feature map into K = 3 groups in the channel dimension; (3) executing K = 3 convolutional branches in parallel: using 3×3 grouped convolutional kernels with dilation rates of 1, 2, and 3 respectively; (4) concatenating the output feature maps of K = 3 branches in the channel dimension; (5) introducing a learnable residual weight parameter α (initial value set to 0.1) to fuse with the input features: F_out = α * F_fused + (1-α) * F_in. This design can expand the equivalent receptive field of Stage3 output features from 9×9 pixels to 52×52 pixels with extremely low parameter cost, enhancing the model's ability to perceive the multi-scale context of polyps.

[0078] Stage 4: Outputs 64 channels, size 16×16.

[0079] Stage 5 (bottleneck layer): Outputs 96 channels, size 16×16.

[0080] Decoder path (five-stage upsampling): Each upsampling stage is followed by a group shuffle fusion module (GSF).

[0081] Group Shuffle Fusion Module (GSF): The GSF module is used to enhance cross-channel information interaction and correct local receptive fields while progressively adjusting spatial resolution, processing flow ( Figure 2 )include:

[0082] (1) Input feature map F_in (the number of channels is C, the spatial size is H×W, which is consistent with the resolution of the current upsampling layer);

[0083] (2) Divide F_in into 4 groups along the channel dimension, with C channels in each group. ′ =C / 4, resulting in {G1,G2,G3,G4};

[0084] (3) Each group enters the corresponding space gating unit (SGU) in sequence. Figure 3 ):

[0085] Learnable space template: Each group maintains one 1×C template. ′ The weight template is ×8×8 and is updated via gradient during training.

[0086] Size enlargement: The 8×8 template is bilinearly interpolated to the current H×W to obtain the size of G. i Spatial gating map M at the same resolution i ;

[0087] Gated Refinement: M i Successfully pass through 3×3 depthwise convolutions (groups=C) ′BN→GELU→1×1 pointwise convolution to generate the final gated graph G. i ′ ;

[0088] Spatial self-enhancement: G i ′ With G i Pixel-by-pixel multiplication yields the enhanced sub-feature G. i ″ .

[0089] (4) Channel shuffling: The four groups of enhancement sub-features are re-spun in the channel dimension in the preset order 2-4-1-3 to form a new C channel feature F_shuffle, which is then directly sent as the module output F_out into the subsequent network layer.

[0090] Specifically, through the above process, GSF achieves cross-group information flow and feature reuse with extremely low computational overhead, enhancing the ability to distinguish edge details.

[0091] Cross-layer attention fusion (UltraSeg-130K):

[0092] After Stage 3 features are upsampled, they are input together with Stage 4 features into the Attention-Guided Fusion (AGF) module. Figure 5 The attention-guided fusion module generates pixel-level weight maps α and β (α+β=1), and adaptively weights and fuses the two-level features. The fusion result is then spatially recalibrated by a simplified spatial attention module (SSA), finally outputting enhanced Stage4 features. The AGF processing flow is as follows:

[0093] (1) The module receives two feature maps of the same level:

[0094] A feature map from the third stage, with spatial dimensions of H / 16 × W / 16 (size aligned outside the module using bilinear interpolation), and C channels. ′ (The number of channels here is 48);

[0095] Another feature map from the fourth stage has a spatial size of H / 16×W / 16 and a channel number of C (C=64).

[0096] (2) Inside the module, a 1×1 convolution is first performed on the first stage input feature map to increase its number of channels to C, ensuring that the channel dimensions of the two branches are consistent (now the feature map from stage3 and the result of stage4 both have 64 channels, and the size remains consistent).

[0097] (3) The two branch feature maps are spliced ​​together in the channel dimension to obtain a fusion feature with 2C=128 channels.

[0098] (4) Perform the following steps on the fusion features in sequence: 3×3 convolution → batch normalization (BN) → GELU activation → 1×1 convolution to reduce the number of channels back to 2 and obtain two spatial weight maps.

[0099] (5) Apply Softmax along the channel dimension to make the two weight maps at each pixel position satisfy α+β=1, and generate pixel-level spatial masks α and β (both with size 1×H / 16×W / 16).

[0100] (6) Weighted fusion by element: F_out = α⊙Stage - 3 ′ +β⊙Stage-4 ′ , where ⊙ represents pixel-wise multiplication and addition, the output channel remains C=64, and the space size remains H / 16×W / 16.

[0101] (7) The fused feature map is used as a new fourth-stage feature and is fed into subsequent network layers.

[0102] Through the above design, AGF automatically learns the spatial importance distribution of two-stage features at the cost of only adding two 1×1 convolutions and one 3×3 convolution, thereby achieving complementary contextual information and improving the expressive power of edge and region features.

[0103] The Simple Spatial Attention Module (SSA) Figure 6 The processing flow is as follows:

[0104] (1) The module receives the feature map output from the front-end (AGF), denoted as F_in (the number of channels is C=64, and the spatial size is H / 16×W / 16).

[0105] (2) Perform global average pooling on the channel dimension to compress C channels into 1 channel, and obtain the spatial descriptor F_avg with a size of 1×H / 16×W / 16.

[0106] (3) Activate F_avg with the Sigmoid activation function in sequence to obtain a spatial gated map G with a value range of [0,1] and keep the size 1×H / 16×W / 16.

[0107] (4) Multiply the gated map G with the original feature F_in pixel by pixel (broadcasting mechanism) to obtain the attention-weighted feature map F_att, which has the same size as F_in.

[0108] (5) Introduce a learnable residual weight coefficient α (initial value 0.3) and calculate the final output element by element: F_out=(1−α)⊙F_in+α⊙F_att, where ⊙ represents pixel-wise multiplication and addition, and α is automatically updated through backpropagation during training.

[0109] (6) F_out is used as the module output and is then fed into subsequent network layers.

[0110] Through the above design, SSA achieves spatial dimension adaptive weighting at the cost of only one global average pooling, one sigmoid activation function, and one learnable scalar: high-response regions retain more details, while low-response regions suppress redundant information. This mechanism requires no additional labels, has negligible parameters, yet significantly improves the segmentation generalization ability of small models in cross-center and cross-modal scenarios, while meeting the stringent resource constraints of real-time inference on the CPU. After enhancement by the AGF and SSA two-level modules, UltraSeg-130K is formed, with the number of parameters increasing to 0.13M. It shows significant performance improvement on the PolypDB and PolypGen datasets, with almost no impact on other datasets.

[0111] Implementation of dual depth supervision:

[0112] like Figure 1 As shown, a dual prediction generator (DPG) is set in layers 2, 3, and 4 of the decoder, respectively. Figure 9 Generate region predictions (R3, R2, R1) and boundary predictions (B3, B2, B1); set the region prediction generator (RPG) at the bottleneck layer (after Stage 5 output). Figure 8 ), generating the deepest region prediction R4.

[0113] The workflow of the Dual Prediction Generator (DPG) is as follows:

[0114] (1) Receive the feature map from the current level of the decoder as input;

[0115] (2) The input is fed into two parallel and lightweight 1×1 convolutional branches simultaneously:

[0116] Boundary prediction (or edge prediction) branch: The number of channels is reduced to 1 through a 1×1 convolution, and then passed through a Sigmoid activation function to output an edge prediction probability map with values ​​in the range [0,1].

[0117] Region prediction branch: The number of channels is reduced to 1 by another 1×1 convolution, and the output region prediction logistic value R_logits is not passed through the activation function.

[0118] (3) The edge prediction probability map and the region prediction probability map after the Sigmoid activation function can be used to calculate the edge loss and region loss with the corresponding gold standard (GT) to complete the supervision function.

[0119] (4) At the same time, the two prediction maps are sent to the prediction gate fusion module (PGF) in the same layer to participate in feature modulation.

[0120] This module achieves decoupling of region and edge information under feature sharing with extremely low computational overhead, and provides accurate intermediate signals for deep supervision and feature fusion.

[0121] The workflow of the Region Prediction Generator (RPG) is as follows:

[0122] (1) The module receives deep features from the encoder bottleneck layer;

[0123] (2) By using a single 1×1 convolutional layer, the number of feature channels is compressed to 1, and the region prediction logistic value R4_logits at the coarsest scale is obtained.

[0124] (3) Activate this logic value through the Sigmoid function to obtain the region prediction probability map, which can be used to calculate the deepest region supervision loss.

[0125] (4) The predicted probability map of this region will also be used for feature fusion of the corresponding layer (if any).

[0126] The RPG module focuses on generating global region prior information, providing initial semantic guidance for the entire decoding process.

[0127] Predictive Gated Fusion Module (PGF) Figure 7 The workflow includes:

[0128] (1) The module receives two inputs of the same size: the current layer feature x1 (C×H×W) of the main upsampled path, and the same layer feature x2 (C×H×W) of the skip connection.

[0129] (2) Perform 1×1 convolution (decreasing the channels to max(C / 8,4) → ReLU → 1×1 convolution (increasing back to C) on the main feature x1 to obtain the channel-adapted x1_adapted, with the size remaining C×H×W.

[0130] (3) Add x1_adapted to the cross feature x2 pixel by pixel to form the basic fusion feature F_base=x1_adapted+x2.

[0131] (4) Normalize the external region confidence map R (single channel H×W) with the Sigmoid activation function and extend it to the C channel to obtain the spatial gating α; calculate the region contribution: α×x2×ω_region (ω_region is learnable, initially 0.3).

[0132] (5) If the boundary branch is enabled, the external boundary prediction probability map (single channel H×W) is extended to the C channel to obtain the gated β; calculate the boundary contribution: β×x2×ω_boundary (ω_boundary is learnable, initially 0.1).

[0133] (6) The three factors, F_base, region contribution, and boundary contribution, are added pixel by pixel to output F_out (C×H×W), which is then fed into the subsequent layers of the backbone upsampling. As designed, only the current layer feature x1 of the backbone upsampling path is compressed and restored. The final output of the network is the segmentation probability map after all processing.

[0134] Example 2

[0135] Network construction and training methods:

[0136] The construction method of the present invention includes the following steps:

[0137] S1. Constructing the network: Construct an UltraSeg-108K or UltraSeg-130K network as described in Example 1;

[0138] S2. Prepare the dataset and labels: Obtain a training dataset (such as CVC-ClinicDB, Kvasir-SEG, PolypGen, PolypDB) containing colorectal polyp images and corresponding segmentation annotations. Divide the data into training and test sets in a ratio (e.g., 8:2). Generate edge supervision labels based on the segmentation annotations. For all data, there are original colonoscopy images for prediction and gold standard polyp masks. For all mask images in the training set, perform edge detection using the Canny operator, using a 5x5 operator matrix to obtain all corresponding edge mask images.

[0139] S3, Model Training:

[0140] Environment: Training is performed on a computer equipped with a GPU using the PyTorch framework;

[0141] Settings: Input image resolution 256×256, batch size 4, data loading threads 2; optimizer Adam (initial learning rate 3e-4); training 100 epochs, using an early stopping strategy (stop if the Dice coefficient on the validation set does not improve for 10 consecutive epochs).

[0142] Loss function: The constructed neural network is trained using a dual deep-supervised loss function. The total loss L consists of three weighted components:

[0143] ,

[0144] Among them, L main The loss of the final output layer has a weight of 1; L ri For the auxiliary loss of the i-th region (i=1~4, corresponding to R4 to R1), the BCE-Dice joint loss is used, with weights ω. ri The depth increments to [0.1, 0.2, 0.3, 0.4]; Lbj For the j-th level edge auxiliary loss (j=1~3, corresponding to B3 to B1), the BCE-Dice joint loss is also used, with weight ω. bj The depth is set to [0.1, 0.2, 0.3]; λ region and λ edge The balancing factor is set to 1.0; the BCE-Dice joint loss is defined as: L bce-dice =2L dice +L bce .

[0145] Initialization: Training begins with random initialization and does not depend on any external pre-trained model weights.

[0146] Inference Deployment: After training is complete, export the model weight file, which can then be deployed to the target single-core CPU device for real-time inference.

[0147] Example 3

[0148] Performance verification and effect analysis:

[0149] 1. Comparative experiment:

[0150] The UltraSeg-108K and UltraSeg-130K of this invention are compared with a variety of baseline models, including the standard U-Net series (parameter count from 31M to 0.1M), lightweight general-purpose models (MobileUNet, FastSCNN), and advanced lightweight medical segmentation models (LB-UNet, EGE-UNet).

[0151] Accuracy: On the PolypDB dataset, which includes multi-center and multimodal datasets, UNet-Base with 31M parameters achieves a Dice of 0.8536. UltraSeg-130K (0.13M) achieves a Dice of 0.7820, and UltraSeg-108K (0.108M) achieves a Dice of 0.7697, significantly outperforming UNet-Tiny (0.102M, Dice 0.6683) with similar parameter counts.

[0152] Speed: In single-core CPU testing, UNet-Base achieved only 1.6 FPS, while UNet-Tiny achieved 95.6 FPS. UltraSeg-108K and UltraSeg-130K reached 92.1 FPS and 90.3 FPS respectively, meeting the real-time requirement of >90 FPS while maintaining high accuracy.

[0153] Figure 10This is a scatter plot comparing the performance of the embodiments of the present invention and the comparative models, where (a) is a scatter plot of the number of parameters of different models versus the average Dice metric, and (b) is a scatter plot of the number of frames per second (FPS) that can be run under single-core CPU inference versus the average Dice metric. Specifically, the pentagrams in the figure represent the UltraSeg series proposed in this embodiment, including UltraSeg-108K and UltraSeg-130K (the metrics of the two models are similar, so they are shown in average form). Figure 10 The scatter plot shows that the UltraSeg series achieves the highest Dice index while maintaining a very small number of parameters, and reaches 90+ FPS on a single-core CPU, achieving the best balance between accuracy and speed.

[0154] 2. Ablation experiment:

[0155] As shown in Table 3 (the ablation experiment used the average and standard deviation of three ICE indicators), its effectiveness was verified by gradually adding core modules.

[0156] Baseline: UNet-Tiny (0.102M), with low Dice.

[0157] Step 1: By applying the horn-shaped channel, PGF module and Canny edge supervision, UltraSeg-108K(ST) (0.06M) was obtained, which outperformed the baseline LB-UNet on all datasets.

[0158] Step 2: Add two EDBs to form UltraSeg-108K (0.108M), which results in a significant performance boost, such as increasing Dice from 0.7155 to 0.7516 on Kvasir-SEG.

[0159] Step 3: Further addition of AGF and SSA modules to form UltraSeg-130K (0.130M) further improved Dice performance on complex cross-domain datasets (such as PolypGen), verifying its enhancement effect on generalization ability.

[0160] Table 3 Ablation Experiment Performance Table (Mean Dice ± Standard Deviation)

[0161]

[0162] 3. Visual effects:

[0163] Figure 11This diagram presents a visual comparison of the segmentation results of different models on the test image. The columns in the diagram, from left to right, are: the original image (input image), the gold standard (GT), the prediction result of UltraSeg-130K, the prediction result of UltraSeg-108K, and the prediction results of other comparative models. The two models of this invention predict more complete polyp regions with clearer boundaries than other lightweight models. The result of UltraSeg-130K is closest to the gold standard (GT), while other lightweight models exhibit significant region loss or blurred boundaries.

[0164] Figure 12 The bar chart further shows that the model of this invention achieves stable improvement in average Dice at both the sample level and the modality / center level, verifying its strong generalization ability and good adaptability in joint training of multimodal and multicenter data.

[0165] In summary, this invention, through a series of extremely lightweight designs, successfully solves the technical challenge of achieving high-precision real-time colorectal polyp segmentation on a single-core CPU, providing a feasible technical solution for AI in primary healthcare, mobile devices, and embedded colonoscopy screening.

[0166] The above embodiments are preferred embodiments of the present invention and are not intended to limit the present invention. Any other changes or equivalent substitutions made without departing from the technical solution of the present invention are included within the protection scope of the present invention.

Claims

1. A lightweight neural network structure for real-time colorectal polyp segmentation on a single-core CPU, characterized in that, It includes a five-level encoder, a five-level decoder, and jump connections connecting the corresponding level encoders and decoders; The channel widths of the encoder and decoder are 8, 16, 48, 64, and 96 in sequence from input to output. Two enhanced dilated convolutional modules are connected in series in the third stage of the encoder. Each stage of the decoder is connected to a shuffle fusion module. The overall parameter count of the neural network structure is less than 0.3M.

2. The ultra-lightweight neural network structure for real-time colorectal polyp segmentation on a single-core CPU according to claim 1, characterized in that, The enhanced dilated convolution module includes: The first grouping unit is used to divide the input feature map into K groups equally along the channel dimension; There are K parallel branch units. Each branch unit uses a convolutional layer with a grouped convolutional kernel size of 3×3 and a group number equal to the number of corresponding branch channels to process one of the groups. Each branch is configured with a different hole ratio. A splicing unit is used to splice the outputs of the K parallel branch units in the channel dimension; The fusion unit is used to fuse the features output by the splicing unit with the input feature map through learnable residual weights.

3. The ultra-lightweight neural network structure for real-time colorectal polyp segmentation on a single-core CPU according to claim 1, characterized in that, The group shuffle and fusion module includes: The second grouping unit is used to evenly divide the input feature map into N groups along the channel dimension; N spatial gating units, each spatial gating unit corresponding to a set of features, are used to generate a spatial gating map with the same resolution as the input feature map and to spatially modulate the set of features; The channel rearrangement unit is used to rearrange and splice the modulated N sets of features in a preset order.

4. The ultra-lightweight neural network structure for real-time colorectal polyp segmentation on a single-core CPU according to any one of claims 1-3, characterized in that, The decoder is equipped with a dual depth supervision mechanism for predicting signals in four different spatial resolution output regions and predicting signals at three different spatial resolution output edges.

5. The ultra-lightweight neural network structure for real-time colorectal polyp segmentation on a single-core CPU according to claim 4, characterized in that, The dual deep supervision mechanism is implemented through a region prediction generator and a dual prediction generator; The region prediction generator is positioned after the deepest decoder and is used to generate the deepest region prediction signal. The dual prediction generator is positioned after the decoders of other layers and is used to simultaneously generate the region prediction signal and the edge prediction signal of the corresponding layer.

6. The ultra-lightweight neural network structure for real-time colorectal polyp segmentation on a single-core CPU according to claim 5, characterized in that, It also includes a prediction gating fusion module, which is used to adaptively fuse the same-layer region prediction probability map and the edge prediction probability map generated by the dual depth supervision mechanism back to the jump connection as spatial gating.

7. The ultra-lightweight neural network structure for real-time colorectal polyp segmentation on a single-core CPU according to any one of claims 1-6, characterized in that, An attention-guided fusion module and a simplified spatial attention module are also integrated between the third-level feature map and the fourth-level feature map of the encoder.

8. The ultra-lightweight neural network structure for real-time colorectal polyp segmentation on a single-core CPU according to claim 1, characterized in that, The total number of parameters in the neural network structure is 0.108M.

9. The ultra-lightweight neural network structure for real-time colorectal polyp segmentation in a single-core CPU according to claim 7, characterized in that, The total number of parameters in the neural network structure is 0.130M.

10. A method for constructing an extremely lightweight neural network for real-time colorectal polyp segmentation on a single-core CPU, characterized in that, Includes the following steps: Construct a neural network structure as described in any one of claims 1 to 9; Obtain a training dataset containing images of colorectal polyps and their corresponding segmentation annotations; Based on the segmentation annotation, generate edge supervision labels; The constructed neural network is trained using a dual deep supervision loss function, which simultaneously constrains the final output region segmentation result, as well as the region prediction signal generated by the dual deep supervision mechanism at four different spatial resolutions and the edge prediction signal generated at three different spatial resolutions. The training begins from a randomly initialized state and does not rely on external pre-trained model weights.