KvasirCAM: Explainable Diagnosis of Gastrointestinal Diseases with Visual Attention and Bayesian Optimization

  • Marcos R. A. Amorim UFMA
  • Neilson P. Ribeiro UFMA / IFMA
  • Luana B. da Cruz UFCA
  • João O. B. Diniz UFMA / IFMA
  • Geraldo B. Júnior UFMA
  • João Dallyson S. Almeida UFMA

Abstract


Gastrointestinal cancer represents a significant portion of global oncological diseases, with colorectal cancer being the third most diagnosed neoplasm and stomach cancer the fifth. Early detection increases survival rates, and endoscopy is the primary examination for identifying these pathologies. Detection studies using Deep Learning have assisted in early identification; however, hyperparameter search is not a trivial task. This work proposes an automatic method for detecting gastrointestinal pathologies by integrating region of interest extraction, visual attention, hyperparameter optimization, and explainability into CNN architectures. The results demonstrate improvements across architectures, with ResNet50 achieving an F1-Score of 94.33% and an AUC of 98.22%, confirming that the approach is effective for gastrointestinal diagnosis.

References

Aguiar, R. M., Scheeren, M. H., de Araujo Junior, S. L., Mendes, E., de Paula Filho, P. L., and Franco, R. A. (2024). Aplicaçao de modelos de aprendizado profundo para a segmentaçao semântica de imagens de colonoscopia. In Simpósio Brasileiro de Computação Aplicada à Saúde (SBCAS), pages 389–399. SBC.

Akiba, T., Sano, S., Yanase, T., Ohta, T., and Koyama, M. (2019). Optuna: A next-generation hyperparameter optimization framework. In Proceedings of the 25th ACM SIGKDD international conference on knowledge discovery & data mining, pages 2623–2631.

Attallah, O., Aslan, M. F., and Sabanci, K. (2025). Endonet: A multiscale deep learning framework for multiple gastrointestinal disease classification via endoscopic images. Diagnostics, 15(16):2009.

Borgli, R. J., Stensland, H. K., Riegler, M. A., and Halvorsen, P. (2019). Automatic hyperparameter optimization for transfer learning on medical image datasets using bayesian optimization. In 2019 13th international symposium on medical information and communication technology (ISMICT), pages 1–6. IEEE.

Bray, F., Laversanne, M., Sung, H., Ferlay, J., Siegel, R. L., Soerjomataram, I., and 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.

Demirbaş, A. A., Üzen, H., and Fırat, H. (2024). Spatial-attention convmixer architecture for classification and detection of gastrointestinal diseases using the kvasir dataset. Health Information Science and Systems, 12(1):32.

Diniz, J. O., Dias Jr, D. A., da Cruz, L. B., Marques, R. C., Gomes Jr, D. L., Cortês, O. A., de Carvalho Filho, A. O., and Quintanilha, D. B. (2024a). Efficientensemble: Diagnóstico de câncer de mama em imagens de ultrassom utilizando processamento de imagens e ensemble de efficientnets. In Simpósio Brasileiro de Computação Aplicada à Saúde (SBCAS), pages 202–213. SBC.

Diniz, J. O., Ribeiro, N. P., Junior, D. A. D., da Cruz, L. B., de Carvalho Filho, A. O., Gomes Jr, D. L., Silva, A. C., and de Paiva, A. C. (2024b). Efficientxyz-deepfeatures: seleção de esquema de cor e arquitetura deep features na classificação de câncer de cólon em imagens histopatológicas. In Simpósio Brasileiro de Computação Aplicada à Saúde (SBCAS), pages 82–93. SBC.

El-Bouzaidi, Y. E. I., Hibbi, F. Z., and Abdoun, O. (2025). Optimizing convolutional neural network impact of hyperparameter tuning and transfer learning. In Innovations in Optimization and Machine Learning, pages 301–326. IGI Global Scientific Publishing.

Elmagzoub, M. A., Kaur, S., Gupta, S., Rajab, A., Rajab, K. D., Al Reshan, M. S., Alshahrani, H., and Shaikh, A. (2024). Improving endoscopic image analysis: Attention mechanism integration in grid search fine-tuned transfer learning model for multi-class gastrointestinal disease classification. IEEE Access, 12:80345–80358.

Gautam, S., Thambawita, V., Riegler, M., Halvorsen, P., and Hicks, S. (2025). Medico 2025: Visual question answering for gastrointestinal imaging. arXiv preprint arXiv:2508.10869.

