Abstract
The early detection and removal of colorectal polyps can help reduce colorectal cancer and mortality rates. The segmentation of colorectal polyps in colonoscopy images is difficult due to multi-scale morphology, blurred boundaries, and complex background interference.To solve this problem, we propose a network of cross-scale attention and frequency domain perception of encoder-decoder architecture.The network has two new modules: first, Scale-Aware Cross Attention Skip Connection (SCAS) uses multi-head attention mechanism and multi-scale pyramid fusion to fuse multi-scale features from encoder and decoder to enhance the model to capture polyp features of different sizes.Secondly, Dual-domain fusion (D2F) separates and assigns weights of low-frequency global information and high-frequency detail information of the feature map at bottleneck stage, improving the model to analyze spatial and frequency domains and improve polyp boundaries.Multiple public colorectal polyp segmentation datasets show that our method is competitive and performs better than existing mainstream approaches in terms of mIoU and mDice: On the CVC-ClinicDB dataset our model produces mDice of 0.922 and mIoU of 0.863, outperforming UNet, UNet++, PraNet, ACSNet, DCSAU-Net, HarDNet-CPS, ProMamba, FoBS. These results validate its strong segmentation capability and effectiveness in accurately delineating polyp regions with blurred boundaries, large size variations, and complex background interference. The proposed method provides a reliable and promising tool for clinical endoscopic assistant diagnosis. The source code is publicly available at https://github.com/si-yuan20/Robust-segmentation-of-colon-polyps-Unet.
1. Introduction
Colorectal cancer, the most common and fatal tumor worldwide is usually derived from adenomatous polyps [1]. Early detection and removal of such polyps are important to reduce the prevalence and mortality of colorectal cancer [2]. Colonoscopy is the gold standard for colorectal polyp detection and diagnosis but is heavily influenced by endoscopist experience and attention to detail [3], contributing to an optical partial blindness when small or folded polyps are concerned [4]. Therefore, an intelligent segmentation model holds substantial clinical value by assisting endoscopists in achieving accurate and automated polyp delineation, thereby improving early lesion detection and reducing the workload for medical staff.
In the past few years, deep learning based medical image segmentation methods such as U-Net and its variants have achieved impressive performances in medical images segmentation [5–8]. These approaches leverage annotated data to automatically capture intricate features of lesion areas. However,the segmentation of colorectal polyps in medical images presents challenges due to the considerable variability in size, shape, color, and texture(as illustrated in Fig 1).Further, colonoscopy images are often subjected to interferences such as uneven lighting, mucosal reflections, motion blur, and noise, thereby causing poor segmentation [9–13]. Current approaches face two main challenges: traditional skip connection schemes have difficulty selecting and merging feature information of different scales from the encoder to the decoder and resulting in loss of details and unclear boundaries; and most models focus only on the spatial domain, ignoring the complementary role of frequency domain data in distinguishing polyps from healthy mucosal tissue.
Fig 1. Colonic polyps of different shapes, sizes, and lighting conditions.

We propose a U-shaped segmentation network with cross-scale attention and frequency domain perception that follows a encoder-decoder architecture and introduces Scale-aware Cross Attention Skip Connection (SCAS) and Dual Domain Fusion (D2F) modules. The SCAS module uses multi-head attention and multi-scale pyramid fusion to synchronize multi-scale features between encoder and decoder, allowing polyp features of different size captured by the model. The D2F module separates low-frequency global information and high-frequency details at the bottleneck layer and assign adaptive weights to each. This allows the model to have strong spatial frequency domain collaborative perception, thus improves polyp boundary detection.
Experimental results on publicly available polyp datasets demonstrate that our approach outperforms common methods in key metrics, such as mIoU and mDice, and excels particularly in segmenting small polyps and delineating blurred boundaries.We summarize our main contributions as follows:
We propose a new U-shaped segmentation network which incorporates cross-scale attention and frequency domain perception. By integrating encoder-decoder design with new modules, we are capable of solving key problems in colorectal polyp segmentation like multi-scale variation, blurred boundaries, and background noise.This new technique provides an advanced technique for the automated segmentation of colorectal polyps.
We propose a Scale-Aware Cross Attention Skip Connection (SCAS) module. Different from conventional attention-gated skip connections, our design models encoder-decoder interactions explicitly through multi-scale cross-attention instead of single-scale feature gating. The SCAS integrates pyramid-based attention aggregation and gated residual recalibration to perform scale-adaptive skip connection, maintaining low-level structural cues that contribute to precise boundary delineation.
Design of a dual-domain fusion (D2F) module, which is used to separate, harvest and weight low-frequency global context information as well as high-frequency detail signals within the bottleneck feature map. This module endows the model with the potentiality of joint perception in frequency domain space, making rough and vague polyp boundaries more distinct and mitigating to ignore the important details of frequency with singular spatial domain operation.
Experiments conducted on different public datasets confirm the effectiveness of the proposed method, which has outperformed several state-of-the-art methods in terms of mIoU and mDice scores. Especially, in small polyp and fuzzy boundary segmentation tasks, which shows better robustness and accuracy of clinical endoscopic auxiliary diagnosis.
2. Related work
2.1 Current status of research on colonic colorectal polyp segmentation
Fully convolutional neural networks (FCN) [14] are the first deep learning model for medical image segmentation. U-Net [5] is one of the best models for this work with encoder-decoder architecture and skip connection design. Colorectal polyp segmentation has been studied a lot.One method for this is the extraction of features using pre-trained networks as encoder backbone [15–17] to capture more complex features. Models like UNet++ [6] and MultiResUNet [18] have been developed to improve multi-scale feature fusion by merging features of different resolution by dense connections or multi-path structures. Attention has also been gaining popularity, highlighting critical regions and minimizing irrelevant background by spatial or channel attention weight [19]. Attention mechanisms used in these models work at local scale or single scale, indicating need for improved adaptive fusion for polyp features.
2.2 Application of attention mechanism
The effectiveness of attention mechanisms in enhancing model performance within computer vision has been well-established [20]. In the realm of medical image segmentation, techniques such as CBAM [21] and SENet [22] adjust the model by utilizing spatial or channel dimension weights to emphasize critical areas. Nonetheless, these approaches frequently do not explicitly model cross-scale dependencies when handling features across encoders and decoders. Recently, there has been a growing interest in leveraging non-local self-attention mechanisms to capture long-range dependencies, thereby enhancing the model’s capacity to comprehend the overall morphology of lesions through global feature similarity calculations. Nevertheless, such methodologies often necessitate intensive matrix operations on the original resolution feature maps, leading to a quadratic increase in computational complexity relative to the feature map size. This substantial computational burden restricts their applicability in real-time clinical auxiliary diagnostic systems [23–25]. While attention-based skip connection improves feature selection during encoder-decoder fusion, most attention-based skip connection methods rely on single-scale attention gating or feature reweighting, which does not explicitly model multi-scale cross-scale interactions. In contrast, the proposed SCAS considers skip connection as multi-scale cross-attention process, in which encoder features guide the selection of encoder features in multiple pooled resolutions, followed by gated residual refinement.
2.3 Transformer-based and hybrid segmentation models
Transformer-based and hybrid architectures are increasingly popular in medical image segmentation because they handle long-range dependencies and capture global contextual information. Ji et al. [26], proposed the Shared Hybrid Attention Transformer (SHAT) network, which uses transformer-based attention mechanisms with convolutional features to capture contextual information. Luo et al. [27], proposed a transformer-convolutional fusion network that mixes global attention modeling with local feature extraction, yielding improved segmentation performance on challenging polyp data. To further exploit complementary information, Li et al. [28] developed the cross-information fusion network, which combines CNN and transformer branches for multi-level feature interaction. Gupta et al. [29] proposed Transformer-Dilated ResUNet, which combines dilated convolutions and transformer blocks to achieve optimal receptive field enlargement and feature representation efficiency. Although promising performance methods, they are often a computational complexity and memory consumption due quadratic scaling of self-attention mechanisms. Other approaches focus more on global context modeling, with no cross-scale feature interaction and frequency domain information that is essential for polyp boundary delineation.
2.4 Research progress on frequency domain information fusion
Frequency domain analysis is a key method in image processing, providing valuable insights into texture and structural periodicity that are not readily apparent in the spatial domain [30]. The incorporation of frequency domain data has recently emerged as an innovative strategy to improve model performance: high-frequency components capture intricate details such as texture and edges, while low-frequency components depict overall contours [31]. Traditional approaches typically utilize Fourier transform for spatial frequency conversion, but its computational requirements are prohibitive. Recent studies have investigated the fusion of frequency domain knowledge with deep learning methods. For example, some research employs fast Fourier transform to convert images into the frequency domain, combined with CNN features [32,33]. Other investigations integrate frequency domain filtering at the feature level to enhance the model’s robustness against interference [34]. Nonetheless, the optimal incorporation of frequency domain information into segmentation networks, especially in the context of colorectal polyp segmentation tasks, remains a relatively unexplored area.
3. Materials and methods
3.1 Datasets
To validate the efficacy of the proposed approach, this investigation utilized four publicly accessible datasets for segmenting colorectal polyp images for both training and assessment purposes. These datasets are CVC-ClinicDB [35], CVC-ColonDB [36], CVC-T [37], and ETIS-LaribPolypDB [38]. The distribution of data quantities across these datasets is illustrated in Fig 2.
Fig 2. Colorectal polyp Image Datasets.

