Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

IEEE TRANSACTIONS ON INSTRUMENTATION AND MEASUREMENT, VOL.

70, 2021 2502809

A Multitier Deep Learning Model for


Arrhythmia Detection
Mohamed Hammad , Abdullah M. Iliyasu , Senior Member, IEEE, Abdulhamit Subasi ,
Edmond S. L. Ho , and Ahmed A. Abd El-Latif

Abstract— An electrocardiograph (ECG) is employed as a main cause of deaths globally [1]. An estimated 17.9 million
primary tool for diagnosing cardiovascular diseases (CVDs). ECG succumbed to CVD-related ailments, representing 31% of all
signals provide a framework to probe the underlying properties deaths worldwide in the same year. Two-thirds of these deaths
and enhance the initial diagnosis obtained via traditional tools
and patient–doctor dialogs. Notwithstanding its proven utility, occurred in low-income countries [1] where medical facilities
deciphering large data sets to determine appropriate information for early detection and supports for patients of CVD are
remains a challenge in ECG-based CVD diagnosis and treatment. deemed generally poor.
Our study presents a deep neural network (DNN) strategy to Arrhythmia is a situation that arises when a person’s
ameliorate the aforementioned difficulties. Our strategy consists heart pacemaker does not work properly, or its functions are
of a learning stage where classification accuracy is improved
via a robust feature extraction protocol. This is followed by impaired by ectopic focuses [2]. There are several diagnostic
using a genetic algorithm (GA) process to aggregate the best methods available to detect CVDs. Electrocardiography (ECG)
combination of feature extraction and classification. Comparison is the most well-known and widely applied method for the
of the performance recorded for the proposed technique alongside detection of various heart diseases [3]. ECG is an affirmed
state-of-the-art methods reported the area shows an increase method for the detection of acute coronary syndromes, intra-
of 0.94 and 0.953 in terms of average accuracy and F1 score,
respectively. The outcomes suggest that the proposed model could ventricular conduction disturbances, and arrhythmias [4]. ECG
serve as an analytic module to alert users and/or medical experts lead refers to an imaginary line between two ECG elec-
when anomalies are detected. trodes [5]. The standard ECG has 12 leads, of which six leads
Index Terms— Advancement of medical instrumentation are placed on the arms and/or legs of the individual, and called
(AAMI) standard, arrhythmia detection, cardiovascular diseases limb leads, while the remaining leads are placed on the torso
(CVDs), deep neural network (DNN), E-healthcare devices, elec- and are referred to as precordial leads. The limb leads are
trocardiograph (ECG), genetic algorithm (GA). labeled as I, II, III, aVL, aVR, and aVF, while the precordial
leads are similarly labeled as V1, V2, V3, V4, V5, and V6.
Overall, ECG has valuable potential to reveal hidden disease
I. I NTRODUCTION features. However, the manual analysis of the long-term ECG
signals is a tiresome task even for an expert. Hence, developing
A CCORDING to the World Health Organization (WHO),
as of 2016, cardiovascular diseases (CVDs) are the a computer-aided cardiac diagnosis (CACD) system helps
clinicians in obtaining a second opinion regarding cardiac
Manuscript received May 10, 2020; revised August 6, 2020; accepted diagnosis, and they serve as tools supporting the decline of
October 2, 2020. Date of publication October 26, 2020; date of current
version December 22, 2020. This work was supported in part by Prince diagnostic errors in cardiology [6].
Sattam Bin Abdulaziz University, Saudi Arabia, via the Deanship for Scientific Several CACD systems have been developed to support
Research funding for the Advanced Computational Intelligence and Intelligent different stages of CVD diagnosis and treatment based on
Systems Engineering (ACIISE) Research Group, under Project 2019/01/9862.
The Associate Editor coordinating the review process was Sheng-Fu Liang. machine learning (ML) strategies. Most classical ML methods
(Corresponding author: Abdulhamit Subasi.) are based on the extraction of features from different sig-
Mohamed Hammad is with the Faculty of Computers and Infor- nal types, typically ECG, which are subsequently processed
mation, Menoufia University, Shebeen El-Kom 32511, Egypt (e-mail:
mohammed.adel@ci.menofia.edu.eg). using different algorithms, such as random forest [7] and
Abdullah M. Iliyasu is with the Electrical Engineering Department, College support vector machines (SVMs) [8]. Similarly, employing
of Engineering, Prince Sattam Bin Abdulaziz University, Al-Kharj 11942, convolutional neural networks (CNNs), unsupervised feature
Saudi Arabia, also with the School of Computing, Tokyo Institute of Tech-
nology, Yokohama 226-8502, Japan, and also with the School of Computer extraction mechanisms have been used in the classification
Science and Technology, Changchun University of Science and Technology, of signals. While effective in its use to classify such signals,
Changchun 130022, China (e-mail: a.iliyasu@psau.edu.sa). little has been invested in understanding the intrigues in CNN’s
Abdulhamit Subasi is with the Institute of Biomedicine, Faculty
of Medicine, University of Turku, 20520 Turku, Finland (e-mail: automated classification of the extracted features.
abdulhamit.subasi@utu.fi). Meanwhile, advances in terms of available computational
Edmond S. L. Ho is with the Department of Computer and Information Sci- tools and algorithms have revealed that their use in automated
ences, Northumbria University, Newcastle upon Tyne NE1 8QH, U.K. (e-mail:
e.ho@northumbria.ac.uk). early detection and diagnosis of cardiac abnormalities is on
Ahmed A. Abd El-Latif is with the Mathematics and Computer Science the rise. Recently, focus on ECG rhythm (ECGr) classification
Department, Faculty of Science, Menoufia University, Shebeen El-Kom has similarly been on the increase. ECGr classification can be
32511, Egypt, and also with the School of Information Technology and Com-
puter Science, Nile University, Giza, Egypt (e-mail: a.rahiem@gmail.com). grouped into areas that focus on finding effective extraction
Digital Object Identifier 10.1109/TIM.2020.3033072 methods [9], improving classification outcomes [10]–[14], and
1557-9662 © 2020 IEEE. Personal use is permitted, but republication/redistribution requires IEEE permission.
See https://www.ieee.org/publications/rights/index.html for more information.

