A model that runs in a notebook serves one request at a time. A production endpoint receives many requests at once, and each one needs GPU memory for its key-value (KV) cache, a slot in the batch, and a response stream. Plain PyTorch or Hugging Face Transformers can serve the model, but you have to

XAI-ECGNet: an explainable hybrid CNN-BiLSTM framework for multi-label cardiac diagnosis classification from 12-lead ECG signals using the PTB-XL dataset – Scientific Reports
- Prakash B Metre1,
- Vinay K2,
- Deepa B G2 &
- …
- Gauri Kalnoor1
We’re sharing this article early to provide faster access to peer-reviewed, accepted research. It is citable and carries a permanent DOI. This version is subject to further edits and will be replaced automatically by the final Version of Record. All legal disclaimers apply.
Abstract
Cardiovascular disorders cause approximately 17.9 million deaths annually, and the 12-lead electrocardiogram remains the primary non-invasive diagnostic tool, yet interpretable deep-learning ECG classifiers remain limited, restricting clinical adoption. We present XAI-ECGNet, which is based on 1D residual CNNs, squeeze-and-excitation (SE) channel attention on learned, lead-derived feature channels, and bidirectional LSTM (BiLSTM) temporal modelling. On PTB-XL (21,799 ECGs, 18,885 patients), XAI-ECGNet outperforms all of the top performing baselines in terms of macro-AUROC, which is 0.9337, within the range of the baselines’ bootstrap confidence intervals, and four of five diagnostic superclasses have AUROC above 0.90. Ablation results indicate that the full model is within five-seed variability (σ = 0.0023) of the CNN-only backbone (0.9333); per-class analysis reveals that SE attention is crucial for BiLSTM to offer benefit, as it recovers and surpasses CNN-only performance on four out of five classes after BiLSTM alone fails to do so. Three post-hoc methods (Grad-CAM, SHAP, Integrated Gradients) show the model learns clinically consistent representations without explicit clinical priors. We also report quantitative faithfulness evaluation, SHAP background-sample-size justification, and zero-shot cross-dataset validation on CPSC 2018, demonstrating genuine generalisation for NORM and CD, and interpretable label-taxonomy mismatch for STTC. XAI-ECGNet combines accurate multi-label ECG classification with a rigorously and quantitatively assessed explainability framework, but prospective cardiologist validation is required before any claim to clinical use can be made.
Similar content being viewed by others
Acknowledgements
The authors thank the PTB-XL and CPSC 2018 dataset creators for making these large-scale clinical ECG datasets publicly available. The authors acknowledge the use of Google Colab and Kaggle Notebook GPU compute resources used in this study. The authors also sincerely thank Manipal Academy of higher Education and Christ University for helping the authors in successfully completing this research paper by offering academic support and resources.
Funding
Open access funding provided by Manipal Academy of Higher Education, Manipal. The author received No Funding for this work.
Ethics declarations
Competing interests
The authors declare no competing interests.
Ethical approval
This study did not involve new data collection from human or animal subjects. All analyses were conducted on the publicly available, de-identified PTB-XL6 and CPSC 201840 electrocardiography datasets. Both datasets were collected and ethically approved by their original data providers, with informed consent and ethical oversight described in the respective dataset publications, and are distributed for secondary research use without further identifying information. No additional ethical approval was required for the secondary analyses reported here.
Declaration of generative AI and AI-assisted technologies in the writing process
During the preparation of this work, the authors used AI-assisted tools, including Cursor with Claude (Anthropic) and ChatGPT (OpenAI), to support project organization, debugging, code refactoring, and other development-related tasks. These tools were also used to improve the language, clarity, and readability of the manuscript. The authors reviewed the AI-assisted suggestions and revisions and take full responsibility for the final content of the work.
Additional information
Publisher’s note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Rights and permissions
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article’s Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.
Reprints and permissions
About this article
Cite this article
Metre, P.B., K, V., G, D.B. et al. XAI-ECGNet: an explainable hybrid CNN-BiLSTM framework for multi-label cardiac diagnosis classification from 12-lead ECG signals using the PTB-XL dataset. Sci Rep (2026). https://doi.org/10.1038/s41598-026-76799-w
Download citation
-
Received:
-
Accepted:
-
Published:
-
DOI: https://doi.org/10.1038/s41598-026-76799-w