The CVC-ClinicDB dataset contains 612 high resolution colonoscopy images with expert annotations covering polyp types.CVC-ColonDB dataset contains 300 colonoscopy images and annotations covering different polyp types. The ETIS-LaribPolypDB dataset contains 196 colonoscopy images obtained from real clinical cases representing different and complex intestinal environments for validation of colorectal polyp segmentation. CVC-T polyp dataset contains 60 images from 44 videos of 36 patients. It is a validation dataset for medical image segmentation tasks, including polyp detection and segmentation validation. The quantities of each dataset are shown in Fig 3.
Fig 3. Representative examples of colorectal polyp images from four public datasets.

The four publicly available datasets together form an evaluation framework covering a range of clinical scenarios, polyp characteristics, and image quality levels, ensuring a thorough and dependable assessment of model performance (Table 1).
Table 1. Use of different datasets in this study.
| Dataset | Year | Train | Test | Val |
|---|---|---|---|---|
| CVC-ClinicDB | 2015 | 490 | 61 | 61 |
| CVC-ColonDB | 2016 | / | / | 380 |
| ETIS-LaribPolypDB | 2014 | / | / | 196 |
| CVC-T | 2017 | / | / | 60 |
3.2 Framework of the network architecture
The network employs a U-shaped encoder-decoder architecture specifically designed for colorectal polyp segmentation. It comprises four key components: a ResNet-34 encoder, a decoder, the SCAS module for multi-scale feature fusion, and the D2F module for feature enhancement, which together form a comprehensive framework. A schematic representation of the network architecture is illustrated in Fig 4.
Fig 4. Overview of the proposed segmentation framework.

The network adopts an encoder–decoder architecture with skip connections, enhanced by SCAS modules and the D2F module for multi-scale feature refinement.
Figure 4 shows the role of ResNet-34 encoder for retrieving hierarchical features from input images. Deep residual solves gradientvanishing problem by residual connections and learns polyp edges and high-level semantic information such as overall polyp morphology. The fusion process is performed after passing through bottleneck layer. The encoded features are merged into fusion stage. The D2F module combines low frequency and high frequency features. Low frequency encodes global context using adaptive average pooling and high frequency encodes local details via residual operations. Low frequency encodes global context using adaptive average pooling while high frequency captures local details via residual operations. The components are adaptively integrated by learning parameter, which improves feature discrimination. Multi-level upsampling and skip connections, the decoder gradually restores the resolution of the feature map. SCAS module is crucial in integrating decoder and encoder features by first creating feature maps with different resolutions for multi-scale downsampling, compute multi-scale attention, merge the results, and adaptively assign weights to encoder features using gate generator.Finally, we use multi-layer convolution and upsampling to obtain a segmentation map of the same size as input image and target for polyp selection. Both parts work together to keep a balance between local segment accuracy and detail presentation, suitable for colorectal polyp selection.
3.2.1 Encoder.
Features are extracted from input image by the encoder with multi-level and multi-scale using pre-trained ResNet34 model on ImageNet, and we remove the original global average pooling layer and fully connected layer to transfer this model as feature extractor. In order to make subsequent decoder skip connections, the output of layer 4 is upsampled by a factor of 2, and we have a set of feature maps [e1, e2, e3, e4], whose spatial size is reduced to 1/16 of original input image and channel number 64, 128, 256 and 512 respectively. Pretrained models can extract learned general image features, improve convergence and improve performance.
3.2.2 Decoder.
The main function of the decoder is to gradually increase the resolution of the encoded feature map to match the original output resolution.This allows spatial information to be recovered for precise segmentation of pixels.The decoder is symmetrical and has 4 stages.The first step is upsampling by bilinear interpolation of abstract feature maps created higher in the previous step to match them with the dimensions of encoder feature map for current stage integration.Feature enhancement and fusion is a new step.Rather than skip connections, the SCAS module is introduced instead to improve feature merging. In this module, the upsampled features of the current decoder are used as the query and encoder features from the previous layer are used as the Key and Value. Multiscale cross attention is used to create spatial attention map to reevaluate encoder features, highlighting important information about polyp region and background noise.In the third step, the encoder features, enhanced by the SCAS module, are concatenated with the upsampled decoder features in the channel dimension to merge detailed information from the encoder with semantic information from the decoder.The fourth step involves feature reconstruction, where the concatenated features are inputted into a decoding block for further processing. Each Decoder Block consists of two ConvBNReLU layers and a residual connection to merge features and reduce the channel count. The output channels for all decoder stages are set at 512 to maintain feature consistency.The network architecture of the DecoderBlock and ConvBNReLU modules is illustrated in Fig 5.
Fig 5. Architecture of ConvBNReLU (a) and Architecture of DecoderBlock(b).

Processing via a streamlined convolution module, which includes convolution, dropout layer, and a 1x1 convolution, to enhance feature extraction and upsample to the original image dimensions. The ultimate segmentation image is produced utilizing the Sigmoid activation function.
3.3 Scale-aware cross attention skip connection (SCAS)
The conventional U-Net skip connection method concatenates encoder and decoder features without considering variations in feature layer importance. To address this limitation, we have developed the SCAS module to enhance feature fusion intelligently and adaptively. The module’s structure is illustrated in Fig 6, comprising a multi-scale attention computation unit and a gated fusion unit.
Fig 6. Schematic illustration of the proposed SCAS module.

The module leverages encoder–decoder feature interaction through Q–K–V projection, followed by multi-scale attention fusion and a gating mechanism to enhance feature representation.
The SCAS module consists of four components: feature projection, multi-scale attention, feature fusion, and gating refinement. Decoder features (Query) and encoder features (Key/Value) are first reduced in channel dimension using separate 11 convolutions to improve efficiency while retaining essential information.To capture structures at different scales, average pooling with 22 and 44 kernels is applied to generate multi-resolution features. Cross-attention is then performed at each scale using a multi-head scheme, where Query–Key similarity is computed, normalized by Softmax, and used to weight the Value features.The outputs from different scales are upsampled to the original size and fused through element-wise operations, enabling complementary information to be integrated. A gating mechanism is further introduced to suppress noise, where a spatial attention map is generated via convolutional layers and applied to encoder features.Finally, a residual connection with a learnable parameter is incorporated to retain original information, leading to more stable and refined feature representations.
In our implementation, each SCAS block uses 4 attention heads. The query, key, and value features are first projected to a reduced dimension defined as , where Ce and Cd denote the encoder and decoder channel widths, respectively. Therefore, the per-head dimension is dh = d/4. For the four skip levels used in our network, the resulting projected dimensions are 256, 128, 64, and 32, corresponding to head dimensions of 64, 32, 16, and 8, respectively.
For an input image of 352352, SCAS is applied at feature resolutions of 2222, 2222, 4444, and 8888 from coarse to fine levels. At each level, cross-attention is computed over three scales (1, 1/2, and 1/4). The corresponding attention complexity is , which preserves the quadratic dependence on the number of spatial tokens but only introduces a ~6.6% overhead relative to single-scale attention at the same projected dimension. Because SCAS uses d = 0.5Ce in our implementation, its core attention cost is approximately 53.3% of a full-channel non-local block applied at the same spatial resolution.
Unlike conventional attention-gated skip connections, which usually generate a single-scale gating map from concatenated encoder and decoder features, the proposed SCAS treats decoder features as queries and encoder features as keys/values, thereby modeling skip connection as an explicit cross-attention process. Furthermore, instead of computing attention at only one spatial resolution, SCAS aggregates attention responses from a multi-scale pyramid (1, 1/2, and 1/4 resolutions), which improves sensitivity to polyps with heterogeneous sizes. Finally, a gated residual refinement strategy is introduced to suppress irrelevant background responses while preserving essential low-level structural information. These characteristics distinguish SCAS from standard attention-gated and single-scale cross-attention skip mechanisms.
3.4 Dual-domain fusion (D2F)
The Dual-Domain Fusion (D2F) module is designed to enhance feature representation for colorectal polyp segmentation by jointly modeling low-frequency global structures and high-frequency detailed information. This design effectively addresses challenges such as blurred boundaries and shape variability. The overall architecture of the D2F module is illustrated in Fig 7.
Fig 7. Overview of the proposed Dual-Domain Feature Fusion (D2F) module.