Authorized licensed use limited to: VTU Consortium. Downloaded on March 09,2024 at 04:40:48 UTC from IEEE Xplore. Restrictions apply.
2502809 IEEE TRANSACTIONS ON INSTRUMENTATION AND MEASUREMENT, VOL. 70, 2021

utilization of deep learning methods to enhance the perfor-


mance of classification [15]–[18].
Akhmani et al. [11] presented a method based on
the Gaussian mixture modeling (GMM) with enhanced
expectation–maximization (EM) for arrhythmia detection.
They obtained an accuracy of 99.7% for arrhythmia classi-
fication. Hammad et al. [12] reported the use of a classifier
based on characteristics of ECG signals to detect abnormal
heart conditions. As reported therein, their strategy yielded
an average classification accuracy of 99%. In their contribu-
tion, Tuncer et al. [14] presented an automated method for
arrhythmia detection using hexadecimal local patterns (HLPs) Fig. 1. Outline of the proposed multitier DLM.
and discrete wavelet transform (DWT). For classification, they
used a one-nearest neighborhood (1NN) classifier and reported data set available, i.e., the MIT-BIH arrhythmia [21]. Conse-
an accuracy of 99.7%. quently, the main contributions of this study are summarized
Despite excelling in suppressing classification errors, in the as follows:
face of big data of ECG records, the reported ML methods 1) design of an optimized DNN model for feature learning
(i.e., [10]–[14]) might be less effective. This is attributed to the required to distinguish different cardiac rhythms using a
inherent shortcoming associated with training ML models on single lead ECG;
limited or small data sets. Among others, important differences 2) integrating LSTM-based features with a k-nearest neigh-
between our study and those enumerated earlier include the bor (k-NN) classifier to improve the classification
following. efficacy;
1) Unlike the focus of most of the highlighted studies 3) design of a new DNN method based on the cross-
(i.e., [10]–[14]) on designing preprocessing of ECG validation combined with GA for optimization of fea-
signals, feature extraction, feature selection, and clas- tures and parameters.
sification protocols, this work proposes a DNN model To the best of our knowledge, this is the first attempt at
optimized using genetic algorithm (GA) to aggregate the arrhythmia detection in the manner enumerated above. The
best combination of feature extraction and classification. outcomes show promising results in terms of detection accu-
2) As widely established, data inadequacy is crucial for racy, sensitivity, specificity, positive predictivity, and F1-Score.
the learnability of machine and deep learning models The flow of the remainder of the study is outlined as
(DLMs) [19]. Unlike the reported use of average-sized follows. The details of the proposed techniques and data
data sets in [12]–[14], which manifests in their validation sets employed throughout its execution and validation are
on big data sets, the proposed study exhibits the same discussed in Section II. The presentation of the performance
performance on both small and big data sets. analysis and discussion of outcomes are given in Section III.
3) Although with its own merits, some of the highlighted Conclusions are drawn in Section IV.
methods employed multiple ECG recordings, which
increases the complexity of the respective methods [11], II. P ROPOSED M ETHODOLOGY
[12]. To overcome this, the proposed employs only one The proposed technique fuses the adaptability and flexibility
lead ECG. in input–output relationships of deep neural network (DNN)
4) Unlike [10], [12], and [13], where classification was models with the “learnability” of classical ML methods and
confined to one or two types of arrhythmia, our proposed repeatability inherent to the mutation, crossover, and other
model is employed to classify five arrhythmia categories. properties of GA and other optimization techniques to realize
To overcome the shortcomings attributed to the high- a prodigious yet efficient strategy for arrhythmia detection.
lighted ML techniques, DLMs are used. In fact, today DLMs Execution of the proposed strategy entails feeding the ECG
are so ubiquitous that their applications traverse different signal into the DNN model where deep features of each patient
domains [19], including the applications in auspicious medical are extracted. Next, these features are fed into a GA that
areas [20]. Specific to arrhythmia detection, numerous meth- determines their optimum combination. Following that, several
ods have been reported [15]–[18]. In addition to the studies classifiers, including k-NN, SVM, and multilayer perceptron
highlighted earlier (i.e., [10]–[14]), some of the shortcomings (MLP), are utilized to classify the features, following which
in the studies on arrhythmia detection will also be ameliorated final CVD detection is realized. Fig. 1 presents the general
as part of the contributions of this study. outline of the proposed technique as explained. The remainder
To accentuate, the work presented in this study is tailored of this section presents the details of the three (i.e., the deep
toward the automated detection of CVD ailments based on learning, GA, and traditional ML) tiers that make up the
ECG signals. Especially, a DLM is suffused with other ML proposed technique.
and optimization (i.e., ResNet-LSTM+GA) techniques for
efficient detection of five types of arrhythmia based on the A. Proposed Deep Learning Model
association for the advancement of medical instrumentation DNN is a class of artificial neural networks ingrained with
(AAMI) standards using the most standard ECG classification mathematical manipulation to turn an input state into output

Authorized licensed use limited to: VTU Consortium. Downloaded on March 09,2024 at 04:40:48 UTC from IEEE Xplore. Restrictions apply.
HAMMAD et al.: MULTITIER DLM FOR ARRHYTHMIA DETECTION 2502809

via unitwise calculation of the probability of each output [22].


