Paper 27-Arrhythmia Classification Using 2D
Paper 27-Arrhythmia Classification Using 2D
net/publication/341156350
Article in International Journal of Advanced Computer Science and Applications · January 2020
DOI: 10.14569/IJACSA.2020.0110427
CITATIONS READS
0 142
2 authors, including:
Nico Surantha
Binus University
51 PUBLICATIONS 89 CITATIONS
SEE PROFILE
Some of the authors of this publication are also working on these related projects:
All content following this page was uploaded by Nico Surantha on 17 May 2020.
Abstract—Arrhythmia is an abnormal situation of heartbeat accuracy than 1D CNN [14]. Using 128x128 size produced
rate that may cause a critical condition to our body and this high accuracy but it also consumed high computational
condition gets more dangerous as our cardiovascular system gets resources to train the model, moreover, the transformed data
more vulnerable as we grow older. To diagnose this abnormality, that is used to train the model is quite a lot.
the arrhythmia expert or cardiologist uses an electrocardiogram
(ECG) by analyzing the pattern. ECG is a heartbeat signal that is In this paper, authors’ purpose is to propose a new
produced by a tool called an electrocardiograph sensor that approach of 2D CNN model to classify up to 8 classes of
records the electrical impulses produced by the heart. arrhythmia including Normal Beat (NRML), Atrial premature
Convolutional Neural Networks (CNN) is often used by beat (APB), Premature ventricular contraction (PVC),
researchers to classify ECG signals to Arryhtmia classes. The Premature Beat (PB), Fusion of paced and normal beat
state-of-the-art research had applied CNN 2D (CNN 2D) with (FPBN), Fusion of ventricular and normal beat (FVCN), Left
accuracy up to 99% with 128x128 image size obtained by bundle branch block beat (LBBB) and Right bundle branch
transforming the ECG signal. In this paper, authors try to block beat (RBBB) with smaller input size than current 2D
classify arrhythmia disorder with a different approach by CNN model Classifier [11], [12]. Authors try to compare
creating simpler image classifier using CNN 2D with a smaller multiple input sizes including 64x64, 32x32 and 16x16 to see
variety of input size that is smaller than state-the-art input and the different accuracies between input sizes and also group
group the classes based on transformed ECG signal from MIT- classes that are divided into three groups: Normal (NRML)
BIH Arrhythmia database with the purpose to know what the
And Abnormal (ANML), All Abnormal Classes and All
most optimum input and the best accuracy to classify ECG signal
image. The result of this research had produced an accuracy of
Classes to see how our model accuracy between different
up to 98.91% for 2 Classes, 98.10% for 7 Classes dan 98.45% for input.
8 Classes. This paper is structured as follows: Section 2 contains a
literature review about arrhythmia, ECG and Neural Networks.
Keywords—Convolutional neural network; CNN; CNN 2D; In Section 3, the authors show all related works about the
image classifier; electrocardiogram; ECG; arrhythmia
classification of Arrhythmia group classes by using ECG as
I. INTRODUCTION input. Section 4 shows methods that authors used including
dataset, proposed solution, experimental design, and evaluation
Arrhythmia is a heart disorder that can be life-threatening. method. In Section 5 authors show experiment results and
The symptom is a heartbeat rhythm abnormally that can be any finally, the conclusion is in Section 6.
of the following: too fast, too slow or irregular. Irregular
heartbeats can impact other organs because the blood does not II. LITERATURE REVIEW
flow well, the impacts can either be hurting the organ or stop it
[1]. One way to find out or diagnose this disorder is by using A. Arrhythmia
an electrocardiogram (ECG). ECG is a diagram produced by Arrhythmia is a disorder that occurs to the heart, making
Electrocardiograph sensors that record electricity impulses the heartbeat pace either too fast or too slow. In some cases, the
produced by the heart [2]. However, this process takes a long heartbeat rhythm is erratic. This disorder causes ineffective
time and the number of experts who can handle these cases are pumping of the blood to the organ and can cause organ death
very few and it's hard to diagnose this disorder manually. or organ damage that might cause sudden death [1], [15].
Therefore, if arrhythmia pattern on ECG data can be detected Experts use ECG to detect and analyze arrhythmia by
automatically, it will help experts to detect this disorder early incorporating pattern recognition [2].
and can reduce casualties.
B. Electrocardiogram
Convolutional Neural Network (CNN) is often used by An electrocardiogram or ECG is a recording of the
researcher to classify ECG signal patterns into arrhythmia electrical activity of the heart [2]. ECG analysis is very
classes by using both 1D CNN and 2D CNN showing accuracy important for diagnosing arryhthmia. Some features can be
up to 92 % for the former for up to 17 classes [3]–[10] and extracted from ECG signals including P Wave, QRS Complex,
99% for the latter up to 8 Classes using 128x128 pixel T Wave, and other features which can be seen in Fig. 1.
transformed ECG signal [11]–[13]. This shows that 2D CNN
performed better in classifying arrhythmia with higher
201 | P a g e
www.ijacsa.thesai.org
(IJACSA) International Journal of Advanced Computer Science and Applications,
Vol. 11, No. 4, 2020
ISO P-R S-T with a length of 10 seconds where the data were not filtered or
Segment Segment Segment
cleansed first but before being re-processed the data on a scale
R-Peak was first obtained with 16 CNN 1D layers. The model that was
built not only showed a high accuracy of 91.33% for 17
classes, but it also showed a fast detection of 0.015s for the
model classifying ECG signals.
Xiong et al. [6] built RyhtmNet, 1 Dimension
P Convolutional Recurrent Neural Network with 21 layers that is
T
a combination of Convolutional Neural Network and Recurrent
Neural Network. The dataset used for this training model
S
Q comes from the 2017 PhysioNet / Computing in Cardiology
(CinC) Challenge. It consists of 8528 ECG data with 9 - 60
QRS
P Wave T Wave seconds of data variation. The model that was built processes 5
Complex
seconds data successfully classifying 3 types of arrhythmia
Fig. 1. Feature Illustration of ECG [16].
with an accuracy of 82%.
C. Deep Learning Billeci et al. [4] developed an algorithm to classify ECG
Deep Learning enables computational models consisting of signals specifically for atrial fibrillation, only 2 classifications
several layers of processing to study the representation of data are carried out by this algorithm, namely atrial fibrillation and
with various levels of abstraction [14]. Deep Learning models other arrhythmias. The database used is from MIT-BH AF.
have dramatically improved state-of-the-art speech recognition, This algorithm is a combination of RR Analysis, P-Wave and
visual object recognition, object detection and many other Frequency Spectrum Analysis that had been modified to detect
domains such as drug discovery and genomics. In-depth Arrhythmia AF. This algorithm shows good accuracy which is
learning finds complicated structures in large data sets by using 98% even with a small classification.
the backpropagation algorithm to show how machines must Izci et al. [13] used 2D Convolutional Neural to classify 5
change the internal parameters used to calculate representations arrhythmia classes by transforming MIT-BIH Arrhythmia
at each layer from representations in the previous layer. The database to 128x128 size grayscale image and 5 layer CNN
Deep Convolutional Neural Network has produced resulting in 97.42% accuracy.
breakthroughs in processing images, video, speech, and audio,
while the Recurrent Neural Network (RNN) shows sequential Jun et al. [12] used 2D CNN with 11 layers by firstly
data processing such as text and speech [17]. transforming ECG signal from MIT-BIH Arrhythmia dataset
into images with size 128x128. Afterward, the transformed
III. RELATED WORKS data is used to train the model resulting in an average accuracy
Acharya et al. [3] conducted research to establish of 99.05% with 8 class classification.
Computer-aided Diagnosis (CAD) to diagnose arrhythmia Huang et al. [18] classified 5 arrhythmia classes using MIT
using eleven CNN layers based on the PhsyioBank public -BIH arrhythmia database that was transformed into a time-
dataset with a total of 614,526 ECGs. Before processing the frequency spectrogram with size 256x256 within 10 seconds of
data, the data are cleansed by using Daubechies wavelet 6 data to train and test the model resulting in 99% average
(Singh and Tiwari 2006), then the data are segmented and accuracy.
sorted by heart condition with a notation that previously
existed in the database. Each segment is normalized with a Z- IV. METHODS
Score to eliminate the amplitude scale and eliminate the offset
The research begins by determining the background
effect before the data are processed for 1-Dimensional CNN
problem of the research to be conducted, then conducting a
Deep Learning training and testing. This method shows 92.5%
literature study to find out the state-of-the-art of the field to be
accuracy in data with a length of 2 seconds and 94.9% with
examined. Then the next set of objectives and scope of
data that is 5 seconds in length.
research, at this stage also conducted a literature study to show
Rajpurkar et al. [5] conducted research that began by the views of the research to be conducted. after that, the new
collecting a dataset in which there are 30,000 unique patient model is then built added to the theories and techniques used to
data and annotated 64,000 datasets. The 336 data samples were build the model. After the model has been built, the model is
obtained using 34 Convolutional Neural Network layers. To then validated compared to the current research showing the
optimize the model, the Residual Network architecture uses a contribution of the research conducted.
portion of the connection shortcut. The trained model was then
tested by comparing the classifications made by the model and A. Data Set
those performed by cardiologists in 12 classes of Arrhythmia. From the MIT-BIH Arrhythmia database [19], hosted at
The result, this model showed superiority in comparison to PhysioNet (http://www.physionet.org), ECG signals were
cardiologists with a value of 80% precision and 82% sensitivity acquired. This dataset contains an ECG signal from 48 subjects
while cardiologists with 76% precision and 75% sensitivity. that had been annotated with 360 Hz frequency. Authors then
transformed this data by first segmenting the signal for every
Yıldırım et al. [10] classified a total of 17 classifications second with 360 Hz frequency resulting 108819 heartbeat
using the MTI-BIH dataset containing data from 45 patients signal images with 8 Classes including Normal beat (NRML),
202 | P a g e
www.ijacsa.thesai.org
(IJACSA) International Journal of Advanced Computer Science and Applications,
Vol. 11, No. 4, 2020
Begin
NRML APB PVC
Dataset
PB FPBN FVCN
Clustering
Transforming
LBBB RBBB
ECG Signal
Segmented
Signal Image
64 x 64 32 x 32 16 x 16
Conv2D(32, (3, 3))
MaxPooling(2, 2)
Dropout(0.25)
Flatten()
Dense(128)
Dropout(0.5)
Dense(10)
ECG Classes
203 | P a g e
www.ijacsa.thesai.org
(IJACSA) International Journal of Advanced Computer Science and Applications,
Vol. 11, No. 4, 2020
V. RESULTS AND DISCUSSION Fig. 10 shows that 64x64 input size is showing the best
After doing the experiment, we collect the result and accuracy with 98.1% followed by 32x32 input size with
compare the accuracy result from each experiment to another. 97.42% accuracy and 16x16 input size with 92.82% accuracy.
The difference between 64x64 and 32x32 is less than 1% and
A. Result of 2 Classes accuracy is more than 92% accuracy, showing that our model
From 10-fold validation for group 1, it contains 2 classes, can classify arrhythmia classes with high accuracy of 7 classes
input size 64x64 leading consistently following input size and less than average accuracy of 2 classes.
32x32 and 16x16. With the difference between 64x64 and
32x32, less than 1% and all accuracies are more than 96%
showing our model classified well within 2 classes as seen in
Fig. 6.
Table I shows the score for every class and input, as shown
the highest score for precision is ANML class for 99.10%. The
highest score for Recall is NRML class with 99.60% and the
best F1 score is NRML class with 99.22%, showing on this
model NRML class is predicted better than ANML class.
From Fig. 7, the 64x64 input size shows the best accuracy
with 98.91% followed by 32x32 input size with 98.41% Fig. 6. Test Accuracy for Every Fold for 2 Classes.
accuracy and 16x16 input size with 96.34% accuracy. The
difference between 64x64 and 32x32 is less than 1% and
accuracy is more than 96% showing that our model can
classify arrhythmia classes with high accuracy of 2 classes.
B. Result of 7 Classes
From 10-fold validation for group 2, it contains 7 classes of
Abnormal class, input size 64x64 leading consistently,
following with input size 32x32 and 16x16. With the
difference between 64x64 and 32x32, less than 1% and all
accuracy are more than 91% showing our model classified well
within 7 classes as seen in Fig. 8.
For classifying 7 classes, Table II shows the highest
precision score is RBBB class with 99.23%. The highest recall Fig. 7. Average Accuracy for 2 Classes.
score is PB class with 99.64% and for F1, the highest score is
PB class showing that PB class is predicted better than another
one. And for classes that are fusion beats like FPBN and
FVCN has big difference score with another class and getting
smaller when the input size is smaller for 16x16 input size
precision score is 81.70%, recall is 41.05% and F1 is 53.51%
and FVCN has a precision of 83.01%, recall 61.91% and F1
70.78%.
Fig. 9 shows that PVCN was predicted as PVC with 22%
accuracy and FPBN was predicted as PB with 27% accuracy.
This may happen because fusion beats have a similar feature
with another beat. Fig. 8. Test Accuracy for Every Fold for 7 Classes.
204 | P a g e
www.ijacsa.thesai.org
(IJACSA) International Journal of Advanced Computer Science and Applications,
Vol. 11, No. 4, 2020
C. Result of 8 Classes
From 10-fold validation for group 3, it contains 8 classes,
input size 64x64 leading consistently following input size
32x32 and 16x16. With the difference between 64x64 and
32x32, less than 1% and all accuracy are more than 94%
showing our model classified well within 8 classes as seen in
Fig. 11.
Table III shows that the highest precision score is RBBB
class with score of 99.00%, for recall score the best score is Fig. 12. Confusion Matrix for Input 16x16 and 8 Classes.
205 | P a g e
www.ijacsa.thesai.org
(IJACSA) International Journal of Advanced Computer Science and Applications,
Vol. 11, No. 4, 2020
206 | P a g e
www.ijacsa.thesai.org
(IJACSA) International Journal of Advanced Computer Science and Applications,
Vol. 11, No. 4, 2020
207 | P a g e
www.ijacsa.thesai.org
(IJACSA) International Journal of Advanced Computer Science and Applications,
Vol. 11, No. 4, 2020
[9] P. H. Kuo and C. J. Huang, “A high precision artificial neural networks [14] Ian Goodfellow, Y. Bengio, and A. Courville, Deep learning. 2017.
model for short-Term energy load forecasting,” Energies, vol. 11, no. 1, [15] G. Tse, “Mechanisms of cardiac arrhythmias,” J. Arrhythmia, vol. 32, no.
pp. 1–13, 2018. 2, pp. 75–81, 2016.
[10] Ö. Yıldırım, P. Pławiak, R. S. Tan, and U. R. Acharya, “Arrhythmia [16] S. Chandra, A. Sharma, and G. K. Singh, “Feature extraction of ECG
detection using deep convolutional neural network with long duration signal,” J. Med. Eng. Technol., vol. 42, no. 4, pp. 306–316, 2018.
ECG signals,” Comput. Biol. Med., vol. 102, no. September, pp. 411–
420, 2018. [17] Y. Lecun, Y. Bengio, and G. Hinton, “Deep learning,” Nature, vol. 521,
no. 7553, pp. 436–444, 2015.
[11] H. Wang et al., “A high-precision arrhythmia classification method based
on dual fully connected neural network,” Biomed. Signal Process. [18] J. Huang, B. Chen, B. Yao, and W. He, “ECG Arrhythmia Classification
Control, vol. 58, p. 101874, 2020. Using STFT-Based Spectrogram and Convolutional Neural Network,”
IEEE Access, vol. 7, pp. 92871–92880, 2019.
[12] T. J. Jun, H. M. Nguyen, D. Kang, D. Kim, D. Kim, and Y.-H. Kim,
“ECG arrhythmia classification using a 2-D convolutional neural [19] G. B. Moody and R. G. Mark, “The impact of the MIT-BIH arrhythmia
network,” 2018. database,” IEEE Eng. Med. Biol. Mag., vol. 20, no. 3, pp. 45–50, 2001.
[13] E. Izci, M. A. Ozdemir, M. Degirmenci, and A. Akan, “Cardiac [20] S. L. Oh, E. Y. K. Ng, R. S. Tan, and U. R. Acharya, “Automated
arrhythmia detection from 2d ecg images by using deep learning diagnosis of arrhythmia using combination of CNN and LSTM
technique,” TIPTEKNO 2019 - Tip Teknol. Kongresi, pp. 1–4, 2019. techniques with variable length heart beats,” Comput. Biol. Med., no.
June, 2018.
208 | P a g e
www.ijacsa.thesai.org
View publication stats