0% found this document useful (0 votes)
145 views9 pages

Cardiac Arrhythmia Detection Using Deep Learning

The document discusses using deep learning techniques to detect cardiac arrhythmias from electrocardiogram (ECG) data. Specifically, it proposes applying a deep learning framework trained on general images to classify patient ECGs into different cardiac conditions. The methodology involves preprocessing ECG data, extracting features directly from the data using convolutional neural networks, and classifying rhythms into normal, premature ventricular contraction, atrial fibrillation, or other types. The goal is to develop an accurate, easy-to-use system for automatic ECG arrhythmia detection.

Uploaded by

Revati Wable
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
145 views9 pages

Cardiac Arrhythmia Detection Using Deep Learning

The document discusses using deep learning techniques to detect cardiac arrhythmias from electrocardiogram (ECG) data. Specifically, it proposes applying a deep learning framework trained on general images to classify patient ECGs into different cardiac conditions. The methodology involves preprocessing ECG data, extracting features directly from the data using convolutional neural networks, and classifying rhythms into normal, premature ventricular contraction, atrial fibrillation, or other types. The goal is to develop an accurate, easy-to-use system for automatic ECG arrhythmia detection.

Uploaded by

Revati Wable
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Cardiac Arrhythmia Detection Using Deep Learning

Revati Vilas Wable


Department of Information Technology, National Institute of Technology Raipur
G.E. Road, Raipur, Chhattisgarh-492010, India
[email protected]

● ABSTRACT :
For the assessment of cardiac arrhythmias in clinical routine we can use an electrocardiogram or (ECG) as
an important diagnostic tool. By applying the deep learning framework trained on a general image set is
transferred to carry out automatic ECG arrhythmia diagnostics by classifying patient’s ECG into
corresponding cardiac conditions. The aim of this paper is to implement a simple, reliable and easily
applicable deep learning framework (as mentioned above) to carry out automatic ECG arrhythmia
diagnostics by classifying patient’s ECG into corresponding cardiac conditions.

● INTRODUCTION :
Cardiac arrhythmia occurs when electrical impulses in the heart don't work properly. There may be no
symptoms or symptoms like a fluttering in the chest, chest pain, fainting or dizziness. If required, treatment
includes anti-arrhythmic drugs, medical procedures, implantable devices and surgery. There is a wide range
of things that can lead to or cause an arrhythmia like health issues such as sleep apnea, diabetes, stress, high
blood pressure, and thyroid problems. Heart diseases like cardiomyopathy and coronary artery disease can
cause heart rhythm problems. Smoking, drinking and drug abuse can also result in rhythm complications.

Fig1
The above pictures demonstrate how a normal heart functions v/s how a person’s heart diagnosed with
cardiac arrhythmia functions. Electrocardiogram (ECG) is used to diagnose cardiac arrhythmia. This test uses
a monitor with electrodes attached to your body to measure your heart's electrical activity for a short time.

1
Electrophysiology study includes a catheter-based test that assesses serious arrhythmias by recording your
heart's electrical activity from the inside. It is an established technique in cardiology for the analysis of
cardiac conditions of the patients. The rhythm of the heart in terms of beats per minute (bpm) can be easily
calculated by counting the R peaks (as observed in the previous diagram) of the ECG wave during one
minute of recording. More importantly, rhythm and the morphology of the ECG waveform is altered by
cardiovascular diseases and abnormalities such as cardiac arrhythmias. Where, normal beats are healthy adult
human ECG waveform; paced beats are artificial beats from the device called pacemaker; and RBBB is an
arrhythmia that is frequently associated with ischemic, hypertensive, rheumatic and pulmonary heart disease,
right ventricular hypertrophy and some drug intoxication which has a ECG waveform with QRS duration
between 0.10 and 0.11 sec (incomplete RBBB) or 0.12sec or more (complete RBBB), prolonged ventricular
activation time or QR interval (0.03sec or more) and right axis deviation. However, apart from these the
system can also be easily adapted to further classify other various similar cardiac arrhythmias. [1]