Each mathematical manipulation is considered a layer of the
neural network and so, in the case of complex architectures,
the network requires a deep layer of computations, hence the
name DNN.
As the features for ECG classification are usually mani-
fested in the morphology of the ECG waveforms, algorithms
for feature extraction should be crafted to characterize ECG
waveforms by a set of parameters. The convolution operation
in a CNN model has been proven effective in the extraction of
features from 1-D or 2-D data that exhibit good robustness to
noise [23]. The residual CNN (ResNet), which is an improved
version of CNN, augment a known drawback regarding the
problem of degradation associated with DNNs by adding
shortcut links between its layers. Therefore, a ResNet is
potentially viable for extraction of the features from the raw
ECG waveforms.
However, an ECG recording used to diagnose CVD ailments
could extend to tens of seconds in duration. As a result, mor-
phological features of ECG recordings can be very complex
and hard to characterize. Moreover, an average segment of
ECG recording is considered enough to make a diagnosis since
parts of it are either irrelevant or redundant. Consequently,
it is neither effective nor expedient to rely solely on ResNet.
In view of this, the proposed DLM utilizes ResNet for local Fig. 2. Architecture of the proposed DLM.
feature extraction from the raw ECG signals while using
other network components, such as long short-term memory where the feature maps are fed as input to the global features
(LSTM) layer to summarize the local feature series. Further- learning part.
more, the proposed DLM ResNet-LSTM network, whose main 2) Global Feature Learning Unit: The global feature learn-
function is to extract ECG features, is structurally composed ing (GFL) unit transforms the feature map from the preceding
of three parts: local features learning, global features learning, LFL unit into a global vector that is subsequently used in the
and classification units. Fig. 3 presents the detailed structure classification unit. The LSTM, which is a kind of recurrent
of the proposed ResNet-LSTM DLM, and the details of its neural network (RNN), is used to characterize the properties
three units are presented in the sequel. of the global vector that emanates from the final layer of the
1) Local Feature Learning (LFL) Unit: This part of the LSTM. This vector’s length is determined by the hidden units
proposed DLM is focused on the raw ECG signals. A local in LSTM layers (preset at 64 in this study); at that stage,
feature vector manifests the morphological information of a the test samples achieved the minimum classification error
short period in an ECG recording. The resulting feature map using this number.
is composed of a sequence of local features ordered by time. 3) Classification Unit: The classification process is the final
As discussed earlier, in this study, the LFL unit is implemented step of the proposed DLM, whence classification process
using ResNet. It consists of a few initial layers, while its is done based on the global feature vector extracted from
main body is made up of repeating substructures. As presented preceding units. Classification is accomplished using two fully
in Fig. 2, each substructure consists of one max-pooling layer connected (i.e., dense) layers that are each followed by a ReLU
whose size is present at 2 and a residual module. The length of activation layer and a SoftMax activation layer, respectively.
the feature map will be split through each of the substructures In the case of multiclass classification, the number of cells
whose number depends in part on the input length such that in the last dense layer is the same as the number of classes.
a longer input requires more pooling layers to compress the However, in the two-class classification, the last dense layer
feature map to a certain length. Each residual module contains usually has just one cell. The outputs of the last layer
two convolutional layers, each preceded by two layers: a are the predicted probabilities showing the class that each
rectified linear unit (ReLU) activation layer and a dropout ECG recording belongs to. Although traditional DNN models
layer. Through a shortcut connection, the input of a residual can make predictions in an end-to-end fashion, to improve
module is merged by combining it with the output of its second classification performance, an optimization layer is integrated
convolutional layer. As required by the merge operation and to into the proposed DLM, whose details are discussed in
ensure equal input and output length, feature maps are padded Section II-B.
before input into each convolutional layer. The kernel size of
the first convolutional layer in the network is set at 32, and B. GA-Based Optimization Tier
through every four substructures, the kernel size is reduced by A high-dimensional feature set perturbs classification
half. The LFL unit terminates with a ReLU activation layer accuracy while imposing temporal constraints on available

Authorized licensed use limited to: VTU Consortium. Downloaded on March 09,2024 at 04:40:48 UTC from IEEE Xplore. Restrictions apply.
2502809 IEEE TRANSACTIONS ON INSTRUMENTATION AND MEASUREMENT, VOL. 70, 2021

TABLE I
D EFAULT C HOICE OF B EST PARAMETERS FOR GA-BASED O PTIMIZATION

Fig. 3. Impact of changing parameter k on the system accuracy.

resources. A wide range of approaches, such as GA [24]


