ECG-XPLAIM: eXPlainable Locally-adaptive Artificial Intelligence Model for arrhythmia detection from large-scale electrocardiogram data

Panteleimon Pantelidis, Samuel Ruipérez-Campillo, Julia E. Vogt, Alexios S. Antonopoulos, Ioannis Gialamas, George Ε. Zakynthinos, Μichael Spartalis, Polychronis Dilaveris, José Millet, Theodore G. Papaioannou, Evangelos Oikonomou, Gerasimos SiasosFrontiers in Cardiovascular Medicine 2025 · DOI

TL;DR

ECG-XPLAIM is a novel, open-source deep learning framework that achieves state-of-the-art arrhythmia detection while pulling back the curtain on "black-box" AI. By combining a multi-scale Inception-style architecture with Grad-CAM interpretability, the model provides clinicians with both high-accuracy diagnoses and visual heatmaps that highlight the specific physiological features driving its decisions.

What Problem Does This Paper Address?

While deep learning models have shown incredible promise in interpreting electrocardiograms (ECGs), they face a major hurdle: the "black-box" problem. Clinicians are understandably hesitant to trust a model that provides a diagnosis without explaining why.

Furthermore, ECG signals are complex. They contain "local" features (the specific shape of a single heartbeat's waves) and "global" features (the overall rhythm over 10 seconds). Most standard neural networks struggle to balance these two scales effectively. There is also a lack of high-quality, open-source models trained on massive, diverse datasets, which limits the ability of the broader research community to validate and build upon existing work.

Methods

The researchers developed ECG-XPLAIM, which uses a one-dimensional (1D) Inception-style convolutional neural network (CNN).

  • Multi-Scale Processing: Unlike standard CNNs that use a single filter size, each "Inception module" in this model runs three parallel convolutional kernels of different lengths (4ms, 20ms, and 80ms). This allows the model to simultaneously "zoom in" on sharp features like pacemaker spikes and "zoom out" to see broader rhythm disturbances.
  • Residual Learning: The architecture uses three residual blocks with skip connections to prevent signal degradation as the network gets deeper.
  • Explainability (XAI): The team integrated Grad-CAM (Gradient-weighted Class Activation Mapping). This technique generates heatmaps over the raw ECG traces, highlighting exactly which segments (e.g., a missing P-wave or a widened QRS complex) the model focused on to reach its conclusion.
  • Raw Data Approach: Interestingly, the model was trained on raw waveform data. The authors found that traditional signal filtering (like bandpass filters) actually removed critical information, such as sharp pacing spikes.

Datasets

The model was developed and tested using two of the largest publicly available ECG repositories:

  1. MIMIC-IV: Used for training and internal evaluation, containing over 800,000 12-lead ECG recordings.
  2. PTB-XL: Used for rigorous external validation to ensure the model generalizes to different hospital settings and equipment. It contains over 25,000 records.

The researchers focused on five major tasks: Tachyarrhythmias (AFib vs. Sinus Tachycardia), Conduction Disturbances (RBBB, LBBB, LAFB), Long QT (LQT), Wolff-Parkinson-White (WPW) pattern, and Paced rhythms.

Key Insights and Ideas

  • The "Doctor’s Eye" Architecture: By using parallel kernels of different lengths, the model mimics the clinical reasoning process—looking at the fine morphology of a wave while keeping an eye on the overall rhythm.
  • Filtering is a Double-Edged Sword: A major "aha" moment was discovering that standard preprocessing (filtering) significantly dropped the sensitivity for detecting paced rhythms because it smoothed out the very "spikes" the model needed to see.
  • XAI as a Debugging Tool: Grad-CAM didn't just confirm correct hits; it revealed why the model failed. For example, the model sometimes misidentified 1st-degree AV block as AFib because it "thought" the P-wave was missing when it was actually just delayed. This provides a clear roadmap for future model refinement.
  • Prioritizing Sensitivity: The model was tuned to minimize false negatives. In a clinical screening context, it is much more dangerous to miss a life-threatening arrhythmia than to flag a healthy patient for further review.

Key Results

ECG-XPLAIM demonstrated robust performance, consistently outperforming vanilla CNNs and Gated Recurrent Units (GRUs).

  • Internal Validation (MIMIC-IV): Achieved macro-averaged AUROC scores exceeding 0.96 across all tasks.
  • External Validation (PTB-XL): Maintained high generalizability, specifically for Atrial Fibrillation (AUROC 0.988) and Conduction Disturbances (AUROC 0.98).
  • Benchmarking: When compared to a state-of-the-art ResNet-based model, ECG-XPLAIM showed superior sensitivity, particularly in detecting bundle branch blocks.
  • Efficiency: The model is highly scalable, with inference times between 4.5 and 16 milliseconds per 10-second ECG, making it suitable for real-time clinical deployment.

Limitations and Future Work

The authors acknowledge that class imbalance remains a hurdle. Rare conditions like WPW and Long QT had fewer samples, leading to lower sensitivity in external datasets (dropping to the 0.7–0.8 range).

Future work will likely involve:

  • Targeted Data Augmentation: Using synthetic data generation to "beef up" the training sets for rare arrhythmias.
  • Prospective Clinical Trials: Moving from retrospective database testing to real-world hospital environments.
  • Advanced XAI: Moving beyond "where" the model looks to "why" it chooses one diagnosis over another using more sophisticated logic-based interpretability frameworks.

By releasing the code and pre-trained weights, the authors have provided a powerful, transparent foundation for the next generation of AI-assisted cardiology.

Summary updated

Abstract

ECG-XPLAIM combines high diagnostic performance with interpretability, addressing a key limitation in AI-driven ECG analysis. The open-source release of ECG-XPLAIM's architecture and pre-trained weights encourages broader adoption, external validation, and further refinement for diverse clinical applications.
BibTeX
@inproceedings{pantelidis2025ecg,
  author = {Panteleimon Pantelidis and Samuel Ruipérez-Campillo and Julia E. Vogt and Alexios S. Antonopoulos and Ioannis Gialamas and George Ε. Zakynthinos and Μichael Spartalis and Polychronis Dilaveris and José Millet and Theodore G. Papaioannou and Evangelos Oikonomou and Gerasimos Siasos},
  title = {{ECG-XPLAIM: eXPlainable Locally-adaptive Artificial Intelligence Model for arrhythmia detection from large-scale electrocardiogram data}},
  booktitle = {Frontiers in Cardiovascular Medicine},
  year = {2025},
  doi = {10.3389/fcvm.2025.1659971},
}
Figure