Abstract
Atrial fibrillation (AFib) detection through ECG interpretation remains a critical yet complex task in clinical settings. While deep learning models have shown promise in automated ECG analysis, their "black box" nature limits clinical adoption. This study presents a multi-level explainable AI (XAI) framework for AFib detection, combining LIME, SHAP, and Grad-CAM approaches to provide clinically meaningful interpretations. Using the PhysioNet AFib Dataset with 5,830 ECG samples, we developed a ResNet-based model that achieved 91.3% precision and 88.7% recall for AFib detection, and 98.4% precision and 98.8% recall for normal rhythm classification. While traditional LIME and SHAP analyses provided feature importance values, their point-wise granularity proved too fine-grained for clinical interpretation. We addressed this limitation by introducing a novel RR-interval aggregation method that aligns XAI outputs with clinical diagnostic patterns. Further examination using Grad-CAM successfully localized three key morphological features: P-wave absence, pronounced T-waves, and irregular RR-intervals. This comprehensive XAI framework bridges the gap between AI predictions and clinical interpretability, offering both beat-level and temporal pattern analysis that aligns with established diagnostic criteria for AFib. Our results demonstrate that integrating multiple XAI approaches can provide clinically relevant explanations while maintaining high diagnostic accuracy.