The module integrates low-frequency (channel-wise), high-frequency (spatial-wise), and residual branches through adaptive weighting to enhance feature representation.
As shown in Fig 7, given an input feature map the D2F module first performs parallel dual-domain feature extraction, followed by adaptive fusion to integrate the features.To capture global contextual information, adaptive global average pooling is first applied to aggregate spatial statistics. A channel attention mechanism is then employed to generate low-frequency weights:
| (1) |
where denotes the sigmoid activation function. The low-frequency enhanced feature is obtained via channel-wise modulation:
| (2) |
To emphasize local details including boundaries and texture variations, high-frequency components are extracted via subtracting the smoothed feature map from the original feature map. Channel attention is adopted to produce adaptive weights. High-frequency enhanced features are constructed by weighting high-frequency components and fusing them with original features.
| (3) |
| (4) |
| (5) |
To integrate complementary information from different domains, normalized parameterization is employed for feature fusion. A learnable parameter vector is introduced. Fusion weights are derived through the softmax function.
| (6) |
| (7) |
The final fused feature is obtained as a weighted combination of the low-frequency enhanced feature, high-frequency enhanced feature, and the original residual feature:
| (8) |
This formulation allows the model to dynamically balance global structural information and fine-grained details with complementary residual information. By adaptively weighting features from different domains, the proposed fusion scheme enhances both feature discriminability and segmentation robustness. Compared to unconstrained weighting schemes, the proposed normalized fusion scheme naturally avoids degenerate solutions without additional regularization. By allowing a convex combination, the model can balance global structural information, fine-grained details and residual features, thus improving robustness and segmentation accuracy.
3.5 Loss function
This study employs a multi-scale mixed loss function to optimize the training of a colorectal polyp segmentation model. The proposed loss function integrates the BCE-Dice mixed loss component to enhance gradient guidance effectively by consolidating the loss values from feature maps at various scales. Specifically, the BCE-Dice loss amalgamates the strengths of BCE and Dice loss. This composite loss leverages BCE’s sensitivity to pixel-level classification errors while prioritizing the optimization of the intersection-to-union ratio of the target area through Dice loss. The calculation formula for this loss function is as follows:
| (9) |
In the formula, is the weight coefficient with a value of 0.5, LBCE representing the binary cross entropy loss, and D is the Dice coefficient. The formula is defined as follows (9) and (10):
| (10) |
In the formula, yirepresents the binary label 0 or 1 of the i-th pixel, represents the probability of the output belonging to the label, and N represents the number of groups predicted by the model.
| (11) |
In the formula, represents the i-th pixel value of the predicted value and the true label respectively, and is a smoothing term to avoid the denominator being 0.
A multi-scale loss fusion strategy is employed to effectively leverage feature information across various levels of the model. The BCE-Dice loss of the ultimate output is combined with losses from four distinct downsampling scales, weighted according to their respective coefficients, and then aggregated. The formulation is presented below:
| (12) |
In the formula, wk represents the weight of each scale loss, which are [1.0, 0.8, 0.6, 0.4, 0.2], respectively, and represents the BCE-Dice loss value output at the kth scale. This multi-scale loss enables the model to effectively capture both global structural features and local details simultaneously, thereby enhancing the accuracy of segmenting polyp boundaries as well as small-sized polyps.
4. Results and analysis
4.1 Evaluation metrics
Various evaluation metrics were employed in this study to assess the segmentation performance of the model, such as mIoU, mDice, accuracy, sensitivity, and specificity.
(1) mIoU: Intersection ratio measures the degree of overlap between the predicted segmentation area and the actual annotated area.
| (13) |
(2) mDice:Dice coefficient is used to evaluate the similarity between segmentation results and real annotations, and is sensitive to imbalanced data.
| (14) |
(3) Recall: The proportion of true polyp pixels correctly identified.
| (15) |
(4) Precision:The proportion of pixels predicted to be polyps that are actually polyps.
| (16) |
(5) HD95:The 95th percentile Hausdorff Distance measures the boundary discrepancy between the predicted segmentation and the ground truth, reducing sensitivity to extreme outliers.
| (17) |
| (18) |
| (19) |
(6) ASSD: Average Symmetric Surface Distance computes the average distance between the boundaries of the predicted segmentation and the ground truth in both directions.
| (20) |
(7) BF-score: Boundary F1 score evaluates the similarity between predicted and ground-truth boundaries by combining precision and recall at the boundary level.
| (21) |
| (22) |
Within this context, True Positive (TP) refers to cases that are correctly identified as positive, False Positive (FP) denotes cases incorrectly identified as positive, False Negative (FN) represents cases incorrectly identified as negative, and True Negative (TN) signifies cases correctly identified as negative.
4.2 Implementation details
Experiments evaluating our proposed method were performed utilizing the PyTorch framework and executed on a high-performance NVIDIA L20 GPU. Detailed specifications are provided in Table 2. below.
Table 2. Environment configuration details.
| Type | Component | Configure |
|---|---|---|
| Hardware environment | GPU | NVIDIA L20(48 GB VRAM) |
| CPU | Intel XeonGold 6226R | |
| Memory | 128 GB | |
| Storage | 1TB | |
| Software environment | Operating system | Ubuntu20.04LTS |
| Python | 3.8.10 | |
| PyTorch | 2.00 + cu118 | |
| CUDA | 11.8 | |
| Training Parameter | Batch size | 8 |
| Initial_lr | 1e-3 | |
| Minimum_lr | 1e-6 | |
| Lr_scheduler | Cosine annealing | |
| Warm-up | First 5 epochs (0.1) | |
| Optimizer | AdamW | |
| Weight decay | 1e-4 | |
| epochs | 200 | |
| Input size | 352352 |
In addition, standard data augmentation techniques were applied, including random flipping, cropping, and elastic deformation, each with a probability of 0.5. These settings follow common practice in medical image segmentation.To ensure the robustness of our results, all experiments were repeated 3 times with different random seeds (2024, 2025, and 2026). We report the mean and standard deviation of the evaluation metrics. For UNet, UNet++ and our proposed model, we trained all models under a consistent experimental setup, including unified data split, preprocessing pipeline, input resolution, optimizer and training hyperparameters, so that complete statistical results can be provided. For other competing methods, we directly report the official performance values from their original publications, as their training codes are not publicly available or their training protocols are inconsistent with ours. Consequently, variance statistics are not available for these methods.
4.3 Analysis of learning ability
The performance of the proposed method was evaluated on the public CVC-ClinicDB dataset for colorectal polyp segmentation. A quantitative comparison with representative state-of-the-art methods is summarized in Table 3, where multiple commonly used metrics including mDice, mIoU, precision (Pre), recall, HD95, ASSD, and BF-score are employed for comprehensive evaluation.
Table 3. Comparison of performance indicators of different methods.
| Method | mDice | mIoU | Pre | Rec | HD95 | ASSD | BF-score |
|---|---|---|---|---|---|---|---|
| UNet [5] | 0.853 | 0.744 | 0.831 | 0.872 | 12.36 | 3.21 | 0.742 |
| UNet++ [6] | 0.826 | 0.705 | 0.793 | 0.861 | 14.85 | 3.98 | 0.698 |
| PraNet [39] | 0.899 | 0.817 | 0.913 | 0.916 | 9.87 | 2.76 | 0.821 |
| ACSNet [40] | 0.913 | 0.840 | 0.915 | 0.931 | 9.12 | 2.58 | 0.845 |
| DCSAU-Net [41] | 0.912 | 0.861 | 0.924 | 0.919 | 9.05 | 2.52 | 0.853 |
| HarDNet-CPS [42] | 0.911 | 0.856 | 0.929 | 0.912 | 9.21 | 2.61 | 0.848 |
| ProMamba [43] | 0.886 | 0.808 | 0.889 | 0.867 | 10.53 | 2.94 | 0.806 |
| FoBS [44] | 0.912 | 0.859 | 0.909 | 0.912 | 9.18 | 2.57 | 0.851 |
| Ours | 0.922 0.016* | 0.863 0.019* | 0.922 0.023* | 0.913 0.021* | 9.13 0.35* | 2.61 0.12* | 0.846 0.016* |
* indicates statistically significant improvement (p < 0.05).
As shown in Table 3, the proposed method achieves a mean Dice coefficient (mDice) of 0.9220.016, which is approximately 0.96% higher than DCSAU-Net (0.912), 1.01% higher than HarDNet-CPS (0.911), and 2.56% higher than PraNet (0.899). The mean Intersection over Union (mIoU) reaches 0.8630.019, representing an increase of 0.23% over DCSAU-Net (0.861) and 0.81% over HarDNet-CPS (0.856). In terms of precision, the proposed method achieves a value of 0.9220.023, surpassing DCSAU-Net (0.924, which is nearly similar but slightly lower) and PraNet (0.913) by approximately 0.97%. The recall value is 0.9130.021, which remains comparable to that of mainstream high-performance networks. Additionally, the proposed method yields HD95, ASSD, and BF-score values of 9.130.35, 2.610.12, and 0.8460.016, respectively, which are comparable to those of top-performing counterparts. These results demonstrate that the proposed method exhibits competitive advantages over most existing approaches in colorectal polyp segmentation, with enhanced regional integrity and localization accuracy.
To assess the stability of the proposed approach, three separate runs were carried out using distinct random seeds on the CVC-ClinicDB dataset. The outcomes are outlined in Table 4. The model exhibits uniform performance across all assessment criteria, with negligible discrepancies noted among the runs.
Table 4. Multi-run results of our method on CVC-ClinicDB.
| Seed | mDice | mIoU | Pre | Rec | HD95 | ASSD | BF-score |
|---|---|---|---|---|---|---|---|
| 2024 | 0.923 | 0.864 | 0.924 | 0.915 | 9.14 | 2.61 | 0.847 |
| 2025 | 0.906 | 0.843 | 0.899 | 0.892 | 8.78 | 2.49 | 0.830 |
| 2026 | 0.937 | 0.882 | 0.943 | 0.932 | 9.47 | 2.73 | 0.861 |
| MeanSD | 0.922 0.016 | 0.863 0.019 | 0.922 0.023 | 0.913 0.021 | 9.13 0.35 | 2.61 0.12 | 0.846 0.016 |
Table 4 displays the segmentation outcomes of the proposed approach on the CVC-ClinicDB dataset across three distinct random seeds (2024, 2025, 2026). The mDice values for region-based assessments range from 0.906 to 0.937, with an average of 0.9220.016. Correspondingly, the mIoU ranges from 0.843 to 0.882, averaging 0.8630.019. Precision and Recall scores fall within the ranges of 0.899–0.943 and 0.892–0.932, with mean values of 0.9220.023 and 0.9130.021, respectively. Despite variations induced by diverse random initializations, all region-level metrics exhibit relatively concentrated distributions, indicating the insensitivity of the proposed model to random seed configurations and its consistent performance in region segmentation. Concerning boundary-related metrics, HD95 varies from 8.78 to 9.47, with a mean of 9.130.35, while ASSD fluctuates between 2.49 and 2.73, averaging 2.610.12. The BF-score shows slight fluctuations from 0.830 to 0.861, with a mean value of 0.8460.016. Despite the challenges posed by blurred edges and poor contrast in polyp boundary delineation, the minimal standard deviations observed across runs indicate the stability and reliability of the proposed method in boundary localization.Moreover, the coefficient of variation (CV) for all metrics remains below 5%, confirming the robustness and reliability of the proposed approach. These findings validate that the performance enhancements noted in this study are replicable and consistent, rather than stemming from random initialization or fortuitous optimization.
The results demonstrate that our method yields stable and consistent performance under different random initializations. While the metrics for seed 2025 are marginally lower due to stochastic variation in optimization and a slightly harder subset of validation cases, the overall mean and standard deviation confirm the reliability and reproducibility of our approach.
4.4 Analysis of ablation experiment
To validate the effectiveness of each proposed component, systematic ablation experiments are conducted on the CVC-ClinicDB dataset for colorectal polyp segmentation.Quantitative results measured using mDice and mIoU are summarized in Table 5.
Table 5. Experimental data indicators for ablation of different modules.
| Module | Metrics | ||||
|---|---|---|---|---|---|
| Baseline | Resnet | D2F | SCAS | mDice | mIoU |
| 0.8330.028 | 0.7370.031 | ||||
| 0.8590.024 | 0.8130.026 | ||||
| 0.8520.017 | 0.8240.023 | ||||
| 0.8870.020 | 0.8360.021 | ||||
| 0.9100.018 | 0.8510.020 | ||||
| 0.922 0.016 | 0.863 0.019 | ||||
The baseline model attains an mDice of 0.8330.028 and an mIoU of 0.7370.031, serving as a fundamental reference. By incorporating the ResNet encoder, the mDice increases to 0.8590.024 and the mIoU to 0.8130.026, reflecting improvements of approximately 3.1% and 10.3%, respectively. This finding demonstrates that ResNet effectively enhances multi-level feature representation for polyp regions. When the D2F module is integrated into the baseline, the mDice reaches 0.8520.017 and the mIoU reaches 0.8240.023, corresponding to increments of about 2.3% and 11.8% compared to the baseline. This result indicates that the D2F module contributes to refining boundary details and reducing fuzzy segmentation. The combination of ResNet and D2F further enhances performance, yielding an mDice of 0.8870.020 and an mIoU of 0.8360.021, confirming the complementary benefits of improved feature extraction and boundary optimization.
By integrating the SCAS module with ResNet, the model achieves an mDice of 0.9100.018 and an mIoU of 0.8510.020, demonstrating improvements of approximately 8.5% in mDice and 18.2% in mIoU over the baseline. This outcome verifies that the multi-scale attention mechanism effectively focuses on informative regions while suppressing background noise.Full integration of ResNet, D2F, and SCAS yields favorable performance for the model, with an mDice of 0.9220.016 and an mIoU of 0.8630.019, representing 10.7% and 17.1% improvements compared to the baseline, respectively. These results illustrate that each module contributes positively to segmentation performance, and their synergistic integration effectively improves both region coverage and boundary precision for colorectal polyp segmentation.
Table 6 presents a component-level ablation to quantify the contribution of each design in SCAS and D2F. Each variant removes or replaces a single component while keeping the remaining structure unchanged, enabling a direct assessment of its effect on segmentation performance.
Table 6. Component-level ablation of SCAS and D2F modules.
| Setting | mDice | mIoU |
|---|---|---|
| SCAS w/o multi-scale fusion | 0.8810.022 | 0.8480.011 |
| SCAS w/o gating mechanism | 0.9120.018 | 0.8510.016 |
| D2F w/o high-frequency branch | 0.8950.021 | 0.8420.017 |
| D2F w/o adaptive fusion weights | 0.9110.017 | 0.8560.013 |
| D2F with Laplacian filter | 0.9070.020 | 0.8530.011 |
| Ours | 0.922 0.016 | 0.863 0.019 |
As reported in Table 6, removing multi-scale fusion in SCAS leads to the most significant performance drop, with mDice decreasing from 0.922 to 0.881 and mIoU from 0.863 to 0.848, highlighting its critical role in capturing scale variations. In comparison, excluding the gating mechanism results in a relatively smaller decline (mDice:0.912, mIoU:0.851), suggesting that it mainly contributes to feature refinement.For the D2F module, removing the high-frequency branch reduces mDice to 0.895 and mIoU to 0.842, indicating weakened boundary representation capability. Eliminating the adaptive fusion weights results in a slight decrease in mDice (0.911), while mIoU (0.856) remains comparable, implying a limited but stabilizing effect. When the learnable high-frequency extraction is replaced by a Laplacian filter, performance drops to mDice 0.907 and mIoU 0.853, suggesting that fixed operators are less effective than adaptive ones.
Overall, the observations from Table 6 indicate that different components contribute in complementary ways. Multi-scale fusion and high-frequency modeling play a more prominent role, while the gating mechanism and adaptive weighting further enhance feature refinement and balance, leading to more stable segmentation performance.
4.5 Analysis of learned fusion weights
Table 7 presents the fusion weights learned by the D2F module under various random seeds. It is evident that each of the three branches maintains a non-zero contribution in all iterations, indicating the fusion mechanism avoids converging to a single-branch outcome.
Table 7. Learned D2F fusion weights under different random seeds on the validation set.
| Seed | W low | W high | W res |
|---|---|---|---|
| 2024 | 0.521 | 0.256 | 0.223 |
| 2025 | 0.438 | 0.341 | 0.221 |
| 2026 | 0.479 | 0.316 | 0.205 |
Specifically, the low-frequency branch consistently holds the highest weight, underscoring the significance of global structural cues in the acquired representation. Conversely, the high-frequency branch sustains a steady and moderate contribution, facilitating precise boundary delineation and the capture of intricate details. The residual branch demonstrates minimal variability across different seeds, supplementing additional information to bolster the overall resilience of the system.Although minor fluctuations can be observed across different random initializations, the overall distribution remains highly consistent. This indicates that the learned fusion behavior is stable and not sensitive to initialization.These results suggest that the proposed D2F module achieves a balanced integration of global context and high-frequency details, with a clear preference for structural information while still preserving complementary refinement cues.
4.6 Analysis of generalization ability
In Table 8, we generalize the colorectal polyp segmentation model to different datasets. Our model trained on CVC-ClinicDB data sets and tested on four different validation sets.
Table 8. Generalization performance of different datasets.
| Training set | Validation set | mDice | mIoU |
|---|---|---|---|
| CVC-ClinicDB | CVC-ClinicDB | 0.9220.016 | 0.8630.019 |
| CVC-Colondb | 0.6940.047 | 0.5800.028 | |
| ETIS-LaribPolypDB | 0.7030.027 | 0.5470.031 | |
| CVC-T | 0.8910.021 | 0.8270.027 |
When trained and validated on the same CVC-ClinicDB dataset, the model achieved an mDice of 0.9220.016 and an mIoU of 0.8630.019, indicating strong segmentation consistency and reliability on identically distributed data. Upon validation with CVC-T, the model’s performance showed slight fluctuations with the mDice decreasing to 0.8910.021, a reduction of approximately 3.4% compared to the CVC-ClinicDB validation set, while the mIoU changed to 0.8270.027, a slight decrease of around 4.2%. This suggests that the model maintains a favorable level of generalization capability when encountering datasets with distribution characteristics similar to the training data. In contrast, more significant performance declines were evident when validating with CVC-ColonDB and ETIS-LaribPolypDB. For CVC-ColonDB, the mDice decreased to 0.6940.047, a reduction of approximately 24.7% compared to the CVC-ClinicDB baseline, and the mIoU decreased to 0.580.028, a reduction of about 32.8%. Similarly, on ETIS-LaribPolypDB, the mDice dropped to 0.7030.027, corresponding to a decrease of around 23.7%, and the mIoU was 0.5470.031, a reduction of approximately 36.6% compared to the baseline performance.
These findings suggest that the model’s generalization performance tends to weaken when confronted with datasets with substantial distribution shifts, which may be attributed to variations in polyp morphology, imaging conditions, and background complexity between these validation datasets and the training set. Therefore, further improvements in data diversity enhancement and domain adaptation strategies would be beneficial to promote the model’s cross-dataset generalization ability, thereby facilitating its potential clinical deployment.
To assess the generalization capacity of our approach, we conducted a comparative performance analysis across various polyp datasets from recent years. Table 9 presents a comprehensive overview of the results.
Table 9. Performance comparison of different methods on the CVC-Colondb, ETIS-LaribPolypDB, and CVC-T datasets. The best results are displayed in bold.
| Datasets | Method | Years | mDice | mIoU |
|---|---|---|---|---|
| CVC-ColonDB | PraNet [39] | 2020 | 0.713 | 0.644 |
| ACSNet [40] | 2020 | 0.726 | 0.663 | |
| EUNet [45] | 2021 | 0.751 | 0.681 | |
| DCRNet [46] | 2022 | 0.715 | 0.645 | |
| HarDNet [42] | 2023 | 0.729 | 0.652 | |
| Ours | 2026 | 0.6940.047 | 0.580.028 | |
| ETIS-LaribPolypDB | PraNet [39] | 2020 | 0.634 | 0.578 |
| ACSNet [40] | 2020 | 0.582 | 0.518 | |
| EUNet [45] | 2021 | 0.695 | 0.612 | |
| DCRNet [46] | 2022 | 0.561 | 0.509 | |
| HarDNet [42] | 2023 | 0.695 | 0.617 | |
| Ours | 2026 | 0.7030.027 | 0.5470.031 | |
| CVC-T | PraNet [39] | 2020 | 0.877 | 0.802 |
| ACSNet [40] | 2020 | 0.874 | 0.794 | |
| EUNet [45] | 2021 | 0.843 | 0.769 | |
| DCRNet [46] | 2022 | 0.866 | 0.791 | |
| HarDNet [42] | 2023 | 0.899 | 0.821 | |
| Ours | 2026 | 0.8910.021 | 0.827 0.027 |
Table 9 summarizes the quantitative comparison between the proposed method and several state-of-the-art approaches on CVC-ColonDB, ETIS-LaribPolypDB, and CVC-T datasets. On CVC-ColonDB, EUNet performs best with an mDice of 0.751 and an mIoU of 0.681. The proposed method yields an mDice of 0.6940.047 and an mIoU of 0.580.028, approximately 7.6% lower in mDice and 14.8% lower in mIoU than EUNet. This modest performance may stem from the domain gap and complex background interference between CVC-ColonDB and the training dataset CVC-ClinicDB.ETIS-LaribPolypDB is the most challenging dataset, with all methods’ mDice ranging from 0.561 to 0.703 and mIoU from 0.509 to 0.617. The proposed method achieves an mDice of 0.7030.027, approximately 1.2% higher than EUNet and HarDNet. However, its mIoU of 0.5470.031 is 11.3% lower than HarDNet and 10.6% lower than EUNet, indicating the need for improved segmentation alignment precision.On CVC-T, all methods perform better, with mDice exceeding 0.843 and mIoU above 0.769. HarDNet leads with an mDice of 0.899, while the proposed method achieves 0.8910.021, 0.9% lower. In mIoU, the proposed method reaches 0.8270.027, 0.7% higher than HarDNet, demonstrating competitiveness and advantages in region integrity.
Although performance on CVC-ColonDB is relatively limited, the model achieves competitive or superior results on ETIS-LaribPolypDB and CVC-T, validating its effectiveness in capturing fine polyp characteristics and improving segmentation robustness under domain shifts.
4.7 Analysis of visualizations and computational performance
4.7.1 Performance radar charts of segmentation models.
Figure 8 shows radar chart comparison of 9 polyp segmentation models for various evaluation metrics including mDice, mIoU, precision, recall, HD95, ASSD and BF-score. Each subplot is based on a method and is organized chronologically from 2015 to 2024 with the model highlighted red.
Fig 8. Radar plots illustrating multi-dimensional performance (mDice, mIoU, Precision, Recall, HD95, ASSD, and BF-score) of different segmentation methods.