and particle swarm optimization (PSO) [25], is employed as belonging to the category of those points. As a drawback,
to mitigate these encumbrances. In this study, a GA is however, the k-NN is sensitive to errors during the training
infused into the DLM discussed earlier with the objective of sequence [27]. In this study, the k-NN classifier with k = 5
minimizing the number of features and classification errors is employed. Fig. 3 depicts the k selection criterion where
associated with the variability of signal characteristics and preference is given to a value that yields the highest accuracy.
random permutation of the signals. 2) SVM Classifier: The SVM is another type of supervised
Moreover, recently, GA has been found very adaptive and learning algorithm that is employed for regression and classifi-
efficient for feature selection [26]. Typically, GA has four cation problems by finding a hyperplane that splits the features
steps, and its use as the optimization tier of the proposed into diverse domains [28]. When employed in classification
technique is outlined in the following steps. tasks, the SVM is called support vector classification (SVC).
1) Initialize a population that consists of N chromosomes, Similarly, when SVM is used in regression problems, the
each of length L. SVM is called support vector regression (SVR). Irrespective
2) Select optimum features from the feature space com- of where it is used, SVM can be broadly classified into two
prising of 36 different features, which can be defined as main types: linear SVM (L-SVM) for two-class problems and
the initial population in the GA optimization procedure. non-L-SVM (N-SVM) for multiclass problems. This study is
From the feature space, the features that have higher built on the N-SVM, where the classification is accomplished
fitness values (as measured by a fitness function) will via a kernel function to map the data into a different space
be eliminated, whereas those with lower fitness values with a hyperplane. A Kernel function can be chosen from
will be retained. the different types available, such as linear, polynomial, and
3) In each generation, select two parents using the classi- radial basis function (RBF). However, the choice is guided by
fiers to categorize the feature combination of each of the kind of classification problem. Constrained by limitations
these parents separately. of data set available, RBF kernel, where the number of
4) Calculate the fitness value of each classification and observations is larger than the number of features chosen,
terminate the optimization when the generation passes is used in this study. Formally, the RBF (Gaussian) kernel
the 100th iteration. is defined as follows [29]:
5) Send the selected parents to the crossover stage, and  
x − x i 2
continue the optimization until the generation meets K (x, x i ) = exp − (1)
the defined number of iterations. A default crossover 2σ 2
probability of 0.8 used to choose parents with lower where σ is a real value standard variance of the Gaussian
fitness values to generate the next population. Table I distribution, and each x i ∈ R p is a p-dimensional real vector.
presents the default parameter settings for the proposed In this study, a default value of σ = 1 is used.
GA-based optimization procedure. 3) MLP Classifier: Multilayer perceptron (MLP) is a class
of feed-forward artificial neural networks that consist of three
C. Classification Tier of Proposed Model layers, the input layer, a hidden layer, and an output layer.
In this study, classification is realized using several classi- Except for the input nodes, each node is a neuron that uses a
fiers, such as k-NN, SVM, and MLP. These classifiers were nonlinear activation function (e.g., sigmoid function). In this
implemented and evaluated to choose a suitable classifier for study, an MLP classifier with one hidden layer and five output
our model, as outlined in the remainder of this section. nodes is used for arrhythmia detection used. Layers in the
1) k-NN Classifier: The k-NN is a supervised ML algorithm network are completely connected to each other and trained
that is credited with ease of deployment and low tempo- in a way that each input vector results in an output vector
ral demands. The k-NN algorithm performs the test point with one nonzero element corresponding to the estimated class
classification based on the surrounding training points, i.e., label. For training, the Levenberg–Marquardt backpropagation
the neighbors closest to the test point (hence, the name nearest algorithm [30] is used. The learning procedure is continued
neighbors). When the distance of some of these neighboring until either 30 validation failures are obtained or when the
points is closer than the rest, the test point will be considered maximum number of iterations (100 epochs) is reached.

Authorized licensed use limited to: VTU Consortium. Downloaded on March 09,2024 at 04:40:48 UTC from IEEE Xplore. Restrictions apply.
HAMMAD et al.: MULTITIER DLM FOR ARRHYTHMIA DETECTION 2502809

Fig. 4. Samples of normal and abnormal classes from the MIT-BIH data set [21].

III. E XPERIMENTS AND VALIDATION TABLE II


D ISTRIBUTION OF D ATA S AMPLES FOR E ACH OF THE
As mentioned earlier, a fivefold cross-validation F IVE T YPES OF A RRHYTHMIA
method [31] is employed in this study, and the performance
of the system was evaluated in each fold. The average
result of all the five folds was calculated as the final
performance of the system.
The performance of the proposed DLM was assessed in
three steps. First, the impact of using fivefold cross-validation
on an end-to-end model was evaluated. Second, the role
of proposed GA-based optimization on the classification is
assessed. Finally, outcomes of the classification were com-
pared alongside standard techniques in the area of automated predictivity (PPV), and specificity (SPE). These parameters
detection of cardiac abnormalities, which is an important step are defined in the equation matrix in Table III.
in CVD diagnosis and treatment. In addition, F1-score defined in (2) [32] is used to evaluate
The data set employed and metrics used in validating the the classification
proposed model are introduced in subsequent sections. ⎛  ⎞
N 2TP
1 ⎝
M
i 2TP+FN+FP
F1 − score = ⎠ (2)
A. MIT-BIH Arrhythmia Data Set M N
i
The MIT-BIH database [21] contains 48 ECG recordings
obtained from 47 subjects composed of 47% female and 53% where N and M represent the number of sets applied in the
male participants whose age range varied between 23 and fivefold and the number of classes, respectively. TP and TN
89 years. Each subject is represented by one ECG recording are true positives and true negatives, and FP and FN are false
that is obtained using two leads placed on the chest. The positives and false negatives
lead II (MLII), which is at the top and lead V1, which is the 
N
TP
lower one, produced the signals at a sampling frequency of Positive Predictivity (PPV) = /N (3)
360 Hz. As explained in [26], in the upper signal, the normal i
TP + FP
QRS complexes are usually prominent, while, in some cases 
N
TP
(such as in recordings 102 and 104), surgical dressings on the Sensitivity (SEN) = /N (4)
TP + FN
patients prevented the use of lead II, so, in this case, lead i
V5 was used. 
N
TN
According to the AAMI specifications, the MIT-BIH data- Specificity (SPE) = /N (5)
TN + FP
base can be grouped into five arrhythmia groups: normal (N), i

supraventricular ectopic (S), ventricular ectopic (V), fusion 


N
TP+TN
(F), and unknown (Q). The distribution of the data over the Accuracy (Acc) = /N.
i
TP+TN+FP+FN
training and testing sets for each of the five types of arrhythmia
is presented in Table II, while Fig. 4 presents samples of three (6)
recordings (i.e., normal and other abnormal cases) from the
MIT-BIH database. C. Preprocessing and Implementation Details
Since ECG recordings in the selected data set are dispro-
B. Performance Metrics portionate in length, the first preprocessing operation is that
The classification results were evaluated using standard met- to convert them to the same length by padding or truncating
rics, including the Accuracy (Acc) sensitivity (SEN), positive for the convenience of DNN training. However, the choice

