Source-linked AI summary
Classification of Arrhythmia by Using Deep Learning with 2-D ECG Spectral Image Representation
Amin Ullah, Syed M. Anwar, Muhammad Bilal, Raja M Mehmood
TL;DR
The paper addresses automated classification of diverse cardiac arrhythmias from ECG signals, whose 1-D form is not directly suited to 2-D image-based deep learning. It converts ECG time series into STFT spectrograms, applies augmentation, and classifies them with a 2-D CNN, achieving 99.11% average accuracy on the MIT-BIH arrhythmia dataset.
Problem
Existing arrhythmia methods often use small datasets, cover only a few types, or do not clearly describe converting 1-D ECG signals into 2-D images.
Method
The method converts 1-D ECG signals into STFT-based 2-D spectrograms, augments the images, and applies a 2-D CNN for classification.
Results
99.11% average accuracy was achieved for eight-class arrhythmia classification on the MIT-BIH arrhythmia dataset.
Takeaways & Limitations
The proposed 2-D ECG representation and CNN classified eight arrhythmia classes with reported state-of-the-art performance.
Takeaways & Limitations
Direct comparison with existing techniques may be unfit because datasets, dataset sizes, CNN architectures, and numbers of arrhythmia types vary.
Abstract
from arXiv · showhide
The electrocardiogram (ECG) is one of the most extensively employed signals used in the diagnosis and prediction of cardiovascular diseases (CVDs). The ECG signals can capture the heart's rhythmic irregularities, commonly known as arrhythmias. A careful study of ECG signals is crucial for precise diagnoses of patients' acute and chronic heart conditions. In this study, we propose a two-dimensional (2-D) convolutional neural network (CNN) model for the classification of ECG signals into eight classes; namely, normal beat, premature ventricular contraction beat, paced beat, right bundle branch block beat, left bundle branch block beat, atrial premature contraction beat, ventricular flutter wave beat, and ventricular escape beat. The one-dimensional ECG time series signals are transformed into 2-D spectrograms through short-time Fourier transform. The 2-D CNN model consisting of four convolutional layers and four pooling layers is designed for extracting robust features from the input spectrograms. Our proposed methodology is evaluated on a publicly available MIT-BIH arrhythmia dataset. We achieved a state-of-the-art average classification accuracy of 99.11\%, which is better than those of recently reported results in classifying similar types of arrhythmias. The performance is significant in other indices as well, including sensitivity and specificity, which indicates the success of the proposed method.
1. Introduction
The paper motivates automated arrhythmia classification from ECG recordings because accurate identification supports diagnosis and treatment, while existing approaches face representation, data-scale, and coverage limitations.
- Automated classification of arrhythmia types could support earlier diagnosis and treatment of heart disease.
- ECG recordings are widely used to diagnose and predict cardiac arrhythmia and other heart diseases.
- Existing methods may be affected by inter-patient variability and increasing data size, and many studies use relatively small datasets.
- Prior 2-D ECG methods do not clearly detail how 1-D signals are converted into images, while many methods evaluate only a few arrhythmia types.
- The study employs STFT-generated spectrograms and data augmentation with a CNN-based method for ECG arrhythmia classification.
2. Proposed Scheme
The proposed scheme preprocesses ECG signals, converts them into spectrogram images, augments the data, extracts features with a CNN, and classifies the resulting representations.
- The proposed procedure comprises signal preprocessing, spectrogram generation, data augmentation, CNN feature extraction, and classification.
- Signal preprocessing: Wavelet thresholding and reconstruction remove electromyographic, power-line, and baseline-drift noise from the original ECG signal.
- Generation of 2-D Images: STFT converts non-stationary 1-D ECG signals into 2-D time-frequency spectrograms for CNN processing.
- Generation of 2-D Images: The logarithmic STFT values are represented as 256 × 256 spectrogram images.
- Data Augmentation: 2-D spectrograms support augmentation such as cropping, helping increase training data and address underrepresented arrhythmia classes.
- Deep Neural Network: The 2-D CNN uses local spatial correlations and downsampling to extract and filter features from ECG image representations.
3. Experiments
Experiments used selected MIT-BIH arrhythmia classes to evaluate the proposed CNN against AlexNet and VGGNet using standard classification metrics. The setup trained the model on 2-D spectral images and measured accuracy, precision, sensitivity, and specificity.
- The MIT-BIH dataset contains 48 approximately 30-minute, two-channel ambulatory ECG records collected between 1975 and 1979.
- The proposed CNN algorithm was compared with AlexNet and VGGNet for ECG arrhythmia classification.
- Eight arrhythmia classes were selected because they were more common and had acceptable ground-truth representation.The selected classes included normal beat, seven arrhythmia types, and classes used by comparison methods.
- The experiment used 2-D spectral images and required substantial computational power and training time.The implementation used Python, TensorFlow, an NVIDIA 1080 GPU with 11GB memory, and 32GB RAM.
- Cross-entropy measured the CNN's error, while Adam optimization minimized the cost during training.The reported learning rate was 0.001, and Adam reached the optimal point in fewer iterations.
- Four evaluation metrics were used: accuracy, precision, sensitivity, and specificity.Accuracy represents the ratio of correctly classified instances to total instances; the other metrics use true- and false-positive or negative counts.
4. Classification Results and Discussion
The proposed 2-D CNN was evaluated through parameter studies, confusion-matrix comparisons, and comparisons with other arrhythmia-classification methods. It achieved strong performance across eight-class ECG classification, while direct comparisons remain constrained by experimental differences.
- Parameter selection: 0.001 learning rate was selected because it improved convergence and attained better accuracy for the proposed model.Learning rates below 0.0005 converged slowly, whereas rates above 0.001 improved convergence but produced asymmetric accuracy changes.
- Parameter selection: 2800 batch size produced the highest accuracy and reached a stable convergence state.Batch sizes of 1000 caused large fluctuations, while 2000 improved accuracy without reaching stability.
- Model comparison: Confusion matrices compare correct classifications on the diagonal with incorrect classifications off the diagonal for VGGNet, AlexNet, and the proposed model.Average accuracy is computed by averaging diagonal values across the eight classes.
- Representation comparison: 97.80% classification accuracy was obtained when 1-D ECG signals were used as input, while reported 1-D CNN results included 96.40% and 93.60%.The proposed model instead used a 2-D representation of ECG data, supporting the application of 2-D CNNs and data augmentation.
- Model comparison: The proposed model attained better accuracy, sensitivity, and specificity than FFNN in eight-class classification, whereas FFNN classified four arrhythmia types.VGGNet performed worse than the proposed model despite having a deeper network, potentially because of its deeper architecture and limited training data.
- Performance comparison: 97.88% average sensitivity, 99.61% specificity, 99.11% average accuracy, and 98.59% positive predictive value were achieved by the proposed CNN algorithm.The comparison used recent arrhythmia-classification techniques and included augmented and non-augmented data settings.
5. Conclusions
The study proposes a 2-D CNN model using ECG signals to classify eight kinds of cardiac arrhythmia. The model achieved high sensitivity, specificity, accuracy, and precision, while the study identifies multiple-lead ECG data as future work.
- The proposed 2-D CNN model automatically classifies eight kinds of cardiac arrhythmia from ECG signals.The classes are NOR, VFW, PVC, VEB, RBB, LBB, PAB, and APC.
- 97.91% average sensitivity, 99.61% specificity, 99.11% average accuracy, and 98.59% positive predictive value were achieved.
- The authors characterize ECG spectrogram representation with CNN classification as a reliable operative technique for diagnosing CVDs.The automated classification can support experts when diagnosing CVDs.
- The study uses only a single-lead ECG signal, with multiple-lead ECG data reserved for future investigation.