A consistent improvement in segmentation performance from early to recent models can be observed in Fig 8. Compared with UNet (mDice: 0.853, mIoU: 0.744), advanced methods including PraNet and DCSAU‑Net achieve higher accuracy, with mDice values of 0.899 and 0.912, respectively. Our method further improves mDice to 0.922 (a 1.1% gain over DCSAU‑Net) and mIoU to 0.863, indicating better region overlap. Meanwhile, our model yields a balanced precision (0.922) and recall (0.913), showing stable detection ability. For boundary metrics, HD95 and ASSD are reduced to 9.13 and 2.61, corresponding to decreases of 26.0% and 18.7% compared with UNet, respectively. Overall, the proposed model achieves more consistent performance across all metrics, demonstrating enhanced robustness for colorectal polyp segmentation.
4.7.2 Generalization performance of polyp segmentation methods across different datasets.
In order to compare generalization performance and performance stability of the proposed cross scale attention and frequency domain perception network with state-of-the-art polyp segmentation methods, two visualizations are provided: Fig 9 shows the performance of each model on three public datasets (CVC-ColonDB, ETIS-LaribPolypDB, and CVC-T) mDice and mIoU scores together in 13 subplots; Fig 10 shows the comparison between different datasets, separately, mDice and mIoU scores in 12 layout to highlight consistency and relative strengths of each method. Together, these figures provide a good understanding of the model’s ability to handle multiscale variations and blurred boundaries.
Fig 9. Quantitative comparison of segmentation performance on CVC-ColonDB, ETIS-LaribPolypDB, and CVC-T datasets in terms of mDice and mIoU.

