| Literature DB >> 35214561 |
Bhekumuzi M Mathunjwa1, Yin-Tsong Lin2, Chien-Hung Lin2, Maysam F Abbod3, Muammar Sadrawi4, Jiann-Shing Shieh1.
Abstract
In this paper, an effective electrocardiogram (ECG) recurrence plot (RP)-based arrhythmia classification algorithm that can be implemented in portable devices is presented. Public databases from PhysioNet were used to conduct this study including the MIT-BIH Atrial Fibrillation Database, the MIT-BIH Arrhythmia Database, the MIT-BIH Malignant Ventricular Ectopy Database, and the Creighton University Ventricular Tachyarrhythmia Database. ECG time series were segmented and converted using an RP, and two-dimensional images were used as inputs to the CNN classifiers. In this study, two-stage classification is proposed to improve the accuracy. The ResNet-18 architecture was applied to detect ventricular fibrillation (VF) and noise during the first stage, whereas normal, atrial fibrillation, premature atrial contraction, and premature ventricular contractions were detected using ResNet-50 in the second stage. The method was evaluated using 5-fold cross-validation which improved the results when compared to previous studies, achieving first and second stage average accuracies of 97.21% and 98.36%, sensitivities of 96.49% and 97.92%, positive predictive values of 95.54% and 98.20%, and F1-scores of 95.96% and 98.05%, respectively. Furthermore, a 5-fold improvement in the memory requirement was achieved when compared with a previous study, making this classifier feasible for use in resource-constricted environments such as portable devices. Even though the method is successful, first stage training requires combining four different arrhythmia types into one label (other), which generates more data for the other category than for VF and noise, thus creating a data imbalance that affects the first stage performance.Entities:
Keywords: arrhythmia; deep residual convolutional neural network; electrocardiogram; recurrence plot
Mesh:
Year: 2022 PMID: 35214561 PMCID: PMC8877903 DOI: 10.3390/s22041660
Source DB: PubMed Journal: Sensors (Basel) ISSN: 1424-8220 Impact factor: 3.576
Figure 1Diagram of the proposed approach.
Figure 2Waveforms and their corresponding RPs of the (a) VF rhythm, (b) noise, and the other four ECG arrhythmia types which need further classification including (c) AF, (d) normal, (e) PAC, and (f) PVC.
Figure 3Waveforms and their corresponding RPs of (a) AF, (b) normal, (c) PAC, and (d) PVC, which are the four ECG arrhythmia types discriminated in the second stage.
Visualization of the confusion matrix.
| Predicted | ||||
|---|---|---|---|---|
| A | B | C | ||
| Actual | A |
|
|
|
| B |
|
|
| |
| C |
|
|
| |
Figure 4Architecture of the two adopted CNNs: (a) ResNet-18; (b) ResNet-50.
The structure of the two ResNet architectures that we used in this study. The two models comprised 18 and 50 layers.
| Layer Name | Output Size | ResNet-18 | ResNet-50 |
|---|---|---|---|
| Conv 1 | 112 × 112 | 7 × 7, 64, stride 2 | 7 × 7, 64, stride 2 |
| Conv 2_x | 56 × 56 | 3 × 3 max pool, stride 2 | 3 × 3 max pool, stride 2 |
|
|
| ||
| Conv 3_x | 28 × 28 |
|
|
| Conv 4_x | 14 × 14 |
|
|
| Conv 5_x | 7 × 7 |
|
|
| 1 × 1 | Average pool, 6-d fc, softmax | Average pool, 6-d fc, softmax |
Evaluating the first classification stage accuracy and model size to determine the layer size for ResNet.
| ResNet Number of Layers | Training | Validation | Testing | Size (MB) |
|---|---|---|---|---|
| ResNet-18 | 98.77% | 96.61% | 97.04% | 43 |
| ResNet-34 | 98.12% | 96.74% | 97.45% | 83 |
| ResNet-50 | 98.40% | 96.23% | 96.53% | 94 |
| ResNet-101 | 98.55% | 96.42% | 97.26% | 169 |
| ResNet-152 | 98.60% | 96.09% | 96.72% | 230 |
Evaluation of the ResNet layers using the three performance measures (training, validation, and testing).
| ResNet Number of Layers | Training | Validation | Testing | Size (MB) |
|---|---|---|---|---|
| ResNet-18 | 99.43% | 94.06% | 94.65% | 43 |
| ResNet-34 | 99.21% | 95.59% | 95.26% | 83 |
| ResNet-50 | 98.95% | 97.22% | 98.15% | 94 |
| ResNet-101 | 98.59% | 97.91% | 98.46% | 169 |
| ResNet-152 | 98.56% | 97.62% | 98.33% | 230 |
Evaluating the first classification stage using Sens and Sp to determine the ResNet layer size.
| ResNet Number of Layers | Sens | Sp | ||||
|---|---|---|---|---|---|---|
| Noise | Other | VF | Noise | Other | VF | |
| ResNet-18 | 96.33% | 92.96% | 99.42% | 97.16% | 99.30% | 99.28% |
| ResNet-34 | 95.93% | 99.17% | 94.35% | 98.32% | 99.00% | 98.91% |
| ResNet-50 | 92.64% | 98.58% | 96.61% | 97.03% | 98.31% | 99.33% |
| ResNet-101 | 93.20% | 99.50% | 96.89% | 97.29% | 99.37% | 99.40% |
| ResNet-152 | 93.43% | 98.75% | 95.76% | 97.34% | 98.51% | 99.17% |
Second stage Sens and Sp for the selection of the ResNet layers.
| ResNet Number of Layers | Sens | Sp | ||||||
|---|---|---|---|---|---|---|---|---|
| AF | Normal | PAC | PVC | AF | Normal | PAC | PVC | |
| ResNet-18 | 87.27% | 99.67% | 92.08% | 98.49% | 94.37% | 99.84% | 99.11% | 99.46% |
| ResNet-34 | 88.35% | 99.08% | 96.04% | 98.69% | 94.83% | 99.56% | 99.55% | 99.53% |
| ResNet-50 | 97.17% | 99.67% | 95.51% | 98.49% | 99.11% | 99.80% | 99.41% | 99.28% |
| ResNet-101 | 98.34% | 99.67% | 96.31% | 97.98% | 99.22% | 99.84% | 99.59% | 99.28% |
| ResNet-152 | 97.84% | 99.42% | 94.72% | 98.99% | 98.99% | 99.73% | 99.41% | 99.64% |
First stage performance measure for the cross-validation (5-fold) using training validation and testing accuracies.
| CV | Training | Validation | Testing |
|---|---|---|---|
| Mean ± SD | 98.56 ± 0.16% | 96.76 ± 0.31% | 97.21 ± 0.34% |
First stage Sens, Sp, and F1-score for the 5-fold cross-validation.
| Noise | Other | VF | |||||||
|---|---|---|---|---|---|---|---|---|---|
| CV | Sens | Sp | F1-Score | Sens | Sp | F1-Score | Sens | Sp | F1-Score |
| Mean | 96.44 | 97.80 | 93.01 | 93.77 | 99.22 | 95.46 | 99.27 | 98.97 | 99.42 |
| STD | 0.47% | 0.76% | 1.10% | 1.39% | 0.24% | 0.63% | 0.09% | 0.74% | 0.06% |
Figure 5Performance metrics using the ROC curves: (a) first stage; (b) second stage.
Performance of the first stage cross-validation test using the AUC of the ROC curve.
| CV | Noise | Other | VF | |||
|---|---|---|---|---|---|---|
| AUC | Threshold | AUC | Threshold | AUC | Threshold | |
| Mean | 0.991 | 0.273 | 0.999 | 0.536 | 0.991 | 0.626 |
| STD | 0.002 | 0.040 | 0.001 | 0.334 | 0.001 | 0.160 |
Evaluation of the accuracy through training, validation, and testing with cross-validation (5-fold) in the second stage.
| CV | Training | Validation | Testing |
|---|---|---|---|
| Mean ± SD | 98.72 ± 0.16% | 97.71 ± 0.16% | 98.36 ± 0.16% |
Evaluation of the accuracy through Sens, Sp, and F1-score with cross-validation (5-fold) in the second stage.
| AF | N | PAC | PVC | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| CV | Sens | Sp | F1-Score | Sens | Sp | F1-Score | Sens | Sp | F1-Score | Sens | Sp | F1-Score |
| Mean | 97.64 | 98.90 | 98.07 | 99.65 | 99.84 | 99.18 | 95.73 | 99.52 | 96.59 | 98.67 | 99.52 | 98.37 |
| STD | 0.42% | 0.19% | 0.08% | 0.22% | 0.10% | 0.19% | 1.11% | 0.12% | 0.46% | 0.48% | 0.17% | 0.18% |
Performance of the second stage cross-validation test using the AUC of the ROC curve.
| CV | AF | Normal | PAC | PVC | ||||
|---|---|---|---|---|---|---|---|---|
| AUC | Threshold | AUC | Threshold | AUC | Threshold | AUC | Threshold | |
| Mean | 0.998 | 0.234 | 0.999 | 0.624 | 0.998 | 0.144 | 0.999 | 0.264 |
| STD | 0.001 | 0.139 | 0.000 | 0.228 | 0.001 | 0.096 | 0.000 | 0.110 |
Evaluation of the average accuracy through Sens, Sp, PPV, F1-score, and kappa with cross-validation in the first and second stages.
| Av Sens | Av Sp | PPV | Av F1-score | Kappa | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| CV | 1st Stage | 2nd Stage | 1st Stage | 2nd Stage | 1st Stage | 2nd Stage | 1st Stage | 2nd Stage | 1st Stage | 2nd Stage |
| Mean | 96.49 | 97.92 | 98.66 | 99.45 | 93.29 | 95.18 | 95.28 | 97.71 | 95.28 | 97.71 |
| STD | 0.39% | 0.30% | 0.14% | 0.04% | 0.68% | 0.37% | 0.57% | 0.20% | 0.57% | 0.20% |
Overall performance of the two models through Acc, averages of Sens, Sp, PPV, and F1-score, and kappa.
| Acc | Av Sens | Av Sp | Av PPV | Av F1-score | Kappa |
|---|---|---|---|---|---|
| 94.85% | 94.44 ± 2.94% | 94.96 ± 7.31% | 93.37 ± 7.31% | 94.05 ± 4.61% | 93.37% |
Comparison of the proposed approach with previous work.
| Classifier | Layer Size | Model Size (MB) | Training Time (h) | Accuracy (%) First Stage | Accuracy (%) Second Stage |
|---|---|---|---|---|---|
| ResNet-18 | 18 | 43 | 6.26 | 97.21 | 94.65 |
| ResNet-34 | 34 | 83 | 6.22 | 97.45 | 95.26 |
| ResNet-50 | 50 | 94 | 6.32 | 96.53 | 98.36 |
| ResNet-101 | 101 | 169 | 6.25 | 97.26 | 98.46 |
| ResNet-152 | 152 | 230 | 6.26 | 96.72 | 98.33 |
| AlexNet | 8 | 228 | 5.37 | 96.59 | 98.53 |
| VGG16 | 16 | 525 | 7.6 | 87.35 | 86.86 |
| VGG19 | 19 | 545 | 7.75 | 81.01 | 94.09 |
ECG arrhythmia classification evaluations.
| Studies | Databases | No. of Classes | Segment Length(s) | Method | Acc (%) | Sens (%) | PPV (%) | F1-Score |
|---|---|---|---|---|---|---|---|---|
| Zhang et al. [ | CPSC | 9 | 5 | Inception-ResNet-v2 | N/A | 84.7 | 84.7 | 84.4 |
| Ullah et al. [ | MITDB | 8 | N/A | 2D CNN | 99.02 | N/A | N/A | N/A |
| Degirmenci et al. [ | MITDB | 5 | N/A | CNN | 99.70 | 99.70 | 99.22 | N/A |
| Izci et al. [ | MITDB | 5 | N/A | CNN | 97.42 | N/A | N/A | N/A |
| Le et al. [ | MITDB | 6 | N/A | RCNN | 98.29 | N/A | N/A | 99.14 |
| Li et al. [ | MITDB | - | N/A | CNN | 97.96 | N/A | N/A | 84.94 |
| Chen et al. [ | MITDB | 6 | 10 | CNN + LSTM | 99.32 | 97.75 | 97.66 | N/A |
| Yıldırım et al. [ | MITDB | 17 | 10 | 1D CNN | 91.33 | 83.91 | N/A | 91.33 |
| He et al. [ | CPSC | 9 | 30 | CNN + LSTM | N/A | N/A | N/A | 80.6 |
| Yildirim et al. [ | MITDB | 5 | 1 | DULSTM | 99.25 | N/A | N/A | N/A |
| Yao et al. [ | CPSC | 9 | 1.5 | ResNet + BLSTM-GMP | N/A | 80.1 | 82.6 | 81.2 |
| Fradi et al. [ | MITDB, TPB | 5 | 1.496 | 1D CNN | 99.61 | N/A | N/A | 99 |
| Wang et al. [ | MITDB | 5 | N/A | Random forest | 92.31 | 89.98 | N/A | N/A |
| El-Saadawy et al. [ | MITDB | 5 | N/A | SVM + PNN | 88.7 | N/A | N/A | N/A |
| Sahoo et al. [ | MITDB | 6 | N/A | PNN + | 99.54 | N/A | N/A | N/A |
| Khairuddin et al. [ | MITDB | 17 | N/A | K-NN | 97.30 | N/A | N/A | N/A |
| Proposed | AFDB, MITDB, CUDB, VFDB | 3 | 2 | ResNet-18 | 97.21 | 96.49 | 95.54 | 95.96 |
CNN = convolutional neural network, LSTM = long short-term memory, DULSTM = deep unidirectional LSTM, DBLSTM = deep bidirectional LSTM, SVM = support vector machine, BLSTM = bidirectional LSTM, GMP = global maximum pooling, K-NN = k-nearest neighbor, CDF = cumulant derived features, PNN = probabilistic neural network, ANN = artificial neural network, RBF-NN = radial basis function neural network.
Summary of the AAMI arrhythmia types extracted from the MITDB database.
| AAMI Type | No. of Beats |
|---|---|
| Normal (N) | 8980 |
| Ventricular ectopic (V) | 7202 |
| Supraventricular ectopic (S) | 2758 |
| Fusion (F) | 799 |
| Unknown (Q) | 8307 |
Classification performance acquired with 5-fold cross-validation for Sens, Sp, and F1 score.
| Type | CV_1 | CV_2 | CV_3 | CV_4 | CV_5 | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Sens | SP | F1 | Sens | SP | F1 | Sens | SP | F1 | Sens | SP | F1 | Sens | SP | F1 | |
| Mean | 96.14% | 97.00% | 96.56% | 96.00% | 97.76% | 96.84% | 95.89% | 97.26% | 96.55% | 97.03% | 95.63% | 96.31% | 96.92% | 96.78% | 96.84% |
| STD | 4.35% | 3.39% | 3.79% | 4.96% | 1.90% | 3.38% | 4.83% | 1.88% | 3.33% | 2.89% | 5.42% | 4.15% | 2.39% | 3.07% | 2.64% |
Average classification performances including Acc, Sens, Sp, PPV, F1, and kappa.
| CV | Acc | Sens | Sp | PPV | F1 | Kappa |
|---|---|---|---|---|---|---|
| Mean ± STD | 98.21 ± 0.11% | 96.40 ± 0.54% | 96.89 ± 0.79% | 93.26 ± 2.61% | 96.65 ± 0.19% | 97.44 ± 0.15% |
Comparison between our approach and existing approaches to AAMI arrhythmia types.
| Studies | Classes | Method | Acc (%) | Sens | Sp | PPV | F1 |
|---|---|---|---|---|---|---|---|
| Acharya et al. [ | 5 | CNN | 94.03 | 96.71 | 91.54 | N/A | N/A |
| Oh et al. [ | 5 | CNN + LSTM | 98.10 | 97.50 | 98.70 | N/A | N/A |
| Izci et al. [ | 5 | CNN | 97.42 | N/A | N/A | N/A | N/A |
| Zhu et al. [ | 5 | SVM | 97.80 | 88.83 | 93.76 | N/A | N/A |
| Aphale et al. [ | 5 | CNN | 92.73 | 92.00 | 91.00 | N/A | 91.00 |
| Sellami et al. [ | 5 | CNN | 99.48 | 96.97 | 99.87 | 96.83 | N/A |
| Gan et al. [ | 4 | DenseNet-BiLSTM | 99.44 | 95.89 | 99.32 | 96.11 | 95.89 |
| Proposed | 5 | ResNet-50 | 98.21 | 96.40 | 96.89 | 93.26 | 96.65 |
Figure 6Illustration of how users can use the proposed short-duration ECG arrhythmia recognition.