● LITERATURE REVIEW :
Although most of the conventional pattern recognition techniques have been previously applied successfully
to the ECG arrhythmia detection tasks, recent state-of-the-art performances obtained by deep learning
methods encouraged researchers to implement these techniques to the field of medical image and signal
processing. Application of deep learning methods even to the most complex medical pattern recognition
tasks proved to be very promising. In general, extracting highly representative features from the data in hand
has the most significant impact on the performance of computerized classification/recognition systems.
However, this being a time-consuming process requires expert knowledge and often selected features fail to
be robust with respect to the variations in the data. When compared to conventional classification methods,
CNNs automatically learn representative complex features directly from the data itself, thus the need for
handcrafting features to represent the data effectively is eliminated.

(PVC morphologies found in various ECGs)

In one of the recent studies a deep neural network was proposed to recognize premature ventricular
contraction (PVC) beats from ECG recordings with six hidden layers is trained by feeding six different
features extracted from ECGs to carry out the classification between normal and PVC beats. Although, a
deep neural network is used authors still preferred handcrafting their own features from the ECG data.
In 2016, a deep convolutional neural network was trained to extract features directly from raw ECG signals
and to carry out the classification between two cardiac conditions i.e normal beats and paroxysmal atrial
fibrillation.

2
(ECG signals for detection of Atrial Fibrillation)

One of the drawbacks of training a deep convolutional neural network from scratch is the need for a quite
large labeled training dataset size to obtain improved network performance by making the network deeper
i.e. increasing the number of convolutional layers. Despite this, increasing the depth of the network will also
increase the computation cost during training due to the increase in complex convolutional operations
throughout deep convolutional layers. Thus, powerful GPU powered computers are required for such training
tasks. [2]

● METHODOLOGY / COMPARATIVE STUDY :


Various approaches/methods/steps are applied to solve the ECG pattern recognition and classification
problem. This is an emerging area of research where pattern recognition methodologies play a leadership role
and can tremendously benefit from the immense knowledge accumulated on the ECG features in other
applications. The aim of pattern recognition methods is to assign each individual heartbeat to its specific
class or to detect a patient’s pathology using the information contained in features that can be measured (for
eg: age, gender, standard deviation of R-R intervals, etc.). It is commonly recognised that pattern recognition
methods are based on three main concepts: feature extraction/selection/transformation, classification and
training. While classification and training can be considered well defined areas and many algorithms have
been proposed for selection/transformation of features, extraction of features more appropriate for a specific
field of research cannot be given a general formulation independent of the specific application area. [3]

3
(Block diagram of the ECG arrhythmia classification operation)

1. ECG Data (Acquization) :


The ECG signal is simultaneously observed at three different level of focus by means of the Wavelet Transform
(WT). The types of beat being selected are normal (N), premature ventricular contraction (V) which is often
precursor of ventricular arrhythmia, two of the most common class of supra-ventricular arrhythmia (S), named
atrial fibrillation (AF), atrial flutter (AFL), and normal rhythm (N). Both MLII and V1 derivations are used. Run
time classification errors can be detected at the decoding stage if the classification of each derivation is different.
These pulses are selected for a posterior physician analysis. Experimental results were obtained in real data from
MIT-BIH Arrhythmia Database and also in data acquired from a developed low-cost Data-Acquisition System.
All the waveforms present in these recordings are annotated by expert cardiologists.

4
Each of these records has a sample frequency of 360Hz and contains two leads (two signals recorded from
different angles on chest). As a final step, one of the channels is removed and only one channel for each
recording is used for the rest of the system (channel MLII). In the end of this part a total of 214 waveforms (as 3
separate recordings each representing a normal, rbbb and paced waveform class) for training and 202 waveforms
for testing are prepared ready for next step which is signal pre-processing or simply pre-processing.

