0% found this document useful (0 votes)
18 views10 pages

Deep Learning for ECG Diagnosis

The paper introduces a deep learning method for automatic ECG diagnosis, utilizing a Deep Convolution Neural Network (D-CNN) and KNN classifier to detect Atrial fibrillation and congestive heart failure, achieving an accuracy of 98%. It emphasizes the significance of heart disease as a leading cause of death globally and discusses various classification techniques, including the effectiveness of data augmentation. The study highlights the importance of early diagnosis and treatment of arrhythmias and heart failure to mitigate health risks.

Uploaded by

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

Deep Learning for ECG Diagnosis

The paper introduces a deep learning method for automatic ECG diagnosis, utilizing a Deep Convolution Neural Network (D-CNN) and KNN classifier to detect Atrial fibrillation and congestive heart failure, achieving an accuracy of 98%. It emphasizes the significance of heart disease as a leading cause of death globally and discusses various classification techniques, including the effectiveness of data augmentation. The study highlights the importance of early diagnosis and treatment of arrhythmias and heart failure to mitigate health risks.

Uploaded by

Satish Padimila
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

ABSTRACT

The paper presents a robust deep learning approach for ECG automatic
diagnose. For this purpose, Deep Convolution Neural Network (D-CNN)
algorithm and a multiclass model for KNN classifier will automate the
detection process of ECG images specific to Atrial fibrillation and
congestive heart failure cases. In this research work, a pre-built and pre-trained
D-CNN model is developed. It applies transfer learning which has been proved
as a robust technique for computer vision. The early layers of convolutional
network are frozen and only the last few layers are trained, identifying objects
in images either through a database search or through real-time analysis and
detection of the fetched image. Different type of heart diseases are predicted
using different datasets. Further, the study includes a comparison between the
results of using data augmentation techniques and the results without using it.
We achieved an average 98% of accuracy. The implementation environment of
our work is based on MATLAB using Deep Network Designer toolbox.
Keywords: Deep Learning; CNN; Atrial fibrillation; congestive heart failure;
Transfer Learning; Classification; KNN Multiclass Model

1
CHAPTER I

INTRODUCTION
Now day’s Heart disease is main reason for death in the world. Heart
disease is a number one problem from the world. Heart disease is leading cause
of death in the world. Over the past few years. Some types of disease occur
from heart. There are several kinds of causes, reason, factor which increase the
risk factor of heart disease. There are considered as important reason of heart
disease. Most of hospitals admitted in heart disease patient. This disease mostly
affected in male because smoking habits. This paper analyzes the different kinds
of heart disease using the classification techniques of the total number of deaths
worldwide nearly 10% of them are caused by heart related diseases. Heart
disease is also one of the top ten leading causes of death globally and it is also
the second cause of deaths in Japan.
Advances in computer technology and an increasing interest in artificial
intelligence have fostered the research and development of many machine
classification methods. The application of machine learning is very ample and it
has been used in many different ways in Medicine. The large amount of data
available is also bringing into light many unexpected and interesting results.