He, K., Zhang, X., Ren, S., and Sun, J. (2016). Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 770–778.

Huang, G., Liu, Z., Van Der Maaten, L., and Weinberger, K. Q. (2017). Densely connected convolutional networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 4700–4708.

Júnior, D. A. D., da Cruz, L. B., Diniz, J. O. B., da Silva, G. L. F., Junior, G. B., Silva, A. C., de Paiva, A. C., Nunes, R. A., and Gattass, M. (2021). Automatic method for classifying covid-19 patients based on chest x-ray images, using deep features and pso-optimized xgboost. Expert Systems with Applications, 183:115452.

Kamble, A., Bandodkar, V., Dharmadhikary, S., Anand, V., Sanki, P. K., Wu, M. X., and Jana, B. (2025). Enhanced multi-class classification of gastrointestinal endoscopic images with interpretable deep learning model. arXiv preprint arXiv:2503.00780.

Maida, M., Marasco, G., Maas, M., Ramai, D., Spadaccini, M., Sinagra, E., Facciorusso, A., Siersema, P., and Hassan, C. (2025). Effectiveness of artificial intelligence assisted colonoscopy on adenoma and polyp miss rate: A meta-analysis of tandem rcts. Digestive and Liver Disease, 57(1):169–175.

Malik, H., Naeem, A., Sadeghi-Niaraki, A., Naqvi, R. A., and Lee, S.-W. (2024). Multiclassification deep learning models for detection of ulcerative colitis, polyps, and dyed-lifted polyps using wireless capsule endoscopy images. Complex & Intelligent Systems, 10(2):2477–2497.

Nouman Noor, M., Nazir, M., Khan, S. A., Song, O.-Y., and Ashraf, I. (2023). Efficient gastrointestinal disease classification using pretrained deep convolutional neural network. Electronics, 12(7):1557.

Pogorelov, K., Randel, K. R., Griwodz, C., Eskeland, S. L., de Lange, T., Johansen, D., Spampinato, C., Dang-Nguyen, D.-T., Lux, M., Schmidt, P. T., et al. (2017). Kvasir: A multi-class image dataset for computer aided gastrointestinal disease detection. In Proceedings of the 8th ACM on Multimedia Systems Conference, pages 164–169.

Ramaswamy, H. G. et al. (2020). Ablation-cam: Visual explanations for deep convolutional network via gradient-free localization. In proceedings of the IEEE/CVF winter conference on applications of computer vision, pages 983–991.

Simonyan, K. and Zisserman, A. (2014). Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556.

Su, C.-C., Chou, C.-K., Mukundan, A., Karmakar, R., Sanbatcha, B. F., Huang, C.-W., Weng, W.-C., and Wang, H.-C. (2025). Capsule endoscopy: Current trends, technological advancements, and future perspectives in gastrointestinal diagnostics. Bioengineering, 12(6):613.

Tan, M. and Le, Q. (2019). Efficientnet: Rethinking model scaling for convolutional neural networks. In International conference on machine learning, pages 6105–6114. PMLR.

Wang, S., Zheng, R., Li, J., Zeng, H., Li, L., Chen, R., Sun, K., Han, B., Bray, F., Wei, W., et al. (2024). Global, regional, and national lifetime risks of developing and dying from gastrointestinal cancers in 185 countries: a population-based systematic analysis of globocan. The Lancet Gastroenterology & Hepatology, 9(3):229–237.

Woo, S., Park, J., Lee, J.-Y., and Kweon, I. S. (2018). Cbam: Convolutional block attention module. In Proceedings of the European conference on computer vision (ECCV), pages 3–19.
Published
2026-06-01
AMORIM, Marcos R. A.; RIBEIRO, Neilson P.; CRUZ, Luana B. da; DINIZ, João O. B.; B. JÚNIOR, Geraldo; ALMEIDA, João Dallyson S.. KvasirCAM: Explainable Diagnosis of Gastrointestinal Diseases with Visual Attention and Bayesian Optimization. In: BRAZILIAN SYMPOSIUM ON COMPUTING APPLIED TO HEALTH (SBCAS), 26. , 2026, Ouro Preto/MG. Anais [...]. Porto Alegre: Sociedade Brasileira de Computação, 2026 . p. 645-656. ISSN 2763-8952. DOI: https://doi.org/10.5753/sbcas.2026.21416.

Most read articles by the same author(s)

<< < 1 2