2. Pre-Processing :
This step is focused on removing noise from ECG recordings. ECG data obtained from MIT-BIH database is not
expected to contain as much disruptive noise as an ECG data obtained directly from a patient, it still contains
some noise which requires attention to improve the subsequent steps of the system. Firstly, mean removal is
applied to remove the dc noise present in the ECG signals by subtracting the mean of the ECG recording from
every sample point, the unwanted dc component is removed and the signal baseline amplitude is pulled back to
level zero. Due to depressing high frequency interference of the ECG signals, low pass filters preprocesses ECG
signals. It proposes a QRs complex detection method based on wavelet transform. After the removal of high
frequency noise, the next step is to remove low frequency noise components. This low frequency noise is
removed by a derivative based (high pass) filter, which passes high frequencies but attenuates low frequencies
and is thus applied to all ECG recordings.

5
All of the steps mentioned above are applied to all training and testing ECG records and filtered ECG signals are
obtained ready for the next i,e QRS detection step. [4]

3. QRS Detection :
It is the most striking waveform within the ECG as it reflects the electrical activity within the heart during the
ventricular contraction, the time of its occurrence as well as its shape provide valuable information about the
current state of the heart. In that sense, QRS detection provides the fundamentals for almost all automated ECG
analysis algorithms. The ECG waveform contains, in addition to the QRS complex, P and T waves, 60-Hz noise
from powerline interference, EMG from muscles, motion artifact from the electrode and skin interface, and
possibly other interference from electrosurgery equipment in the operating room. Many clinical instruments such
as a cardiotachometer and an arrhythmia monitor require accurate real-time QRS detection. It is necessary to
extract the signal of interest, the QRS complex, from the other noise sources such as the P and T waves.

( Representation of the relative power spectra of the ECG, QRS complexes, P and T waves, motion artifact, and muscle noise)

QRS complex detection algorithm has been studied for decades, two major methods of study being hardware and
software methods classified by the way of realization, of which hardware methods are, according to literature, far
less flexible and convenient, so that software methods are under more discussion. [5]

4. Feature extraction using transferred deep learning :


The first step for our model is to leverage a pre trained DCNN model, using principles of transfer learning to
extract the right features from our source images. To keep things simple, we will not be fine-tuning or connecting
the VGG-16 model to the rest of our model architecture. For the proposed ECG classification system, the outputs
of the deeper layers of the pre-trained AlexNet can be extracted as features for the given ECG inputs.
Unfortunately, the AlexNet accepts 256x256 sized RGB images as input where the remaining ECG waveforms
after the previously explained steps are discrete signals with 200 sample points.To solve this, all training and
testing data are converted into 256x256 sized binary images. Each image representing a single ECG waveform is
then reproduced three times to imitate an RGB image.

6
After the ECG signals are converted into 256x256x3 sized images representing R-T intervals, they are fed into
the pre-trained AlexNet and the outputs of the 6th and 7th fully connected layers of the AlexNet are extracted as
features representing our R-T segment images for the three different cardiac conditions.
Since the fully connected layers of the AlexNet contains 4096 neurons each, this procedure will result in 4096
features for each input ECG waveform that will enable accurate ECG arrhythmia classification.

(graphical representation of R-T intervals of all training ECG data) (graphical representation of R-T intervals of all testing ECG data)

All these obtained features are then ready for the next classification step. As the ECG data in hand is
investigated, it can be observed that the features that clearly distinguish each class (normal, rbbb and paced) lies
between the R-T interval.We will be extracting the bottleneck features from all our images beforehand to speed
up training later, since building a sequence model with several LSTMs will take a lot of training time even on
GPUs, as we will see shortly. [6]

5. Classification :
The multilayer perceptron neural network classifier is used to classify the four types of ECG beats namely:
normal beat, congestive heart failure beat, ventricular tachyarrhythmia beat, and atrial fibrillation beat. These
networks are trained using scaled conjugate gradient back-propagation algorithm.

(ECG classification using CSA features)