The KNN (k Nearest Neighbor) method and many others are frequently
used in knowledge mining. Also, many methods has been proposed and
evaluated for diagnosis of heart disease evaluated 10 methods, using the 4 sets
of the heart disease UCI repository, and found that a PLS-DA (Partial Least
Square Discriminant Analysis) method was the best with an accuracy of
86:13%. KNN method gives an accuracy of 81:4% for a number of neighbours
(k) set to 5.
Since the combination of classifiers could lead to improvements in the
accuracy of the prediction, many ensembles can also be found in the technical
literature. Normal resting heart rate is between 60 and 100 bpm. A series of
rhythms obtained from the contraction and relaxation of heart muscles
continuously produces the ECG waveform. From a person to person, the cycles
of ECG get varied based on their respective clinical factors.
Atrial fibrillation is one of the type of Arrhythmia. Arrhythmia is a form
of irregularity in heart rhythms and, in some cases, results in heart disease,
which poses serious threats to human lives. It should be diagnosed and treated
as early as possible to reduce the risk of sudden death, since if left untreated it
2
can also lead to a heart attack. Arrhythmia is a type of disease that disturbs the
smooth rhythm of heart’s electrical system and causes the heart to beat either
too slow or too fast, to race, and to skip beats and causes non-sequential
movement of heart signals. Generally, arrhythmia is identified and analyzed
from an ECG recording. Arrhythmias are generally divided into two broad
categories, that is, bradycardia and tachycardia. Bradycardia causes the heart to
beat too slow, which is usually below the rate of 60 beats per minute (bpm),
while tachycardia makes the heart beat faster which could go up to 100 bpm .
Congestive Heart failure is a condition in which the heart can't pump
enough blood to meet the body's needs. Heart failure does not mean that your
heart has stopped or is about to stop working. It means that your heart is not
able to pump blood the way it should. It can affect one or both sides of the
heart. The weakening of the heart's pumping ability causes Blood and fluid to
back up into the lungs, The build-up of fluid in the feet, ankles and legs called
edema, Tiredness and shortness of breath. Common causes of heart failureare
coronary artery disease, high blood pressure and diabetes. It is more common
in people who are 65 years old or older, African Americans, people who are
overweight, and people who have had a heart attack. Men have a higher rate of
heart failure than women. Your doctor will diagnose heart failure by doing a
physical exam and heart tests. Treatment includes treating the underlying
cause of your heart failure, medicines, and heart transplantation if other
treatments fail.

Deep learning is a class of machine learning based on pre-set criteria of


the data defining the class. Typically, deep learning is implemented by utilizing
a neural network architecture. It composed of three layers: an input layer,
hidden layers in which these layers are connected successively, and then the
output layer. All interconnected layers are linked through nodes (neurons). The
relationship of multiple layers of deep learning neural network is nonlinear and
it uses the back propagation algorithm for training. Commonly, the
convolutional neural network (CNN, or ConvNet) is considered as one of the
most popular neural network techniques [9]. Therefore, we proposed the deep
convolutional neural network (D-CNN) in this work. D-CNN technique with
added feature specific layers could provide needed accuracy as the number of
feature defined layers increase, you get the required accuracy and reduce
training time.
KNN based arrhythmia classification with the reduction of feature
dimensions. Since, a KNN is known to have the advantage of offering
remarkable performance of classification; we have chosen three well-known and
most widely used KNN based methods in this study for classification of

3
standard atrial fibrillation dataset and thereby comparing their accuracy rates
obtained for best results. The KNN method is a kind of machine learning
method that is based on the structural risk minimization principle and theoretical
basis, by selecting the appropriate subset function. One part of the data can be
used as training, and the other part of data is used as a test.
Some of the signs and symptoms of Arrhythmia are Fatigue or
weakness, Dizziness or light-headedness, Fainting or near-fainting spells, Rapid
heartbeat or in the chest, Shortness of breath and anxiety, Chest pain or
pressure, in extreme cases, collapse and sudden cardiac arrest. And for
myocardial infraction are Pressure, tightness, pain, or a squeezing or aching
sensation in your chest or arms that may spread to your neck, jaw or back,
Nausea, indigestion, heartburn or abdominal pain, Shortness of breath, Cold
sweat, Fatigue and Light-headedness or sudden dizziness.

4
.

5
As a central part of the circulatory system, the heart is primarily responsible for
pumping blood and distributing oxygen and nutrients throughout the body.
Because of this task, the heart may be considered one of the most important
organs of the body, such that even small dysfunctions or abnormalities may
cause drastic changes or effects in the human organism.
The heart is a muscle whose working mechanism is made possible by the
many parts that operate together. The organ is divided into several chambers
that take in and distribute oxygen-poor or oxygen-rich blood. These chambers
are accompanied by veins and arteries that facilitate the same function. With all
of its parts working together towards the same goal, the heart successfully
pumps blood with ease.
Normally, a good-functioning adult heart could go on three cardiac cycles or
72 beats per minute this rate changes for children whose heart rates are
normally and relatively faster.
2.1.1 Structure of heart:

