Processing & Properties of Floor and Wall Tiles.pptx
Two phase heart disease diagnosis system using deep learning
1. International Journal of Control and Automation
Vol. 12, No.5, (2019), pp. 558 - 573
558
ISSN: 2005-4297 IJCA
Copyright ⓒ 2019 SERSC
Two-Phase Heart Disease Diagnosis System Using Deep Learning
Anurag Jain1
, Shamik Tiwari2
, Varun Sapra3
1,2
Virtualization Department,3
Systemics Department,
1,2,3
School of Computer Science, University of Petroleum & Energy Studies,
Dehradun, India,
Abstract
Heart disease diagnose mechanism can differ, depending on the type of heart disease.
However, the common routine which most medical practitioners use to make a diagnosis
consisting of physical examination using clinical data followed by a specific medical test
like Electrocardiogram, Echocardiogram, Cardiac CT Scan, Cardiac MRI Study, Stress
Testing, Cardiac Catheterization, and Electrophysiology Study. Out of these specific tests,
Electrocardiogram is a widely used test that can detect information about the heart
rhythm and significant indications about structural heart disease. This work presents a
scheme that first uses clinical data to identify the chances of cardiovascular problems. In
case of positive chances, the ECG signals are used to classify heart rhythm for diagnosing
the particular type of heart disease. In this integrated approach, deep neural network-
based methods are utilized and results confirm the robustness of the proposed model.
Keywords: Cardiovascular disease, ECG, Arrhythmia, Deep Learning, Convolutional
Neural Network
1. Introduction
As per the World Health Organization (WHO) report published in September 2016,
around 17900000 people dies every year because of heart related disease. This figure
covers the 31% of all deaths occurred all around the world [1]. In medical terminology
heart disease are called as cardiovascular disease (CVD) which occur either due to
narrowed or blocked blood vessels or due to problem in heart rhythm. Sometime it also
occurs due to some inborn problem. CVD involves the heart, blood vessels or both
[2].Heart disease detection method can be categorized in two categories: invasive and
non-invasive methods. In invasive method, doctor break or penetrate the skin to diagnose
the disease while in non-invasive method doctor diagnose the disease without breaking or
penetrating the skin [3].
1.1 Non-invasive heart disease detection method:
Electrocardiography (ECG) is the basic non-invasive test for detecting abnormalities in
heart conditions. During contraction and expansion of heart muscles, electric charges are
generated and transmitted on the skin. These electric charges can be identified through the
electrodes attached to the body surface & represented in the graphical form on a paper.
Through this test, we can observe changes in heart rhythm and predict about the heart
attack situation [4]. Holter monitor and Qardiocore are another non-invasive test for
detecting abnormalities in heart conditions. Duration of ECG test is few minutes but
Holter monitor and Qardiocore test monitor the heart rhythm for 72 hours or one week to
detect the abnormalities in heart rhythm. While holter monitor uses very few electrodes
relative to ECG and Qardiocore does not use electrodes. Qardiocore is a wearable device
[5].Chest X-ray is another invasive method to detect abnormalities in heart. It is used to
detect abnormality in heart size.Echo test is another non-invasive test to detect
abnormality in heart condition. A hand held device generating high frequency sound
wave is placed on chest to get the images of heart valves and chambers on the monitor
screen. These images helps sonographer to analyse the pumping action of heart.Computed
2. International Journal of Control and Automation
Vol. 12, No.5, (2019), pp. 558 - 573
559
ISSN: 2005-4297 IJCA
Copyright ⓒ 2019 SERSC
tomography is another non-invasive method of heart disease detection where three
dimensional images of heart is generated to analyse the blockage in coronary arteries due
to deposit of calcium.Another non-invasive test for heart disease detection is exercise
stress test where different parameters like heart rate, breathing rate, blood pressure, ECG
etc. are measured and analysed during exercise or running on treadmill [4, 5].
1.2 Invasive heart disease detection method:
Thallium stress test is an invasive heart disease detection method. Radioactive material
thallium is injected in blood and through this blood flow images are analysed on monitor.
This help doctor in finding the damage in heart or poor blood flow.Cardiac catheterization
is most commonly used invasive heart disease detection method used to examine the
inside of heart blood vessels through X-rays. A thin hollow tube called catheter is injected
in blood vessel via arm, neck or groin to heart. Dye is insertedvia catheter into blood
vessels. This dye is visible by X-ray. This help doctor in analysis of blockage level in
blood vessels [6, 7].
1.3 Significance of clinical data in heart disease detection
Analysis of clinical data is commonly used method for early detection of heart disease. A
model is formulated under the guidance of expert doctors. Input to this model are different
clinical parameters and outcome is in the form of prediction about heart disease. Data is
pre-processed and analysed through different algorithm. So model act as an expert system
which provide the early warning feature. Till date, expert systems like MYCIN,
CADIAG-2, INTERNIST etc. are available. But they are not single disease expert system.
Rather they are multi disease expert system. So accuracy in detection of heart disease is
not very good. Obesity, age, sex, height, weight, random blood sugar, cholesterol,
hypertension, smoking habits, diabetes, chest pain, lipid profile etc. are some of the most
frequently used clinical parameter. Once the database about the knowledge of heart
diseaseand their symptoms is prepared then it is converted into suitable form which can
be understand by computer.After this rule based inference mechanism is applied to
conclude about heart disease. Accuracy of disease prediction from clinical data depends
upon the analysis method and feedback mechanism [8].
1.4 Usage of ECG in heart disease detection
Electrocardiography (ECG) is the basic test for detecting abnormalities in heart
conditions. During contraction and expansion of heart muscles, electric charges are
generated and transmitted on the skin. These electric charges can be detected through the
electrodes attached to body surface& represented in the graphical form on a paper. Figure
1 shows the schematic drawing of standard sinus rhythm for human heart as seen on ECG.
An ideal ECG look like image shown in figure 1 and keep repeating itself.
Figure 1: Schematic diagram of standard sinus rhythm for human heart as seen on ECG
3. International Journal of Control and Automation
Vol. 12, No.5, (2019), pp. 558 - 573
560
ISSN: 2005-4297 IJCA
Copyright ⓒ 2019 SERSC
An ideal ECG consist of three waves:
1. P-wave: represents the depolarization of atrial. Its amplitude is very small.
Duration of normal P wave is less than 120ms, amplitude for limb leads is less
than 2.5 mm and for chest leads is less than 1.5 mm.
2. QRS-complex: It shows the depolarization of the ventricles which is series of
three prominent deflections. Duration of normal QRS complex is less than .12
seconds. QRS complex is subdivided into three waves:
a. Q wave: Q wave last long for less than 40ms and amplitude of Q wave is
less than 2 mm. Q wave shows the depolarisation of the interventricular
septum from left to right. Q wave have negative deflection.
b. R wave: R wave is the biggest wave among QRS-complex, which have
positive deflection. It shows the depolarisation of the ventricular walls.
c. S wave: The small -ive deflection after R wave is called S wave, which
shows depolarisation of the Purkinje fibres.
3. T-wave: It shows the repolarization of ventricles. Amplitude for limb leads is less
than 5 mm and for chest leads is less than 15 mm.
ECG waves can be divided into intervals and segment. These help in the analysis of
signal. Interval is analysed to analyse the duration while segment is analysed to check the
deviation from iso-electrical lines.
The region between two waves is called segment. The region which is starting after the
finish of P wave and ending at the starting of QRS complex is called PR segment. The
region starting after the finish of QRS complex and ending at the start of T wave
constitutes the ST segment. This segment shows the time taken from ventricles
depolarization to repolarization.
The region starting from P wave and finishing at QRS-complex is called PR interval.
Normal duration of this interval is .12 to .2 second. If duration of this interval is more
than .2 second then it indicates the situation of first degree heart block. Also if its duration
is less than .12 seconds then it indicates presence of some pre excitation syndrome. The
region beginning from the starting of QRS-complex and ending at the end of T wave is
known as QT interval. Normal duration of QT interval is less than 440ms.
Specifically ECG is used to detect abnormality in heart rhythm. In medical terminology
this problem is called arrhythmia.In arrhythmia disease, heart can beat too slowly
(bradycardia) or too fast (tachycardia), in short shows an irregular pattern (fibrillation).
Figure 2(a), 2(b) and 2(c) shows the diagrammatical representation of normal heartbeat,
bradycardia and tachycardia.
Figure 2(a): Normal heartbeat Figure 2(b): Bradycardia Figure 2(c): Tachycardia
Arrhythmia can be caused by imbalance of electrolyte in blood, coronary artery disease,
and change in heart muscles or injury from heart attack. When situation of arrhythmia
persists in body for long duration then it causes poor blood circulation in body which can
cause tiredness, lightheaded or death too. So it‘s necessary to detect the situation of
arrhythmia in early state [9, 10].
1.5 Motivation
From the above discussion, it can be concluded that invasive methods are very expensive,
complex and painful. Non-invasive method like ECG is not expensive and complex, but
still it is time consuming and sometime not able to diagnose the symptoms of CAD.
Clinical data alone is not an accurate and effective method to detect heart disease in
4. International Journal of Control and Automation
Vol. 12, No.5, (2019), pp. 558 - 573
561
ISSN: 2005-4297 IJCA
Copyright ⓒ 2019 SERSC
advance. So in this paper, Two-phase Heart Disease Diagnosis System using Deep
Learning has been proposed by combining the clinical data and ECG data to detect
disorder in heart. This system will help poor people and people living in remote areas to
detect heart disease in advance.
Paper outline is as follows: Review of literature about different methods of prior heart
disease detections and their classification are discussed in section 2. Section 3 covers the
detail of proposed work. Result and contributionare discussed in section 4. Conclusion is
given in section 5.
2. Literature review
In this section, techniques found in literature about detection and classification of heart
disease has been discussed.MKachuee et al. [11] have used ECG for precise classification
of heart beats. Authors have used deep convolutional neural network for categorization of
heartbeat in different arrhythmias classes. Authors have used MIT-BIH and PTB
Diagnostics dataset for training and validation purpose. Authors have judged 93.4%
average accuracy in detection of arrhythmias classes.S. Singh et al. [12] have used
recurrent neural network based long short term memory network (RNN LSTM) for
classification of different arrhythmia class from ECG signal. For training and validation
purpose, authors have used the MIT-BIH arrhythmia database. Authors have shown that
their proposed RNN LSTM model possess 88.1% accuracy which is better than other
models found in literature. Authors have used five iterations and three hidden layers.
There are sixty-four, two hundred fifty six and hundred neurons in each hidden layer.
Moreover due to no data pre-processing, their proposed model was less complex. Authors
have also mentioned that by increasing the no. of epochs and increasing the no. of neurons
in the hidden layer, accuracy of model can be further increased.T. J. Jun et al. [13] have
used the two dimensional convolutional neural network to train arrhythmia prediction
model through ECG images. ECG images are fetched from MIT-BIH arrhythmia
database. Authors have used around 10000 ECG images having normal and arrhythmia
beats of eight types. Their model have achieved 99.05% accuracy and 97.85% sensitivity.
U. R. Acharya et al. [14] have discussed about the need of automated diagnosis of
coronary artery disease. Authors have developed a model for automated diagnosis of
CAD using convolutional neural network. Authors have tested the model for time
duration of 2 and 5 seconds on real ECG data and it has been found that their model
possess the 94.95% of accuracy.
F. Babic et al. [15] have analysed the different data set for preparation of heart disease
prediction data model. Data sets analysed by authors are ―Cleveland, Hungary,
Switzerland and Long Beach VA‖, ―Z-Alizadeh Sani Dataset‖ and ―South African heart
disease‖. Authors have used the support vector machine (SVM), naïve bayes, neural
network and decision tree method for preparation of heart disease prediction model.
Authors have used three clinical data sets. In dataset 1, clinical parameters used were
resting blood pressure, serum cholesterol level,age, sex, chest pain type, fasting blood
sugar and resting ecg result. In dataset 2, clinical parameter used were age, systolic blood
pressure, obesity, family history, body fat percentage, tobacco and alcohol consumption.
While in dataset 3, clinical parameters used were age, pulse rate, obesity, haemoglobin
level, white blood cell count and fasting blood sugar level. Authors have recorded neural
network method giving the highest accuracy of 89.93% on first data set. In the second
data set, relatively small number of clinical parameters were used. This resulted in less
accuracy with all methods in comparison to data set 1. While SVM has given the highest
accuracy of 86.67% on data set 3. L. Verma et al. [16] have designed a hybrid model for
identification of heart disease. Authors have taken the clinical data from cardiology
department of IGMC Shimla, HP, India. Data was populated from 335 patients from
twenty-six attributes. Authors have pre-processed the data through correlation and feature
subset selection method like particle swarm optimization. After pre-processing of data,
5. International Journal of Control and Automation
Vol. 12, No.5, (2019), pp. 558 - 573
562
ISSN: 2005-4297 IJCA
Copyright ⓒ 2019 SERSC
authors have formed the model using four different methods named: Decision tree,
multilayer perceptron, fuzzy unordered rule induction approach and multinomial logistic
regression. Authors have recorded that multinomial logistic regression have shown the
highest accuracy of 88.4% among all the four methods. Authors have also applied their
methodology on standard Cleveland heart disease data set. J. wang et al. [17] have
developed a prediction model for risk assessment of coronary artery disease. Cause of
coronary artery disease is Breast arterial calcifications (BAC). It can be detected through
analysis of mammography images. Authors have developed a model using 12 layer
convolution neural network to detect BAC in coronary artery disease. Authors have used
840 digital mammograms from 210 cases to train the model. These mammograms images
were collected from 9 Kaiser Permanente of Northern California facilities from 23
different machines.K. Srinivas et al. [18] have used and compared the artificial neural
network, naive bayes and decision tree techniques for designing of heart disease
prediction model. It has been recorded by the authors that decision tree has outperformed
the other techniques. Beside the standard attributes for prediction of heart attack, authors
have also considered other factors like stress, financial status, pollution and past medical
history of patient. K. C. Lin et al. [19] have discussed the importance of feature selection
from a given dataset. Suitable feature selection will improve the quality and accuracy of
the model. Feature selection is a kind of combination optimization problem. There are
many evolutionary algorithms which can be used for optimum feature selection process.
Authors have developed a hybrid algorithm for feature selection by combining artificial
bee colony and particle swarm optimization algorithms. Authors have tested the proposed
feature selection algorithm on UCI medical dataset with support vector machine
approach. D. Pal et al. [20] have discussed about the challenges involved in early
detection of heart disease. Authors have formed a rule based model to detect heart disease
in advance. Rules have been formed through doctor advice and concept of fuzzy logic has
been used fuzzification of clinical data. R. Alizadehsani et al. in [21] have discussed about
the complications and cost involved in different invasive methods of heart disease
detection. Authors have investigated feature and rule based classifier for heart disease
detection using Z-Alizadeh Sani dataset. Authors have used data mining techniques along
with ten-fold cross validation namely sequential mining optimization, naïve bayes,
support vector machine, K-nearest neighbour and C4.5. It has been observed that
sequential mining optimization algorithm have shown the highest sensitivity and accuracy
among all tested algorithms.
3. Proposed System
Proposed model presents a system that first use the clinical data to identify the chances of
cardiovascular problems. In case of positive chances, the ECG signals are used to classify
heart rhythm for diagnosing the particular type of heart disease. In this integrated
approach, deep neural network based methods are utilized and results confirm the
robustness of the proposed model. Figure 3 shows the design of the proposed model.
6. International Journal of Control and Automation
Vol. 12, No.5, (2019), pp. 558 - 573
563
ISSN: 2005-4297 IJCA
Copyright ⓒ 2019 SERSC
Figure 3: Proposed Two-phase Heart Disease Diagnosis Model
Steps of the proposed system are as follows:
1. First of all clinical data of patient is analysed using model developed in phase 1.
2. If outcome of model is yes then ECG analysis of patient will be done through
model developed in phase 2 to identify the class of arrhythmia otherwise no need
of ECG analysis.
3. Based on arrhythmia class, severity of heart disease is detected by heart disease
expert doctor.
3.1Phase I: Deep Learning Based Heart Disease Diagnosis using Clinical Data
3.1.1 Deep Learning
Deep learning was developed from artificial neural network, and now it is a prevalent
field of machine learning. Traditional artificial neural networks (ANNs)& Deep learning
are different only by the number of hidden layers, the connections between them and their
learning capability for abstractions of inputs. Deep learning models usually adopt
hierarchical structures to connect their layers. The output of a lower layer can be regarded
as the input of a higher layer. These models can transform low-level features of the data
into high level abstract features. Recently deep learning has a lot of attention from
researchers because of its performance and accuracy, and more precisely, its power of
feature extraction [22].
Deep learning uses architecture of neural network. The word Deep symbolize the no. of
hidden layers in neural network. A normal neural network have two three hidden layers
whereas in deep neural network, it can go up to 140. It uses huge set of labelled data
along with neural network architecture to train deep learning model. There is no need of
manual feature extraction to learn features. Figure 4 shows the abstract view of working
of deep neural network.
7. International Journal of Control and Automation
Vol. 12, No.5, (2019), pp. 558 - 573
564
ISSN: 2005-4297 IJCA
Copyright ⓒ 2019 SERSC
Figure 4: Deep Neural Network Working Model
It consist of input layer, which is followed by several hidden layers and at the end, there is
one output layer. Innermost layer aggregate features from all the previous layers. So
innermost layer identifies the most complex feature. Each layer includes multiple neurons.
On receiving input, neuron performs a weighted addition over its input and activation
function is applied over the input to produce the output. Neuron of each subsequent layer
repeat the same process of assigning weighted addition and applying of activation
function. Output of the last layer/output layer represents the prediction of the model. To
identify the correctness of the model, a loss function is used. Loss function calculate the
difference between true value and predicted value. This difference is called error rate and
it is back propagated to reduce the error at every layer. This process of training the deep
neural network is repeated until error rate goes below a desired value. Figure 5 shows the
training mechanism of deep learning model [22].
Figure 5: Deep Learning Training Mechanism
3.1.2Model Construction and Learning Schemes
Pre-processing of the data was carried out usingfeature subset selection with Particle
Swarm Optimization (PSO) Search method [23].The PSO algorithm works by
concurrently keeping numerouspossible solutions in the search space. In every execution
8. International Journal of Control and Automation
Vol. 12, No.5, (2019), pp. 558 - 573
565
ISSN: 2005-4297 IJCA
Copyright ⓒ 2019 SERSC
of the algorithm, one possible solution is calculated by the objective function being
optimized, finding the fitness of that solution. Everypossible solution can be considered as
a particle ―flying‖ over the fitness landscape searching the minimum or maximum of the
objective function.Then models created with supervised learning were validated with ten-
fold cross validation method. The performance measures were recorded. Steps for model
construction are summarized below in figure 6.
Stage 1 : Data preprocessing
Reducing dimensionality using Correlation based feature subset selection
using PSO search
Stage 2 : Construction of Model and validation
( 10 fold cross validation)
Stage 3 :Performance measure
Figure 6: Steps for Model construction
3.1.3 Dataset Description
Cleveland Heart disease [24] data set is obtained from one of the most popular repository
of the University of California at Irvine. It consists of features like Gender, Age, Type of
chest pain, Resting electrocardiographic outcome, Serum cholesterol, Maximum heart rate
achieved, Fasting blood sugar, blood pressure (Resting) on admission, Exercise induced
angina, Exercise induced angina, ST depression induced by exercise related to rest, No. of
fluoroscopy colored vessel, Slope of the peak exercise ST Segment, Thal and result of
Angiography as a deciding factor for CAD. Description of data set with values has been
given in table 1.
Table 1: Description of dataset with statistical values
Features Description Range
Min
Max
Mean Standard
Deviation
Age Age (in yrs) 20 77 55.43 9.03
Sex 0-female, 1-male 0 1 0.68 0.46
Cp Chest pain types
1. typical Angina
2. atypical angina
3. non-angina pain
4. asymptomatic
1 4 3.15 0.96
Trestbps blood pressure (resting) on admission. 90 200 131.69 17.6
Chol Serum cholesterol mg/d 126 564 246.6 51.77
Fbs Fasting blood sugar > 120 mg/dl
0 – no
1- yes
0 0-1 0.149 0.356
Restecg Resting Electrocardiographic outcome
0. normal
1. having ST-T wave abnormality
2. showing probable or definite left
ventricular hypertrophy by Estes' criteria
0 0-2 0.99 0.995
Thalach Max heart rate achieved 71 202 149.60 22.8
Exang Exercise induced angina
0. no
1. yes
0 1 0.327 0.47
Old peak ST depression induced by exercise related 0 6.2 1.04 1.161
9. International Journal of Control and Automation
Vol. 12, No.5, (2019), pp. 558 - 573
566
ISSN: 2005-4297 IJCA
Copyright ⓒ 2019 SERSC
to rest
Slop Slope of the peak exercise ST Segment
1. upsloping
2. flat
3. down sloping
1 3 1.601 0.616
Ca No. of fluoroscopy colored vessels 0 3 0.672 0.937
Thal 3. normal
6. fixed defect
7. reversible defect
3 7 4.73 1.94
3.2. Phase 2: Deep Learning Based Heart Disease Diagnosis using ECG signals
3.2.1Gaussian Noise Injection and Gaussian Dropout based Regularized Deep
Neural Network
Deep Neural Networks are susceptible to over-fitting due to the large amounts of
parameters involved in the multiplicity of layers and the large number of nodes. The
training data consist of information regarding the regularities in the relationship from
input to output. However, there are always chances of sampling error in mapping. There
are the possibilities of some unintended regularities just because of the specific selected
training cases. At the time of learning, it is difficult to identify which regularities are
actual and which are occurred due to the sampling error. Therefore, it fits actual and false
both types of regularities. If the model is not robust, it learns the sampling error also. This
means the model will not generalize well to unseen data. The regularization of DNN can
be achieved in many ways, some the commonly used methods are:
Regularization with architecture: in this case of the size of hidden layers and the
total number of neurons per layer are limited.
Regularization with early stopping: in the early stopping learning initiate with
lesser weights and ends before overfitting.
Regularization with weight-decay: Penalize bulky weights by limitations or
penalties on their absolute values (L1 penalty) or squared values (L2 penalty).
Regularization with noise: Add noise to the weights or the activities.
Regularization with dropout: Dropout is a regularization way that estimates
learning an enormous number of neural networks with diverse architectures in
parallel. During learning, few number of layer outputs are randomly disregarded
or dropped out.
Usually, a combination of some of these methods is used for regularization of DNN. In
the proposed model Gaussian drop out layer and Gaussian noise layer is used for
regularization of DNN model.
Gaussian noise: Noise injection improves the generalization ability of a DNN, especially
in fully connected DNN layers. The Gaussian Noise can be used in variety of ways with
neural network model.
Firstly, to add noise in input variable, it can be utilized as input layer.
Secondly, it can also be utilized in between two hidden layer after or before the usage of
activation function.
Gaussian Dropout: main idea of dropout is to randomly turn-off some of the units in a
neural network on each iteration of the training together with all its input and output
connections, so that they are not affected by the gradient updates. Gaussian Dropout is a
combination of Dropout and 1-centered Gaussian noise; the rate specifies the percentage
of units to be dropped, and the standard deviation of the noise is calculated as:
𝑠𝑞𝑟𝑡(𝑑𝑟𝑜𝑝𝑜𝑢𝑡_𝑟𝑎𝑡𝑒 / (1 — 𝑑𝑟𝑜𝑝𝑜𝑢𝑡_𝑟𝑎𝑡𝑒))
10. International Journal of Control and Automation
Vol. 12, No.5, (2019), pp. 558 - 573
567
ISSN: 2005-4297 IJCA
Copyright ⓒ 2019 SERSC
Gaussian Noise:
Adding noise is another way to prevent a neural network from ‗learning‘ the training data.
Noise is a matrix containing small random values (different on each training iteration),
which are added to the outputs of a layer. This way consequent layers will not be able to
co-adapt too much to the outputs of the previous layers. Gaussian Noise is added as noise
layer, which adds zero-centered noise, with specified standard deviation.
3.2.2ECG Data Base:
There are numerous heartbeat databases available for arrhythmia classification in the
literature. This work utilizes one of the widely acceptable MIT-BIH arrhythmia dataset
(MADS) [9] which has been used for evaluating arrhythmia detection and classifying the
arrhythmia types. MADS contains 48 long-term ECGs from 25 male aged 32–89 years,
and 22 females aged 23–89 years; each has 11-bit resolution with sampling frequency of
360 Hz. These heartbeats are labelled as five key arrhythmia categories defined by the
Association for the Advancement of Medical Instruments (AAMI) standard. AAMI
categorizes heartbeats into five group namely normal beats(𝑁), supraventricular ectopic
heartbeats(𝑆), ventricular ectopic heartbeats(𝑉), fusion heartbeats(𝐹), and unknown
heartbeats(𝑄). The description of the heartbeats from the MADB are given in Table 2.
Table 2: Classes of heartbeats available in the MIT-BIH database
Group Annotations Class
(𝑁)
Non-ectopic beats or
normal beats, Any
heartbeat not
categorized as 𝑆, 𝑉, 𝐹
and 𝑄 type
𝑁 𝑜𝑢. Normal heartbeat
𝐿 Left bundle branch block heartbeat
𝑅 Right bundle branch block heartbeat
𝑒 Atrial escape heart beat
𝑗 Nodal (junctional) escape heartbeat
(𝑆)
Supraventricular ectopic
heartbeats
𝐴 Atrial premature heartbeat
𝑎 Aberrated atrial premature heartbeat
𝑗 Nodal (junctional) premature heart beat
𝑠 Supraventricular premature heartbeat
(𝑉)
Ventricular ectopic
heartbeats
𝑉 Premature ventricular contraction
heartbeat
𝐸 Ventricular escape heartbeat
(𝐹) Fusion heartbeats
𝐹 Fusion of ventricular and normal
heartbeat
(𝑄) Unknown heartbeats
𝑃 𝑜𝑢 / Paced heart beat
𝑓 Fusion of paced and normal heartbeat
𝑈 Unclassifiable heartbeat
This heart beat database has been pre-processed for extracting beats. The pre-processing steps
consist of splitting of ECG signals, normalization of amplitude, identification of R-peaks using local
maxima, finding the median of R-R intervals, and selection of signals parts followed by padding if
required. All types of heart beats are plotted in figure 7.
11. International Journal of Control and Automation
Vol. 12, No.5, (2019), pp. 558 - 573
568
ISSN: 2005-4297 IJCA
Copyright ⓒ 2019 SERSC
(a)
(b)
(c)
12. International Journal of Control and Automation
Vol. 12, No.5, (2019), pp. 558 - 573
569
ISSN: 2005-4297 IJCA
Copyright ⓒ 2019 SERSC
(d)
(e)
Figure 7(a-e): sample heartbeats for each group
4 Results
In phase 1, model for heart disease detection using clinical data was developed. The
models were constructed using Cleveland Heart Disease data set gathered from UCI
Machine repository [24]. Dimensionality of the data set is reduced using PSO method.
The most influential risk factors identified to predict the CAD are CP, Thalach, Exang,
oldpeak, slope, CA, Thal. Deep learning based method achieved the highest prediction
accuracy of 97.18% with mean squared error as low as 2.33%. The results are presented
in Table 3. Change in accuracy by the increase of epochs has been shown in figure 8.
Results shown in table 3 and figure 8 shows the accuracy of phase 1 model while finding
the heart disease from clinical data.
Table 3: Performance Measures
Class 𝐏𝐫𝐞𝐜𝐢𝐬𝐢𝐨𝐧 𝐑𝐞𝐜𝐚𝐥𝐥 𝐟 − 𝐬𝐜𝐨𝐫𝐞
0 0.98 0.97 0.97
1 0.97 0.98 0.97
Average 0.97 0.97 0.97
13. International Journal of Control and Automation
Vol. 12, No.5, (2019), pp. 558 - 573
570
ISSN: 2005-4297 IJCA
Copyright ⓒ 2019 SERSC
Figure8: Accuracy of the Proposed Model
In the phase 2 of the proposed model, model for heart disease classification has
developed. Two separate three layer DNN architectures are designed for heart beat
classification. In the first model, the usual DNN layers are used while in the second model
Gaussian noise is injected including the Gaussian drop out layers. A sequential model is
used for designing of these models. All three layers are the dense layers consisting of 100,
100 and 5 neurons in that order. All nodes of the current layer connect to the nodes of the
previous layer in a dense layer. The first dense layer acts as input layer, the second dense
layer woks as hidden layer and the last layer presents the outputs. Rectified Linear
Activation or ReLU is used as the activation function. ReLU has two advantages first It is
fast and It does not agonize from the vanishing gradient problem. The models are
compiled by deciding two main parameters optimizer and loss. The optimizer controls the
learning rate. The stochastic gradient descent (sgd) is used as an optimizer with a suitable
learning rate and momentum. When training input is very bulky, gradient descent is
relatively lazy to converge. ‗sgd‘ is the favoured variation of gradient descent which
computes the gradient from a lesser sample of randomly chosen training input in each
iteration called mini-batches.The values 0.01 and 0.9 are used as learning rate and
momentum respectively. The model is trained to minimize binary cross entropy. The
models are trained with 100 epochs, with a validation dataset of 20% of training data size.
After learning, training and validation accuracies are plotted over the training epochs. In
the first DNN model a regular dropout layers are used after first and second layer with
dropout rate of 0.2 in each case. A combination of the Gaussian noise and Gaussian
dropout is used in second DNN model. The Gaussian noise of 0.1 standard deviation and
zero mean is added to the linear output of first two dense layers. Gaussian dropout with
rate 0.1 follows each of these layers.
The goal of the any learning algorithm is good fit and it falls between an under-fit and
over-fit model. A model is considered well learned if the training and validation
accuracies that reaches to a stage of stability with a minimal gap among them.
A plot of accuracy during the learning for training and validation samples over training
epochs are given in Figure 9 and Figure 10. Both models shows good fitting, however it is
evident from the plots in Figure 10 the impact of the added noise that Gaussian dropout
based and Gaussian noise injected model is better choice than regular dropout based
regularized DNN model.
14. International Journal of Control and Automation
Vol. 12, No.5, (2019), pp. 558 - 573
571
ISSN: 2005-4297 IJCA
Copyright ⓒ 2019 SERSC
Figure 9: Accuracy curves for DNN model
Figure 10: Accuracy curves for Gaussian Noise Injection and Gaussian Dropout based
Regularized DNN model
To confirm the performance of DNN models precision, recall, f-score, Mean Absolute
Error (MAE) and accuracy are calculated. The low value of MAE and high values of
other performance metrics shows the efficiency of models.
The overall accuracy for the first model is 98.9 % whereas in case second model the
overall accuracy is 99.2%. The analysis of these values clearly shows the Gaussian
injected and Gaussian drop out based DNN achieves higher performance than the regular
drop out based DNN. Moreover, one of the finest model available in literature have
achieved 93.4 % average accuracy using Deep Residual Convolution Neural Network
[25] which is inferior to the proposed model.
Table 4 shows the comparison of performance metrics for the deep neural network with
regular dropout and Gaussian noise injection based regularized deep neural network.
15. International Journal of Control and Automation
Vol. 12, No.5, (2019), pp. 558 - 573
572
ISSN: 2005-4297 IJCA
Copyright ⓒ 2019 SERSC
Table 4: Performance metrics for the models
ECG Class
Deep Neural Network with
Regular Dropout layer
Gaussian Noise Injection and
Gaussian Dropout based
Regularized Deep Neural Network
𝐏𝐫𝐞𝐜𝐢𝐬𝐢𝐨𝐧 𝐑𝐞𝐜𝐚𝐥𝐥 𝐟 − 𝐬𝐜𝐨𝐫𝐞 𝐏𝐫𝐞𝐜𝐢𝐬𝐢𝐨𝐧 𝐑𝐞𝐜𝐚𝐥𝐥 𝐟 − 𝐬𝐜𝐨𝐫𝐞
N 0.98 1 0.99 0.98 1 0.99
S 0.9 0.63 0.74 0.92 0.67 0.77
V 0.94 0.92 0.93 0.98 0.89 0.94
F 0.9 0.6 0.72 0.8 0.67 0.73
Q 0.99 0.96 0.97 1 0.96 0.98
Average 0.97 0.97 0.97 0.98 0.98 0.98
MSE 0.034 0.028
AverageAccuracy 0.989 0.992
4. Conclusion
Heart disease detection tests are usually costly, painful and not available at all places.
This needs to design an integrated system that use the clinical data to detect heart disease
symptoms prior to specific test. This work has offered a method that confirms the
arrhythmia heart disease in two phases. In the first phase, the usual clinical data is used to
recognise the chances of cardiovascular problems. Later in the second phase which is
required only in case of positive signal from first phase, the ECG signals are used to
classify heart rhythm for diagnosing the particular type of arrhythmia. Both systems
depend on robust deep learning models for classification. The proposed system eliminates
the need of specific tests related to heart disease for all the patients. Only those patents,
having symptoms in regular test will be advised to go for specific test. This eliminates the
need of costly painful specific heart disease test for all the patents. Moreover, such a
system reduces the human intervention through automation of heart disease detection
process which further reduces the chances of human error.
As a future scope of this work, by using the ECG sensor with proposed system, a portable
model can be developed which can be used in remote area where medical facilities are not
available.
Acknowledgement
This research was supported under the UPES-SEED scheme with the project ID:
UPES/R&D/300119/13 titled ‗Smart ECG monitoring system to diagnose cardiovascular
disease‘ for the period of 2019-20 from the University of Petroleum and Energy Studies,
Dehradun, INDIA.
References
[1] https://www.who.int/news-room/fact-sheets/detail/cardiovascular-diseases-(cvds) as on 17-
08-19.
[2] Weng, S. F., Reps, J., Kai, J., Garibaldi, J. M., & Qureshi, N. (2017). Can machine-learning
improve cardiovascular risk prediction using routine clinical data? PloS one, 12(4),
e0174944. F.
[3] Verma, L., Srivastava, S., & Negi, P. C. (2018). An intelligent noninvasive model for
coronary artery disease detection. Complex & Intelligent Systems, 4(1), 11-18.
[4] https://www.heart.org/en/health-topics/heart-attack/diagnosing-a-heart-attack/noninvasive-
tests-and-procedures as on 17-08-19
[5] Bampi, A. B. A., Rochitte, C. E., Favarato, D., Lemos, P. A., & Luz, P. L. D. (2009).
Comparison of non-invasive methods for the detection of coronary atherosclerosis. Clinics,
64(7), 675-682.
[6] https://www.heart.org/en/health-topics/heart-attack/diagnosing-a-heart-attack/invasive-tests-
and-procedures as on 17-08-19
16. International Journal of Control and Automation
Vol. 12, No.5, (2019), pp. 558 - 573
573
ISSN: 2005-4297 IJCA
Copyright ⓒ 2019 SERSC
[7] Maisch, B., Pankuweit, S., Karatolios, K., &Ristić, A. D. (2006). Invasive techniques—from
diagnosis to treatment. Rheumatology, 45(suppl_4), iv32-iv38.
[8] Martis, R. J., Acharya, U. R., Mandana, K. M., Ray, A. K., & Chakraborty, C. (2012).
Application of principal component analysis to ECG signals for automated diagnosis of
cardiac health. Expert Systems with Applications, 39(14), 11792-11800.
[9] https://www.emedicinehealth.com/electrocardiogram_ecg/article_em.htm#what_is_an_electr
ocardiogram_ecg_ekg as on 17-08-19
[10] https://www.cvphysiology.com/Arrhythmias/A009.htm as on 17-08-19
[11] Kachuee, M., Fazeli, S., &Sarrafzadeh, M. (2018, June). Ecg heartbeat classification: A deep
transferable representation. In 2018 IEEE International Conference on Healthcare Informatics
(ICHI) (pp. 443-444). IEEE.
[12] Singh, S., Pandey, S. K., Pawar, U., &Janghel, R. R. (2018). Classification of ECG
arrhythmia using recurrent neural networks. Procedia computer science, 132, 1290-1297.
[13] Jun, T. J., Nguyen, H. M., Kang, D., Kim, D., Kim, D., & Kim, Y. H. (2018). ECG
arrhythmia classification using a 2-D convolutional neural network. arXiv preprint
arXiv:1804.06812.
[14] Acharya, U. R., Fujita, H., Lih, O. S., Adam, M., Tan, J. H., & Chua, C. K. (2017).
Automated detection of coronary artery disease using different durations of ECG segments
with convolutional neural network. Knowledge-Based Systems, 132, 62-71.
[15] Babič, F., Olejár, J., Vantová, Z., &Paralič, J. (2017, September). Predictive and descriptive
analysis for heart disease diagnosis. In 2017 Federated Conference on Computer Science and
Information Systems (FedCSIS) (pp. 155-163). IEEE.
[16] Verma, L., Srivastava, S., & Negi, P. C. (2016). A hybrid data mining model to predict
coronary artery disease cases using non-invasive clinical data. Journal of medical systems,
40(7), 178.
[17] Wang, J., Ding, H., Bidgoli, F. A., Zhou, B., Iribarren, C., Molloi, S., &Baldi, P. (2017).
Detecting cardiovascular disease from mammograms with deep learning. IEEE transactions
on medical imaging, 36(5), 1172-1181.
[18] Srinivas, K., Rao, G. R., &Govardhan, A. (2010, August). Analysis of coronary heart disease
and prediction of heart attack in coal mining regions using data mining techniques. In 2010
5th International Conference on Computer Science & Education (pp. 1344-1349). IEEE.
[19] Lin, K. C., & Hsieh, Y. H. (2015). Classification of medical datasets using SVMs with hybrid
evolutionary algorithms based on endocrine-based particle swarm optimization and artificial
bee colony algorithms. Journal of medical systems, 39(10), 119.
[20] Pal, D., Mandana, K. M., Pal, S., Sarkar, D., & Chakraborty, C. (2012). Fuzzy expert system
approach for coronary artery disease screening using clinical parameters. Knowledge-Based
Systems, 36, 162-174.
[21] Alizadehsani, R., Hosseini, M. J., Boghrati, R., Ghandeharioun, A., Khozeimeh, F., & Sani,
Z. A. (2012). Exerting Cost-Sensitive and Feature Creation Algorithms for Coronary Artery
Disease Diagnosis. International Journal of Knowledge Discovery in Bioinformatics
(IJKDB), 3(1), 59-79.
[22] Jain, A., Tiwari, S., & Sapra, V. (2018).Hands-on Deep Learning with Python Programming.
LAP LAMBERT Academic Publishing. ISBN: 978-6139915514.
[23] Kennedy, J. (2010). Particle swarm optimization. Encyclopedia of machine learning, 760-
766.
[24] https://archive.ics.uci.edu/ml/datasets/heart+Diseaseas on 17-08-2019.
[25] Xie, S., Girshick, R., Dollár, P., Tu, Z., & He, K. (2017). Aggregated residual transformations
for deep neural networks. In Proceedings of the IEEE conference on computer vision and
pattern recognition (pp. 1492-1500).