The developed model aims to classify early arrhythmias into N, L,R, V, and A classes. Here, all of the datasets are combined to create a principal dataset, which the model uses as input to produce different arrhythmia classes as output.
Method Article
The developed model aims to classify early arrhythmias into N, L,R, V, and A classes. Here, all of the datasets are combined to create a principal dataset, which the model uses as input to produce different arrhythmia classes as output.
As a major cause of death worldwide, cardiovascular diseases-especially arrhythmias-require the creation of precise and automated technologies for early diagnosis and detection. To identify arrhythmias from electrocardiogram (ECG) signals, this paper introduces a deep learning-based classification model that focuses on five main heartbeat types: Normal (N), Left Bundle Branch Block (L), Right Bundle Branch Block (R), Atrial Premature Beat (A), and Premature Ventricular Contraction (V). We leverage Lead I signals from several sources, such as the INCART 12-lead, Sudden Cardiac Death Holter, Supraventricular, and MIT-BIH Arrhythmia databases, yielding more than 3.9 million training and 112,575 testing segments.
Examples of data preparation include 180 sample, fixed-window segmentation, Min-Max normalization, and class balancing with the Synthetic Minority Over-sampling Technique (SMOTE). The hybrid architecture uses Transformer layers to model temporal dependencies and 1D Convolutional Neural Networks (CNNs) to extract spatial features. The Adam optimizer with dropout and batch normalization for regularization trains the model.
The proposed system outperforms the TN4 model and other cutting-edge benchmarks, achieving 99.99% accuracy, precision, and F1-score across all classes. Feature robustness is further improved by applying deep hybrid architectures and convolutional neural networks, which were motivated by earlier studies. The suggested paradigm advances artificial intelligence-driven, individualized digital healthcare and has great promise for scalable, real-time arrhythmia identification.
Cardiovascular diseases (CVDs) remain one of the leading health concerns globally, responsible for nearly 31% of deaths worldwide each year, according to the World Health Organization (WHO)1. A significant subset of these cases involves arrhythmias-irregularities in the heart's rhythm that can range from benign to life-threatening. Arrhythmias are often marked by irregular times. These disruptions substantially contribute to patient morbidity and mortality, heightening the risk of severe health issues such as stroke, heart failure, and sudden cardiac arrest. Early identification and accurate classification of arrhythmias are therefore crucial for improving patient outcomes, managing healthcare costs, and advancing the quality of cardiac care2.
Electrocardiography (ECG) remains a key non-invasive diagnostic tool for detecting arrhythmias. By capturing the heart's electrical activity as visual waveforms, ECG enables clinicians to identify subtle variations that may point to specific arrhythmic patterns3. However, manually interpreting ECG signals is time-consuming and prone to variability due to individual differences among practitioners, which introduces a margin of human error. These challenges are magnified when handling extensive datasets or recognizing nuanced arrhythmias. With the global shift towards digital healthcare, the need for reliable and automated diagnostic systems capable of delivering consistent, real-time ECG analysis is increasingly vital evident4.
Traditional machine learning models have been applied to ECG analysis with moderate success; however, their reliance on handcrafted features and domain-specific expertise poses notable limitations. To address this limitation, the model employs the Synthetic Minority Over-sampling Technique (SMOTE), which generates synthetic data points for underrepresented classes, thereby balancing the dataset and improving the model's capacity to generalize across all heartbeat types. The integration of SMOTE with our deep learning model enhances classification performance, especially for rare arrhythmias, and supports a more equitable diagnostic tool5. The primary objectives of this research are threefold. First, the aim is to develop an accurate, scalable model capable of real-time arrhythmia detection, contributing to the global shift toward digital and personalized healthcare. Second, to demonstrate the effectiveness of a hybrid CNN-Transformer architecture in ECG analysis, highlighting its potential to outperform traditional methods in both accuracy and robustness6.
Finally, the aim is to develop a model with meaningful applications in clinical diagnostics, enhancing early detection of cardiac abnormalities. This study seeks to bridge the gap between deep learning advancements and practical medical applications, positioning our approach as a valuable tool in pursuing improved cardiac care and patient outcomes6.
Access restricted. Please log in or start a trial to view this content.
1. Acquiring datasets
2. Data preprocessing
3. Normalization
4. Class balancing with SMOTE
NOTE: A common challenge in arrhythmia classification is the significant class imbalance, where normal heartbeats vastly outnumber abnormal ones.
5. Train-test split
6. Dataset splitting and class distribution
7. Methodology
(1)
(2)
(3)
(4)
(5)Access restricted. Please log in or start a trial to view this content.
Performance metrics of the proposed model
The accuracy, sensitivity, specificity, and F1-score of the proposed model are calculated for each arrhythmia class. The model's performance is evaluated on the MIT-BIH and other pertinent ECG databases. Key results are summarized as follows:
Accuracy: The hybrid CNN-Transformer model achieved an accuracy of 99.32% on the MITDB dataset and 97.15% on combined databases, demonstrating the model's robustness across different ECG sourc...
Access restricted. Please log in or start a trial to view this content.
This study's results indicate that the hybrid CNN-Transformer model proficiently classifies ECG arrhythmias with elevated accuracy, sensitivity, specificity, and F1-score, markedly surpassing conventional CNN-only and CNN-LSTM models. Incorporating Transformer layers has enhanced the model's ability to capture temporal dependencies, a crucial element of ECG analysis. Moreover, continuous wavelet transformations (CWT) provide extensive time-frequency characteristics, enabling the CNN layers to differentiate between subtle...
Access restricted. Please log in or start a trial to view this content.
The authors have no conflicts of interest to declare.
I wish to thank Dr. Azadeh Amoozegar, Senior Lecturer, INTI International University , for providing online resources to train on the datasets.
Access restricted. Please log in or start a trial to view this content.
| Name | Company | Catalog Number | Comments |
|---|---|---|---|
| Computer system | (For training) Processor: AMD Ryzen 7 7840HS, CPU RAM:16 GB, GPU RAM:6GBNVIDIA GeForce RTX 3050 | ||
| imbalanced-learn | python package used for resampling | ||
| pytorch | PyTorch is a Python package that provides two high-level features: - Tensor computation (like NumPy) with strong GPU acceleration - Deep neural networks built on a tape-based autograd system | ||
| seaborn | Seaborn is a Python visualization library based on matplotlib. | ||
| wfdb | used for reading ,writing, processing, and plotting physiological signal and annotation data |
Access restricted. Please log in or start a trial to view this content.
Request permission to reuse the text or figures of this JoVE article
Request Permission