Fig1:human heart srtucture


The heart can be found at the chest centre, underneath the sternum in a thoracic
compartment. It comprises four chambers and several valves that regulate the normal flow of
blood within the body. Two chambers called atria are located in the upper portion of the heart
with the left atrium receiving oxygen-rich blood and the right receiving oxygen-free blood.

6
The valves that separate these chambers are called atrioventricular valves, composed of the
tricuspid valve on the left and the mitral valve on the right.
On the other hand, ventricles are chambers found on the lower portion of the heart;
they pump oxygen-enriched blood into the body & organs, reaching even the smallest cells.
Similar to the atria, valves also separate the ventricular chambers. Collectively-termed as
semilunar valves, these are comprised of the pulmonary and aortic valves.
The heart also has a wall that is composed of three layers: the outer layer pericardium
(thin layer), the middle layer myocardium (thick layer), and the innermost layer endocardium
(thin layer). The myocardium is thick because it is made up of cardiac muscle fibres.
The heart structure is made more complex because of the mechanisms that allow blood to
be distributed throughout the body and return to the heart. Facilitating this continuous process
are two types of blood vessels: veins and arteries. The vessels that bring oxygen-free blood
back into the heart are called veins; those that bring oxygen-rich blood away from the heart
and to other body parts are called arteries.

2.1.2 Function of heart:

Fig2: Functional diagram of human heart


The heart’s blood-pumping cycle, called the cardiac cycle, ensures that blood is
distributed throughout the body. The oxygen distribution process begins when oxygen-free
blood enters into the heart through the right atrium, goes into the right ventricle, and enters
the lungs for oxygen refill and release of carbon dioxide, and transfers into the left chambers,
ready for redistribution. About 5.6 litres of blood circulate the body, and three cardiac cycles
are completed per minute.
The performance of the heart could now be easily monitored when any cardiovascular
problem or disorder is suspected. For instance, a regularly abnormal heartbeat or beats per

7
minute are characteristic of a heart-related illness. This is because a heartbeat is a
manifestation of the heart & oxygen-reloading process that is made up of two phases.
The systole is a short period that occurs when the tricuspid and mitral valves close; the
diastole is a relatively long period when the aortic and pulmonary valves close. The systole-
diastole relationship is the reference in measuring blood pressure. Other ways of physically
determining the heart & regular functioning are examining the pulse rate (beats per minute).
An adult normal heart rate is at 72 beats per minute,

2.2 ECG:

ECG is the abbreviated term for an Electrocardiogram. It is used to record the electrical
activity of the heart from different angles to both identify and locate
pathology. Electrodes are placed on different parts of a patient’s limbs and chest to record the
electrical activity.

During the following symptoms ECG is required Chest pain, Dizziness, light-
headedness or confusion, Heart palpitations, Rapid pulse shortness of breath, Weakness,
fatigue or a decline in ability to exercise

An electrocardiogram is a painless, non-invasive way to help diagnose many common heart


problems in people of all ages. Your doctor may use an electrocardiogram to determine or
detect:

 Abnormal heart rhythm (arrhythmias)


 If blocked or narrowed arteries in your heart (coronary artery disease) are causing chest
pain or a heart attack
 Whether you have had a previous heart attack

2.2.1 ECG signal:

Fig3: ECG signal representation

