Data Science And Analytics For Operations
November 19, 2026
Polyp-YOLO: an efficient, low-latency detector for polyps in colonoscopies
Victor Felipe Reis Silva; Lucas Zanovello Tahara
DOI: 10.22167/2675-6528-202603810
Article derived from a Final Course Work (TCC), with content based on the student’s original work and adapted to the editorial format of the E&S Magazine with the support of the ResumeAI tool, an artificial intelligence solution developed by Instituto Pecege for textual synthesis and organization.
Summary
The early detection of colorectal polyps is crucial for the prevention of colorectal cancer, and real-time computer-aided detection (CADe) systems have demonstrated gains in endoscopic practice. The objective was to develop and validate a lightweight colorectal polyp detector, based on the YOLO architecture, capable of operating on restricted hardware with high precision and low latency. The methodology used public datasets of endoscopic images, partitioning the Kvasir-SEG dataset for internal training and validation, and CVC-ClinicDB and ETIS-Larib Polyp DB for cross-dataset evaluation. Lightweight variants of the YOLOv8, YOLO11, and YOLO26 families with 640×640 pixel input were evaluated. A grid search tested 70 combinations of optimizers and activation functions, and identified AdaBelief and LeakyReLU as the configuration with the best generalization. The optimization pipeline applied unstructured pruning, knowledge distillation, and fine-tuning. The optimized YOLO11n-seg model outperformed the higher-capacity architecture (YOLO26m-seg) in mAP50 and showed similar performance in F1-Score, operating with approximately seven times fewer parameters. It achieved an mAP50 of 0.7929 and an F1-Score of 0.7514 on the ETIS-Larib dataset, and fast inference was demonstrated in different formats, with real-time latencies. The explainability of predictions was validated by Grad-CAM activation maps. The proposed solution demonstrated to be a promising experimental tool for diagnostic support, with technical feasibility for integration into environments with reduced computational power, although it requires future clinical validation.
Keywords: Computer-aided detection; Edge computing; Hyperparameter optimization; Endoscopic image segmentation; Medical computer vision.
1. Introduction
Colorectal cancer (CRC) represents a global health concern, being the third most incident neoplasm and the second leading cause of cancer death worldwide, according to estimates from the Global Cancer Observatory (GLOBOCAN) in 2022 (Bray et al., 2024). Improvement in the prevention and early diagnosis of this type of cancer is of great public utility. The removal of adenomatous polyps contributes to CRC prevention, considering that many benign adenomas progress to adenocarcinomas if not identified and removed (Winawer et al., 1993). Colonoscopy is the gold standard examination for detecting and resecting these polyps, interrupting the progression to CRC.
Despite the effectiveness of colonoscopy, the error rate in polyp detection increases progressively for lesions with a diameter equal to or less than ten millimeters (van Rijn et al., 2006). A meta-analysis of 43 publications and over 15,000 tandem colonoscopies estimated miss rates of 26% for adenomas, 9% for advanced adenomas, and 27% for serrated polyps. Misses were higher in proximal, flat lesions and in high-risk individuals, highlighting the need for adequate preparation and auxiliary techniques to mitigate these omissions (Zhao et al., 2019).
In this context, Artificial Intelligence (AI) and, specifically, real-time computer-aided detection (CADe) systems have demonstrated consistent gains in endoscopic practice. Randomized studies have concluded that CADe systems substantially reduced the miss rate of adenomas (13.9% vs. 40.0%) and polyps (13.0% vs. 45.9%), with consistent benefit across different colon segments (Wang et al., 2020). A meta-analysis of five randomized clinical trials and over 4,300 patients also noted significant gains with CADe, with the adenoma detection rate increasing from 25.2% to 36.6% (Relative Risk 1.44), including lesions up to five millimeters and flat morphologies (Relative Risk 1.78), which are notoriously difficult to identify (Hassan et al., 2021).
In the field of computer vision, real-time object detectors, such as the YOLO family (Redmon et al., 2016), offer fast inference and good accuracy. These characteristics are crucial for low-latency applications, such as use in endoscopic video. The need to operate on hardware with limited computational resources, such as edge computing devices, requires lightweight and efficient solutions capable of maintaining high diagnostic accuracy without relying on high-cost infrastructures.
The problem lies in the gap between the proven efficacy of colonoscopy and the persistent rates of missed polyps, especially those difficult to visualize, which compromises the early diagnosis of CRC. Although AI offers a path to mitigate this issue, there is a critical need to develop detectors that are not only accurate but also computationally efficient and low-latency, suitable for deployment in clinical settings with restricted hardware. The rationale for this research lies in the urgency to improve diagnostic quality, standardize detection among different examiners, reduce medical fatigue, and consequently, decrease institutional risks associated with the late diagnosis of CRC.
Given this context, the present work aimed to develop and validate a lightweight colorectal polyp detector capable of operating on restricted hardware without compromising diagnostic accuracy, using a YOLO architecture optimized for high sensitivity and near real-time operation, with resilience to lighting variations and endoscopic artifacts, and compatibility with compression and export techniques for efficient execution on lower computational power devices, validating the explainability of predictions through activation maps.
2. Material and Methods
The present study adopted an experimental approach, focusing on the technical evaluation and computational feasibility of a colorectal polyp detector, without including clinical validation. The research aimed at the development and optimization of a computer vision model capable of operating efficiently on hardware with limited resources, while maintaining high diagnostic accuracy for polyp detection in endoscopic images.
For the experiments, public databases of endoscopic images were used, previously segmented and annotated in YOLO26 format, which includes segmentation masks. The datasets employed were: 196 images from the ETIS-Larib Polyp DB (Bernal et al., 2015), 612 images from the CVC-ClinicDB (Silva et al., 2014), and 1000 images from Kvasir-SEG (Jha et al., 2019). All data were obtained from Roboflow Universe under a CC BY 4.0 license (Roboflow, 2024a, 2024b, 2024c).
The management and distribution of the datasets were structured in two distinct phases to avoid image reuse between training, validation, and testing. In the first phase, intended for hyperparameter optimization, a grid search was performed with 70 combinations of optimizers and activation functions. For this exploratory stage, the Kvasir-SEG dataset was used for training, CVC-ClinicDB for validation and training monitoring (early stopping), and ETIS-Larib Polyp DB for generalization testing.
In the second phase, focused on architectural evaluation and comparison between YOLO variants, a more rigorous data split was adopted. The Kvasir-SEG dataset was randomly partitioned into 90% for training and 10% for static internal validation. The CVC-ClinicDB and ETIS-Larib Polyp DB datasets were reserved exclusively for external testing, aiming to measure the generalization capability of the models and reduce methodological bias.
The images were standardized to an input resolution of 640×640 pixels, ensuring uniformity in feature extraction. To mitigate the risk of overfitting and increase generalization, a YOLO native “data augmentation” pipeline was applied. This pipeline included techniques such as translations, horizontal and vertical mirroring (“flipping”), and random variations in brightness, hue, and saturation. Training was configured for up to 150 epochs, with an early stopping mechanism of 30 epochs to avoid redundant training.
The grid search for hyperparameter optimization systematically evaluated 70 combinations, spanning ten optimizers and seven activation functions. The optimizers investigated included AdEMAMix (Pagliardini et al., 2025), AdaBelief (Zhuang et al., 2020), AdamW (Loshchilov & Hutter, 2019), CAME (Luo et al., 2023), Grokfast (Lee et al., 2024), Lion (Chen et al., 2023), NAdam (Dozat, 2016), RMSProp (Tieleman & Hinton, 2012), SGD (Robbins & Monro, 1951), and SophiaG (Liu et al., 2024).
The activation functions evaluated encompassed classic alternatives from the ReLU family, such as LeakyReLU (Maas et al., 2013), PReLU (He et al., 2015), and ELU (Clevert et al., 2016), as well as non-monotonic functions and more recent variants, including GELU (Hendrycks and Gimpel, 2016), Mish (Misra, 2020), SiLU/Swish (Ramachandran et al., 2018), and Hardswish (Howard et al., 2019). To enable the evaluation of these different activation functions and optimization algorithms in YOLO, a code adaptation was performed through monkey patching, which allowed for dynamic method overriding without altering the original source code.
The optimization pipeline for limited hardware comprised three main steps. Firstly, L1-norm based unstructured pruning was applied, with a sparsity rate of 30% on the convolutional layers of the backbone, preserving the segmentation head to maintain diagnostic integrity. After pruning, an initial fine-tuning was performed with a learning rate of 0.0005 to recover performance.
Next, knowledge distillation was implemented, where smaller models (YOLO11n-seg and YOLO26n-seg) acted as students, learning from larger capacity models (YOLO11m-seg and YOLO26m-seg) that served as teachers. The loss function was adjusted to include the Kullback-Leibler Divergence between the logits, with temperature 4 and distillation weight alpha 0.5, aiming to smooth the probability distributions.
The final stage of the pipeline consisted of an additional fine-tuning, in which the distilled models were subjected to 30 extra epochs of training with conservative learning rates (0.0001 for YOLO11n-seg and 0.00005 for YOLO26n-seg). This procedure aimed at stabilizing the remaining weights before export. The final model was stabilized in FP16 format, which ensured the balance between compression and compatibility, after attempts at quantization to INT8 proved technically unfeasible.
The explainability of the model’s predictions was qualitatively validated through Grad-CAM (Gradient-weighted Class Activation Mapping) activation maps (Selvaraju et al., 2017). This technique allowed for visual verification of the detector’s focus on polypoid structures, confirming that the model identified the relevant morphological features of the lesions. Data analysis was performed using metrics such as mAP50 and F1-Score.
As project deliverables, a Jupyter notebook containing the training and optimization code, the final weights of the YOLO11n-seg and YOLO26n-seg models in PyTorch format (.pt), and their exported versions for inference in ONNX FP32, ONNX FP16, and TensorRT FP16 formats were generated. These artifacts were made available in a public repository of the Polyp-YOLO project (Silva, 2026).
3. Results and Discussion
The research focused on the development and validation of a lightweight colorectal polyp detector, with an emphasis on real-time operation and on hardware with limited computational resources. The results demonstrate that the proposed model achieved a remarkable balance between diagnostic accuracy and computational efficiency, overcoming the latency and hardware requirements challenges that often limit the application of artificial intelligence systems in clinical settings. The methodological approach, which included hyperparameter optimization and a robust optimization pipeline, was fundamental to achieving these objectives, as detailed in the subsequent sections.
Model Optimization and Hyperparameter Study
The first phase of the study involved an exhaustive grid search, evaluating seventy distinct combinations of optimizers and activation functions. Among the optimizers investigated were AdEMAMix (Pagliardini et al., 2025), AdaBelief (Zhuang et al., 2020), AdamW (Loshchilov & Hutter, 2019), CAME (Luo et al., 2023), Grokfast (Lee et al., 2024), Lion (Chen et al., 2023), NAdam (Dozat, 2016), RMSProp (Tieleman & Hinton, 2012), SGD (Robbins & Monro, 1951), and SophiaG (Liu et al., 2024). The activation functions included LeakyReLU (Maas et al., 2013), PReLU (He et al., 2015), ELU (Clevert et al., 2016), GELU (Hendrycks & Gimpel, 2016), Mish (Misra, 2020), SiLU/Swish (Ramachandran et al., 2018), and Hardswish (Howard et al., 2019), covering a wide range of properties.
The analysis of the mAP50 distribution by activation function, aggregating all optimizers, revealed that Hardswish presented the highest mAP50 median on the ETIS-Larib Polyp DB dataset, while LeakyReLU obtained the second highest median and the highest maximum performance value, close to 0.80. In contrast, PReLU exhibited the lowest median and Mish also fell below the best-performing activations. Regarding optimizers, AdEMAMix demonstrated the highest median, indicating consistency, and AdaBelief achieved the highest performance value of the analysis, albeit with a slightly lower median. CAME and SGD presented lower medians, and RMSProp exhibited a sharp negative outlier, suggesting greater sensitivity to less effective configurations.
The combination of the AdaBelief optimizer with the LeakyReLU activation function was identified as the most efficient, achieving an mAP@0.5 of 0.7961 on the ETIS-Larib Polyp DB dataset. This result surpassed the SiLU activation function, Ultralytics’ default for YOLO, and classic optimizers such as AdamW, SGD, and RMSProp. The choice of F1-Score as the primary decision criterion was justified by the clinical context of polyp detection, where the cost of a false negative is significantly higher than that of a false positive, as an unidentified lesion would compromise early diagnosis. The mAP50 was maintained as a complementary metric, providing a global view of performance.
The combination of AdaBelief and LeakyReLU achieved the highest F1-Score of 0.7787 on the ETIS-Larib Polyp DB dataset. Other high-performing combinations included AdEMAMix with Hardswish, with an F1-Score of 0.7468, and NAdam with SiLU, which obtained 0.7546. These variations demonstrate the complexity of the interaction between optimizers and activation functions, and the importance of a systematic hyperparameter search to maximize performance in specific application scenarios, such as polyp detection in endoscopic images.
Comparison of Lightweight YOLO Variants
In the second phase, the impact of model scale on detection performance was evaluated, training nano, small, and medium variants of the YOLOv8 (Jocher et al., 2023), YOLO11 (Jocher and Qiu, 2024), and YOLO26 (Jocher and Qiu, 2026) families with the AdaBelief and LeakyReLU configuration. The YOLO26m-seg variant showed the best absolute performance in external generalization, with an F1-Score of 0.7684 and mAP@0.5 of 0.7765 on the ETIS-Larib Polyp DB dataset, and the highest mAP@0.5 of 0.8913 on the CVC-ClinicDB base.
However, the training of YOLO26m-seg required reducing the batch size to eight due to video memory constraints of the hardware used. Clinical application in edge computing demands computational efficiency, and absolute performance was not the sole selection criterion. YOLO26m-seg presented approximately seven times more parameters (about twenty million versus 2.9 million for YOLO11n-seg) and ten times more arithmetic operations (approximately 68 billion versus 6.5 billion FLOPs), resulting in an inference latency of 4.7 ms, about three times higher than the 1.5 ms of YOLO11n-seg.
In this trade-off between diagnostic sensitivity and overall performance, the YOLO11n-seg model stood out as the most viable option for devices with limited computational resources. It achieved the second highest F1-Score (0.7274) and the third highest mAP50 ETIS (0.7439) among the nano models, offering the best diagnostic balance with lower computational demand. This choice reflects the need for a solution that is not only accurate but also computationally efficient and low-latency for deployment in clinical settings with restricted hardware.
Optimization
The optimization of the models followed a three-stage pipeline: unstructured pruning, knowledge distillation, and fine-tuning. Unstructured pruning, based on the L1 norm with a sparsity rate of thirty percent in the convolutional layers of the backbone, was the first step towards reducing computational cost. After removing the least relevant weights, the models underwent a recovery stage (fine-tuning) using the AdaBelief optimizer with a learning rate of 0.0005.
In knowledge distillation, the smaller models (YOLO11n-seg and YOLO26n-seg) acted as students, learning from the features generated by their respective higher-capacity teacher models (YOLO11m-seg and YOLO26m-seg). The loss function was adjusted to include Kullback-Leibler Divergence with a temperature of four and a distillation weight alpha of 0.5, aiming to smooth the probability distributions. Finally, the distilled models underwent an additional thirty epochs of fine-tuning with low learning rates (0.0001 for YOLO11n-seg and 0.00005 for YOLO26n-seg), seeking to stabilize the weights before export.
The evolution of the models’ inferential quality demonstrated that the architectures reacted distinctly to compression and distillation. The YOLO11n-seg model showed a slight natural drop in F1-Score during unstructured pruning (from 0.7274 to 0.7063), but subtly outperformed the baseline in the distillation step with an F1-Score of 0.7298. The additional fine-tuning step consolidated expressive gains, resulting in the highest global mAP50 value among the variants (0.7929) and the second highest F1-Score (0.7514).
In contrast, the YOLO26n-seg model demonstrated diverse dynamics. The pruning followed by recovery step resulted in a slight gain in mAP50 compared to the baseline (from 0.6665 to 0.6985), maintaining a discrete increment post-distillation (0.7006). However, the extra fine-tuning round caused a drastic performance drop, reducing the mAP50 to 0.5372 and the F1-Score to 0.6078, values substantially lower than the baseline. This instability of YOLO26n-seg, culminating in worse generalization, validated the choice of YOLO11n-seg for final deployment, which not only surpassed YOLO26n-seg in absolute precision after optimizations but also did so by occupying significantly less storage space.
Latency and Export Formats
The evaluation of inference time and latency by export format was performed with empirical tests using synthetic input tensors of unitary dimension (1 x 3 x 640 x 640). The experiment was executed in a containerized environment on a computer equipped with an AMD Ryzen 5 5600X processor and an NVIDIA GeForce RTX 3060 GPU. For GPU inference, PyTorch baseline and TensorRT FP16 were used, while for CPU, ONNX FP32 and ONNX FP16 were evaluated through the “InferenceSession” runtime of ONNX Runtime.
All exported models met the real-time analysis scenarios, with latencies below 33 ms (equivalent to thirty frames per second). With acceleration via TensorRT FP16 on GPU, inference time reached 7.82 ms for YOLO11n-seg and 2.52 ms for YOLO26n-seg. Even in executions strictly dependent on CPU via ONNX (FP32 and FP16), the latency remained within the safety margin of approximately thirty to thirty-two ms, enabling real-time processing without the requirement for dedicated hardware accelerators.
The export behavior regarding model size also showed heterogeneity. The ONNX framework in FP16 precision (for CPU) was the only one to present a decrease in the final obtained size, about 5.449 MB for YOLO26n-seg and 5.736 MB for YOLO11n-seg. The attempt to quantize to INT8 format, using methods such as PTQ (Post-Training Quantization) and QAT (Quantization-Aware Training), proved technically unfeasible due to compilation failures in the segmentation head subgraph of the YOLO-seg architecture within the TensorRT framework. For this reason, the final model stabilized in FP16 format, which ensured the balance between compression and compatibility.
Explainability
The explainability of the model’s predictions was qualitatively validated through Grad-CAM (Gradient-weighted Class Activation Mapping) activation maps (Selvaraju et al., 2017). The areas of highest activation, represented by intense heat zones, precisely coincided with the actual locations of colorectal polyps in the endoscopic images. This visual characteristic confirms that the model is effectively identifying the relevant morphological features of the lesion, which is crucial for the confidence and acceptance of the tool in a clinical context.
Managerial and Operational Contribution
The computational efficiency of YOLO11n-seg, with a compact footprint of 5.7 MB and CPU inference time on AMD Ryzen 5 5600X via ONNX FP16 of approximately 30.94 ms, indicates the viability of transitioning from the experimental environment to clinical practice with low budgetary and structural impact. The system dispenses with high-cost GPUs and can operate on conventional local commercial hardware, without cloud dependency or network latency. Deployment in endoscopic units could be structured in four stages: connectivity, edge deployment, pilot validation, and assisted operation (Silva, 2026).
From an assistance perspective, the tool would act as a real-time virtual assistant, aiding in the mitigation of lesion omission rates, as reported in the literature (Zhao et al., 2019). By focusing on highlighting difficult-to-visualize lesions, such as flat and proximal ones, the solution seeks to contribute to the standardization of diagnostic quality among examiners with different levels of experience. This aims to mitigate the effects of medical fatigue and reduce potential institutional risks associated with the late diagnosis of colorectal cancer, aligning directly with the objective of improving prevention and early diagnosis.
Study Limitations
Despite the promising results, the study presented important limitations. The experiments were conducted exclusively on publicly available, pre-annotated databases, which implies dependence on the quality of these annotations and potential influence of biases. Additionally, due to the computational cost of grid search, multiple seeds were not run for each configuration, limiting the estimation of metric variability. Practical reproducibility was ensured by making the Jupyter Notebook and the final model weights available, as well as validating the exported model in different inference formats.
This work does not include prospective clinical validation in a hospital setting, which limits the generalization of the results to medical practice. There is also a risk of “domain shift”, arising from variations between different endoscopic equipment, image acquisition protocols, and patient populations. Finally, the Grad-CAM-based explainability analysis is qualitative in nature and does not constitute a quantitative validation metric of the model’s internal behavior. Therefore, although the proposed method demonstrates technical feasibility on public databases, its clinical application requires further validation in controlled studies in a hospital setting.
In summary, the optimized YOLO11n-seg model demonstrated to be a promising experimental tool for diagnostic support, achieving an mAP50 of 0.7929 and an F1-Score of 0.7514 on the challenging ETIS-Larib dataset. Its real-time processing capability, with latencies below 33 ms across different export formats, including CPU execution via ONNX, validates the technical feasibility for integration into environments with reduced computational power. The balance between accuracy and efficiency, along with the visual explainability of predictions, positions this solution as a significant advancement for the early detection of colorectal polyps, although future clinical validation is essential for its practical applicability.
4. Conclusion
This study aimed to develop and validate a lightweight colorectal polyp detector, designed to operate on restricted hardware with high precision and low latency. The optimized YOLO11n-seg model, after a pipeline of unstructured pruning, knowledge distillation, and fine-tuning, achieved an mAP50 of 0.7929 and an F1-Score of 0.7514 on the challenging ETIS-Larib Polyp DB dataset. This performance was achieved with approximately seven times fewer parameters than the highest-capacity architecture evaluated (YOLO26m-seg), demonstrating a superior balance between diagnostic accuracy and computational efficiency. The combination of the AdaBelief optimizer with the LeakyReLU activation function was identified as the most effective for generalization. Real-time inference capability was proven, with latencies below 33 ms across different export formats, including CPU execution via ONNX, and the explainability of predictions was qualitatively validated by Grad-CAM activation maps.
The main contribution of the work lies in the proposition of a promising experimental tool for diagnostic support, with technical feasibility for integration into clinical environments with reduced computational power, without dependence on cloud or high-cost GPUs. The solution acts as a real-time virtual assistant, aiding in the mitigation of lesion omission, standardizing diagnostic quality, and reducing medical fatigue. However, the study presented important limitations, such as dependence on public databases, execution of experiments with a single seed for each configuration (which limits the estimation of metric variability), and the absence of prospective clinical validation in a hospital setting. This implies risks of “domain shift” and limits the generalization of results to medical practice, in addition to the qualitative nature of the explainability analysis. Therefore, future studies are suggested for controlled clinical validation, in order to confirm the practical applicability of the solution in a real context.
Bibliographic References
Bray, F.; Laversanne, M.; Sung, H.; Ferlay, J.; Siegel, R.L.; Soerjomataram, I.; Jemal, A. 2024. Global cancer statistics 2022: GLOBOCAN estimates of incidence and mortality worldwide for 36 cancers in 185 countries. CA: a cancer journal for clinicians 74(3): 229-263.
Rijn, J.C. van; Reitsma, J.B.; Stoker, J.; Bossuyt, P.M.; Deventer, S.J. van; Dekker, E. 2006. Polyp miss rate determined by tandem colonoscopy: a systematic review. The American journal of gastroenterology 101(2): 343–350.
Winawer, S.J.; Zauber, A.G.; Ho, M.N.; O’Brien, M.J.; Gottlieb, L.S.; Sternberg, S.S.; Waye, J.D.; Schapiro, M.; Bond, J.H.; Panish, J.F. 1993. Prevention of colorectal cancer by colonoscopic polypectomy. The new england journal of medicine 329(27): 1977–1981.
Zhao, S.; Wang, S.; Pan, P.; Xia, T.; Chang, X.; Yang, X.; Guo, L.; Meng, Q.; Yang,
Article originating from the Final Course Work of the Specialization in Data Science and Analytics of the MBA USP/Esalq
To learn more about the course, click here and access the MBX Academy platform