A Swarm-Optimized Hybrid Yolov8–Random Forest Model For Gastrointestinal Abnormality Identification In Wireless Capsule Endoscopy
DOI:
https://doi.org/10.29284/t9n5wh05Keywords:
Wireless Capsule Endoscopy, You only Look Once (YOLO)v8, Random Forest, Swarm Intelligence, Particle Swarm Optimization, Medical Image Analysis.Abstract
Wireless Capsule Endoscopy (WCE) enables non-invasive visualization of the gastrointestinal tract; however, the large volume of acquired frames makes manual inspection labor-intensive and prone to diagnostic variability. To address this challenge, this paper proposes a swarm-optimized hybrid You only Look Once (YOLO)v8–Random Forest framework for automated gastrointestinal abnormality identification. The proposed method employs YOLOv8 for real-time lesion localization and deep spatial feature extraction, followed by Random Forest classification to enhance robustness and interpretability. Particle Swarm Optimization (PSO) and Grey Wolf Optimizer (GWO) are incorporated to optimize critical hyper parameters of the detection and classification stages. Experiments were conducted on the Kvasir-Capsule dataset using two dataset sizes (4,000 and 8,000 images) with patient-independent splitting. On the 8,000-image configuration, the proposed PSO/GWO–YOLOv8–RF model achieved an accuracy of 98.24%, Precision of 97.92%, Recall of 97.68%, F1-score of 97.80%, and an AUC of 0.992. For the 4,000-image setting, the model achieved an accuracy of 97.82% and an AUC of 0.986. In addition, the optimized framework obtained a mean Average Precision (mAP@0.5) of 82.6%, significantly outperforming standalone YOLOv8 and non-optimized hybrid variants. The results demonstrate that the synergistic integration of deep learning localization, ensemble classification, and swarm-based optimization provides a highly accurate and reliable decision-support system for clinical WCE diagnostics.
References
[1] M. Obayya, F. N. Al-Wesabi, M. Maashi, A. Mohamed, M. A. Hamza, S. Drar, I. Yaseen, and M. I. Alsaid, “Modified salp swarm algorithm with deep learning based gastrointestinal tract disease classification on endoscopic images,” IEEE Access, vol. 11, pp. 25678–25692, Mar. 2023, doi: 10.1109/ACCESS.2023.3256084.
[2] V. Raut, R. Gunjan, V. V. Shete, and U. D. Eknath, “Gastrointestinal tract disease segmentation and classification in wireless capsule endoscopy using intelligent deep learning model,” Comput. Methods Biomech. Biomed. Eng., Imag. Visualizat., vol. 2021, pp. 1–17, Aug. 2022, doi: 10.1080/21681163.2022.2099298.
[3] S. Yang, C. Lemke, B. F. Cox, I. P. Newton, I. Näthke, and S. Cochran, “A learning-based microultrasound system for the detection of inflammation of the gastrointestinal tract,” IEEE Trans. Med. Imag., vol. 40, no. 1, pp. 38–47, Jan. 2021.
[4] A. Sahafi, A. Koulaouzidis, and M. Lalinia, “Polypoid lesion segmentation using YOLO-V8 network in wireless video capsule endoscopy images,” Diagnostics, vol. 14, no. 5, pp. 1–15, Feb. 2024, doi: 10.3390/diagnostics14050474.
[5] H. Malik, A. Naeem, A. Sadeghi-Niaraki, and R. A. Naqvi, “Multi-classification deep learning models for detection of gastrointestinal diseases using wireless capsule endoscopy images,” Complex Intell. Syst., vol. 10, pp. 2477–2497, Nov. 2023, doi: 10.1007/s40747-023-01271-5.
[6] X. Li, Q. Wu, and K. Wu, “Wireless capsule endoscopy anomaly classification via dynamic multi-task learning,” Biomed. Signal Process. Control, vol. 100, pp. 107081, Feb. 2025, doi: 10.1016/j.bspc.2024.107081.
[7] S. Abd El-Ghany, M. A. Mahmood, and A. A. Abd El-Aziz, “Deep learning-based computer-aided diagnosis system for gastrointestinal disease detection using wireless capsule endoscopy,” Appl. Sci., vol. 14, no. 22, pp. 10243, Nov. 2024, doi: 10.3390/app142210243.
[8] S. Xiao, X. Zhang, Q. Wu, and Y. Li, “Image detection method for multi-category lesions in wireless capsule endoscopy based on deep learning,” World J. Gastroenterol., vol. 30, no. 48, pp. 5111–5129, Dec. 2024, doi: 10.3748/wjg.v30.i48.5111.
[9] X. Zhang, P. Li, and Q. Wu, “Automated small bowel lesion detection based on deep learning models in wireless capsule endoscopy,” World J. Gastroenterol., vol. 30, no. 2, pp. 170–183, Jan. 2024.
[10] S. Ye, Q. Meng, S. Zhang, and H. Wang, “Multi-scale feature fusion network for intestinal lesion detection in wireless capsule endoscopy,” Comput. Mater. Continua, vol. 82, no. 2, pp. 2415–2429, Feb. 2025, doi: 10.32604/cmc.2024.058250.
[11] H. Wahab, M. Rashid, and S. Khan, “Federated deep learning for wireless capsule endoscopy anomaly classification,” Comput. Biol. Med., vol. 170, pp. 107593, 2024, doi: 10.1016/j.compbiomed.2023.107593.
[12] P. C. Shekar, V. Kanhangad, and T. S. Kumar, “Automated bleeding detection and classification in wireless capsule endoscopy using YOLOv8,” IEEE Access, vol. 12, pp. 34567–34579, 2024.
[13] H. Malik and R. A. Naqvi, “Multi-class gastrointestinal disease classification using hybrid deep learning on wireless capsule endoscopy,” Complex Intell. Syst., vol. 11, pp. 1123–1138, 2025.
[14] S. Balasubramanian, D. Gera, and Y. Krishna, “Visual attention-based classification for wireless capsule endoscopy images,” IEEE Access, vol. 12, pp. 45621–45634, 2024.
[15] B. Alawode, S. Hamza, and D. Velayudhan, “Transformer-based wireless capsule endoscopy bleeding tissue detection,” IEEE Access, vol. 12, pp. 62311–62324, 2024.
[16] D. K. Iakovidis and A. Koulaouzidis, “Automatic lesion detection in wireless capsule endoscopy: A survey,” IEEE Rev. Biomed. Eng., vol. 8, pp. 253–266, 2015.
[17] Y. Yuan, B. Li, and M. Q.-H. Meng, “Bleeding frame detection in wireless capsule endoscopy using convolutional neural networks,” IEEE Trans. Biomed. Eng., vol. 64, no. 10, pp. 2433–2444, Oct. 2017.
[18] S. Wang, J. Zhang, and L. Cheng, “Hybrid CNN–Random Forest model for gastrointestinal disease classification,” Expert Syst. Appl., vol. 162, pp. 113–121, 2020.
[19] H. Sharma, R. Gupta, and S. Mishra, “Swarm-optimized deep learning for wireless capsule endoscopy lesion detection,” Biomed. Signal Process. Control, vol. 71, pp. 103–115, 2022.
[20] S. Mirjalili, S. M. Mirjalili, and A. Lewis, “Grey wolf optimizer,” Adv. Eng. Softw., vol. 69, pp. 46–61, Mar. 2014.
[21] A. Singh, N. Prakash, and A. Jain, “Particle swarm optimization-based random forest framework for the classification of chronic diseases,” IEEE Access, 2023.
[22] Q. B. Phan and T. T. Nguyen, “A novel approach for photovoltaic cell fault detection using YOLOv8 and particle swarm optimization,” in Proc. IEEE Int. Midwest Symp. Circuits Syst. (MWSCAS), 2023.
[23] K. M. Elgamily, M. A. Mohamed, A. M. Abou-Taleb, and M. M. Ata, “Enhanced object detection by applying metaheuristic optimizers to YOLOv7 and YOLOv8,” Sci. Rep., 2025.
[24] G. Gallo and A. Torrisi, “Random forests based WCE frames classification,” in 2012 IEEE 25th Int. Symp. Comput.-Based Med. Syst. (CBMS), pp. 1–4, 2012.
[25] T. H. Nguyen et al., “An explainable hybrid deep learning model for gastrointestinal abnormality detection in wireless capsule endoscopy,” IEEE Access, vol. 10, 2022.
[26] C. V. Chakradhar, I. K. Reddy, and T. B. Reddy, “Wireless capsule endoscopy: A systematic review and meta-analysis,” Int. J. Anal. Exp. Modal Anal., vol. 13, no. 12, pp. 1795–1802, 2021.
[27] C. V. Chakradhar and T. B. Reddy, “A WCE image classification on Kvasir dataset using hybrid CNN-LSTM,” Int. J. Eng. Res. Curr. Sci., vol. 12, no. 3, 2025.
[28] A. R. Krishna, C. R. Rajeswari, Y. V. S. Kartheek, L. B. S. Ram, R. A. V. V. S. Sai, and K. T. Ramyasri, “Interpretable AI-driven wireless capsule endoscopy image classification: Advancing explainability in medical diagnostics,” Int. J. Sci., Eng. Technol., vol. 13, no. 2, 2025.
[29] P. C. Shekar, V. Kanhangad, S. Maheshwari, and T. S. Kumar, “Automated bleeding detection and classification in wireless capsule endoscopy with YOLOv8-X,” arXiv preprint arXiv:2412.16624, 2024.
[30] J. Werner, C. Gerum, J. Nick, M. Le Floch, F. Brinkmann, J. Hampe, and O. Bringmann, “Enhanced anomaly detection for capsule endoscopy using ensemble learning strategies,” arXiv preprint arXiv:2504.06039, 2025.
[31] A. K. Kundu, M. H. Kabir, M. A. Hossain, and M. A. Rahman, “An accurate deep learning-based computer-aided diagnosis system for gastrointestinal disease detection using wireless capsule endoscopy image analysis,” Appl. Sci., vol. 14, no. 22, p. 10243, 2024.
[32] B. Zhang, Y. Chen, L. Bai, Y. Zhao, Y. Sun, Y. Yuan, J. Zhang, and H. Ren, “Learning to adapt foundation model DINOv2 for capsule endoscopy diagnosis,” arXiv preprint arXiv:2406.10508, 2024.
[33] Smedsrud et al., “Kvasir-Capsule: An open access dataset for gastrointestinal endoscopy,” Sci. Data, 2021.
[34] S. Jain, A. Seal, A. Ojha, O. Krejcar, J. Bureš, I. Tachecí, and A. Yazidi, “Detection of abnormality in wireless capsule endoscopy images using fractal features,” Comput. Biol. Med., vol. 127, p. 104094, 2020.
[35] C. V. Chakradhar and T. B. Reddy, “A deep CNN approach for WCE images on Kvasir dataset,” IMACIS Proc., SCITEPRESS, vol. 1, pp. 5–12, 2025.
[36] S. M. Ayyad, N. M. Sallam, S. A. Gamel, and Z. H. Ali, “Particle swarm optimization with YOLOv8 for improved detection performance of tomato plants,” J. Big Data, vol. 12, p. 152, 2025.
[37] M. Feroskhan, K. Li, and X. Liu, “Enhanced object detection in remote sensing images by applying metaheuristic and hybrid metaheuristic optimizers to YOLOv7 and YOLOv8,” Sci. Rep., vol. 15, p. 89124, 2025.
[38] R. Ramya, S. Priyanka, and M. Karthikeyan, “Particle swarm optimization technique to detect brain tumor using YOLO technology,” J. Propulsion Technol., vol. 44, no. 6, 2023.
[39] P. Kaur and R. Kumar, “Wireless capsule endoscopy video summarization using transfer learning and random forests,” Int. J. Adv. Comput. Sci. Appl., vol. 14, no. 9, pp. 1–?, 2023, doi: 10.14569/IJACSA.2023.0140938.
Downloads
Published
Issue
Section
License

This work is licensed under a Creative Commons Attribution 4.0 International License.
This work is licensed under a Creative Commons Attribution 4.0 International License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