Authorized licensed use limited to: VTU Consortium. Downloaded on March 09,2024 at 04:40:48 UTC from IEEE Xplore. Restrictions apply.
2502809 IEEE TRANSACTIONS ON INSTRUMENTATION AND MEASUREMENT, VOL. 70, 2021

TABLE III
C OMPARISON OF I NTRAPATIENT ’ S C LASSIFICATION P ERFORMANCE OF U SING THE MIT-BIH D ATABASE

of a padding method can increase the computing complex- D. Results and Performance Analysis
ity of the model, while the truncation method can damage In this section, the results of experiments and performance
the recording integrity. Moreover, 90% of recordings in the of the proposed model are presented and discussed. Especially,
selected database are no longer than 30 s in length. In view of the proposed models are validated via three experiments.
this, as a tradeoff between computing efficiency and recording In the first experiment, the proposed end-to-end model is
integrity, 30-s-long recordings are chosen as the target length. employed without any ML stages. In the second experiment,
Furthermore, a zero-padding value was used because it is the the proposed deep model is used for feature extraction, and an
baseline value of the ECG signals. The padding was positioned external classifier (k-NN classifier) is employed for classifica-
at the head of each recording because LSTM is considered tion. In the last experiment, a comparison of the two proposed
more sensitive to values in the recording tail. Meanwhile, for models (i.e., end-to-end and DLM with external classifier)
the truncation, the model uses the same method that truncates alongside state-of-the-art approaches reported in the literature.
a segment randomly from the original signal. In addition, other As discussed earlier, based on the AAMI specification EC
fixed-length recordings (such as 10 and 20 s) were considered, 57 [33], using the MIT-BIH database [21], arrhythmia is con-
but the 30-s-length recordings remained the optimal choice. sidered as the beat level that can be classified as N, S, V, F, and
The randomness involved in the padding/truncation methods Q classes. Each beat contains 300 sampling points: 100 before
augments and balances the data set during this process. How- and 200 after the R peak (with Fs = 360 Hz). The lead II
ever, considering the additional memory requirements imposed data are used for the classification, so the channel number for
by the augmentation, the data augmentation and balancing are the input is 1. Four residual substructures in the DLM (i.e.,
done in batches. For each model training, a batch is generated ResNet-LSTM) model produce a local feature map of length
by randomly selecting a certain number of recordings from 18. Since this is a multiclass and single-label classification
each class and then padding or truncating these recordings as problem, SoftMax is used as the final activation function.
the case may demand. For example, for an adopted batch size Furthermore, both intrapatient and interpatient models are
of 63 and a class numbers of 5, a batch contains seven record- trained for this problem. For the training of intrapatient mod-
ings from each class. The randomness in the padding (except els, the beats from all recordings are first shuffled and divided
that for the ResNet-LSTM) and truncation ensure that, with into five segments for the cross-validation, whereas, for the
the exception of the ResNet-LSTM, no two training samples training of intrapatient models, the beats from 22 recordings
are the same. Furthermore, no additional memory is required are used for training and another 22 recordings for validation,
for the augmented recordings because they are generated just as stipulated in the AAMI standards. However, since the beat
prior to preparing a batch and discarded immediately after numbers of classes F and Q are small, only the other three
processing of the batch. classes (i.e., N, S, and V) are involved in the interpatient
As stated earlier, the recordings are padded or truncated classifications. The results of the intrapatient and interpatient
to 30 s, which adds up to 15 000 sampling points. The local models are presented in Tables III and IV, respectively.
features learning pipeline of the proposed ResNet-LSTM has From Tables III and IV, it can be deduced that GA optimized
seven residual substructures. As each substructure has a max- the features of the proposed DLM better than other methods.
pooling layer with a pool size of 2, the resulting output length Similarly, it can be inferred that k-NN is better suited for
of the local features learning pipeline is set at 117. Since a GA optimization since it produced better accuracy relative to
recording may have more than one label, the resulting task other classifiers. Figs. 5 and 6 present the graphs showing
is a multilabel classification problem. Consequently, as out- the validation of the proposed k-NN ML model with and
lined in Section III, SoftMax is used as the final activation without using GA-based optimization. A reading of the two
function that generates the predicted probability for each class plots confirms the choice of the GA-optimized strategy as
independently. more efficient.
The models are implemented on the Keras framework
with a Tensorflow back end. The hardware environment is
a workstation equipped with an Intel Core i7-6800K CPU, E. Comparison With Similar State-of-the-Art Methods
an Nvidia GTX 1080ti GPU, and 16-GB memory, while the In this section, the performance of the proposed techniques
training time of each batch for ResNet-LSTM is 307 ms. is evaluated alongside longstanding methods in the area. For

Authorized licensed use limited to: VTU Consortium. Downloaded on March 09,2024 at 04:40:48 UTC from IEEE Xplore. Restrictions apply.
HAMMAD et al.: MULTITIER DLM FOR ARRHYTHMIA DETECTION 2502809

TABLE IV
C OMPARISON OF I NTERPATIENT ’ S C LASSIFICATION P ERFORMANCE OF U SING THE MIT-BIH D ATABASE

TABLE V
C OMPARISON OF P ERFORMANCE P ROPOSED M ODEL A LONGSIDE
R EPORTED S TUDIES T HAT U SE THE MIT-BIH D ATABASE

Fig. 5. Plot of the proposed ResNet-LSTM with GA when using k-NN as


a classifier (the best classifier).

Fig. 6. Plot of the proposed ResNet-LSTM without GA when using k-NN


as a classifier (the best classifier).

a level playing ground, outcomes with the best performance


