Comparing Time-Frequency and Time Domain ECG Data for Forecasting and Detection of Atrial Fibrillation

Njegos Ljusic1, Bjørn-Jostein Singstad2, Vimala Nunavath3
1University of South-Eastern Norway, 2Akershus University Hospital, 3USN


Abstract

Atrial fibrillation (AF), the most common sustained arrhythmia, is linked to stroke and heart failure, but paroxysmal AF is often missed because episodes are brief and asymptomatic. This study uses the IRIDIA-AF database (167 Holter records, 152 patients) to detect and forecast paroxysmal AF with convolutional neural networks (CNNs), comparing 1D models on raw ECG windows with 2D models on spectrograms, using 10- and 30-second segments from ECG leads I and II. Four explainable AI (XAI) methods (Grad-CAM, low- and high-resolution Guided Grad-CAM, and Layer-Wise Relevance Propagation) were used to clarify model decisions. For AF detection, all 1D CNNs and the 2D CustResNet models performed strongly (AUROC >= 0.98), and XAI showed that irregular QRS complexes and fibrillatory P/T-wave activity underpinned correct classifications. For AF forecasting, some models achieved AUROC up to 0.86, but XAI showed this depended on an artifact in pre-AF window construction (segments ending near a QRS complex) rather than true predictive patterns; 2D spectrogram models were also biased toward non-physiological frequencies above 40 Hz. We suggest that 10–30 s windows are unsuitable for AF onset forecasting with these methods, that 1D CNNs on raw ECG outperform 2D CNNs on spectrograms for AF detection, and that, for now, multiple XAI techniques are crucial to distinguish genuinely informative models from those that perform well for spurious reasons.