Fig 10. Quantitative comparison of segmentation performance (mDice and mIoU) across different datasets.

Figure 9 compares segmentation performance across three datasets in terms of mDice and mIoU. On CVC-ColonDB, EUNet achieves the best results with an mDice of 0.751 and an mIoU of 0.681, while the proposed method attains 0.694 and 0.580, respectively. On the more challenging ETIS-LaribPolypDB dataset, the proposed method achieves the highest mDice of 0.703, outperforming HarDNet and EUNet, while obtaining an mIoU of 0.547, slightly lower than the best-performing methods at 0.617. On CVC-T, the proposed method achieves competitive performance with an mDice of 0.891 and the highest mIoU of 0.827. Overall, the performance variations across datasets highlight the generalization capability of the proposed network. In particular, its robustness on challenging datasets such as ETIS-LaribPolypDB underscores its effectiveness in handling small, low-contrast, and irregular polyp structures. These results further support the potential of the proposed approach for reliable clinical deployment in diverse endoscopic scenarios.
Figure 10 presents the cross-dataset comparison of segmentation performance in terms of mDice and mIoU. As shown in Fig 10(a), the proposed method achieves mDice scores of 0.694 on ColonDB, 0.705 on ETIS, and 0.894 on CVC-T, demonstrating relatively consistent performance across datasets. In contrast, several methods exhibit more pronounced performance degradation on the ETIS dataset. The mIoU results in Fig 10(b) show a similar pattern. The proposed method obtains mIoU values of 0.584 on ColonDB, 0.547 on ETIS, and 0.867 on CVC-T. While its performance on ColonDB and ETIS is lower than that of EUNet, which reaches 0.681 and 0.612, respectively, the proposed method achieves the highest mIoU on CVC-T, surpassing other methods.
The results suggest that the proposed method maintains competitive and relatively stable performance across different datasets. Its advantage is particularly evident on the ETIS dataset in terms of mDice, where it achieves the highest score, indicating improved capability in capturing small and low-contrast polyp regions. Although the mIoU values are comparatively lower on certain datasets, the consistent mDice performance indicates reliable region-level segmentation, with remaining limitations primarily related to boundary refinement under complex imaging conditions.
4.7.3 Comparison of computational performance metrics for different models.
To quantitatively assess the computational efficiency and model complexity of the proposed framework, two comparative analyses are conducted based on comprehensive metrics. Related experimental results are separately recorded in two formal tables for intuitive observation. The investigated indicators include parameters, floating-point operations, peak GPU memory occupation, inference time per image and frames per second, all of which are essential for evaluating the practical deployment potential in clinical endoscopic scenarios.
Table 10 summarizes the computational performance between the proposed method and several representative approaches. The proposed model possesses 52.38 million parameters and 23.31 giga floating-point operations, with peak GPU memory of 1.287 gigabytes. The inference time is 5.93 milliseconds per image and the frames per second reach 168.70. This model maintains moderate parameter scale and computational overhead among all compared methods. Table 11 presents the computational performance comparison of different ablation models. The baseline model achieves the highest efficiency with the lowest parameters, floating-point operations and memory consumption. The integration of individual components gradually increases parameters and computational cost while reducing inference speed. The full model combining multiple modules obtains 52.38 million parameters, 23.31 giga floating-point operations and 5.93 milliseconds per image, showing acceptable efficiency loss during performance improvement.
Table 10. Comparison of computational performance metrics for different methods.
| Method | Params(M) | FLOPs (G) | Peak GPU memory(GB) | Inference time (ms/image) | FPS |
|---|---|---|---|---|---|
| UNet [5] | 36.51 | 7.74 | 0.812 | 1.99 | 503.12 |
| UNet++ [6] | 39.86 | 9.45 | 0.934 | 2.43 | 411.52 |
| PraNet [39] | 54.63 | 32.21 | 1.356 | 8.24 | 121.35 |
| ACSNet [40] | 41.72 | 25.17 | 1.238 | 6.48 | 254.32 |
| DCSAU-Net [41] | 47.98 | 28.62 | 1.412 | 7.32 | 206.61 |
| HarDNet-CPS [42] | 43.48 | 22.83 | 1.021 | 5.87 | 270.35 |
| ProMamba [43] | 32.14 | 10.95 | 0.946 | 3.01 | 476.86 |
| FoBS [44] | 45.38 | 30.91 | 1.487 | 7.96 | 239.64 |
| Ours | 52.38 | 23.31 | 1.287 | 5.93 | 168.70 |
Table 11. Computational performance comparison of different ablation models.
| Method | Params(M) | FLOPs (G) | Peak GPU memory(GB) | Inference time (ms/image) | FPS |
|---|---|---|---|---|---|
| Baseline | 36.51 | 7.74 | 0.812 | 1.99 | 503.12 |
| Baseline+ D2F | 39.86 | 9.45 | 0.934 | 2.43 | 411.52 |
| Baseline+ Resnet | 41.72 | 15.17 | 1.038 | 3.48 | 294.31 |
| Baseline+ Resnet+ D2F | 45.91 | 20.62 | 1.112 | 4.32 | 246.63 |
| Baseline+ Resnet+ SCAS | 48.98 | 21.53 | 1.177 | 4.93 | 216.71 |
| Baseline+ Resnet+ SCAS+ D2F | 52.38 | 23.31 | 1.287 | 5.93 | 168.70 |
In general, the proposed model achieves a reasonable trade-off between segmentation accuracy and computational burden. Although additional modules introduce certain computational overhead, the overall complexity remains at a moderate level compared with existing methods. The inference speed is sufficient for real-time clinical application, demonstrating good balance between effectiveness and efficiency.
4.7.4 Visualization of segmentation results.
Figure 11 presents a qualitative comparison of segmentation results across four representative datasets, including CVC-ClinicDB, CVC-ColonDB, ETIS-LaribPolypDB, and CVC-T. For each case, the first column shows the original endoscopic image, and the second column displays the ground-truth annotation highlighted in red. The remaining columns visualize the prediction outcomes of different model variants using an error-aware overlay strategy. In this visualization, red denotes correctly detected polyp regions, blue indicates missed polyp pixels, and green represents falsely predicted non-polyp areas. This design allows a direct visual assessment of region coverage, boundary alignment, and error distribution across models.
Fig 11. Qualitative comparison of segmentation results on different datasets.