are used for the assessment. For this study, this is the DLM
suffused with k-NN and GA-based optimization.
From the results that the comparison presented in Table V,
it can be concluded that the proposed method matches or bet-
ters the other methods in terms of robustness for the data
set reported. As noted earlier, as a motivation for embark-
ing on this study, while it was observed that there are
a good number of machine or deep learning approaches
for detecting heart disorders (such as arrhythmia), most
of them are encumbered by the computational overhead
associated with the complex frameworks utilized in their memory-related constraints [10]–[13]. Furthermore, most of
detection models [10], [11], [13]–[18]. Many of these frame- the developed models are especially primed to detect only one
works are slow [15]–[18], while others are overburdened by type of signal. Unlike these previous studies, a multitier DLM

Authorized licensed use limited to: VTU Consortium. Downloaded on March 09,2024 at 04:40:48 UTC from IEEE Xplore. Restrictions apply.
2502809 IEEE TRANSACTIONS ON INSTRUMENTATION AND MEASUREMENT, VOL. 70, 2021

TABLE VI with ML and GA-based optimization for effective discrimi-


C OMPARISON B ETWEEN C OMPUTATIONAL C OMPLEXITY OF LSTM AND nation of cardiac abnormalities in the ECG signal. The pro-
B I LSTM DLM S IN ECG-BASED A RRHYTHMIA D ETECTION
posed techniques fuse the adaptability and flexibility in input–
output relationships of DNN models with the “learnability”
of classical ML methods and repeatability inherent to the
mutation, crossover, and other properties of GA and other
optimization techniques to realize a prodigious yet efficient
strategy for early detection of different CVD ailments. These
properties ensure that the proposed approach alleviates many
of the shortcomings that encumber traditional approaches. The
capable of detecting more than one type of signal is proposed. outcomes show that the proposed model matches and outper-
Its use in detecting heart disorders, such as arrhythmia, is forms many of the competing approaches in either or both
demonstrated. the data sets used. Moreover, with average accuracy values
In addition, the bidirectional long-short term memory net- of 98%, the proposed technique is efficient in arrhythmia
work (BiLSTM) method is reported to perform creditably for detection on the MIT-BIH data set. Furthermore, the perfor-
arrhythmia detection [35], [36]. Compared with our proposed mance was reported in terms of specificity (98.9%), sensitivity
model (see Table V), the BiLSTM method in [35] offers (99.7%), and positive predictivity (95.8%) for the fivefold
marginally better performance in detection accuracy. However, cross-validation. The metrics validate the potentials for incor-
Li et al. [35] report detecting RR intervals, which increases porating the proposed model in state-of-the-art applications for
computational overhead. Furthermore, the method is more CVD detection, as well as its subsequent diagnosis, treatment,
susceptible to noisy signals, and its accuracy is data-intensive and management. In ongoing work, we are exploring effective
since large amounts of ECG data are required. In addition, techniques to fuse the proposed method into other aspects of
it requires double LSTM cells, which makes it costlier. Con- the e-health framework. In future work, we intend to exploit
sequently, the time complexity of [35] is potentially prohibitive the potency of the BiLSTM method to enhance other aspects
because of the complexity of BiLSTM. of CVD detection.
Meanwhile, the intuition to suffuse GA-based optimization
into the proposed DLM ensures that (the best) lower features R EFERENCES
are extracted from the ECG signals of more than one lead,
despite the use of the lead II ECG signals. This suggests that [1] V. K. Sudarshan, U. R. Acharya, and S. L. Oh, “Automated diagnosis of
congestive heart failure using dual tree complex wavelet transform and
the proposed method is less complex than other competing statistical features extracted from 2, s of ECG signals,” Comput. Biol.
techniques. The proposed model requires four hours for train- Med., vol. 83, pp. 48–58, May 2011.
ing with a computational complexity (defined in terms of the [2] N. Singh and P. Singh, “Cardiac arrhythmia classification using
machine learning techniques,” in Engineering Vibration, Communication
decision time for each recording) of 10 ms. and Information (Lecture Notes in Electrical Engineering), vol. 478.
Finally, as presented in Table V, for the data sets employed, Singapore: Springer-Verlag, 2019, pp. 469–480.
the proposed technique outperforms similar ones in terms of [3] M. Liu and Y. Kim, “Classification of heart diseases based on ECG
signals using long short-term memory,” in Proc. 40th Annu. Int. Conf.
classification accuracy, which is an important precursor for IEEE Eng. Med. Biol. Soc. (EMBC), Jul. 2018, pp. 2707–2710.
arrhythmia detection and subsequent diagnosis. [4] P. Kligfield et al., “Recommendations for the standardization and inter-
pretation of the electrocardiogram: Part I: The electrocardiogram and its
technology: A scientific statement from the American Heart Association
F. Complexity Analysis Electrocardiography and Arrhythmias Committee, Council on Clinical
Cardiology; the American College of Cardiology Foundation; and the
To evaluate the complexity of our proposed model, the CPU Heart Rhythm Society,” Circulation, vol. 115, no. 10, pp. 1306–1324,
time required to execute each phase is computed, as presented Mar-2007.
in Table VI. Therefore, we note that, in the worst case, the cost [5] Lewis Potter. (Mar. 5, 2011). Understanding an ECG.
Accessed: Jul. 13, 2020. [Online]. Available: https://geekymedics.
of the LSTM amounts to (O(n 2 )). com/understanding-an-ecg/
Meanwhile, this cost is half that expected for the BiLSTM [6] N. Khosravan, H. Celik, B. Turkbey, E. C. Jones, B. Wood, and
method (as reported in the rightmost column of Table V). U. Bagci, “A collaborative computer aided diagnosis (C-CAD) system
with eye-tracking, sparse attentional model, and deep learning,” Med.
Consequently, it is imperative that the marginal improvement Image Anal., vol. 51, pp. 101–115, Jan. 2019.
in terms of prediction accuracy for the BiLSTM model (as [7] L. Breiman, “Random forests,” Mach. Learn., vol. 45, no. 1, pp. 5–32,
reported earlier in Table V) over the proposed LSTM DLM 2001.
[8] Y. Freund and R. E. Schapire, “Experiments with a new boosting
with GA classifier comes at the expense of increases in algorithm,” in Proc. ICML, vol. 96, 1996, pp. 148–156.
computational overhead. We believe this tradeoff between cost [9] M. Hammad, S. Zhang, and K. Wang, “A novel two-dimensional ECG
and marginal improvement in detection accuracy must be feature extraction and classification algorithm based on convolution
neural network for human authentication,” Future Gener. Comput. Syst.,
carefully considered depending on the application. vol. 101, pp. 180–196, Dec. 2019.
[10] D. Sadhukhan, S. Pal, and M. Mitra, “Automated identification of
myocardial infarction using harmonic phase distribution pattern of ECG
IV. C ONCLUSION data,” IEEE Trans. Instrum. Meas., vol. 67, no. 10, pp. 2303–2313,
Efficient and accurate classification of ECG signals is the Oct. 2018.
[11] R. Ghorbani Afkhami, G. Azarnia, and M. A. Tinati, “Cardiac arrhyth-
first important step in the detection and diagnosis of many mia classification using statistical and mixture modeling features of ECG
CVD ailments. This study presents a multitier DLM suffused signals,” Pattern Recognit. Lett., vol. 70, pp. 45–51, Jan. 2016.

