Abstract 4518: An Interpretable Transformer-Based Framework for Multi-Lead ECG Arrhythmia Classification
Abstract
Background: Twelve-lead electrocardiograms (ECGs) are essential for arrhythmia detection, yet manual interpretation is time-consuming and subject to variability. Although deep learning approaches have shown promise, many models rely on limited lead information and lack interpretability. We aimed to develop and evaluate an interpretable deep learning framework for multi-lead arrhythmia classification from 12-lead ECG signals. Methods: A PhysioNet-derived dataset of 12-lead ECG recordings was curated and segmented into fixed-length windows, labeled as normal rhythm, atrial arrhythmias, or conduction abnormalities. Signals were normalized using robust per-lead scaling and lightly augmented. The architecture integrates a 1D patch-embedding front end, multi-scale depthwise dilated convolutional layers for local morphological feature extraction, squeeze-and-excitation modules for channel-wise recalibration, and Transformer encoder blocks to capture long-range temporal dependencies. Outputs were aggregated using attention-based temporal pooling followed by a softmax classifier. Training employed focal loss with effective-number class weighting, AdamW optimization, early stopping, and strict patient-wise data splitting. Model interpretability was assessed using Grad-CAM, integrated gradients, occlusion sensitivity, SHAP-based temporal attribution, and systematic lead-level ablation. Results: The framework achieved excellent multi-class performance on an independent patient-wise test set (micro-AUC = 0.994, macro-AUC = 0.992). One-vs-rest analysis demonstrated high discrimination across classes (atrial = 0.996, conduction = 0.985, normal = 0.995). The confusion matrix showed strong class-wise accuracy, particularly for atrial (98.0%) and normal (97.4%) rhythms, with slightly lower performance for conduction abnormalities (87.6%). Attribution analyses consistently highlighted clinically relevant waveform components, including P-wave morphology and QRS complexes. Conclusions: This interpretable deep learning framework enables robust arrhythmia classification from 12-lead ECGs while providing physiologically meaningful explanations. By linking predictions to waveform features and lead contributions, it supports the development of transparent and clinically reliable AI for cardiac diagnostics.