From left to right: original image, ground truth, and predictions from different models, including our proposed models.
On the relatively clearer samples from CVC-ClinicDB and CVC-T, most variants are able to localize the main lesion area, yet clear differences remain in contour completeness and boundary precision. The baseline model already captures the coarse polyp region, but local under-segmentation and boundary deviations are still visible. After introducing D2F, the predicted region becomes more compact and the amount of blue error decreases, suggesting improved sensitivity to subtle lesion structures. The ResNet-based variants further enhance structural continuity, especially in regions with low contrast or uneven illumination, indicating that the stronger backbone provides more stable semantic representation. When SCAS is incorporated, the predicted contours become more closely aligned with the reference annotation, with fewer scattered errors near lesion margins, reflecting its contribution to multi-scale feature interaction and boundary refinement.
The benefits of the proposed modules are more pronounced on challenging cases from CVC-ColonDB and ETIS-LaribPolypDB, characterized by indistinct lesion boundaries and strong background interference.In these cases, the baseline and several intermediate variants exhibit larger green regions or noticeable blue residuals, implying either over-segmentation into surrounding mucosa or insufficient coverage of the true lesion extent. The combination of ResNet and D2F tends to preserve the overall lesion body more effectively, which supports the role of D2F in enhancing discriminative representation of lesion interiors and subtle structures. The ResNet and SCAS variant shows comparatively cleaner boundaries in some examples, suggesting that cross-scale skip interaction is helpful for delineating lesion edges. The full model yields the most balanced visual outcome across datasets, with lesion regions more consistently overlapping the ground truth and with fewer obvious false positive and false negative areas.
4.7.5 Visualization of feature layer heatmap.
Feature heatmap visualization project provides insights into the feature learning mechanisms of different hierarchical models. Figure 12 illustrates that Encoder Layer 1–2 predominantly detects basic features like edges and textures in polyp images. The heatmap indicates a consistent response across the image’s structure at these layers. With the network’s depth, Encoder Layers 3–4 progressively extract more complex semantic features. The heatmap distinctly highlights polyp region boundaries and central areas, demonstrating the model’s proficiency in discerning crucial polyp features.
Fig 12. Visualization of feature representations at different stages of the network, including encoder and decoder layers, demonstrating progressive refinement of polyp localization.