Authorized licensed use limited to: VTU Consortium. Downloaded on March 09,2024 at 04:40:48 UTC from IEEE Xplore. Restrictions apply.
HAMMAD et al.: MULTITIER DLM FOR ARRHYTHMIA DETECTION 2502809

[12] M. Hammad, A. Maher, K. Wang, F. Jiang, and M. Amrani, “Detection [36] X. Xu, S. Jeong, and J. Li, “Interpretation of electrocardiogram
of abnormal heart conditions based on characteristics of ECG signals,” (ECG) rhythm by combined CNN and BiLSTM,” IEEE Access, vol. 8,
Measurement, vol. 125, pp. 634–644, Sep. 2018. pp. 125380–125388, 2020.
[13] G. Garcia, G. Moreira, E. Luz, and D. Menotti, “Improving automatic
cardiac arrhythmia classification: Joining temporal-VCG, complex net-
works and SVM classifier,” in Proc. Int. Joint Conf. Neural Netw.
(IJCNN), Jul. 2016, pp. 3896–3900. Mohamed Hammad received the M.Sc. degree from the Information Tech-
[14] T. Tuncer, S. Dogan, P. Pàawiak, and U. Rajendra Acharya, “Automated nology Department, Faculty of Computers and Information, Menoufia Univer-
arrhythmia detection using novel hexadecimal local pattern and multi- sity, Shebeen El-Kom, Egypt, in 2015, and the Ph.D. degree from the School
level wavelet transform with ECG signals,” Knowl.-Based Syst., vol. 186, of Computer Science and Technology, Harbin Institute of Technology, Harbin,
Dec. 2019, Art. no. 104923. China, in 2019.
[15] J. Zhang, A. Liu, M. Gao, X. Chen, X. Zhang, and X. Chen, “ECG-based He is currently an Assistant Professor with the Faculty of Computers and
multi-class arrhythmia detection using spatio-temporal attention-based Information, Menoufia University. His research interests include computer
convolutional recurrent neural network,” Artif. Intell. Med., vol. 106, vision, machine learning, pattern recognition, and biometrics.
Jun. 2020, Art. no. 101856.
[16] S. Nurmaini et al., “An automated ECG beat classification system using
deep neural networks with an unsupervised feature extraction technique,”
Appl. Sci., vol. 9, no. 14, p. 2921, Jul. 2019. Abdullah M. Iliyasu (aka Abdul M. Elias) (Senior Member, IEEE) received
[17] U. R. Acharya et al., “A deep convolutional neural network model the M.E., Ph.D., and Dr.Eng. degrees in computational intelligence and
to classify heartbeats,” Comput. Biol. Med., vol. 89, pp. 389–396, intelligent systems engineering from the Tokyo Institute of Technology (Tokyo
Oct. 2017. Tech.), Tokyo, Japan.
[18] M. Amrani, M. Hammad, F. Jiang, K. Wang, and A. Amrani, “Very Concurrently, he is a Research Faculty with the School of Computing,
deep feature extraction and fusion for arrhythmias detectionv,” Neural Tokyo Tech and also the Principal Investigator and the Team Leader of the
Comput. Appl., vol. 30, no. 7, pp. 2047–2057, 2018. Advanced Computational Intelligence and Intelligent Systems Engineering
[19] A. Sedik et al., “Deploying machine and deep learning models for (ACIISE) Research Group, College of Engineering, Prince Sattam Bin Abdu-
efficient data augmented detection of COVID-19 infections,” Viruses, laziz University (PSAU), Saudi Arabia. He is also a Professor with the School
vol. 12, no. 7, p. 769, 2020. of Computer Science and Technology, Changchun University of Science and
[20] A. Alghamdi et al., “Detection of myocardial infarction based on novel Technology, China. In addition to being among the pioneers of research in the
deep transfer learning methods for urban healthcare in smart cities,” emerging quantum image processing (QIP) subdiscipline, he has to his credit
Multimedia Tools Appl., vol. 2020, pp. 1–22, Mar. 2020. more than 120 publications traversing the areas of computational intelligence,
[21] A. Goldberger, L. Amaral, and L. Glass “Physiobank, physiotoolkit, quantum cybernetics, quantum image processing, quantum machine learning,
and physionet: Components of a new research resource for complex cyber and information security, hybrid intelligent systems, the Internet of
physiologic signals,” Circulation, vol. 101, no. 23, p. E215, 2000. Things, 4IR, health informatics, and electronics systems reliability. He is
[22] A. Y. Hannun et al., “Cardiologist-level arrhythmia detection and classi- the Managing Editor of Fuji Technology Press, Japan. He is a member of
fication in ambulatory electrocardiograms using a deep neural network,” editorial board many journals including Journal of Advanced Computational
Nature Med., vol. 25, no. 1, pp. 65–69, Jan. 2019. Intelligence and Intelligent Informatics (JACIII), Quantum Reports Journal,
[23] S. Kiranyaz, O. Avci, O. Abdeljaber, T. Ince, M. Gabbouj, and International Journal of Electrical and Computer Engineering (IJECE), and
D. J. Inman, “1D convolutional neural networks and applications: the Journal of Medical Imaging and Health Informatics (JMIHI). He is
A survey,” 2019, arXiv:1905.03554. [Online]. Available: http://arxiv. also an Associate Editor in many other journals, including IEEE A CCESS ,
org/abs/1905.03554 Telekomnika, and Information Sciences.
[24] D. Whitley, “A genetic algorithm tutorial,” Statist. Comput., vol. 4, no. 2,
pp. 65–85, 1994.
[25] D. P. Rini, S. M. Shamsuddin, and S. S. Yuhaniz, “Particle swarm
Abdulhamit Subasi has been a Professor of medical engineering with the
optimization: Technique, system and challenges,” Int. J. Comput. Appl.,
University of Turku, Turku, Finland, since 2020. He is specialized in machine
vol. 14, no. 1, pp. 19–26, 2011.
learning, data mining, and biomedical signal processing. Concerning the appli-
[26] C. L. Huang and C. J. Wang, “A GA-based feature selection and
cation of machine learning to different fields, he wrote seven book chapters
parameters optimization for support vector machines,” Expert Syst.
and more than 170 published journal articles and conference papers. He is
Appl., vol. 31, no. 2, pp. 231–240, 2006.
also the author of the books: Practical Guide for Biomedical Signals Analysis
[27] S. K. Berkaya, A. K. Uysal, E. S. Gunal, S. Ergin, S. Gunal, and Using Machine Learning Techniques and Practical Machine Learning for
M. B. Gulmezoglu, “A survey on ECG analysis,” Biomed. Signal Data Analysis Using Python. He has worked on several projects related to
Process. Control, vol. 43, pp. 216–235, May 2018. biomedical signal processing and data analysis.
[28] M. Hammad, P. Päawiak, K. Wang, and U. R. Acharya, “ResNet–
attention model for human authentication using ECG signals,” Expert
Syst., vol. 10, Mar. 2020, Art. no. e12547.
[29] M. Hammad and K. Wang, “Fingerprint classification based on a Edmond S. L. Ho received the B.Sc. degree in computer science from
Q-Gaussian multiclass support vector machine,” in Proc. Int. Conf. Hong Kong Baptist University, Hong Kong, in 2003, and the M.Phil. degree
Biometrics Eng. Appl. (ICBEA), 2017, pp. 39–44. in computer science and the Ph.D. degree in informatics from The University
[30] M. T. Hagan and M. B. Menhaj, “Training feedforward networks with of Edinburgh, Edinburgh, U.K., in 2006 and 2011, respectively.
the Marquardt algorithm,” IEEE Trans. Neural Netw., vol. 5, no. 6, He is currently a Senior Lecturer with the Department of Computer
pp. 989–993, 1994. and Information Sciences, Northumbria University, Newcastle upon Tyne,
[31] R. Duda, P. Hart, and D. Stork, Pattern Classification, 2nd ed. U.K. His current research interests include computer graphics and animation,
New York, NY, USA: Wiley, 2001, pp. 55–88. computer vision, machine learning, and robotics.
[32] F. Liu, C. Liu, and L. Zhao, “An open access database for evaluating the
algorithms of electrocardiogram rhythm and morphology abnormality
detection,” J. Med. Imag. Health Inf., vol. 8, no. 7, pp. 1368–1373,
2018. Ahmed A. Abd El-Latif received the B.Sc. degree (Hons.) in mathematics
[33] ANSI/AAMI EC57: 2012-Testing and Reporting Performance Results of and computer science and the M.Sc. degree in computer science from
Cardiac Rhythm and ST Segment Measurement Algorithms, Association Menoufia University, Shebeen El-Kom, Egypt, in 2005 and 2010, respectively.
for the Advancement of Medical Instrumentation, Arlington, VA, USA, He is currently an Associate Professor of computer science with Menoufia
2013. University, Egypt. He is the author or a coauthor of more than 130 ISI articles.
[34] J. Pan and W. J. Tompkins, “A real-time QRS detection algorithm,” IEEE His areas of interests are multimedia content encryption, secure wireless
Trans. Biomed. Eng., vols. BME–32, no. 3, pp. 230–236, Mar. 1985. communication, IoT, applied cryptanalysis, perceptual cryptography, secret
[35] R. Li, X. Zhang, H. Dai, B. Zhou, and Z. Wang, “Interpretability analysis media sharing, information hiding, biometrics, forensic analysis in digital
of heartbeat classification based on heartbeat activity’s global sequence images, and quantum information processing.
features and BiLSTM-attention neural network,” IEEE Access, vol. 7, Dr. Abd El-Latif is also an Associate Editor of the Journal of Cyber
pp. 109870–109883, 2019. Security and Mobility.

Authorized licensed use limited to: VTU Consortium. Downloaded on March 09,2024 at 04:40:48 UTC from IEEE Xplore. Restrictions apply.

You might also like