Method Article

Convolutional Neural Network-Transformer Model to Predict and Classify Early Arrhythmia Using Electrocardiogram Signal

DOI:

10.3791/68227

July 3rd, 2025

In This Article

Summary

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

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.

Abstract

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

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.

Introduction

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

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 cruci....

Access restricted. Please log in or start a trial to view this content.

Protocol

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

1. Acquiring datasets

  1. Acquire publicly available electrocardiogram (ECG) datasets to develop and validate the deep learning model for arrhythmia classification7.
  2. Combine Lead-I datasets from MIT-BIH Arrhythmia Database, MIT-BIH Supraventricular Arrhythmia Database, the St. Petersburg INCART 12-lead Arrhythmia Database, and the Sudden Cardiac Death Holter Database.
    NOTE: Datasets are chosen for their diversity in patient demographics and arrhythmia types, ensuring the model can generalize across varied cases. Each dataset provides high-quality annotated ECG recordings, covering a range of heartbeat cla....

Access restricted. Please log in or start a trial to view this content.

Results

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

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.

Discussion

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

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.

Disclosures

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

The authors have no conflicts of interest to declare.

Acknowledgements

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

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.

Materials

List of materials used in this article
NameCompanyCatalog NumberComments
Computer system(For training) Processor: AMD Ryzen 7 7840HS, CPU RAM:16 GB, GPU RAM:6GBNVIDIA GeForce RTX 3050
imbalanced-learnpython package used for resampling
pytorchPyTorch 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
seabornSeaborn is a Python visualization library based on matplotlib. 
wfdbused for reading ,writing, processing, and plotting physiological signal and annotation data

References

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,
  1. Jamil, S., Rahman, M. A. Novel deep-learning-based framework for the classification of cardiac arrhythmia. J Imaging. 9 (3), 70(2020).
  2. Reegu, F. A., et al. Blockchain-based framework for interoperable electronic health record....

Access restricted. Please log in or start a trial to view this content.

Reprints and Permissions

Request permission to reuse the text or figures of this JoVE article

Request Permission

Tags

Arrhythmia ClassificationElectrocardiogram SignalConvolutional Neural NetworkTransformer ModelDeep Learning ModelHeartbeat ClassificationLead I ECGTemporal DependenciesClass BalancingDigital Healthcare
Video Coming Soon

Related Articles