Within the decoder segment, the feature heatmaps of individual layers illustrate the iterative enhancement of feature reconstruction. Specifically, the profound decoder progressively reinstates spatial intricacies while upholding the fundamental structure of the polyp. In contrast, the shallowest decoder increases edge information, enabling accurate prediction of a segmentation boundary. The visualisation results on different datasets demonstrate that the model has maintained feature alignment despite only seeing images from medical image domains during training, verifying the generalisation and robustness of feature representation in our proposed framework.
5. Discussion
The colorectal polyp segmentation network proposed in this paper adopts an innovative integration of scale-aware attention (SCAS) and dual-domain feature enhancement (D2F). By integrating these state-of-the-art modules, our network achieves outstanding results compared to existing works on various public databases. The above successful validation further demonstrates the effectiveness and robustness of the newly proposed approach in this study. Experimental results demonstrate the efficacy of the SCAS module in rectifying feature misalignment between normal skip connections by a multi-scale attention mechanism. The gating mechanism of the module can effectively learn the information that is useful in the encoder features while suppressing background noises, which demonstrates strong generalization ability for polyps with various sizes and shapes. Furthermore, the D2F module significantly improves the capability of polyp boundary seeking of the model by combining spatial and frequency domain information. In this module, an efficient multiple solution fusion to combines high-frequency detail and low frequency structure is set up, especially for both the contentious boundaries and tiny colorectal polyp segmentation with the improved accuracy.
This approach shows higher accuracy and recall than existing approaches, which improves the specific identification of polyp regions amidst normal tissue and reduces false positives. This difference is important in a clinical environment not only because excessive false positives can add to the physicians’ workload but also due to potential additional costs. Visualization results also validate the superiority of our model. The feature heatmap display network naturally goes from low-level features to high-level semantic characteristics, which is conducive to accurate edge localization. Quantitative comparison among models verifies that our method consistently performs well for challenging scenarios. These results provide evidence in support of the proposed architecture and provide easily comprehensible clues about how and why deep learning works in medical image segmentation.
However, the cross-dataset evaluation reveals that the proposed model still suffers from noticeable performance degradation on ETIS-LaribPolypDB, where the data distribution differs substantially from that of the training datasets. This observation underscores the persistent challenge of domain shift in medical image segmentation. The discrepancy may arise from variations in imaging devices, acquisition protocols, illumination conditions, as well as differences in polyp appearance and annotation standards across datasets.Although the proposed method demonstrates improved robustness compared with baseline approaches, it does not fully overcome these cross-domain inconsistencies. In particular, the model remains vulnerable in challenging scenarios, such as extremely small lesions, motion blur, specular reflections, and cases with blurred boundaries. These failure modes suggest that the learned representations are still partially dependent on dataset-specific characteristics.Therefore, the current framework should be regarded as a step toward more robust segmentation rather than a domain-invariant solution.
Future work will focus on domain generalization by improving domain adaptation, data enhancement and model calibration. The D2F module could also be extended to differentiable spectral fusion model using parameterized DCT or Fourier bases to model more explicit frequency models. Such approaches may have problems with aliasing and edge artifacts. The integration of SCAS with deformable alignment could also explicitly deal with local geometric misalignment in skip connections and enhance boundary localization in complex cases. SCAS attention weights could provide useful information for uncertainty estimation, and suggest promising paths towards uncertainty-aware segmentation and active learning. Effectiveness could be measured by calibration (e.g., ECE) and annotation efficiency metrics.
6. Conclusion
Although the proposed method achieves competitive segmentation performance on standard colorectal polyp datasets and shows improved robustness against blurred boundaries and multi-scale variations, its cross-dataset generalization is still limited by domain shifts, such as differences in imaging conditions, annotation protocols, and polyp appearance across datasets. In future work, we will further investigate more advanced network designs, effective domain adaptation strategies, and stronger data augmentation schemes to improve cross-domain stability. We will validate the generalization of the proposed modules on other medical image segmentation tasks to explore their broader applicability. This work provides a feasible solution for accurate and robust colorectal polyp segmentation and offers a promising technical reference for clinical endoscopic-assisted diagnosis.
Data Availability
For full reproducibility, the minimal dataset supporting this study’s findings—including train/validation/test partitions, preprocessing configurations, per-run evaluation metrics, and raw data for all tables and figures—together with the complete source code, is publicly available in a GitHub repository: https://github.com/si-yuan20/Robust-segmentation-of-colon-polyps-Unet.
Funding Statement
This study was financially supported by the Guangxi First-Class Discipline Statistics Construction Project Fund in the form of an award received by QK. This study was also financially supported by the Guangxi Higher Education Institutions Young and Middle-aged Teachers’ Basic Research Capacity Enhancement Project in the form of a grant (2024KY0669) received by QK. The funders had no role in study design, data collection and analysis, decision to publish, or preparation of the manuscript.
References
- 1.Sninsky JA, Shore BM, Lupu GV, Crockett SD. Risk factors for colorectal polyps and cancer. Gastrointest Endosc Clin N Am. 2022;32(2):195–213. doi: 10.1016/j.giec.2021.12.008 [DOI] [PubMed] [Google Scholar]
- 2.Kanth P, Inadomi JM. Screening and prevention of colorectal cancer. BMJ. 2021;374:n1855. doi: 10.1136/bmj.n1855 [DOI] [PubMed] [Google Scholar]
- 3.Kjølhede T, Ølholm AM, Kaalby L, Kidholm K, Qvist N, Baatrup G. Diagnostic accuracy of capsule endoscopy compared with colonoscopy for polyp detection: systematic review and meta-analyses. Endoscopy. 2021;53(7):713–21. doi: 10.1055/a-1249-3938 [DOI] [PubMed] [Google Scholar]
- 4.Rex DK. Polyp detection at colonoscopy: endoscopist and technical factors. Best Pract Res Clin Gastroenterol. 2017;31(4):425–33. doi: 10.1016/j.bpg.2017.05.010 [DOI] [PubMed] [Google Scholar]
- 5.Ronneberger O, Fischer P, Brox T, editors. U-net: convolutional networks for biomedical image segmentation. International Conference on Medical image computing and computer-assisted intervention. Springer; 2015. [Google Scholar]
- 6.Zhou Z, Siddiquee MMR, Tajbakhsh N, Liang J. UNet++: a Nested U-Net architecture for medical image segmentation. Deep Learn Med Image Anal Multimodal Learn Clin Decis Support (2018). 2018;11045:3–11. doi: 10.1007/978-3-030-00889-5_1 [DOI] [PMC free article] [PubMed] [Google Scholar]
- 7.Azad R, Asadi-Aghbolaghi M, Fathy M, Escalera S. Bi-Directional ConvLSTM U-Net with densley connected convolutions. In: 2019 IEEE/CVF International Conference on Computer Vision Workshop (ICCVW); 2019. pp. 406–15. 10.1109/iccvw.2019.00052 [DOI]
- 8.Oktay O, Schlemper J, Folgoc LL, Lee M, Heinrich M, Misawa K. Attention u-net: learning where to look for the pancreas. In: Medical Imaging with Deep Learning (MIDL 2018); 2018. 10.1007/978-3-030-20351-8_24 [DOI]
- 9.Çiçek Ö, Abdulkadir A, Lienkamp SS, Brox T, Ronneberger O. 3D U-Net: learning dense volumetric segmentation from sparse annotation. In: International conference on medical image computing and computer-assisted intervention; 2016. 10.1007/978-3-319-46723-8_49 [DOI]
- 10.Qayoom A, Xie J, Ali H. Polyp segmentation in medical imaging: challenges, approaches and future directions. Artif Intell Rev. 2025;58(6). doi: 10.1007/s10462-025-11173-2 [DOI] [Google Scholar]
- 11.Gupta M, Mishra A. A systematic review of deep learning based image segmentation to detect polyp. Artif Intell Rev. 2024;57(1). doi: 10.1007/s10462-023-10621-1 [DOI] [Google Scholar]
- 12.Mei J, Zhou T, Huang K, Zhang Y, Zhou Y, Wu Y, et al. A survey on deep learning for polyp segmentation: techniques, challenges and future trends. Vis Intell. 2025;3(1). doi: 10.1007/s44267-024-00071-w [DOI] [Google Scholar]
- 13.Gupta S, Sikka G, Malik A. A review on deep learning-based polyp segmentation for efficient colorectal cancer screening. In: 2023 Third International Conference on Secure Cyber Computing and Communication (ICSCCC); 2023. pp. 501–6. 10.1109/icsccc58608.2023.10176721 [DOI]
- 14.Shelhamer E, Long J, Darrell T. Fully convolutional networks for semantic segmentation. IEEE Trans Pattern Anal Mach Intell. 2017;39(4):640–51. doi: 10.1109/TPAMI.2016.2572683 [DOI] [PubMed] [Google Scholar]
- 15.Guo X, Zhang N, Guo J, Zhang H, Hao Y, Hang J. Automated polyp segmentation for colonoscopy images: a method based on convolutional neural networks and ensemble learning. Med Phys. 2019;46(12):5666–76. doi: 10.1002/mp.13865 [DOI] [PubMed] [Google Scholar]
- 16.Mukasheva A, Koishiyeva D, Sergazin G, Sydybayeva M, Mukhammejanova D, Seidazimov SJ. Modification of U-net with pre-trained ResNet-50 and atrous block for polyp segmentation: Model TASPP-UNet. Eng Proc. 2024;70(1):16. doi: 10.3390/engproc2024070016 [DOI] [Google Scholar]
- 17.Safarov S, Whangbo TK. A-DenseUNet: adaptive densely connected UNet for polyp segmentation in colonoscopy images with atrous convolution. Sensors (Basel). 2021;21(4):1441. doi: 10.3390/s21041441 [DOI] [PMC free article] [PubMed] [Google Scholar]
- 18.Ahamed MdF, Islam MdR, Nahiduzzaman Md, Chowdhury MEH, Alqahtani A, Murugappan M. Automated colorectal polyps detection from endoscopic images using MultiResUNet framework with attention guided segmentation. Hum-Cent Intell Syst. 2024;4(2):299–315. doi: 10.1007/s44230-024-00067-1 [DOI] [Google Scholar]
- 19.Li X, Li M, Yan P, Li G, Jiang Y, Luo H, et al. Deep learning attention mechanism in medical image analysis: basics and beyonds. IJNDI. 2023;2(1):93–116. doi: 10.53941/ijndi0201006 [DOI] [Google Scholar]
- 20.Guo M-H, Xu T-X, Liu J-J, Liu Z-N, Jiang P-T, Mu T-J, et al. Attention mechanisms in computer vision: a survey. Comp Visual Med. 2022;8(3):331–68. doi: 10.1007/s41095-022-0271-y [DOI] [Google Scholar]
- 21.Woo S, Park J, Lee J-Y, Kweon IS. CBAM: convolutional block attention module. In: Lecture notes in computer science. Springer International Publishing; 2018. pp. 3–19. doi: 10.1007/978-3-030-01234-2_1 [DOI] [Google Scholar]
- 22.Hu J, Shen L, Sun G. Squeeze-and-excitation networks. In: 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition; 2018. pp. 7132–41. 10.1109/cvpr.2018.00745 [DOI]
- 23.Wödlinger MG. Applications of neural attention for modelling long-range dependencies. Technische Universität Wien; 2025. [Google Scholar]
- 24.Zeng K, Lin H, Yan Z, Fang J, Lai T. Non-local self-attention network for image super-resolution. Appl Intell. 2024;54(7):5336–52. doi: 10.1007/s10489-024-05343-y [DOI] [Google Scholar]
- 25.Xu Y, Cao H, Yang J, Mao K, Yin J, See S. PNL: efficient long-range dependencies extraction with pyramid non-local module for action recognition. Neurocomputing. 2021;447:282–93. doi: 10.1016/j.neucom.2021.03.064 [DOI] [Google Scholar]
- 26.Ji Z, Qian H, Ma X. Shared hybrid attention transformer network for colon polyp segmentation. Neurocomputing. 2025;616:128901. doi: 10.1016/j.neucom.2024.128901 [DOI] [Google Scholar]
- 27.Luo C, Wang Y, Deng Z, Lou Q, Zhao Z, Ge Y, et al. Colonic polyp segmentation based on transformer-convolutional neural networks fusion. Pattern Recognit. 2026;170:112116. doi: 10.1016/j.patcog.2025.112116 [DOI] [Google Scholar]
- 28.Li X, Liu Q, Li X, Huang T, Lin M, Han X, et al. CIFTC-Net: cross information fusion network with transformer and CNN for polyp segmentation. Displays. 2024;85:102872. doi: 10.1016/j.displa.2024.102872 [DOI] [Google Scholar]
- 29.Gupta S, Sikka G, Malik A, Singh S, Tyagi V. Transformer-dilated ResUNet: an efficient and accurate framework for polyp segmentation. Procedia Computer Science. 2025;259:1765–72. doi: 10.1016/j.procs.2025.04.131 [DOI] [Google Scholar]
- 30.Ghalati MK, Nunes A, Ferreira H, Serranho P, Bernardes R. Texture analysis and its applications in biomedical imaging: a survey. IEEE Rev Biomed Eng. 2022;15:222–46. doi: 10.1109/RBME.2021.3115703 [DOI] [PubMed] [Google Scholar]
- 31.Xu K, Qin M, Sun F, Wang Y, Chen Y-K, Ren F. Learning in the frequency domain. In: 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR); 2020. pp. 1737–46. 10.1109/cvpr42600.2020.00181 [DOI]
- 32.Nair V, Chatterjee M, Tavakoli N, Namin AS, Snoeyink C. Optimizing CNN using fast fourier transformation for object recognition. In: 2020 19th IEEE International Conference on Machine Learning and Applications (ICMLA); 2020. pp. 234–9. 10.1109/icmla51294.2020.00046 [DOI]
- 33.Jia Q, Zhang L, Wu R. Low-power interference identification based on convolutional neural networks. IEEE Trans Instrum Meas. 2025;74:1–17. doi: 10.1109/tim.2025.3538089 [DOI] [Google Scholar]
- 34.Zhang Z, An J, Ye N, Li X, Niyato D, Yang K. Multi-domain fusion for high-sensitivity interference identification: a lightweight model using multi-scale extraction and compression. IEEE Trans Cogn Commun Netw. 2026;12:2675–89. doi: 10.1109/tccn.2025.3585700 [DOI] [Google Scholar]
- 35.Bernal J, Sánchez FJ, Fernández-Esparrach G, Gil D, Rodríguez C, Vilariño F. WM-DOVA maps for accurate polyp highlighting in colonoscopy: validation vs. saliency maps from physicians. Comput Med Imaging Graph. 2015;43:99–111. doi: 10.1016/j.compmedimag.2015.02.007 [DOI] [PubMed] [Google Scholar]
- 36.Tajbakhsh N, Gurudu SR, Liang JJI. Automated polyp detection in colonoscopy videos using shape and context information. IEEE Trans Med Imaging. 2016;35(2):630–44. doi: 10.1109/TMI.2015.2487997 [DOI] [PubMed] [Google Scholar]
- 37.Silva J, Histace A, Romain O, Dray X, Granado B. Toward embedded detection of polyps in WCE images for early diagnosis of colorectal cancer. Int J Comput Assist Radiol Surg. 2014;9(2):283–93. doi: 10.1007/s11548-013-0926-3 [DOI] [PubMed] [Google Scholar]
- 38.Vázquez D, Bernal J, Sánchez FJ, Fernández-Esparrach G, López AM, Romero A, et al. A benchmark for endoluminal scene segmentation of colonoscopy images. J Healthc Eng. 2017;2017:4037190. doi: 10.1155/2017/4037190 [DOI] [PMC free article] [PubMed] [Google Scholar]
- 39.Fan D-P, Ji G-P, Zhou T, Chen G, Fu H, Shen J, et al., editors. Pranet: parallel reverse attention network for polyp segmentation. International conference on medical image computing and computer-assisted intervention; Springer; 2020.doi: 10.1007/978-3-030-59725-2_26 [DOI] [Google Scholar]
- 40.Zhang R, Li G, Li Z, Cui S, Qian D, Yu Y. Adaptive context selection for polyp segmentation. In: International conference on medical image computing and computer-assisted intervention; 2020. 10.1007/978-3-030-59725-2_25 [DOI]
- 41.Xu Q, Ma Z, He N, Duan W. DCSAU-Net: a deeper and more compact split-attention U-Net for medical image segmentation. Comput Biol Med. 2023;154:106626. doi: 10.1016/j.compbiomed.2023.106626 [DOI] [PubMed] [Google Scholar]
- 42.Yu T, Wu Q. HarDNet-CPS: colorectal polyp segmentation based on Harmonic Densely United Network. Biomed Signal Process Control. 2023;85:104953. doi: 10.1016/j.bspc.2023.104953 [DOI] [Google Scholar]
- 43.Xie J, Liao R, Zhang Z, Yi S, Zhu Y, Luo G. Promamba: prompt-mamba for polyp segmentation. arXiv. 2024. https://arxiv.org/abs/2403.13660
- 44.Liu Z, Zheng S, Sun X, Zhu Z, Zhao Y, Yang X, et al. The devil is in the boundary: boundary-enhanced polyp segmentation. IEEE Trans Circuits Syst Video Technol. 2024;34(7):5414–23. doi: 10.1109/tcsvt.2023.3348598 [DOI] [Google Scholar]
- 45.Patel K, Bur AM, Wang G. Enhanced U-Net: a feature enhancement network for polyp segmentation. Proc Int Robot Vis Conf. 2021;2021:181–8. doi: 10.1109/crv52889.2021.00032 [DOI] [PMC free article] [PubMed] [Google Scholar]
- 46.Yin Z, Liang K, Ma Z, Guo J. Duplex contextual relation network for polyp segmentation. In: 2022 IEEE 19th International Symposium on Biomedical Imaging (ISBI); 2022. pp. 1–5. 10.1109/isbi52829.2022.9761402 [DOI]
Associated Data
This section collects any data citations, data availability statements, or supplementary materials included in this article.
Data Availability Statement
For full reproducibility, the minimal dataset supporting this study’s findings—including train/validation/test partitions, preprocessing configurations, per-run evaluation metrics, and raw data for all tables and figures—together with the complete source code, is publicly available in a GitHub repository: https://github.com/si-yuan20/Robust-segmentation-of-colon-polyps-Unet.
