ORIGINAL RESEARCH article
Front. Med.
Sec. Precision Medicine
Volume 12 - 2025 | doi: 10.3389/fmed.2025.1600855
This article is part of the Research TopicIntegrating AI and Machine Learning in Advancing Patient Care: Bridging Innovations in Mental Health and Cognitive NeuroscienceView all 11 articles
Transformer-Based ECG Classification for Early Detection of Cardiac Arrhythmias
Provisionally accepted- 1Islamia University of Bahawalpur, Bahawalpur, Pakistan
- 2Government Sadiq College Women University, Bahawalpur, Bahawalpur, Punjab, Pakistan
- 3College of Technology, Chandigarh Group of Colleges, Mohali, Punjab, India
- 4Department of Signal Theory and Communications, Higher Technical School of Engineering, University of Seville, Seville, Spain
- 5Universidad Europea del Atlántico, Santander, Cantabria, Spain
- 6Laboratorio de Genética Molecular Humana, Centro Universitario Regional Litoral Norte Salto, Universidad de la República, Salto, Uruguay
Select one of your emails
You have multiple emails registered with Frontiers:
Notify me on publication
Please enter your email address:
If you already have an account, please login
You don't have a Frontiers account ? You can register here
Electrocardiogram (ECG) classification plays a critical role in the early detection and monitoring of cardiovascular diseases. This study presents a Transformer-based deep learning framework for automated ECG classification, integrating advanced preprocessing, feature selection, and dimensionality reduction techniques to improve model performance. The pipeline begins with signal preprocessing, where raw ECG data are denoised, normalized, and relabeled for compatibility with attention-based architectures. Principal Component Analysis (PCA), correlation analysis, and feature engineering are applied to retain the most informative features. To assess the discriminative quality of the selected features, t-distributed Stochastic Neighbor Embedding (t-SNE) is used for visualization, revealing clear class separability in the transformed feature space. The refined dataset is then input to a Transformer-based model trained with optimized loss functions, regularization strategies, and hyperparameter tuning. The proposed model demonstrates strong performance on the MIT-BIH benchmark dataset, showing results consistent with or exceeding prior studies. However, due to differences in datasets and evaluation protocols, these comparisons are indicative rather than conclusive. The model effectively classifies ECG signals into categories such as Normal, AtrialPremature Contraction (APC), Ventricular Premature Contraction (VPC), and Fusion Beats. These results underscore the effectiveness of Transformer-based models in biomedical signal processing and suggest potential for scalable, automated ECG diagnostics. However, deployment in real-time or resource-constrained settings will require further optimization and validation.
Keywords: Cardiac monitoring, ECG classification, Electrocardiogram analysis, PCA, t-SNE, Transformer-based Model, VPC, Feature engineering
Received: 27 Mar 2025; Accepted: 22 Jul 2025.
Copyright: © 2025 Ikram, Ikram, Singh, Ali, Naveed, De La Torre, Gongora and Candelaria. This is an open-access article distributed under the terms of the Creative Commons Attribution License (CC BY). The use, distribution or reproduction in other forums is permitted, provided the original author(s) or licensor are credited and that the original publication in this journal is cited, in accordance with accepted academic practice. No use, distribution or reproduction is permitted which does not comply with these terms.
* Correspondence: Sunnia Ikram, Islamia University of Bahawalpur, Bahawalpur, Pakistan
Disclaimer: All claims expressed in this article are solely those of the authors and do not necessarily represent those of their affiliated organizations, or those of the publisher, the editors and the reviewers. Any product that may be evaluated in this article or claim that may be made by its manufacturer is not guaranteed or endorsed by the publisher.