
Expert Systems With Applications 122 (2019) 75–84
Contents lists available at ScienceDirect
Expert Systems With Applications
journal homepage: www.elsevier.com/locate/eswa
A robust deep convolutional neural network with batch-weighted loss
for heartbeat classification
Ali Sellami, Heasoo Hwang
∗
Department of Computer Science and Engineering, University of Seoul, 02504 Korea
a r t i c l e i n f o
Article history:
Received 14 June 2018
Revised 24 November 2018
Accepted 19 December 2018
Available online 21 December 2018
a b s t r a c t
The early detection of abnormal heart rhythm has become crucial due to the spike in the rate of deaths
caused by cardiovascular diseases. While many existing works tried to classify heartbeats accurately, they
suffered from the imbalance between heartbeat classes in the available ECG datasets since abnormal
heartbeats appear much less frequently than normal ones. In addition, most of existing methods heav-
ily rely on data preprocessing such as noise removal and feature extraction, which is computationally
expensive, thus limits their use on low-cost portable ECG devices.
We present a novel deep convolutional neural network based on state-of-the-art deep learning tech-
niques for accurate heartbeat classification. We suggest a batch-weighted loss function to better quantify
the loss in order to overcome the imbalance between classes. The loss weights dynamically change as
the distribution of classes in each batch changes. Also, we propose to use multiple heartbeats for more
effective heartbeat classification.
Even though we use ECG signal from one lead only without any data preprocessing, our method con-
sistently outperforms existing methods of 5-class heartbeat classification. Our accuracy, positive produc-
tivity, sensitivity and specificity under intra-patient paradigm are 99.48%, 98.83%, 96.97% and 99.87%, and
those under inter-patient paradigm are 88.34%, 48.25%, 90.90% and 88.51% respectively.
©2018 Elsevier Ltd. All rights reserved.
1.
Introduction
According to World Health Organization (WHO), cardiovascu-
lar diseases take the lion’s share of death causes globally by ap-
proximately 31%, out of which 82% are in low or middle-income
countries, due to pricey high quality electrocardiograms (ECGs) and
shortage in medical experts to read and interpret the signal ( WHO
Cardiovascular Diseases Factsheet, 2017 ).
Recently, various types of one-lead portable ECG devices such
as chest patches and wristbands have become more widely avail-
able. As the amount of ECG data that is continuously collected us-
ing these devices grows rapidly, both the interest and the opportu-
nity on the effective and robust detection of important arrhythmias
such as atrial fibrillation, one of the leading causes of stroke, are
growing as well. It is also true that the research on heartbeat clas-
sification methods involving deep learning techniques is attracting
more attention than ever before, since more ECG data for training
means that deeper neural networks with better classification per-
formance can be constructed. At the same time, more adaptive and
∗
Corresponding author.
E-mail addresses: asellami1@gmail.com (A. Sellami), hwang@uos.ac.kr (H.
Hwang).
robust classification methods that can easily applied to datasets
from different domains are highly demanded, considering the in-
creasing amount of time series data available in various domains.
In this paper, we focus on classifying important types of car-
diovascular diseases, arrhythmias. According to the American Heart
Association (“AHA ”), arrhythmias are any change from the normal
sequence of electrical impulses, causing abnormal heart rhythms
and can be either life-threatening or require medical therapy to
prevent future problems. The Association for the Advancement of
Medical Instrumentation (AAMI) ( American National Standards In-
stitute, 2012 ) provides a clear guideline for grouping heartbeat
types under 5 super classes as shown in Table 1 .
Many methods have been suggested for automatic detection of
arrhythmia ( Acharya et al., 2017; deChazal, O’Dwyer, & Reilly, 2004;
Huang, Liu, Zhu, Wang, & Hu, 2014; Martis, Acharya, Lim, & Suri,
2013; Ye, Coimbra, & Vijaya Kumar, 2010 ; Yu & Chen, 2007 ), but
none fully addressed both effectiveness and real-time applicability
at the same time.
This paper aims at providing a highly robust and efficient heart-
beat classification method that can be used on low-cost portable
ECG monitors for early detection of arrhythmia. Our approach can
perform accurate classification using raw ECG signal from single
lead without any data preprocessing such as noise removal or fea-
https://doi.org/10.1016/j.eswa.2018.12.037
0957-4174/© 2018 Elsevier Ltd. All rights reserved.