8
P waves represent atrial depolarization. In healthy individuals, there should be a P
wave preceding each QRS complex. PR interval: In healthy individuals, there should be a P
wave preceding each QRS complex. It represents the time taken for electrical activity to
move between the atria and the ventricles.
The QRS complex represents depolarization of the ventricles. It appears as three closely
related waves on the ECG (the Q, R and S wave). ST segment: The ST segment starts at
the end of the S wave and ends at the beginning of the T wave. The ST segment is an
isoelectric line that represents the time between depolarization and repolarization of the
ventricles i.e. (ventricular contraction). The T wave represents ventricular repolarization. It
appears as a small wave after the QRS complex.
The RR interval begins at the peak of one R wave and ends at the peak of the next R
wave. It represents the time between two QRS complexes. The QT interval begins at the start
of the QRS complex and finishes at the end of the T wave. It represents the time taken for
the ventricles to depolarize and then repolarize.

During an ECG, up to 12 sensors (electrodes) will be attached to your chest and limbs.
The electrodes are sticky patches with wires that connect to a monitor. They record the
electrical signals that make your heart beat. A computer records the information and displays
it as waves on a monitor or on paper.

By using the results from ECG we can check following data

 Heart rate. Normally, heart rate can be measured by checking your pulse.
An ECG may be helpful if your pulse is difficult to feel or too fast or too irregular to
count accurately. An ECG can help your doctor identify an unusually fast heart rate
(tachycardia) or an unusually slow heart rate (bradycardia).
 Heart rhythm. An ECG can show heart rhythm irregularities (arrhythmias). These
conditions may occur when any part of the heart's electrical system malfunctions. In
other cases, medications, such as beta blockers, cocaine, amphetamines, and over-the-
counter cold and allergy drugs, can trigger arrhythmias.
 Heart attack. An ECG can show evidence of a previous heart attack or one that's in
progress. The patterns on the ECG may indicate which part of your heart has been
damaged, as well as the extent of the damage.
 Inadequate blood and oxygen supply to the heart. An ECG done while you're having
symptoms can help your doctor determine whether chest pain is caused by reduced
blood flow to the heart muscle, such as with the chest pain of unstable angina.
 Structural abnormalities. An ECG can provide clues about enlargement of the
chambers or walls of the heart, heart defects and other heart problems.

9
10

Common questions

Powered by AI

KNN classifiers are used in the diagnosis of heart disease by employing a method that leverages distance measurements between data points to classify instances of heart disease based on nearest neighbors. In the context of diagnosing conditions such as atrial fibrillation, the KNN model classifies ECG data effectively, especially when used with dimensionality reduction techniques to enhance accuracy while reducing computational complexity . This approach is valuable in pattern recognition within large datasets, leading to an observed accuracy improvement when combined with other models or ensemble techniques .

Symptoms of heart diseases, such as fatigue, weakness, shortness of breath, and chest pain, can significantly impact a patient's ability to perform daily activities. For instance, fatigue and weakness can hinder a person's stamina, reducing physical performance in tasks requiring sustained energy. Shortness of breath may limit endurance activities like walking or climbing stairs, and chest pain or discomfort can lead to interruptions in daily routines and reduce quality of life. These symptoms also contribute to reduced exercise tolerance, potentially leading to a sedentary lifestyle, exacerbating other health issues . Prompt diagnosis and management are essential to mitigate these impacts and improve patient outcomes .

Key ECG patterns crucial for diagnosing arrhythmias include irregularities in heart rhythm traces, such as the presence and interval patterns of P waves, QRS complexes, and T waves. Specifically, the PR interval indicates the time for electrical activity to traverse from atria to ventricles, while the QRS complex reflects ventricular depolarization. Variations or inconsistencies in these can reveal arrhythmias like tachycardia or bradycardia. Additionally, prolonged or shortened QT intervals and missing or multiple P waves are indicative of irregular rhythm disorders like Atrial Fibrillation . These patterns are vital because they provide insights into the electrical function of the heart, helping to diagnose arrhythmias early, which is critical for preventing severe complications or heart failure .