7
The first network i.e (N-Fc6) takes the output of the 6th fully connected layer of AlexNet as inputs (as mentioned
earlier), the second one i.e (N-Fc7) takes the output of the 7th layer, and the third network i.e (N-tst) takes 200
samples of the R-T intervals directly as inputs without any deep learning feature extraction. Additionally, each of
these networks are trained using different number of hidden layer neurons and the best performing hidden layer
neuron numbers are fixed for the final tests. Output layer neuron number is also fixed as three neurons. As the
final step, output vectors are formed as shown in Table 1 and the training of the networks are carried out using
the default settings of the Matlab`s neural network pattern recognition application. Accompanying each record in
the MIT-BIH database there is an annotations file in which each heartbeat has been identified by expert
cardiologist annotators. This annotated information is employed for designing the corresponding target vector for
each R-T segment and also used for evaluating the classifier performance. [7]

● RESULT ANALYSIS :
ECG Data obtained from the mentioned MIT-BIH database are pre-processed, followed by QRS complexes
detection and features in R-T intervals were extracted. After all these steps, three different networks that use
these different features as inputs were designed, trained, tested and evaluated for pattern recognition and
classification of ECG signals for three different cardiac conditions. When all of the tested networks were
evaluated it was found that networks based on transferred deep learning feature extraction (N-Fc6 and
N-Fc7) obtained almost 100% recognition rates and accuracies above 95% in the training phase. For this
reason it is not found necessary to change any parameters like maximum epochs, error limits or learning
rates. When compared, the network that is not based on deep learning (N-tst) obtained 90-92% recognition
rate and accuracy of around 89-90% in the training phase.

● CONCLUSION AND FUTURE ASPECTS :


In clinical routine, computer aided diagnosis of cardiac arrhythmias can reduce the workload of cardiologists
dramatically enabling them to focus more on treatment rather than diagnostics.
After the ECG records are acquired from the previously mentioned MIT-BIH arrhythmia database, they are
filtered from noises and QRS waves are detected to extract R-T segments of the ECG. Pre-trained AlexNet,
is transferred and used as a feature extractor for the ECG classification task in hand. The extracted features
are then fed into a simple back propagation neural network to classify the input ECG R-T segments into one
of the three cardiac conditions.
Obtained very high correct recognition rate (98.5%) and testing accuracy (around 91%) of the proposed
system demonstrated that the transferred deep learning feature extractor cascaded with a simple back
propagation neural network is an efficient automatic cardiac arrhythmia detection method. Additionally,
transferring a pre-trained deep CNN eliminates the need for high expertise and computational power required
for training a deep convolutional neural network from scratch.

8
● REFERENCES :

[1] Weatherspoon, Deborah. “News Letter.” Medical News Today, 28 02 2020,


https://www.medicalnewstoday.com/articles/8887#types. Accessed 08 12 2020.
[2] ScienceDirect. “ECG signal processing.” ScienceDirect, 11 2013,
https://www.sciencedirect.com/science/article/abs/pii/S0263224113002133. Accessed 10 12 2020.
[3] Research Gate. “ECG Signal Processing.” Research Gate, 2019,
https://www.researchgate.net/figure/Block-diagram-of-the-ECG-arrhythmia-classification-operation_fi
g2_309627866. Accessed 8 12 2020.
[4] Johannes Kepler University Linz. “ECG Signal Analysis.” jku.at, 2020,
https://www.jku.at/fileadmin/gruppen/183/Docs/Finished_Theses/BachelorThesis-HglingerMarkus1155
848Final.pdf. Accessed 12 12 2020.
[5] Afonso, Valtino. “ECG QRS Detection.” 2017,
https://www.ejwoo.com/uploads/2/5/4/0/25400517/ecg_qrs_detection.pdf. Accessed 8 12 2020.
[6] “Cardiac Arrhythmia Detection Using Deep Learning.” Research Gate, 01 2017,
https://www.researchgate.net/publication/321812830_Cardiac_arrhythmia_detection_using_deep_learn
ing. Accessed 12 12 2020.
[7] Research Gate. “ECG Classification.” Research Gate, 2017,
https://www.researchgate.net/figure/ECG-classification-using-CSA-features_fig2_315176125.
Accessed 12 12 2020.

You might also like