Classification and Self-Supervised Regression of Arrhythmic ECG Signals Using Convolutional Neural Networks

Bartosz Grabowski, Przemyslaw Glomb, Wojciech Masarczyk, Pawel Plawiak, Özal Yildirim, U. Rajendra Acharya, Ru San TanarXiv 2022 · DOI · OpenReview

Abstract

This study introduces a dual-purpose Convolutional Neural Network (CNN) framework for the automated interpretation of electrocardiogram (ECG) signals. The approach leverages a self-supervised regression task—predicting missing segments of a heartbeat—to learn the underlying geometric structure of ECG signals from unlabeled data. Evaluated on the MIT-BIH Arrhythmia database, the model achieves a classification accuracy of 87.78% across 17 rhythm types. These results demonstrate that signal reconstruction capabilities enhance feature extraction for clinical diagnosis, offering a robust solution to the challenges of data labeling and signal quality in cardiology.

Introduction

Diagnosing cardiac arrhythmias traditionally requires manual, time-consuming interpretation of ECG signals by experts. While machine learning has automated parts of this process, two major hurdles remain: the high cost of expert-labeled data and the prevalence of noise or missing data in real-world recordings. This paper addresses these issues by developing a model that doesn't just categorize heartbeats but understands their fundamental morphology through a self-supervised regression task. By teaching the model to "fill in the blanks" of a heartbeat, the researchers created a system that exploits vast amounts of unlabeled data to improve diagnostic accuracy.

Methods

The researchers proposed a 7-layer 1D-CNN architecture designed to process temporal ECG data. The training methodology follows a two-stage pipeline:

  1. Self-Supervised Regression: The model is first trained on 99,990 unlabeled 10-second ECG segments. A 100-sample window, typically corresponding to the QRS complex, is zeroed out. The network is then tasked with reconstructing this missing signal based on the surrounding context. Because the ground truth is the original signal, this task requires no manual labeling.
  2. Knowledge Transfer and Classification: Once the model learns to reconstruct heartbeats, the weights are transferred to a classification task. The model is then fine-tuned using a smaller set of 1,000 expert-labeled segments categorized into 17 diagnostic classes.
The 7-layer 1D-CNN architecture used for feature extraction and classification.
The self-supervised training pipeline where the network learns to predict missing ECG segments to understand signal geometry.

To optimize performance, the team utilized the Ray Tune library to navigate a complex hyperparameter space, refining kernel sizes and neuron counts for the final layers.

Results and Discussion

The self-supervised regression task yielded satisfactory reconstruction, with most cases achieving a Normalized Root Mean Square Error (NRMSE) of approximately 0.2. The network proved particularly adept at estimating the correct shape of heartbeats even in complex mixed rhythms, prioritizing high-amplitude spikes like the QRS complex.

In the classification phase, the base model (CNet) achieved 87.33% overall accuracy. The pre-trained version (RCNet), which benefited from the regression task, reached a higher accuracy of 87.78%. While the performance boost from self-supervision was modest, it confirmed that the knowledge gained from reconstructing signals is transferable to diagnosing them. Furthermore, the 7-layer model performed on par with much deeper 16-layer reference CNNs and significantly outperformed traditional Support Vector Machine (SVM) approaches, which reached only ~78% accuracy. The model also showed resilience to class imbalance, maintaining a balanced accuracy of over 80% despite the rarity of certain conditions.

Conclusion

This research demonstrates that self-supervised pre-training via signal reconstruction is a viable strategy for enhancing ECG classification. By learning the "language" of the heart from unlabeled data, the proposed CNN architecture achieves high diagnostic performance with reduced reliance on expensive expert labels. Future directions include testing the model on larger, more diverse datasets and exploring multi-task learning to simultaneously optimize for reconstruction and classification.

Summary updated

Abstract

Interpretation of electrocardiography (ECG) signals is required for diagnosing cardiac arrhythmia. Recently, machine learning techniques have been applied for automated computer-aided diagnosis. Machine learning tasks can be divided into regression and classification. Regression can be used for noise and artifacts removal as well as resolve issues of missing data from low sampling frequency. Classification task concerns the prediction of output diagnostic classes according to expert-labeled input classes. In this work, we propose a deep neural network model capable of solving regression and classification tasks. Moreover, we combined the two approaches, using unlabeled and labeled data, to train the model. We tested the model on the MIT-BIH Arrhythmia database. Our method showed high effectiveness in detecting cardiac arrhythmia based on modified Lead II ECG records, as well as achieved high quality of ECG signal approximation. For the former, our method attained overall accuracy of 87:33% and balanced accuracy of 80:54%, on par with reference approaches. For the latter, application of self-supervised learning allowed for training without the need for expert labels. The regression model yielded satisfactory performance with fairly accurate prediction of QRS complexes. Transferring knowledge from regression to the classification task, our method attained higher overall accuracy of 87:78%.
BibTeX
@misc{grabowski2022classification,
  author = {Bartosz Grabowski and Przemyslaw Glomb and Wojciech Masarczyk and Pawel Plawiak and Özal Yildirim and U. Rajendra Acharya and Ru San Tan},
  title = {{Classification and Self-Supervised Regression of Arrhythmic ECG Signals Using Convolutional Neural Networks}},
  year = {2022},
  eprint = {2210.14253},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2210.14253},
}
Figure