Automated heart disease detection using Swin Transformer and ECG signal processing: a high-accuracy approach
Cardiovascular diseases (CVDs) are a leading cause of global mortality, necessitating early and accurate detection to improve patient outcomes. Electrocardiography (ECG) is a fundamental diagnostic tool for identifying cardiac abnormalities; however, traditional methods rely on manual interpretation and conventional machine learning (ML) models, which often struggle with feature extraction and long-range dependencies. Recent advancements in deep learning (DL) have led to the adoption of transformer-based architectures for ECG classification. In this study, we propose the Swin Transformer a hierarchical vision transformer model for automated ECG-based heart disease detection. By leveraging shifted window self-attention mechanisms, the Swin Transformer effectively captures both local and global dependencies, overcoming the limitations of convolutional and recurrent architectures. The proposed approach was evaluated on benchmark ECG datasets and compared with traditional ML models, including Random Forest, Gradient Boosting, Support Vector Machine (SVM), and Neural Networks. Experimental results demonstrate that the Swin Transformer significantly outperforms existing methods, achieving 99.8% accuracy, 99.72% precision, 99.91% recall, and an AUC of 99.99%, establishing a new benchmark in ECG classification. Additionally, eigenvalue analysis confirms the model's ability to retain essential features while minimizing redundancy, ensuring robust generalization across diverse ECG patterns. Despite its superior performance, challenges such as computational complexity and interpretability remain, necessitating future research into Explainable AI (XAI) techniques, model optimization for real-time applications, and hybrid deep learning frameworks. Overall, our findings suggest that the Swin Transformer is a highly effective, scalable, and clinically viable solution for automated ECG-based cardiac disease detection, offering unprecedented accuracy and reliability over traditional approaches.
Authors
- It Ee Lee (ORCID: https://orcid.org/0000-0002-0922-8859)
- Sikandar Ali (ORCID: https://orcid.org/0000-0002-2753-8615)
- Muhammad Faisal Abrar (ORCID: https://orcid.org/0000-0001-7958-9900)
- Salman Jan (ORCID: https://orcid.org/0000-0002-8250-694X)
- Arshad Khan (ORCID: https://orcid.org/0000-0003-2858-4653)
- Ahmed Alkhayyat (ORCID: https://orcid.org/0000-0002-7366-1681)
- Muhammad Saqib (ORCID: https://orcid.org/0000-0003-1452-0878)
Institutions
- New Zealand College of Chiropractic (NZ)
- University of Babylon (IQ)
- Multimedia University (MY)
- University of Haripur (PK)
- Iraqi University (IQ)
- University of Ha'il (SA)
- Arab Open University (BH)
- University of Engineering and Technology Peshawar (PK)
Publication Details
- Journal
- Scientific Reports
- Published
- 2025-11-10
- DOI
- https://doi.org/10.1038/s41598-025-23097-6
- Citations
- 1
- Primary Topic
- ECG Monitoring and Analysis
- Type
- article
- Field-Weighted Citation Impact
- 1.39
Funders
- Multimedia University