JAIT 2025 Vol.16(2): 264-273
doi: 10.12720/jait.16.2.264-273

Explainable Disease Classification: Exploring Grad-CAM Analysis of CNNs and ViTs

Ali Alqutayfi1,* , Wadha Almattar1,2,* , Sadam Al-Azani3 , Fakhri Alam Khan1,3,4 , Abdullah Al Qahtani5 , Solaiman Alageel6 , Mohammed Alzahrani6

  • 1King Fahd University of Petroleum and Minerals, Information and Computer Science Department, Saudi Arabia
  • 2Imam Abdulrahman Bin Faisal University, Computer Science Department, Saudi Arabia
  • 3SDAIA-KFUPM Joint Research Center for Artificial Intelligence, Saudi Arabia
  • 4Interdisciplinary Research Center of Intelligent Secure Systems, KFUPM, Saudi Arabia
  • 5Imam Abdulrahman Bin Faisal University, Ophthalmology-College of Medicine, Saudi Arabia
  • 6Dammam Medical Complex, Radiology Department, Eastern Health Cluster, Saudi Arabia

* Corresponding author

  • Manuscript receivedSeptember 27, 2024
  • revisedOctober 16, 2024
  • acceptedDecember 6, 2024
  • publishedFebruary 17, 2025

Abstract

Deep learning architectures, such as Convolutional Neural Networks (CNNs) and Vision Transformers (ViTs), are playing an increasingly crucial role in early diagnosis and treatment across medical fields. As these AI models are integrated into clinical practice, the need for explainable AI tools, like Gradient-weighted Class Activation Mapping (Grad-CAM), becomes paramount to building clinician trust and ensuring the reliability of AI-driven diagnoses. However, a gap exists in the literature regarding comprehensive, quantitative, and qualitative comparisons of CNN and ViT performance across diverse medical imaging tasks, particularly those involving variations in object scale. This study compares CNN-based and ViT-based models for two medical imaging tasks: diabetic retinopathy detection from fundus images (small objects) and pneumonia detection from chest X-rays (large objects). We evaluate popular CNN architectures (ResNet, EfficientNet, VGG, Inception) and ViT models (ViT-Base, ViT-Large, ViT-Huge), using both quantitative metrics and expert qualitative assessments. We also analyze Grad-CAM’s effectiveness for visualizing regions of interest in these models. Our results show that ViT-Large outperforms other models on X-rays, while EfficientNet excels on fundus images. However, Grad-CAM struggles to highlight small regions of interest, particularly in diabetic retinopathy, revealing a limitation in current explainable AI methods. This work underscores the need for optimization of explainability tools and contributes to a better understanding of CNN and ViT strengths in medical imaging.

Keywords

  • explainable AI
  • Vision Transformer (ViT)
  • Convolutional Neural Network (CNN)
  • medical imaging
  • Gradient-weighted Class Activation Mapping (Grad-CAM)
JAIT-V16N2-264

How to Cite

Copied

Ali Alqutayfi, Wadha Almattar, Sadam Al-Azani, Fakhri Alam Khan, Abdullah Al Qahtani, Solaiman Alageel, and Mohammed Alzahrani, "Explainable Disease Classification: Exploring Grad-CAM Analysis of CNNs and ViTs," Journal of Advances in Information Technology, vol. 16, no. 2, pp. 264-273, 2025. https://doi.org/10.12720/jait.16.2.264-273

Copyright & License

Copyright © 2025 by the authors. This is an open access article distributed under the Creative Commons Attribution License which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited (CC BY 4.0).

Article Metrics in Dimensions