Decoding Pneumonia: Evaluating Convolutional Neural Networks and Transformer Architectures Using Integrated Gradients
摘要
While deep learning has revolutionized medical image analysis, its high computational demands and opaque decision-making have hindered its clinical adoption. In this study, we systematically compare CNN-based (baseline CNN, EfficientNet, CheXNet) and transformer-based (ViT, Swin, DeiT, MedViT) models for pneumonia detection on a chest X-ray dataset. We employ transfer learning to reduce training overhead and evaluate model performance using accuracy, precision, recall, F1 score, and ROC AUC, achieving an F1 score of 95.93% for the best performing model (Swin Transformer). Subsequently, Integrated Gradients provide transparent visual explanations, highlighting pathological regions associated with pneumonia. Our findings show transformer-based models outperform CNN-based models, and when coupled with XAI techniques, they pave the way for robust and trustworthy adoption of AI in healthcare.