The structure and function of the heart are intrinsically connected to its role in the circulatory system. Anatomically, the heart is divided into four chambers (two atria and two ventricles) that facilitate the flow of blood in oxygenation and deoxygenation cycles. The atrioventricular and semilunar valves ensure unidirectional blood flow and prevent backflow between chambers. Functionally, the cardiac cycle enables continuous blood distribution: the right side handles oxygen-poor blood sent to the lungs, while the left side manages oxygen-rich blood disseminated to the body . This meticulous structure allows the heart to maintain effective circulation through systemic and pulmonary circuits, ensuring cells receive necessary oxygen and nutrients . Disruptions in this structure-function harmony can lead to cardiovascular disorders, reflecting its critical role .

The cardiac cycle is a crucial physiological process that ensures blood distribution throughout the body. It consists of two main phases: systole, when the ventricles contract to pump blood out of the heart, and diastole, when the heart relaxes to allow the chambers to fill with blood. This cyclical action maintains an effective blood flow and is critical to delivering oxygen and nutrients to tissues and removing carbon dioxide and waste products . The cardiac cycle is typically represented by three cycles per minute in a healthy adult heart rate of approximately 72 beats per minute . The cycle's efficient execution is fundamental to cardiovascular health, as any abnormalities can indicate heart disorders or lead to diminished cardiac performance .

Transfer learning is significant in the development of automated ECG diagnosis systems because it allows models to leverage pre-trained knowledge from large datasets, thus requiring less labeled data to achieve high accuracy in a specific task. By freezing the initial layers of a Convolutional Neural Network, only the final layers are trained on specific ECG data, enhancing the adaptability and efficiency of models when identifying conditions like Atrial Fibrillation and Congestive Heart Failure . This approach facilitates quicker deployment and higher accuracy since it reduces the need to start model training from scratch, effectively bridging the gap between general-purpose learning and specific application needs .

Deep Convolutional Neural Networks (D-CNN) enhance ECG image diagnosis by using deep learning techniques that involve transfer learning, which allows pre-trained models to apply learned features from a large dataset to another, more specific task, improving accuracy. In this research, the D-CNN model freezes early layers of the neural network and trains only the last layers, optimizing identification of patterns specific to heart diseases like Atrial Fibrillation and Congestive Heart Failure. This approach results in an impressive accuracy of 98%, outperforming traditional methods . The utilization of D-CNNs also allows for real-time image analysis and detection, demonstrating a robust application in medical diagnostics .

Arrhythmia poses a serious threat to human life because it disrupts the normal sequence of heartbeats, potentially leading to inefficient blood circulation and insufficient oxygen delivery to vital organs. If left untreated, this can escalate to severe conditions such as stroke, cardiac arrest, or heart failure. Arrhythmia can significantly increase the risk of clots forming in the heart, which can then travel and cause further complications like a stroke . Early diagnosis and treatment are crucial as they can restore normal rhythm, reduce risks associated with arrhythmias, and prevent serious life-threatening outcomes .

The potential advantages of using deep learning techniques like CNN for ECG analysis include enhanced accuracy and efficiency in diagnosing complex patterns and conditions like atrial fibrillation and heart failure due to CNN's ability to process and learn from vast datasets with high dimensionality . CNNs can identify subtle changes in ECG signals that may not be evident to human analysts, leading to early and more precise diagnostics. However, limitations include the necessity for substantial computational resources and expertise to implement and maintain these systems. Additionally, there is a dependency on high-quality data for training models, which can be a constraint in settings with limited digital records or poor-quality ECG images .

Atrial Fibrillation (AF) is a type of arrhythmia characterized by irregular heart rhythms, causing the heart to beat too fast or too slow, while often resulting in non-sequential heart signals. It disrupts the regular flow of the heart's electrical system, potentially leading to heart disease or heart attack if untreated . Congestive Heart Failure (CHF), on the other hand, is a condition where the heart cannot pump sufficient blood to meet the body's needs, leading to blood and fluid backup in the lungs and body, causing symptoms such as edema and shortness of breath . The primary distinction is that AF specifically affects the rhythm, causing irregular and inefficient heartbeats, while CHF affects the heart's capacity to pump, leading to inadequate blood circulation .

You might also like