Deep Learning Models for Arrhythmia Classification Using Stacked Time-frequency Scalogram Images from ECG Signals

Parshuram Aarotale1 and Ajita Rattani2
1Biomedical Engineering,Wichita state University, 2Dept of Computer Science and Engineering, University of North Texas


Abstract

Introduction: Electrocardiograms (ECGs), a medical monitoring tech-nology recording cardiac activity, are widely used for diagnosing car-diac arrhythmia. The diagnosis is based on the analysis of the defor-mation of the signal shapes due to irregular heart rates associated with heart diseases. Due to the infeasibility of manual examination of large volumes of ECG data, this paper aims to propose a deep-learning-based technique that uses a self-attention mechanism for ECG-based arrhythmia classification.

Methods: Twelve lead electrocardiograms (ECG) of length 10 sec from 45,152 individuals from Shaoxing People's Hospital (SPH) da-taset from PhysioNet with four different types of arrhythmias i.e., atri-al fibrillation (AFIB), supraventricular tachycardia (ST), sinus brady-cardia (SB), and sinus rhythm (SR) were used. The sampling frequen-cy utilized was 500 Hz. Median filtering was used to preprocess the ECG signals. For every 1 sec of ECG signal, the time-frequency (TF) scalogram was estimated, resulting in 10 TF scalograms for each ECG signal. The TF scalogram image was used as an input to a sim-ple convolutional neural network (CNN) architecture along with the self-attention mechanism used for arrhythmia classification.

Results: The proposed model obtained a test accuracy of about 80.06% in ECG arrhythmia classification. For each of the four ECG classes (AFIB, SB, SR, and ST), the precision of 0.65, 0.91, 0.80, 0.71, recall of 0.43, 0.98, 0.76, 0.86, and F1-score of 0.52, 0.94, 0.79, 0.78 were obtained.

Conclusions: Our experimental results demonstrate the efficacy of the simple CNN model along with the self-attention mechanism in the automatic classification of arrhythmia types from ECG signals. This work will be extended to further improve the accuracy rate of the ECG-based arrhythmia classification system using advanced attention mechanisms (such as multi-head attention and cross-attention) across large scale datasets. Additionally, other ECG arrhythmia classes will also be considered for further study.