Deteksi Jantung

You might also like

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

IDENTIFICATION OF ECG SIGNAL BY USING

BACKPROPAGATION NEURAL NETWORK

UNDERGRADUATE PROJECT REPORT

Proposed In Fulfillment Of The Requirements for the award of the Bachelor's


Degree Engineering

Department of Electrical Engineering In Telecommunication Concentration

By:
SARAH FAHIRA ADRIATI
152045800960

FAKULTAS TEKNIK JURUSAN TEKNIK ELEKTRO


KONSENTRASI TELEKOMUNIKASI
UNIVERSITAS WIDYAGAMA
MALANG
2019
i

APPROVAL SHEET

IDENTIFICATION OF ECG SIGNAL BY USING


BACKPROPAGATION NEURAL NETWORK

UNDERGRADUATE PROJECT REPORT

Proposed In Fulfillment Of The Requirements for the award of the Bachelor's


Degree Engineering

Department of Electrical Engineering In Telecommunication Concentration

By :
SARAH FAHIRA ADRIATI
152045800960

Approved by:

Supervisor I Supervisor II

Faqih, ST., MT Dr. Ir. Sabar Setiawidayat, MT


NIDN.0717047802 NIDN. 0717056001

Certified by:

Dean of the Engineering Faculty Head of the Electrical Engineering


Department

(Dr. Ir. Fachrudin, MT ) (Sumartono Ali Putra, ST)


NIDN : 0717066701 NIDN. 9907146644
ii

VALIDATION SHEET

IDENTIFICATION OF ECG SIGNAL BY USING

BACKPROPAGATION NEURAL NETWORK

UNDERGRADUATE PROJECT REPORT

By:
SARAH FAHIRA ADRIATI
NIM : 152045800960

It has been defensed in front of the board of examiners

on Saturday, July 27, 2019 and declared eligible

Approved by:

Examiner Name Signature

Chief Faqih, ST.,MT

Member Dr. Ir. Sabar Setiawidayat, MT .

Member Sumartono Ali Putra, ST.

Certified by:

Dean of the Engineering Faculty Head of the Electrical Engineering


Department

(Dr. Ir. Fachrudin, MT) (Sumartono Ali Putra, ST)


NIDN : 0717066701 NIDN. 9907146644
IDENTIFICATION OF ECG SIGNAL BY USING
BACKPROPAGATION NEURAL NETWORK

SARAH FAHIRA ADRIATI

A project report submitted in


fulfillment of the requirement for the award of the
Bachelor of Electrical/Electronic Engineering with Honours

Faculty of Electrical and Electronic Engineering


Universiti Tun Hussein Onn Malaysia

JUNE, 2019
iii
iv

This work is dedicated to my beloved mother and father, for their constant
encouragement and support through my educational endeavors.

Mr. Andre Budi Sasongko and Mrs. Hedy Lamora Yulianti

I will be eternally grateful.

DEDICATION
v

ACKNOWLEDGEMENT

I wish to express my deepest gratitude to Dr. Ariffuddin Bin Joret, Mr. Faqih
ST., MT & Dr. Sabar Setiawidayat, MT for the opportunity and constant supervision
in carrying out this project. I am extremely thankful for their kind guidance and
valuable expertise, providing me with necessary information which help me to
complete this project.

I would extend my gratitude to all my family who has an important role in my


life, namely, Mrs. Hedy, Mr. Andre, Mrs. Vivi, Mr. Fajar, Mr. Siswanto, Mr. Alfa,
and Rizky for their continuous support and encouragement throughout my studies.
Because without all of them I would never complete my study well.

Then, to dearest Febri Ryan Gustiawan, Rishma, Nara, Citra Agustiya,


Imaudy, Arofah, Citra, Rafi, and all my friend from electrical engineering
organization (HME) who have more or less contributed to the completion of this
project report. I will always be indebted to them.
vi

ABSTRACT

The heart rhythm abnormalities can be detected by interpreting the ECG signal.
However, there are many ECG pattern to be interpreted. Neural network is an artificial
intelligent based technique which can identify pattern and one of the most used
learning algorithm is backpropagation. The system is built to help interpretation
process of ECG signal in heart rhythm abnormalities diagnosis. The data used in this
study are obtained from MIT-BIH database. The data has been pre-processed to be
used in the developed identification system of this study. The pre-processing are
separating signal into one cycle and equalize the size of the signal by using zero padded
technique. In this system, a good feature extraction of the ECG signal is needed to
increase the accuracy. Discrete wavelet transform is used as a feature extraction and
the level which carrying out is until ten. Each level results are used as an input to the
identification system and derive different accuracy value. For this study, the accuracy
is set to 80%. The results below 80% considered not eligible. The developed
identification system of ECG signal achieves an average 91.3% accuracy using ECG
signal’s feature calculated using Discrete Wavelet Transform technique in identifying
normal and abnormal heart pulse.
vii

ABSTRAK

Kelainan denyutan jantung dapat dikesan dengan mentafsirkan signal Electro Cardio
Graph (ECG). Namun, terdapat banyak paten / bentuk signal ECG untuk ditafsirkan.
Projek ini mencadangkan sistem pengecaman signal ECG dengan menggunakan
rangkaian neural jenis backpropagation. Rangkaian neural adalah teknik pengecaman
berdasarkan kecerdasan buatan dimana ianya dapat mengecam paten dan algoritma
pembelajaran yang sering digunakan ialah backpropagation. Sistem ini dibangunkan
untuk membantu proses mentafsiran signal ECG dalam mengdiagnosis kelainan
denyut jantung. Data yang digunakan dalam projek ini telah diambil dari database
MIT-BIH. Data ECG ini telah dipra-proses terlebih dahulu sebelum digunakan dalam
sistem pengecaman yang telah dibangunkan dalam projek ini. Dalam projek ini,
pengekstarakan ciri signal ECG yang baik diperlukan untuk meningkatkan ketepatan
sistem. Terdapat tiga jenis pengektrakkan ciri yang digunakan sebagai perbandingan,
iaitu ciri statistic signal, moment Hu, dan Discrete Wavelet Transform. Sistem
pengecaman signal ECG yang telah dibangunkan dalam kajian ini mencapai 91.3%
ketepatan menggunakan ciri signal ECG yang dikira menggunakan teknik Discrete
Wavelet Transform dalam melakukan pengecaman denyut jantung normal dan tidak
normal.
viii

ABSTRAK

Kelainan denyut jantung dapat dideteksi dengan menafsirkan sinyal EKG. Namun, ada
banyak pola EKG yang harus ditafsirkan. Neural network adalah teknik berbasis
kecerdasan buatan yang dapat mengidentifikasi pola dan salah satu algoritma
pembelajaran yang paling banyak digunakan adalah backpropagation. Sistem ini
dibangun untuk membantu proses interpretasi sinyal EKG dalam mendiagnosa
kelainan denyut jantung. Data yang digunakan dalam penelitian ini diperoleh dari
database MIT-BIH. Data telah diproses untuk digunakan dalam sistem identifikasi
yang dikembangkan dari penelitian ini. Pra-pemrosesan memisahkan sinyal menjadi
satu siklus dan menyamakan ukuran sinyal dengan menggunakan teknik zero padded.
Dalam sistem ini, ekstraksi fitur yang baik dari sinyal EKG diperlukan untuk
meningkatkan akurasi. Transformasi wavelet diskrit digunakan sebagai ekstraksi fitur
dan level yang dijalankan hingga sepuluh. Setiap hasil level digunakan sebagai input
ke sistem identifikasi dan mendapatkan nilai akurasi yang berbeda. Untuk studi ini,
keakuratannya diatur ke 80%. Apabila hasil di bawah 80%, maka dianggap tidak
memenuhi syarat. Sistem identifikasi sinyal EKG yang dikembangkan mencapai
akurasi rata-rata 91,3% menggunakan fitur sinyal EKG yang dihitung menggunakan
teknik Discrete Wavelet Transform dalam mengidentifikasi denyut jantung normal dan
abnormal.
ix

CONTENTS

APPROVAL SHEET i
VALIDATION SHEET ii
DECLARATION iii
DEDICATION iv
ACKNOWLEDGEMENT v
ABSTRACT vi
ABSTRAK vii
ABSTRAK viii
TABLE OF CONTENT ix
LIST OF TABLES xii
LIST OF FIGURES xiii
LIST OF SYMBOLS AND ABBREVIATIONS xv
LIST OF APPENDICES xvi
CURICULUM VITAE xvii
STATEMENT OF AUTHENTICITY xviii
UNDERGRADUATE PROJECT REPORT

CHAPTER 1 INTRODUCTION 1
1.1 Background of study 1
1.2 Problem Statement 2
1.3 Objectives of the study 2
1.4 Scope of project 3
1.5 Project report outline 3

CHAPTER 2 LITERATURE REVIEW 5


2.1 Introduction 5
2.2 ECG signal 5
2.2.1 Arrhythmia 7
2.3 Hu moment 9
x

2.4 Discrete Wavelet Transform 11


2.5 Neural network 12
2.5.1 Backpropagation 13
2.6 The previous project 16
2.7 The summary of chapter 17

CHAPTER 3 METHODOLOGY 18
3.1 Introduction 18
3.2 Identification of ECG signal 18
3.3 Digital signal processing 19
3.3.1 Pre-processing 19
3.2.1.1Separating signal into one 20
cycle
3.2.1.2 Equalizing the size of the 21
signal
3.3.2 Feature extraction 22
3.2.2.1 Signal’s statistic features 22
extraction
3.2.2.2 Hu moment 23
3.2.2.3 Discrete wavelet transform 24
3.4 Identification of ECG signal using 26
backpropagation neural network with two
layers feed forward
3.5 Summary of chapter 27

CHAPTER 4 RESULT AND ANALYSIS 28


4.1 Introduction 28
4.2 The result on analysis of separating signal 28
into one cycle
4.3 The result on analysis of equalizing the size 29
of the signal
4.4 The result on analysis of signal’s statistic 30
features for backpropagation neural network
system
xi

4.5 The result on analysis of Hu moment 32


features for backpropagation neural network
system
4.6 The result on analysis of discrete wavelet 33
transform for backpropagation neural
network system
4.7 The ECG signal classification system using 40
a Graphical User Interface in MATLAB
4.8 The summary of chapter 44

CHAPTER 5 CONCLUSION 45
5.1 Conclusion 45
5.2 Recommendation 45

REFERENCES 47
APPENDIX 49
xii

LIST OF TABLES

2.1 Literature review 15


4.1 The summary of the classification performance of the 39
ECG signal using dwt
4.2 The parameter of the neural network 40
xiii

LIST OF FIGURES

2.1 The heart’s conduction system 6


2.2 The ECG signal 6
2.3 The neural network illustration 13
2.4 The backpropagation algorithm, 14
2.5 The backpropagation structure 15
3.1 Identification process of ECG signal 19
3.2 The process of separating signal into one cycle using 20
MATLAB
3.3 The process of equalizing the size of the signal 21
3.4 The process of extracting signal’s statistic features 22
3.5 Hu moment features extraction 23
3.6 Discrete wavelet transform 25
3.7 Identification of ECG signal using backpropagation 26
neural network
4.1 The ECG signal before separating process 29
4.2 The ECG signal after separating process 29
4.3 Equalizing the size of the signal using interpolating 30
technique
4.4 Plot confusion of signal’s statistic feature extraction 31
(84.4%)
4.5 Plot confusion of signal’s statistic feature extraction 31
(86.5%)
4.6 Plot confusion of Hu moment feature extraction 32
(81.8%)
4.7 Plot confusion of Hu moment feature extraction 33
(82.09%)
4.8 Discrete wavelet transform one times extraction 34
(90.1%)
xiv

4.9 Discrete wavelet transform two times extraction 34


(89.6%)
4.10 Discrete wavelet transform three times extraction 35
(91.2%)
4.11 Discrete wavelet transform four times extraction 35
(91.3%)
4.12 Discrete wavelet transform five times extraction 36
(91.3%)
4.13 Discrete wavelet transform six times extraction 37
(89.5%)
4.14 Discrete wavelet transform seven times extraction 37
(82.6%)
4.15 Discrete wavelet transform eight times extraction 38
(80.2%)
4.16 Discrete wavelet transform nine times extraction 38
(71.8%)
4.17 Discrete wavelet transform ten times extraction 39
(70.2%)
4.18 Main interface of the GUI 41
4.19 Selecting file 42
4.20 Plotting data before and after feature extraction 42
using dwt
4.21 Classifying data 43
4.22 The signal’s information 43
xv

LIST OF SYMBOLS AND ABBREVIATIONS

ca - Approximation coefficients vector


cd - Detail coefficients vector
ECG - Electrocardiograph
dwt - Discrete wavelet transform
GUI - Graphical User Interface
APB - Atrial Premature Beats
AFL - Atrial Flutter
AF - Atrial Fibrillation
SVTA - Supraventricular tachycardia
WPW - Wolf Parkinson White Syndrome
PVCs - Premature Ventricular contraction
VT - Ventricular trachycardia
LBBB - Left Bundle Branch Block
RBBB - Right Bundle Branch Block
bpm - Beat per minute
xvi

LIST OF APPENDICES

A Gantt chart 49
B Weight and bias of the identification system 51
C Main algorithm of the system in MATLAB 58
xvii

CURICULUM VITAE

Full Name : Sarah Fahira Adriati


Gender : Female
Place & Date of Birth : Surabaya, July 13rd 1997
Nationality : Indonesia
Marital status : Single
Religion : Moslem
Address : Jl. Citra Melati no 19, Perum Citra Tropodo
Waru, Sidoarjo 61256
Phone Number : 081233548131
Email : sarahfahiradri@gmail.com

Educational Background
- SD Al-Falah Tropodo II, Waru, Sidoarjo (2003 – 2009)
- SMP Al-Falah Deltasari, Waru, Sidoarjo (2009 – 2012)
- SMAN 20 Surabaya, Specialist subject: Science (2012 – 2015)
- Universitas Widyagama Malang, Electrical Engineering (2015-2019)
xviii

STATEMENT OF AUTHENTICITY UNDERGRADUATE PROJECT


REPORT
The undersign below :
Name : Sarah Fahira Adriati
NIM : 152045800960
Faculty - Department : Engineering – Electrical Engineering
Concentration : Telecommunication
Truly state that the undergraduate project report is titled:
IDENTIFICATION OF ECG SIGNAL BY USING BACKPROPAGATION
NEURAL NETWORK
Supervisor 1 : Faqih, ST., MT
Supervisor 2 : Dr. Ir. Sabar Setiawidayat, MT.
Date of examination : Saturday/ 27 July 2019
It is really my work.
In this undergraduate project report/thesis / paper there is no whole or part of
the writings or ideas of other people that I took by copying or imitating in the form of
a series of sentences or symbols that I admit as my own writing without giving
recognition to the original author. If it is later proven that I did an act of copying or
imitating someone else's writing as if it were my own thoughts, I was willing to accept
sanctions according to the regulations in force at the Faculty of Engineering (including
revocation of the Scholarship / sanction) that I had obtained.

Malang, 27 July 2019.


Who gave the statement,

Sarah Fahira Adriati


1CHAPTER 1

INTRODUCTION

1.1 Background of Study

Electrocardiograph (ECG) signal is a signal generated from periodic heartbeat rhythm.


The signal is measured using a medical instrument that visualizes voltage produced by
heartbeat rhythm in a monitor [1]. By using this instrument any abnormal symptom of
the heartbeat can be detected [2]. It is known that a heart is one of the vital organs that
regulates blood circulation in the human body. The activity of the heart to produce and
regulating blood circulation in the body is happening by the effect of the heart's
bioelectric flow. The bioelectric movement of the heart results in a heartbeat in
producing blood. The bioelectric potential difference of the heart can be detected on
the surface of the skin with an electrocardiograph. The results shown on the
electrocardiograph are a pattern based on heart activity. When there is an abnormality
in a heart, the electrocardiograph would emerge a different pattern. Identification of
ECG recording patterns is important for the accuracy of the diagnosis of human heart
abnormalities by a doctor [3]. The number of ECG recording patterns is a problem in
providing an interpretation of heart conditions. Therefore, there is a need for an
automatic ECG recognition system to reduce the burden of interpreting the ECG.
There is an Artificial Intelligent based method that could be applied to
identification, namely neural network. There are many methods in the neural network.
However, one of the methods suitable for pattern identification is backpropagation.
Backpropagation is a learning algorithm to make the error rate smaller by attuning its
weight based on the desired output and target differences [4]. This method is possible
to identification pattern with high accuracy. In previous research, this method can
identify the pattern of the object in different color and perspective. The object has been
2

turned into 15’, 30’, 45, until 90’ but this method able to identify the pattern [5]. This
project is about a study and identifies recording patterns on the ECG to determine
abnormalities in the heart by using a backpropagation neural network method.

1.2 Problem Statement

In the medical field, the ECG signal is used to diagnose the abnormalities of the heart.
The diagnosis is based on the signal pattern. However, there are several patterns of
ECG signal which indicate the different interpretation of the heart's abnormalities.
Therefore, the interpretation must be right and accurate. In order to avoid the wrong
diagnosis of patient's sickness which will effect on the patient’s medication.
To overcome this problem, this project proposes an artificial intelligence based
method for ECG signal identification. The proposed method is a well-known method
called backpropagation neural network. However, to obtain the optimum result the
neural network needs a feature extraction. Feature extraction helps the neural network
to identification signal. There are several methods of feature extraction with a different
result. Hence, it is needed to choose the method with the most optimal results suitable
to a neural network.

1.3 Objectives of the Study

The main objective of this project is to identify the ECG signal by using a neural
network. As a result, the objectives of the proposed project are:
(i) To process ECG signal into one cycle signal and suitable to the system.
(ii) To determine a feature extraction with an optimum result for the neural
network.
(iii) To classify the ECG signal into two classes, normal and abnormal.
(iv) To build a Graphical User Interface which can identify the ECG signal using
MATLAB.
3

1.4 Scope of Project

(i) All the process of the identification is using a personal laptop with Intel
processor core i5 2^nd generation.
(ii) The data were obtained from the PhysioNet service (http://www.physionet.org)
from the MIT-BIH Arrhythmia database.
(iii) The ECG signals were from 45 patients: 19 female (age: 23-89) and 26 male
(age: 32-89) which contained 17 classes: normal sinus rhythm, pacemaker
rhythm, and 15 types of cardiac dysfunctions (for each of which at least 10
signal fragments were collected).
(iv) All ECG signals were recorded at a sampling frequency of 360 [Hz] and a gain
of 200 [adu / mV] and selecting a random 10-second (3600 samples) fragments
of the ECG signal (not overlapping)
(v) The signals only derived from one lead, the MLII and the data are in mat format
(MATLAB).
(vi) For this project, the data must be separated into one cycle and have the same
size.
(vii) The neural network algorithm used is backpropagation with two layer feed
forward network.
(viii) The program used is MATLAB R2013a which can load the data.
(ix) The GUI is consist of two-part namely feature extraction and classify.
(x) The feature extraction used are signal’s statistic feature, Hu moment feature,
and discrete wavelet transfor.

1.5 Project Report Outline

This thesis consists of five chapters. Chapter 1 serves as an introduction to the thesis.
It contains the problem statement, objectives, and scope of the project. The rest of the
thesis is organized as follows: Chapter 2 covers a relevant theory about
backpropagation neural network, feature extraction, ECG signal and relevant research
related to identification using neural network method. Chapter 3 explain the method
implemented in this project. This chapter is divided into two part. The first part is
digital signal processing signal and the other part is the identification process. It will
4

be explained about digital signal processing signal until derive the best signal feature
which suitable with the identification process. In the last part, identification ECG
signal using a backpropagation neural network method will be defined.
In chapter 4, the result will be analyzed. The analyze is about the effect of the
separating ECG signal into one cycle, determine a feature extraction between a statistic
of the signal, Hu moment, and wavelet discrete transform and the last is analyzing the
result of the performance of the identification system using backpropagation neural
network.
Chapter 5 is the last chapter of this thesis which explains about conclusion and
review based on the previous chapter. The suggestions regarding future research that
can be implemented in the future end this chapter.
CHAPTER 2
2

LITERATURE REVIEW

2.1 Introduction

This chapter discusses the theory related to the identification of ECG signal pattern for
this project. The topic will discuss are about ECG signal as an object in this project,
Hu moment and Discrete wavelet transform as a feature extraction used in this project,
and neural network as a method used for the identification. At last part of this chapter,
the previous project related to this project will be served.

2.2 ECG signal

The electrocardiogram is an image of the heart's electrical waves presented by


electrocardiography (ECG). The periodic impulse propagation of Pacemaker nerve
fibers (SA node, AV node, Purkinje fiber) of the heart muscles causes cycles of
depolarization and repolarization in the heart muscle [6]. Depolarization will cause
muscle contraction while repolarization will cause muscle relaxation. Heart muscle
consists of the Atrium muscle (porch, left and right) and Ventricle muscles (chambers,
left and right) [7]. This system is called by the heart's conduction system [8].
6

Figure 2.1: The heart’s conduction system

Based on Einthoven, there are some part of heart activities which is depicted as ECG
signal, namely:

(i) The depolarization of atrium muscle as a P wave.

(ii) The depolarization of ventricle muscle as a QRS wave.

(iii) The repolarization of ventricle muscle as a T wave.

In each electrocardiogram cycle, there is a R which is the highest potential


difference as result of the ventricle muscle maximum depolarization. Impulse
Propagation from Pacemaker that propagates from the SA node until Purkinje fiber
will reach the surface of the human skin because the human body is a good conductor
[9].

Figure 2.2: The ECG signal


7

In the clinical practice, ECG signal is usually used. Holter ECG device is the
most used ECG signal record [10]. This device applied to a patient if the paramedics
need to monitor the abnormalities of their ECG. The waves and complexes of the ECG
signal will be interpreted by the paramedics. The parameters calculated to find out if
the ECG is normal or not. The parameters are RR interval, PP interval, QT interval,
and ST segment, which are the interval and the height of the wave [7].

2.2.1 Arrhythmia

Cardiac arrhythmia or irregular heartbeat is a conditions when the beat of the cardiac
irregular (rapid or too slow) [11]. There are many kinds of arrhythmia, i.e :
(i) Atrial Premature Beat (APB)
Atrial premature beats is an abnormal heartbeat which commonly occur to a people
who has lungs abnormalities. There is not specific symptoms. However it can be
discovered by looking the ECG signal. APB patients have heart pulse irregularity, a
premature P waves, a narrow QRS complex and shortened or prolonged PR interval.
(ii) Atrial Flutter (AFL)
Atrial flutter is an abnormal cardiac rhythm because the atrium beat too rapid. It makes
the contraction of the atrium muscle is faster and make it out of 1st paragraph.
Synchronization with the ventricle. The ECG characteristics of AFL are the atrial rate
is around 300bpm, the QRS rate is 150 bpm or normal, and a narrow complex
tachycardia at a ventricular rate is 150 bpm.
(iii) Atrial Fibrillation (AF)
Atrial fibrillation is cardiac abnormalities because the electrical impulses shoot from
different place in the atrium in an irregular way. This condition makes the atrium
twitch and generate an irregular pulse in the cardiac. The ECG characteristics of AF
are the atrium rate is about 400-600 bpm, the amplitude is low, and the P waves cannot
be seen.
(iv) Supraventricular tachycardia (SVTA)
Supraventricular tachycardia (SVT) or paroxysmal supraventricular tachycardia, is an
irregularly fast heartbeat. It is a general term of cardiac arrhythmias which occur in
above the ventricles in the atrium or AV node.
(v) Wolf Parkinson White Syndrom (WPW)
8

Wolff Parkinson white syndrome is a syndrome caused of the extra electrical pathway
in the cardiac. It can lead of fast heartbeat. The characteristics of WPW based on the
ECG signal are a shortened P-R interval which is around less than 0.12 s and a
prolonged a QRS complex around 0.11 s or more.
(vi) Premature ventricular contractions (PVCs)
Premature ventricular contractions are an additional cardiac pulse that begin in one of
two ventricles. It bothers a normal cardiac rhythm and causing a skipped pulse in the
heart.
(vii) Trigeminy
Trigeminy is a typical heart rhythm, the heart beats in an even pattern. The top part of
the heart kneads abnormal, then the bottom part of the heart kneads in a regular rhythm.
This is known as a premature ventricular complex (PVC) or ventricular premature
beat. When this occurs in a three-beat pattern, it called trigeminy.
(viii) Ventricular tachycardia (VT)
Ventricular tachycardia is a cardiac rhythm problem caused by irregular electrical
signals in the ventricles. The heartbeat of VT patients usually 100 or more bpm and it
out of sync with the atrium.
(ix) Fusion
A fusion occurs when electrical impulses fire off from different or even the same
region of the heart at the same time. If it occurs in the ventricle, so it called as
ventricular fusion. However, if it occurs in the atrium, it called atrial fusion. The cause
of ventricular fusion is when a normal cardiac rhythm and the impulse from a
pacemaker coincide to activate the same part of a ventricle in one time.
(x) Left Bundle Branch Block (LBBB)
Left bundle branch block (LBBB) is a heart conduction irregularity showed on the
electrocardiogram (ECG). It occurs because the activation of left ventricles is delayed,
then caused the contraction of the left ventricles slower than the right ventricle. The
characteristics of LBBB are the cardiac rhythm is from supraventricular and the QRS
duration is must be more than equal 120ms.
(xi) Right Bundle Branch Block (RBBB)
A right bundle branch block (RBBB) is a cardiac conduction abnormality occurs in the
right bundle branch. It happened because the right ventricle is not directly activated by
impulses, but the left ventricle still activated normally. These impulses move through
left ventricle myocardium to right ventricle and depolarize the right ventricle. because
9

the conduction through the myocardium is slower than conduction through the Bundle
of His-Purkinje fibers, the QRS complex is widened. The QRS complex often shows
an extra deflection that reflects the rapid depolarization of the left ventricle followed
by the slower depolarization of the right ventricle. The parameter to diagnose a right
bundle branch block are the heart rhythm must be from above the ventricles and the
QRS duration more than 100 ms (incomplete block) or more than 120 ms (complete
block).
(xii) Second Degree Heart Block
Second-degree atrioventricular block (AV block) is an irregularity of the electrical
conduction system of the cardiac. It is a conduction block between the atrium and
ventricles. The presence of second-degree AV block is diagnosed when one or more
(but not all) of the atrial impulses fail to conduct to the ventricles due to impaired
conduction. It is classified as a block of the AV node and is categorized in between
first-degree (slowed conduction) and third-degree blocks (complete block).
(xiii) Pacemaker Rhythm
Pacemakers provide an artificial electrical impulse to the cardiac. This impulse and the
normal electrical signals of the cardiac can be interpreted. It is provided a training
module for pacemaker rhythms and links to practice strips of pacemaker patients.
There are multiple types of pacemaker rhythms:
a. Normal Single Chamber Pacemaker
b. Normal Dual Chamber Pacemaker
c. Failure to Capture
d. Failure to Pace
e. Failure to Sense

2.3 Hu moment

Moment Hu invariants were first published to the pattern recognition and image
processing community in 1962 [12]. When Hu applied the results of the theory of
algebraic invariants and derived seven invariants to the rotation of 2-D objects.
Two dimensional ( + ) order moment are defined as follows:
10

∫ ( , )
=∫ (2.1)
, = 0,1,2 …
If the pattern function f(x,y) is piecewise continuous bounded function, the
moment of all orders exist and the moment sequence { } is uniquely determined
by f(x,y). And correspondingly, f(x,y) is also uniquely determined by the moment
sequence { }. One should note that moments in (1) may be not invariant when f(x,y)
changes by translating, rotating, or scaling. The invariant features can be achieved
using central moments, which are defined as follows:

( − ̅) ( − ) ( , ) (2.2)
=
, = 0,1,2 …

where,

̅= =

The point ( ̅ . ) is the centroid of the pattern f (x,y). The centroid moments
computed using the centroid of the ECG signal pattern f(x,y) is equivalent to the
whose center has been shifted to the centroid of the pattern. Therefore, the central
moment is invariant to pattern translation. Scale invariance can be obtained by
normalization. The normalized central moments are defined as follows:

= , =( + + 2)/2, p+q = 2, 3, … (2.3)

Based on normalized central moments, Hu introduced seven-moment


invariants:
= + (2.4)

=( − ) +4 (2.5)

=( −3 ) + (3 − ) (2.6)

=( −3 ) + (3 − ) (2.7)

=( −3 ) ( + )[( + ) −

3 − ) + (3 − ) ( − )
11

[(3 + ) −( + ) ] (2.8)

=( − ) [( + ) − + ) +

(4 ( + )−( + ) (2.9)

= (3 − ) ( + ) [ + ) − (3 + )

−( +3 )( + ) [3( + ) −( + ) ] (2.10)

The seven Hu moment invariants are useful properties of being unchanged under
pattern scaling, translation, and rotation [13].

2.4 Discrete Wavelet Transform

A wavelet transform that is discretely sampled called discrete wavelet transform (dwt)
in numerical and functional analysis. The advantage of this transform as same as other
wavelet transform, it is temporal resolution. Dwt can capture frequency and location
in time which is cannot be done by Fourier transform. A signal is decomposed by dwt
into detail which are a low frequency and a high-frequency component [14]. The
discrete wavelet transform can be written as:

, = ∫ ( ) , ( ) , (2.11)

By choosing an orthonormal wavelet basis , ( ) the original can be


reconstructed [15]. The approximation coefficient of the signal at the scale m and
location n can be written as:

, = ∫ ( ) , ( ) , (2.12)

But the discrete signal is of finite length N. So the range of the scales that can be
investigated is 0<m<M. therefore, a discrete approximation of the signal can be written
as :
12

( )= + ∑ ( ), (2.13)

Where the mean signal approximation at scale M is (t) = , , ( ) and detail


signal approximation corresponding to scale m, for finite length signal is given by

( )= ∑ , , ( ), (2.14)

The signal approximation at a specific scale is a combination of the approximation and


detail at the lower scale.

( )= ( )− ( ), (2.15)

2.5 Neural Network

A method inspired by a neuron in human body and brain called Neural Network. As
how neuron works which transfers the information from human brain to other body
parts, in neural network the neuron receives input and do dot operation with a weight,
weighted sum and adds bias. This operation results a parameters of the activation
function which is the output of the neuron. Referring to Figure 2.3, the neural network
has the same system as a neuron. Dendrites which accepts the information is
represented as an input in the neural network. In the neuron system, the information
will be processed in the cell body. The cell body is represented as an activation
function in the neural network. The activation function is needed by the network to
make the output nonlinearity node so that the node does not only produce output as
input. Another function is to limit the output value to a certain range [16]. For output,
the axon is represented as an output in a neural network. Neural networks can be
applied to do various things, namely:
(i) Grouping/classification
- In marketing, it can be used to group consumer action patterns.
- In agriculture and fisheries, it can be used for grouping of grade fruits and fish.
13

Figure 2.3: The neural network illustration

(ii) Identification and Identification


- In computing and telecommunications, it is used for voice recognition and visual.
- In the financial sector, it is used for verification at the bank
(iii) Assessment
- In the engineering field, it can be used for product inspection and monitoring.
- In the security field, it is used as motion detection and fingerprint detection.
(iv) Forecasting and Prediction
- In the financial sector, it is used for the rate of foreign exchange and forecasting the
value of shares.
- In the field of agriculture, it can be used for crop yield forecasting
- In the Meteorology, it can be used for weather forecasting.

2.5.1 Backpropagation

Backpropagation works by adjusting the neural network’s weight based on the desired
output and target to decrease the error rate. It is a learning algorithm and also a
systematic method for multilayer ANN training. Backpropagation has three layers in
the training process called input layer, hidden layer and output layer.
14

Output Data
(Target)

Output Prediction
Input data Neural Network
-

Loss/Error
Back Propagation
Weight Update

Figure 2.4: The backpropagation algorithm

The hidden layer in backpropagation can cause a large error rate in


backpropagation is smaller than the error rate in a single layer network. It is because
the hidden layer in backpropagation serves as a place to update and adjust the weight
so that a new weight value obtained can be directed towards the desired output target
[17].

Figure 2.5: The backpropagation structure

2.6 The previous project

There are a few journals that are related to this project. The following is an advantage
and disadvantage for each journal.
15

Table 2.1: Literature Review


Citation Title Author’s name Advantage Disadvantage
ECG pattern Nicos Maglaveras  It is decreased  It has a complex
recognition and ,Telemachos use of filtering training time and
classification Stamkopoulos, techniques computational
using non-linear Konstantinos which can with low
[18]
Transformation Diamantaras, Costas decrease the improvement
s and neural Pappas, Michael possibility loss results
networks: A Strintzis of information
review in the signal.
Deep Rajendra Acharya·,  It is proposing  A big data is
convolutional Hamido Fujita, 11-Layer deep required to obtain
neural network Shu Lih Oh, CNN model optimum
for the Yuki Hagiwara,  It not requiring performance
automated Jen Hong Tan, denoising  Extensive
[19]
diagnosis Muhammad Adam,  It not requiring computational
of congestive Ru San Tan R-peak to be power is required
heart failure detected for training the
using ECG model
signals
Cardiac Himanshu Gothwal,  The system is  The feature
arrhythmias Silky Kedawat, very solid extraction and
detection in an Rajesh Kumar  A feature NN structure
ECG beat signal from highly must be
[20] using abnormal determined.
fast Fourier ECG can be
transform and identified and
artificial neural predicted
network
Application of U.Rajendra Acharya,  It does not need  It needs to learn
deep Hamido Fujita, Shu a feature feature with
convolutional Lih Oh, Yuki extraction and computationally
neural network Hagiwara, Jen Hong selection intensive
for automated Tan, techniques.  A huge diversity
[21]
detection of Muhammad Adam of data ECH is
myocardial  It is not required.
infarction using requiring a
ECG signals denoising
technique.
ECG signal Hari Mohan Rai,  A high  ECG signal
processing for Anurag Trivedi, accuracy of denoising is
abnormalities Shailja Shukla classify ECG required.
detection signal is
using multi- obtained
resolution
[22] wavelet
transform and
Artificial
Neural
Network
classifier
16

Citation Title Author’s name Advantage Disadvantage


Using Wavelet Liang-Yu  It is less  It cannot
Transform and Shyu, Ying- complexity an effectively
Fuzzy Neural Hsuan Wu, and actual distinguish
Network for Weichih Hu implementatio the LBBB
VPC Detection n symptom
[23]
From the  A VPC from VPC
Holter ECG heartbeat can
be identified
with high
accuracy.
A novel Pawel Plawiak  It recognize 17  No possibility
methodology classes of analyzing
of cardiac  It has high ECG signals
health efficiency/sen fragments that
recognition sitivity contain more
based on ECG  It is possible than one class
signals and to be type (except
evolutionary- implanted on normal sinus
[24]
neural system mobile device rhythm).
rhythm.  The QRS
complex
detection is
not applied
 A signal
filtering is not
applied
S1 and S2 Tien-En Chen,  The  The feature
Heart Sound Shih-I Yang, recognition extraction and
Recognition Li-Ting Ho, accuracies of NN structure
Using Deep Kun-Hsi Tsai, individual S1 must be
Neural Yu-Hsuan and S2 are determined
Networks Chen, Yun-Fan very high,
Chang, Ying- even when the
Hui Lai, Syu- duration and
Siang interval are
Wang,Yu not accessible.
[25] Tsao,and  The proposed
Chau-Chung system can be
Wu used for
patients with
arrhythmia,
which can
generate
irregular S1
and S2 time
intervals.
17

2.7 Summary of Chapter

The ECG signal is a signal produced from the electrical activity of a heart which is
detected using ECG device. This signal can be used to detect the abnormalities of the
heart. There is an abnormality of a heart called arrhythmia. It is an irregular heartbeat
disease. The disease can be detected by identify the ECG signal pattern. However,
there are many pattern to be interpreted. Neural network can be used to interpret the
pattern but, it needs the right feature extraction to get optimal result. Hu moment and
discrete wavelet transform can be used as a feature extraction to help neural network
identify the ECG signal.
3CHAPTER 3

METHODOLOGY

3.1 Introduction

This chapter defines the detail of the method and the technique of the project. The
process in this research is divided into two parts namely digital signal processing and
identification of the ECG signal by using Neural Network.

In the digital signal processing, every step that has been done will be explained
starting from separating the signal into one cycle until the feature extraction process
to obtain the best features of the signal. In the identification process, a backpropagation
neural network with two layer feed forward network has been used.

3.2 Identification of ECG signal

Identification of ECG signal which has been built in this project consists of two parts,
i.e. digital signal processing and classification using Neural Network[10] [26]. In the
digital signal processing part, there are two main unit known as pre-processing and
feature extraction. Based on the pre-processing unit of this project, there are two sub-
unit, which are separating the signal into one cycle and equalizing the size of the signal.
Figure 3.1 shows the flowchart of the project which includes all the sub-unit.
19

Figure 3.1: Identification process of ECG signal

3.3 Digital signal processing

Digital signal processing is a technique to process signal using a computer. This


technique can be used to analyze and extract the feature of a signal. Referring to figure
3.1, the digital signal processing of this project is divided into pre-processing and
feature extraction. The pre-processing technique is used to separate, analyzed and
equalize signal. In this project, the feature extraction is used to obtain the important
feature of the analyzed signal which will be represented as a number.

3.3.1 Pre-Processing

Pre-processing has a purpose to edit and increase the quality of the signal. Besides, it
helps feature extraction process by providing a signal that matches the characteristics
20

to be extracted. In this project, the pre-processing process has been divided into two
parts, namely separating the signal into one cycle and equalizing the size of the signal.

3.3.1.1 Separating the signal into one cycle

START

Select
ECG
signal

Plot the signal

Select one cycle of


the signal

All the signal


has been
selected?

Save selected data


as a new file

END

Figure 3.2: The process of separating the signal into one cycle using MATLAB
21

The data of this project was obtained from the PhysioNet service
(http://www.physionet.org) of the MIT-BIH Arrhythmia database [27]. The ECG
signal samples contain more than one cycle which is about 10 second (3600 samples).
Based on this signal, it needs to be applied to extract one cycle of the sample signal.
Figure 3.2 shows the flowchart of the proposed technique.

3.3.1.2 Equalizing the size of the signal

START

y = Input Data
Signal

y1=[y zeros(1,500-a)]/max(y)

SHOW
y1

Save y1

END

Figure 3.3: The process of equalizing the size of the signal

Equalizing the size of the signal aims to normalize the data. After the data was
separated, the size of each data is different. In order to make the data have the same
size, the ECG signal will be interpolated using zero padded technique. This technique
22

built by using MATLAB code. Figure 3.3 shows the flowchart of the equalizing
process.

3.3.2 Feature Extraction

Feature extraction is the most important step in the identification process. Choosing a
suitable feature will increase the accuracy of the identification. The result of the feature
extraction will be the input for classifying the ECG signal. This selection of inputs
determines the outcome of the classification. If the inputs are not good, the
performance of the classifier will inadequate[28].

3.3.2.1 Signal’s statistic feature extraction

Start

y = input data signal

Find the maximum value of


y1

Find the minimum value of


y1

Find the variance of y1

Find the standard deviation


of y1

Display the result

Save the result

END

Figure 3.4: The process of extract signal’s statistic feature


23

Signal statistic feature extraction is a feature extraction of input ECG signal using its
statistic features. The statistic feature used is the maximum value of the signal, the
minimum value of the signal, the variance value of the signal, and the standard
deviation value of the signal. Figure 3.4 shows the flowchart of the statistic feature
extraction in this project

3.3.2.2 Hu Moment

In this project, Hu moment features obtained using a function in a MATLAB. The


function will be called in the main program. The feature of the data signal will be
extracted and will be represented as a number. Figure 3.5 shows the Hu moment
extraction process in MATLAB.

START

Read input signal

Load function
cent_moment

Load function
feature_vec

g = calculate hu moment

Display (g)

Save the result

END

Figure 3.5: Hu moment features extraction


24

3.3.2.3 Discrete Wavelet Transform

Discrete wavelet transform(dwt) is a good technique in extracting feature data with


different scales and frequencies, besides this technique is very interesting in the signal
classification perspective [29]. This transformation is available in MATLAB function.
In this project, the dwt used has been set until 10 attempts of extraction. Figure 3.6
shows the dwt extraction process using MATLAB.

START

y1 = input data
signal

Calculate ca and cd of
1 dwt transformation

Calculate ca and cd of
2 dwt transformation

Calculate ca and cd of
3 dwt transformation

Calculate ca and cd of
4 dwt transformation

A
25

Calculate ca and cd of 5 dwt


transformation

Calculate ca and cd of 6 dwt


transformation

Calculate ca and cd of 7 dwt


transformation

Calculate ca and cd of 8 dwt


transformation

Calculate ca and cd of 9 dwt


transformation

Calculate ca and cd of 10 dwt


transformation

Display dwt
transformation results
from 1 10

Save the result

END

Figure 3.6: Discrete wavelet transform


26

3.4 Identification ECG signal using backpropagation neural network with


two layers feed forward

START

Select input
data

Select target
data

Set hidden layer

Run the neural network


tool

Plot result

No Result≥
80%

Yes

Save the result

END

Figure 3.7: Identification of ECG signal using Backpropagation Neural Network


27

In this project, the identification system used is a neural network technique. Referring
to the neural network, the technique requires the weight value of the network to be
determined based on the input and target data. In this project, the learning algorithm
chosen for the neural network is the backpropagation with two layer feed forward
network. According to El-Khafif and El-Brawany [30], the backpropagation neural
network can be used effectively in ECG signal processing.

As the neural network needs inputs and targets to determine the weight and
bias value, the inputs in this project are the features of the ECG signal that has been
extracted and represented as numbers. There are three phases of the neural network,
namely training, testing, and validating, where the phase's percentage used for this
project is 80% for training, 10% for testing, and 10% for validating. In this project, the
minimum result of the identification set to 80%. If the result obtained less than 80%,
the system will be re-train.

3.5 Summary of Chapter

This chapter has discussed the entire process of the project. Starting from the digital
signal processing which contains pre-processing and feature extraction and follows the
neural network pattern identification process. In the pre-processing part, there are two
sub-unit involve, namely the separating signal into one cycle and the signal size
equalize.
Referring to the feature extraction part, this project uses three methods: Signal
statistic extraction, hu moment extraction, and discrete wavelet transform. At the end
of this chapter, the identification of the ECG signal by using a backpropagation neural
network has been discussed.
CHAPTER 4
4

RESULTS AND DISCUSSION

4.1 Introduction

This chapter discusses the result analysis of the identification and feature extraction
system analysis of the project. The analysis will be discussed as follows:
(i) Separating the signal into one cycle analysis in pre-processing system.
(ii) Equalizing the size of the signal analysis in the pre-processing system.
(iii) Signal statistic extraction for backpropagation neural network system analysis
(iv) Hu moment extraction for backpropagation neural network system analysis
(v) Discrete wavelet transform for backpropagation neural network system
(vi) Graphical User Interface in MATLAB
All discussions related to the above analysis will determine the effectiveness
of this identification of the ECG signal pattern. In addition, the analysis of the results
also determines the reliability of the algorithm that has been used.

4.2 The result on analysis of separating the signal into one cycle

This analysis used to specify a signal form. Figure 4.1 shows the signal before
separating process, while figure 4.2 shows the ECG signal after separating process.
The total of the signal which has been separated is 2000, 1000 normal and 1000
abnormal.
29

ECG signal
1350

1300

1250

1200

Amplitude(v)
1150

1100

1050

1000

950

900
0 500 1000 1500 2000 2500 3000 3500 4000
Sample(n)

Figure 4.1: The ECG signal before separating process

ECG signal
1500

1400

1300
Amplitude(v)

1200

1100

1000

900

800
0 20 40 60 80 100 120 140 160
Sample(n)
Figure 4.2: The ECG signal after separating process

4.3 The result on analysis of equalizing the size of the signal

The data signal obtained after separating process has a different size in each cycle. So
in order to equalize the size, the ECG signal needs to interpolate using the zero padded
technique. Figure 4.3 shows the result of the interpolation technique used in this
project.
30

ECG signal before equalizing


1500

Amplitude (v)
1000

500

0
0 50 100 150 200 250 300 350 400 450 500
Sampling(n)
ECG signal after equalizing
1
Amplitude (v)

0.5

0
0 50 100 150 200 250 300 350 400 450 500
Sampling

Figure 4.3: Equalizing the size of the signal using the interpolating technique

4.4 The result on analysis signal’s statistic features for backpropagation


neural network system

This analysis has been done to observe the suitability of the feature extraction method
in the identification of the ECG signal using a backpropagation neural network
method. The first feature extraction is the statistic feature of the ECG signal which
contains maximum, minimum, variance, and standard deviation of the signal

In this project, the neural network using MATLAB nntool which the results are
shown in a plot confusion. Plot confusion (targets, outputs) is matrix which contained
the true labels targets and predicted labels outputs [31]. The predicted class (target) is
corresponding with the rows and the true class (output) is corresponding with the
column on the matrix plot. The correct classified observation is corresponding with
the diagonal cells, while the incorrect classified observation is corresponding with the
off-diagonal cells. The result shown in each cell are the number of the observation and
the percentage of the observation.

The MATLAB nntool has been run for several times until it gives the
performance of the system which is more than 80%. Figure 4.4 and 4.5 shows the final
31

result of the neural network system in classifying the ECG signal using signal statistic
features.

Training Confusion Matrix Validation Confusion Matrix

562 80 87.5% 133 17 88.7%


1 1
40.1% 5.7% 12.5% 44.3% 5.7% 11.3%

Output Class

Output Class
139 619 81.7% 24 126 84.0%
2 2
9.9% 44.2% 18.3% 8.0% 42.0% 16.0%

80.2% 88.6% 84.4% 84.7% 88.1% 86.3%


19.8% 11.4% 15.6% 15.3% 11.9% 13.7%

1 2 1 2
Target Class Target Class

Test Confusion Matrix All Confusion Matrix

111 21 84.1% 806 118 87.2%


1 1
37.0% 7.0% 15.9% 40.3% 5.9% 12.8%
Output Class

Output Class

31 137 81.5% 194 882 82.0%


2 2
10.3% 45.7% 18.5% 9.7% 44.1% 18.0%

78.2% 86.7% 82.7% 80.6% 88.2% 84.4%


21.8% 13.3% 17.3% 19.4% 11.8% 15.6%

1 2 1 2
Target Class Target Class

Figure 4.4: Plot confusion of signal’s statistic features (84.4%)

Training Confusion Matrix Validation Confusion Matrix

620 93 87.0% 116 22 84.1%


1 1
44.3% 6.6% 13.0% 38.7% 7.3% 15.9%
Output Class

Output Class

89 598 87.0% 28 134 82.7%


2 2
6.4% 42.7% 13.0% 9.3% 44.7% 17.3%

87.4% 86.5% 87.0% 80.6% 85.9% 83.3%


12.6% 13.5% 13.0% 19.4% 14.1% 16.7%

1 2 1 2
Target Class Target Class

Test Confusion Matrix All Confusion Matrix

130 22 85.5% 866 137 86.3%


1 1
43.3% 7.3% 14.5% 43.3% 6.9% 13.7%
Output Class

Output Class

17 131 88.5% 134 863 86.6%


2 2
5.7% 43.7% 11.5% 6.7% 43.1% 13.4%

88.4% 85.6% 87.0% 86.6% 86.3% 86.5%


11.6% 14.4% 13.0% 13.4% 13.7% 13.5%

1 2 1 2
Target Class Target Class

Figure 4.5: Plot confusion of signal’s statistic features (86.5%)


32

4.5 The Result on analysis of Hu Moment features for Backpropagation


Neural Network System

Based on the moment features, the ECG signal can be represented as a seven number.
These numbers were used in the neural network system as an inputs parameter. Figure
4.6 and 4.7 shows the result of the ECG signal classification using Hu moment
features. Referring to figure 4.6 and 4.7, the result of the neural network system
performance is about 81.3% and 82%.

Training Confusion Matrix Validation Confusion Matrix

635 200 76.0% 124 36 77.5%


1 1
45.4% 14.3% 24.0% 41.3% 12.0% 22.5%
Output Class

Output Class

67 498 88.1% 12 128 91.4%


2 2
4.8% 35.6% 11.9% 4.0% 42.7% 8.6%

90.5% 71.3% 80.9% 91.2% 78.0% 84.0%


9.5% 28.7% 19.1% 8.8% 22.0% 16.0%

1 2 1 2
Target Class Target Class

Test Confusion Matrix All Confusion Matrix

142 38 78.9% 901 274 76.7%


1 1
47.3% 12.7% 21.1% 45.1% 13.7% 23.3%
Output Class

Output Class

20 100 83.3% 99 726 88.0%


2 2
6.7% 33.3% 16.7% 5.0% 36.3% 12.0%

87.7% 72.5% 80.7% 90.1% 72.6% 81.3%


12.3% 27.5% 19.3% 9.9% 27.4% 18.6%

1 2 1 2
Target Class Target Class

Figure 4.6: Plot confusion of Hu moment features (81.8%)


33

Training Confusion Matrix Validation Confusion Matrix

633 188 77.1% 146 37 79.8%


1 1
45.2% 13.4% 22.9% 48.7% 12.3% 20.2%

Output Class

Output Class
61 518 89.5% 13 104 88.9%
2 2
4.4% 37.0% 10.5% 4.3% 34.7% 11.1%

91.2% 73.4% 82.2% 91.8% 73.8% 83.3%


8.8% 26.6% 17.8% 8.2% 26.2% 16.7%

1 2 1 2
Target Class Target Class

Test Confusion Matrix All Confusion Matrix

134 49 73.2% 913 274 76.9%


1 1
44.7% 16.3% 26.8% 45.6% 13.7% 23.1%
Output Class

Output Class
13 104 88.9% 87 726 89.3%
2 2
4.3% 34.7% 11.1% 4.3% 36.3% 10.7%

91.2% 68.0% 79.3% 91.3% 72.6% 82.0%


8.8% 32.0% 20.7% 8.7% 27.4% 18.1%

1 2 1 2
Target Class Target Class

Figure 4.7: Plot confusion Hu moment features (82.09%)

4.6 The Result on Analysis of Discrete Wavelet Transform for


Backpropagation Neural Network System

The discrete wavelet transform features used in this project in order to classify the
ECG signal into normal and abnormal. The classification has been done from 1
extraction until 10 extractions. Figure 4.8 to Figure 4.17 show the classification
performance of the ECG signal in this project using discrete wavelet transform from 1
until 10 times extraction.

Referring to figure 4.8, the one times the extraction of the discrete wavelet
transform of the ECG signal used as the input parameter of the neural network system
has produced 90.1% of overall performance.
34

Training Confusion Matrix Validation Confusion Matrix

748 99 88.3% 84 15 84.8%


1 1
46.8% 6.2% 11.7% 42.0% 7.5% 15.2%

Output Class

Output Class
51 702 93.2% 7 94 93.1%
2 2
3.2% 43.9% 6.8% 3.5% 47.0% 6.9%

93.6% 87.6% 90.6% 92.3% 86.2% 89.0%


6.4% 12.4% 9.4% 7.7% 13.8% 11.0%

1 2 1 2
Target Class Target Class

Test Confusion Matrix All Confusion Matrix

103 18 85.1% 935 132 87.6%


1 1
51.5% 9.0% 14.9% 46.8% 6.6% 12.4%
Output Class

Output Class
7 72 91.1% 65 868 93.0%
2 2
3.5% 36.0% 8.9% 3.3% 43.4% 7.0%

93.6% 80.0% 87.5% 93.5% 86.8% 90.1%


6.4% 20.0% 12.5% 6.5% 13.2% 9.9%

1 2 1 2
Target Class Target Class

Figure 4.8: Plot confusion discrete wavelet transform one times extraction (90.1%)

Training Confusion Matrix Validation Confusion Matrix

651 93 87.5% 140 21 87.0%


1 1
46.5% 6.6% 12.5% 46.7% 7.0% 13.0%
Output Class

Output Class

39 617 94.1% 13 126 90.6%


2 2
2.8% 44.1% 5.9% 4.3% 42.0% 9.4%

94.3% 86.9% 90.6% 91.5% 85.7% 88.7%


5.7% 13.1% 9.4% 8.5% 14.3% 11.3%

1 2 1 2
Target Class Target Class

Test Confusion Matrix All Confusion Matrix

134 19 87.6% 925 133 87.4%


1 1
44.7% 6.3% 12.4% 46.3% 6.7% 12.6%
Output Class

Output Class

23 124 84.4% 75 867 92.0%


2 2
7.7% 41.3% 15.6% 3.8% 43.4% 8.0%

85.4% 86.7% 86.0% 92.5% 86.7% 89.6%


14.6% 13.3% 14.0% 7.5% 13.3% 10.4%

1 2 1 2
Target Class Target Class

Figure 4.9: Plot confusion discrete wavelet transform two times extraction (89.6%)
35

The overall classification performance using two times dwt extraction is about
89.6% as shown in figure 4.9. Classification performance using three times dwt is
about 91.2%,
Training Confusion Matrix Validation Confusion Matrix

679 79 89.6% 135 20 87.1%


1 1
48.5% 5.6% 10.4% 45.0% 6.7% 12.9%

Output Class

Output Class
33 609 94.9% 8 137 94.5%
2 2
2.4% 43.5% 5.1% 2.7% 45.7% 5.5%

95.4% 88.5% 92.0% 94.4% 87.3% 90.7%


4.6% 11.5% 8.0% 5.6% 12.7% 9.3%

1 2 1 2
Target Class Target Class

Test Confusion Matrix All Confusion Matrix

137 28 83.0% 951 127 88.2%


1 1
45.7% 9.3% 17.0% 47.5% 6.3% 11.8%
Output Class

Output Class
8 127 94.1% 49 873 94.7%
2 2
2.7% 42.3% 5.9% 2.5% 43.6% 5.3%

94.5% 81.9% 88.0% 95.1% 87.3% 91.2%


5.5% 18.1% 12.0% 4.9% 12.7% 8.8%

1 2 1 2
Target Class Target Class

Figure 4.10: Plot confusion discrete wavelet transform three times extraction (91.2%)
Training Confusion Matrix Validation Confusion Matrix

678 77 89.8% 131 20 86.8%


1 1
48.4% 5.5% 10.2% 43.7% 6.7% 13.2%
Output Class

Output Class

32 613 95.0% 13 136 91.3%


2 2
2.3% 43.8% 5.0% 4.3% 45.3% 8.7%

95.5% 88.8% 92.2% 91.0% 87.2% 89.0%


4.5% 11.2% 7.8% 9.0% 12.8% 11.0%

1 2 1 2
Target Class Target Class

Test Confusion Matrix All Confusion Matrix

137 24 85.1% 946 121 88.7%


1 1
45.7% 8.0% 14.9% 47.3% 6.0% 11.3%
Output Class

Output Class

9 130 93.5% 54 879 94.2%


2 2
3.0% 43.3% 6.5% 2.7% 44.0% 5.8%

93.8% 84.4% 89.0% 94.6% 87.9% 91.3%


6.2% 15.6% 11.0% 5.4% 12.1% 8.8%

1 2 1 2
Target Class Target Class

Figure 4.11: Plot confusion discrete wavelet transform four times extraction (91.3%)
36

Based on the Figure, the overall the ECG signal while the performance of the
classification using four and five times extraction of dwt is about 91.3% which are the
highest accuracy value obtained from this project. This can be seen in Figure 4.11 and
Figure 4.12.

Training Confusion Matrix Validation Confusion Matrix

647 78 89.2% 140 12 92.1%


1 1
46.2% 5.6% 10.8% 46.7% 4.0% 7.9%
Output Class

Output Class
44 631 93.5% 10 138 93.2%
2 2
3.1% 45.1% 6.5% 3.3% 46.0% 6.8%

93.6% 89.0% 91.3% 93.3% 92.0% 92.7%


6.4% 11.0% 8.7% 6.7% 8.0% 7.3%

1 2 1 2
Target Class Target Class

Test Confusion Matrix All Confusion Matrix

146 16 90.1% 933 106 89.8%


1 1
48.7% 5.3% 9.9% 46.7% 5.3% 10.2%
Output Class

Output Class

13 125 90.6% 67 894 93.0%


2 2
4.3% 41.7% 9.4% 3.4% 44.7% 7.0%

91.8% 88.7% 90.3% 93.3% 89.4% 91.3%


8.2% 11.3% 9.7% 6.7% 10.6% 8.7%

1 2 1 2
Target Class Target Class

Figure 4.12: Plot confusion discrete wavelet transform five times


extraction (91.3%)

The overall classification performance of the ECG signal in this project using
six times until ten times extraction of dwt has produced results which range from 70%
until 89%. These results can be seen in Figure 4.13 until Figure 4.17.
37

Training Confusion Matrix Validation Confusion Matrix

643 79 89.1% 132 24 84.6%


1 1
45.9% 5.6% 10.9% 44.0% 8.0% 15.4%

Output Class

Output Class
56 622 91.7% 12 132 91.7%
2 2
4.0% 44.4% 8.3% 4.0% 44.0% 8.3%

92.0% 88.7% 90.4% 91.7% 84.6% 88.0%


8.0% 11.3% 9.6% 8.3% 15.4% 12.0%

1 2 1 2
Target Class Target Class

Test Confusion Matrix All Confusion Matrix

146 28 83.9% 921 131 87.5%


1 1
48.7% 9.3% 16.1% 46.1% 6.6% 12.5%
Output Class

Output Class
11 115 91.3% 79 869 91.7%
2 2
3.7% 38.3% 8.7% 4.0% 43.5% 8.3%

93.0% 80.4% 87.0% 92.1% 86.9% 89.5%


7.0% 19.6% 13.0% 7.9% 13.1% 10.5%

1 2 1 2
Target Class Target Class

Figure 4.13: Plot confusion discrete wavelet transform six times extraction (89.5%)

Training Confusion Matrix Validation Confusion Matrix

607 147 80.5% 119 33 78.3%


1 1
43.4% 10.5% 19.5% 39.7% 11.0% 21.7%
Output Class

Output Class

95 551 85.3% 30 118 79.7%


2 2
6.8% 39.4% 14.7% 10.0% 39.3% 20.3%

86.5% 78.9% 82.7% 79.9% 78.1% 79.0%


13.5% 21.1% 17.3% 20.1% 21.9% 21.0%

1 2 1 2
Target Class Target Class

Test Confusion Matrix All Confusion Matrix

133 27 83.1% 859 207 80.6%


1 1
44.3% 9.0% 16.9% 43.0% 10.4% 19.4%
Output Class

Output Class

16 124 88.6% 141 793 84.9%


2 2
5.3% 41.3% 11.4% 7.0% 39.6% 15.1%

89.3% 82.1% 85.7% 85.9% 79.3% 82.6%


10.7% 17.9% 14.3% 14.1% 20.7% 17.4%

1 2 1 2
Target Class Target Class

Figure 4.14: Plot confusion discrete wavelet transform seven times extraction (82.6%)
38

Training Confusion Matrix Validation Confusion Matrix

608 170 78.1% 118 46 72.0%


1 1
43.4% 12.1% 21.9% 39.3% 15.3% 28.0%

Output Class

Output Class
97 525 84.4% 22 114 83.8%
2 2
6.9% 37.5% 15.6% 7.3% 38.0% 16.2%

86.2% 75.5% 80.9% 84.3% 71.3% 77.3%


13.8% 24.5% 19.1% 15.7% 28.7% 22.7%

1 2 1 2
Target Class Target Class

Test Confusion Matrix All Confusion Matrix

130 37 77.8% 856 253 77.2%


1 1
43.3% 12.3% 22.2% 42.8% 12.7% 22.8%
Output Class

Output Class
25 108 81.2% 144 747 83.8%
2 2
8.3% 36.0% 18.8% 7.2% 37.4% 16.2%

83.9% 74.5% 79.3% 85.6% 74.7% 80.2%


16.1% 25.5% 20.7% 14.4% 25.3% 19.9%

1 2 1 2
Target Class Target Class

Figure 4.15: Plot confusion discrete wavelet transform eight times extraction (80.2%)

Training Confusion Matrix Validation Confusion Matrix

625 311 66.8% 130 67 66.0%


1 1
44.6% 22.2% 33.2% 43.3% 22.3% 34.0%
Output Class

Output Class

85 379 81.7% 10 93 90.3%


2 2
6.1% 27.1% 18.3% 3.3% 31.0% 9.7%

88.0% 54.9% 71.7% 92.9% 58.1% 74.3%


12.0% 45.1% 28.3% 7.1% 41.9% 25.7%

1 2 1 2
Target Class Target Class

Test Confusion Matrix All Confusion Matrix

129 81 61.4% 884 459 65.8%


1 1
43.0% 27.0% 38.6% 44.2% 22.9% 34.2%
Output Class

Output Class

21 69 76.7% 116 541 82.3%


2 2
7.0% 23.0% 23.3% 5.8% 27.1% 17.7%

86.0% 46.0% 66.0% 88.4% 54.1% 71.3%


14.0% 54.0% 34.0% 11.6% 45.9% 28.7%

1 2 1 2
Target Class Target Class

Figure 4.16: Plot confusion discrete wavelet transform nine times extraction (71.8%)
39

Training Confusion Matrix Validation Confusion Matrix

564 283 66.6% 121 65 65.1%


1 1
40.3% 20.2% 33.4% 40.3% 21.7% 34.9%

Output Class

Output Class
121 432 78.1% 39 75 65.8%
2 2
8.6% 30.9% 21.9% 13.0% 25.0% 34.2%

82.3% 60.4% 71.1% 75.6% 53.6% 65.3%


17.7% 39.6% 28.9% 24.4% 46.4% 34.7%

1 2 1 2
Target Class Target Class

Test Confusion Matrix All Confusion Matrix

124 57 68.5% 809 405 66.6%


1 1
41.3% 19.0% 31.5% 40.5% 20.3% 33.4%
Output Class

Output Class
31 88 73.9% 191 595 75.7%
2 2
10.3% 29.3% 26.1% 9.6% 29.8% 24.3%

80.0% 60.7% 70.7% 80.9% 59.5% 70.2%


20.0% 39.3% 29.3% 19.1% 40.5% 29.8%

1 2 1 2
Target Class Target Class

Figure 4.17: Plot confusion discrete wavelet transform ten times extraction (70.2%)

The overall classification performance of the ECG signal in this project using
six times until ten times extraction of dwt has produced results which range from 70%
until 89%. The summary of the classification performance of the ECG signal using
discrete wavelet transform from 1 until 10 times extraction shown in table 4.1.

Table 4.1: The summary of the classification performance of the ECG signal using dwt

HIDDEN
DWT TRAINING TESTING VALIDATION RESULT
NODE
1 time 80% 10% 10% 10 90.1%
2 times 80% 10% 10% 10 89.6%
3 times 80% 10% 10% 10 91.2%
4 times 80% 10% 10% 10 91.3%
5 times 80% 10% 10% 10 91.3%
6 times 80% 10% 10% 10 89.5%
7 times 80% 10% 10% 10 82.8%
8 times 80% 10% 10% 10 80.2%
40

HIDDEN
DWT TRAINING TESTING VALIDATION RESULT
NODE
9 times 80% 10% 10% 10 71.8%
10 times 80% 10% 10% 10 70.2%

4.7 The ECG signal classification system using a Graphical User Interface in
MATLAB

The result derived from the feature extraction which has the best value is simulated
and used as input data for Graphical User Interface (GUI) in MATLAB. For this
project, the result of the feature extraction used is dwt feature extraction with five times
extraction. Based on the results, the neural network parameter such as input node,
hidden node, and output node are used to develop the GUI system. The neural network
inputs parameter are shown in table 4.2. Moreover, there are other parameters namely
weight, and bias which shows in appendix B.

Table 4.2: The parameter of the neural network

NEURAL NETWORK INPUT NODE HIDDEN NODE OUTPUT NODE


Statistic 4 10 2
Hu moment 7 10 2
1st Discrete wavelet
246 10 2
transform
2nd Discrete wavelet
123 10 2
transform
3rd Discrete wavelet
62 10 2
transform
4th Discrete wavelet
31 10 2
transform
5th Discrete wavelet 16 2
10
transform
6th Discrete wavelet 8 2
10
transform
41

NEURAL NETWORK INPUT NODE HIDDEN NODE OUTPUT NODE


th
7 Discrete wavelet 4 2
10
transform
8th Discrete wavelet 2 2
10
transform
9th Discrete wavelet 1 2
10
transform
10th Discrete wavelet 1 2
10
transform

Figure 4.18 shows the main GUI interface of the ECG signal classification
system. The ‘feature extraction button’ is used to show the selected ECG signal and
it’s dwt features plot.

Figure 4.18: Main interface of the GUI


42

Figure 4.19: Selecting File

Figure 4.19 shows the interface of the selection menu for the ECG signal
selected by the user after clicking button ‘feature extraction’. Based on this figure, the
user can select the ECG file in a .mat format using mouse click.

ECG SIGNAL
1100
Amplitude (v)

1000

900

800
0 50 100 150 200 250
Sampling
Feature wavelet
3
Amplitude (v)

0
0 10 20 30 40 50 60 70
Sampling

Figure 4.20: Plotting data before and after feature extraction using dwt
43

Figure 4.21: Classifying Data

The plot of the example of the selected ECG signal and its five times dwt
features are shown in figure 4.21. The ‘classify' button used in this GUI to run the
neural network calculation for the classification of the selected ECG signal. In figure
4.22, the message box will appear to inform the user regarding the types of the ECG
signal selected.

Figure 4.22: The signal’s information


44

In this GUI, the ‘Info' button is used to display the information of the signal
types, while the ‘Exit' button is used to close the GUI program. Figure 4.23 shows the
signal information after clicking the ‘Info' button.

4.8 Summary of Chapter

In this project, there are two sub-unit in pre-processing which are separating the signal
into one cycle and equalizing the size of the signal. Both are important for digital signal
processing. Because if it uses the original signal without pre-processing, the result
derived will different and it will make a problem for the feature extraction process. If
the signal is not separated, the signal feature will not specific. Afterward, this process
if the signal is not equalized its size, the data cannot be processed in feature extraction.

In feature extraction, selecting the suitable features determine the result of the
ECG signal classification. For this project, the features used are the signal's statistic,
Hu moment, and discrete wavelet transform from 1 time until 10 times. Based on the
ECG signal classification using these features as inputs of the neural network system
the highest result obtained by discrete wavelet transform for 4 and 5 times extraction.

In this project, the GUI system has also been developed. The classification of
the ECG signal can be made easily using this developed GUI system, where the user
only needs to click the button of the system to select the ECG signal and classify it.
5CHAPTER 5

CONCLUSION AND RECOMMENDATION

5.1 Conclusions

The classification of the ECG signal into normal and abnormal types in this project is
using a backpropagation neural network. Two main processes of this classification
system are the discrete signal processing and neural network. In this project, based on
discrete signal processing, it can be divided into two sub-unit is known as pre-
processing and feature extraction.
In the classification of the ECG signal, this project has evaluated the
backpropagation neural network using several types of features such as signal’s
statistic, Hu moment, and discrete wavelet transform (dwt). Based on the classification
performance the ECG signal using backpropagation neural network, the used of four
and five times extraction of dwt give the best result at about 91.3%.
The implementation of the ECG signal classification using GUI system has
also developed. The GUI system designed can ease the classification process by using
a button to select the featured signal.

5.2 Recommendations

Even though this project proves that backpropagation neural network can identify ECG
signal, but the classes are only two. It will be better if the future project can identify
more than two classes. Besides, the ECG signal classification of this project can be
upgraded from the MATLAB GUI system into the Android application system. In the
46

future, as to improve this ECG signal classification system another features types can
be considered such as Zernike moment and affine moment.
REFERENCES

[1] J. Arifin, “Identifikasi dan Klasifikasi Pola Sinyal EKG Berdasarkan Sifat
Keacakan (Entropy),” 2013.
[2] F. Lutfi and A. Arifin, “Klasifikasi Sinyal Elektrokardiografi Menggunakan
Wavelet Transform dan Neural Network,” 2012.
[3] S. Karpagachelvi, M. Arthanari, and M. Sivakumar, “ECG feature extraction
techniques-a survey approach,” ArXiv Prepr. ArXiv10050957, 2010.
[4] R. Hecht-Nielsen, “Theory of the backpropagation neural network,” in Neural
networks for perception, Elsevier, 1992, pp. 65–93.
[5] A. Riztyan and R. B. Dariska, “Analisis Pengenalan Motif Songket Palembang
Menggunakan Algoritma Propagasi Balik,” 2013.
[6] Sabar Setiawidayat, Rudi Joegijantoro, and Akhmad Farikh, “Pemakaian
Electrocardiograph Diskrit Untuk Pemeriksaan Jantung Secara Standard Klinis,”
Pros. Semin. Nas. FDI, p. AT 29-33, 2016.
[7] Malcolm S. Thaler, Satu-satunya buku EKG yang anda perlukan (The only EKG
book you’ll ever need), 5th ed. Penerbit Buku Kedokteran.
[8] Ahmad Handayani, “Sistem Konduksi Jantung,” vol. 2, no. 3, pp. 116–123,
Oktober 2017.
[9] S. Setiawidayat, R. Hidayati, E. B. Sulistiarini, and N. Finahari, “PENDETEKSI
AMPLITUDO ELEKTROKARDIOGRAM DISKRIT MENGGUNAKAN
ALGORITMA PQRST,” 2017.
[10] Q. Zhao and L. Zhang, “ECG feature extraction and classification using wavelet
transform and support vector machines,” in 2005 International Conference on
Neural Networks and Brain, 2005, vol. 2, pp. 1089–1092.
[11] pilcher J, Pocket Guide to Neonatal ECG interpretation, 3rd ed. NICU INK
Book.
48

[12] Hu M.-K., “Visual pattern recognition by moment invariants,” vol. 8, no. 2, pp.
179–187, 1962.
[13] Zhihu Huang and Jinsong Leng, “Analysis of Hu’s Moment Invariants on Image
Scaling and Rotation,” ECU Publ., pp. 476–480.
[14] R. J. Martis, U. R. Acharya, and L. C. Min, “ECG beat classification using PCA,
LDA, ICA and discrete wavelet transform,” Biomed. Signal Process. Control,
vol. 8, no. 5, pp. 437–448, 2013.
[15] C. Saritha, V. Sukanya, and Y. N. Murthy, “ECG signal analysis using wavelet
transforms,” Bulg J Phys, vol. 35, no. 1, pp. 68–77, 2008.
[16] S. Sena, “Pengenalan Deep Learning Part 1 : Neural Network,” Samuel Sena, 28-
Oct-2017. .
[17] A. T. Goh, “Back-propagation neural networks for modeling complex systems,”
Artif. Intell. Eng., vol. 9, no. 3, pp. 143–151, 1995.
[18] N. Maglaveras, T. Stamkopoulos, K. Diamantaras, C. Pappas, and M. Strintzis,
“ECG pattern recognition and classification using non-linear transformations and
neural networks: A review,” Int. J. Med. Inf., vol. 52, no. 1–3, pp. 191–208, 1998.
[19] U. R. Acharya et al., “Deep convolutional neural network for the automated
diagnosis of congestive heart failure using ECG signals,” Appl. Intell., vol. 49,
no. 1, pp. 16–27, 2019.
[20] H. Gothwal, S. Kedawat, and R. Kumar, “Cardiac arrhythmias detection in an
ECG beat signal using fast fourier transform and artificial neural network,” J.
Biomed. Sci. Eng., vol. 4, no. 04, p. 289, 2011.
[21] U. R. Acharya, H. Fujita, S. L. Oh, Y. Hagiwara, J. H. Tan, and M. Adam,
“Application of deep convolutional neural network for automated detection of
myocardial infarction using ECG signals,” Inf. Sci., vol. 415, pp. 190–198, 2017.
[22] H. M. Rai, A. Trivedi, and S. Shukla, “ECG signal processing for abnormalities
detection using multi-resolution wavelet transform and Artificial Neural Network
classifier,” Measurement, vol. 46, no. 9, pp. 3238–3246, 2013.
[23] L.-Y. Shyu, Y.-H. Wu, and W. Hu, “Using wavelet transform and fuzzy neural
network for VPC detection from the Holter ECG,” IEEE Trans. Biomed. Eng.,
vol. 51, no. 7, pp. 1269–1273, 2004.
[24] P. P\lawiak, “Novel methodology of cardiac health recognition based on ECG
signals and evolutionary-neural system,” Expert Syst. Appl., vol. 92, pp. 334–
349, 2018.
49

[25] T.-E. Chen et al., “S1 and S2 heart sound recognition using deep neural
networks,” IEEE Trans. Biomed. Eng., vol. 64, no. 2, pp. 372–380, 2016.
[26] A. Joret, N. A. M. Isa, A. N. Ali, K. Z. Zamli, K. A. Azizli, and M. S. M. Al
Batah, “Classifying the shape of aggregate using hybrid multilayered perceptron
network,” in Proceeding ICS’05 Proceedings of the 9th WSEAS International
Conference on Systems, 2005, pp. 1–6.
[27] P. Plawiak, “ECG signals (1000 fragments),” vol. 3, Nov. 2017.
[28] A. Subasi, “EEG signal classification using wavelet feature extraction and a
mixture of expert model,” Expert Syst. Appl., vol. 32, no. 4, pp. 1084–1093, 2007.
[29] A. N. Sarlashkar, M. Bodruzzaman, and M. J. Malkani, “Feature extraction using
wavelet transform for neural network based image classification,” in Proceedings
of Thirtieth Southeastern Symposium on System Theory, 1998, pp. 412–416.
[30] S. H. El-Khafif and M. A. El-Brawany, “Artificial Neural Network-Based
Automated ECG Signal Classifier,” International Scholarly Research Notices,
2013. [Online]. Available:
https://www.hindawi.com/journals/isrn/2013/261917/. [Accessed: 15-May-
2019].
[31] “Plot classification confusion matrix - MATLAB plotconfusion.” [Online].
Available:
https://www.mathworks.com/help/deeplearning/ref/plotconfusion.html.
[Accessed: 11-Jun-2019].
50
APPENDIX A

GANTT CHART

Week
No Task
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
1 Meeting with supervisor and discuss about the project
2 Build an algorithm using MATLAB for identification system
3 Design MATLAB GUI
4 Build an application from MATLAB GUI
5 Writing report
6 Submit the report to supervisor
7 Make a correction to the report
8 Send final report to panel
9 Presentation
1. APPEN
51
APPENDIX B
Weight and Bias of the Identification System

Layer weight Bias1 Bias2


-0.58007 0.027851 -0.52084 -1.24933 0.137978 1.010651 -1.08575 -0.13319 1.931256 1.207712 -2.28334 -0.84564
1.486579 0.416063 0.429509 1.357011 0.120895 -1.09427 0.573916 0.545966 -2.24749 -0.16116 -2.30484 0.741408
-2.00479
Signal’s -0.30918
statistic 0.239447
feature -0.90998
-1.2657
-1.94925
-2.98591
2.966296
52
APPENDIX B

Layer weight bias1 bias2


-
1.157569 -0.79157 -0.74778 -0.21183 1.050714 0.891787 -1.32461 -0.17921 0.26067 -1.11174 -1.97598 0.190273
-
-0.44858 0.608271 0.097205 -0.30554 -0.1866 -0.62126 1.099984 0.611076 0.55377 0.931311 1.770234 1.803002
1.369562
Hu
-0.41182
moment
82% -1.00765
-0.10922
0.613797
-0.62572
1.600743
-1.90814

Layer weight bias1 bias2


-
1.093912 1.91567 -1.37487 -0.6962 -0.10061 -0.38008 -0.04707 0.056187 -0.44445 -0.3768 -2.1596 0.491185
-1.58189 1.50433 1.024128 1.260372 0.396517 0.005611 0.876384 -0.04338 0.878723 0.070566 2.10335 -0.61433
1.787019
Hu 0.771999
moment
0.071485
81%
-0.35193
0.75705
1.165687
-1.48465
1.919193
53
APPENDIX B

Layer weight bias1 bias2


1.654529 1.106441 0.166203 0.728575 1.572358 0.521796 0.2936 0.521528 -0.02965 -1.30003 -1.49599 -1.46395
-1.48893 -0.93206 0.467384 0.368209 -1.41916 -0.42583 -0.55761 0.766825 0.652505 1.332361 -1.15701 -1.24545
0.811085
0.534414
Wavelet 1
times 0.1455
0.095108
0.403611
0.841459
1.122391
1.377563

Layer weight bias1 bias2


-0.7466 0.218014 -0.36405 1.261976 -0.02562 -0.92115 1.648551 0.747467 -1.30833 1.440753 1.543283 1.254672
0.604482 0.165923 -0.58929 -1.13021 0.555322 0.785228 -1.65027 0.55856 1.334874 -1.46861 1.101669 1.275809
0.864145
-0.57932
Wavelet
2 times 0.123118
-0.11496
-0.60251
-0.87947
1.057729
1.567014
54
APPENDIX B

Layer weight bias1 bias2


1.642191 0.603128 -1.73049 -0.69835 1.651113 -1.55333 1.9978 -0.09411 0.21097 0.969586 1.411067 -0.90002
-1.60813 -0.56403 1.617547 0.628048 -1.5922 1.5643 -2.04175 1.179514 0.479154 -0.92751 0.939185 -0.8597
-0.97375
-0.2807
Wavelet
3 times -0.47057
0.258456
-0.408
1.076173
-0.81652
-1.6997

Layer weight bias1 bias2


1.226224 1.040879 -1.41811 -1.86971 -1.85154 1.628869 -1.32446 -1.64051 -0.10897 -0.58341 -1.52453 1.086963
-1.18264 -0.33115 1.541042 1.880034 1.812781 -1.58332 1.365846 1.668243 0.513104 0.879384 -1.2439 -0.97707
-0.86998
-0.22585
Wavelet
4 times 0.349478
-0.48939
0.923485
-0.99332
1.116108
1.759276
55
APPENDIX B

Layer weight bias1 bias2


-0.05843 2.948742 -2.24892 -1.05704 1.430126 0.439913 -2.68284 -2.73392 0.391106 0.360067 -1.69987 -1.44222
-0.85308 -2.90632 2.281332 1.160896 -1.49972 -0.33105 2.757681 2.758239 0.745356 0.367026 -1.45553 -1.0954
-1.4748
-0.47963
Wavelet 5
times -0.96368
-0.30359
0.46544
0.681031
1.441038
1.556321

Layer weight bias1 bias2


2.286848 0.366245 -2.57585 1.870213 1.503536 1.791557 -0.16688 -2.99079 3.47732 1.291911 1.726854 -1.26652
-2.3659 -0.76851 2.820829 -2.03626 -1.32319 -1.65464 -0.56921 3.01434 -3.40327 -0.72388 -1.9202 -0.66685
0.536351
-1.76163
Wavelet 6
times 0.149305
-0.68987
-0.82389
0.042084
-2.47745
2.206126
56
APPENDIX B

Layer weight bias1 bias2


-0.53775 0.225553 -0.19668 0.85569 2.540802 -0.18745 2.573946 1.709052 1.163766 -2.66158 -3.09798 -1.12756
0.583268 -0.39116 -0.7398 -1.00294 -2.58084 1.047847 -2.67155 -1.79606 -1.12035 2.771748 -1.4569 1.051329
-1.83024
-0.43522
Wavelet 7
times -2.20437
-0.19184
-0.04512
0.003779
-1.86672
-3.33285

Layer weight bias1 bias2


- - -
1.737425 0.871736 -2.95539 0.562526 0.02512 0.74414 0.22675 -0.80892 -2.31836 1.879936 -3.34654 0.279288
-
-1.73287 -1.28217 2.942357 -0.42085 1.07122 0.69427 -0.2906 0.891876 2.407066 -1.03516 -3.11676 -0.43666
-2.88187
Wavelet 8 -1.42638
times 0.248894
0.73998
1.13812
-2.42126
-4.21743
-4.42809
57
APPENDIX B

Layer weight bias1 bias2


0.23552 -0.34486 -0.49793 -0.44091 -0.37041 -1.09947 -1.46824 -1.67304 -0.11686 -1.16294 -14.0059 0.995178
-0.71264 0.550766 0.51482 0.334536 0.336846 1.14582 1.459547 1.668167 0.54257 1.029211 10.78708 -1.1682
8.290596
-4.98733
Wavelet 9
times 3.081397
-2.88216
4.867375
-6.94986
-10.8464
14.00024

Layer weight bias1 bias2


0.510252 0.189981 0.166378 0.683457 -0.06248 0.38424 1.097178 0.227595 0.120231 -0.09965 14.00562 -1.20472
-0.16158 0.312614 0.806583 -0.85957 0.068737 -0.42035 0.097915 0.5806 -0.68052 0.526931 10.93586 -1.27017
7.785967
-4.65774
Wavelet 10
times -1.53693
1.926402
4.663363
-7.71376
-10.9494
-13.9941
58
APPENDIX C

Main algorithm system in MATLAB

a) DWT Feature Extraction


clear
clc
load DataNN;

for i=1:2000,

y = Data(:,i);
a=length(y);
y1=[y zeros(1,500-a)]/max(y);

[ca,cd] = dwt(y1,'db1','mode','sym');
[ca2,cd2] = dwt(ca,'db1','mode','sym');
[ca3,cd3] = dwt(ca2,'db1','mode','sym');
[ca4,cd4] = dwt(ca3,'db1','mode','sym');
[ca5,cd5] = dwt(ca4,'db1','mode','sym');
[ca6,cd6] = dwt(ca5,'db1','mode','sym');
[ca7,cd7] = dwt(ca6,'db1','mode','sym');
[ca8,cd8] = dwt(ca7,'db1','mode','sym');
[ca9,cd9] = dwt(ca8,'db1','mode','sym');
[ca10,cd10] = dwt(ca9,'db1','mode','sym');

SampleData1(:,i)=ca;
SampleData2(:,i)=ca2;
SampleData3(:,i)=ca3;
SampleData4(:,i)=ca4;
SampleData5(:,i)=ca5;
SampleData6(:,i)=ca6;
SampleData7(:,i)=ca7;
SampleData8(:,i)=ca8;
SampleData9(:,i)=ca9;
SampleData10(:,i)=ca10;
end
59
APPENDIX C

b) Neural Network using nprtool

clear;
clc;

data=importdata('wavelet_result');
inputs = 1;
targets = 2;
nprtool

c) Identification System Using GUI

function varargout = prog_Gui_Final(varargin)


% PROG_GUI_FINAL MATLAB code for prog_Gui_Final.fig
% PROG_GUI_FINAL, by itself, creates a new PROG_GUI_FINAL or
raises the existing
% singleton*.
%
% H = PROG_GUI_FINAL returns the handle to a new PROG_GUI_FINAL
or the handle to
% the existing singleton*.
%
% PROG_GUI_FINAL('CALLBACK',hObject,eventData,handles,...)
calls the local
% function named CALLBACK in PROG_GUI_FINAL.M with the given
input arguments.
%
% PROG_GUI_FINAL('Property','Value',...) creates a new
PROG_GUI_FINAL or raises the
% existing singleton*. Starting from the left, property value
pairs are
% applied to the GUI before prog_Gui_Final_OpeningFcn gets
called. An
% unrecognized property name or invalid value makes property
application
% stop. All inputs are passed to prog_Gui_Final_OpeningFcn via
varargin.
%
% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows
only one
% instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES

% Edit the above text to modify the response to help prog_Gui_Final

% Last Modified by GUIDE v2.5 15-Jun-2019 22:10:16

% Begin initialization code - DO NOT EDIT


gui_Singleton = 1;
60
APPENDIX C

gui_State = struct('gui_Name', mfilename, ...


'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @prog_Gui_Final_OpeningFcn, ...
'gui_OutputFcn', @prog_Gui_Final_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end

if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT

% --- Executes just before prog_Gui_Final is made visible.


function prog_Gui_Final_OpeningFcn(hObject, eventdata, handles,
varargin)
% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin command line arguments to prog_Gui_Final (see VARARGIN)

% Choose default command line output for prog_Gui_Final


handles.output = hObject;

% Update handles structure


guidata(hObject, handles);
axes(handles.axes1);
imshow('Logo1.png');
axes(handles.axes2);
imshow('uwg.jpg');
axes(handles.axes3);
imshow('ecg.jpg');

% UIWAIT makes prog_Gui_Final wait for user response (see UIRESUME)


% uiwait(handles.figure1);

% --- Outputs from this function are returned to the command line.
function varargout = prog_Gui_Final_OutputFcn(hObject, eventdata,
handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

% Get default command line output from handles structure


varargout{1} = handles.output;

% --- Executes on button press in pushbutton1.


function pushbutton1_Callback(hObject, eventdata, handles)
61
APPENDIX C

% hObject handle to pushbutton1 (see GCBO)


% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global data;
[filename, pathname] = uigetfile({'*.*'}, 'Pick a file');

file=[pathname '\' filename];


b = load(file);
y = struct2array(b);
a=length(y);
y1=[y zeros(1,500-a)]/max(y);

[ca,cd] = dwt(y1,'db1','mode','sym');
[ca2,cd2] = dwt(ca,'db1','mode','sym');
[ca3,cd3] = dwt(ca2,'db1','mode','sym');

data=[ca3'];
figure(1)
subplot(211),plot(y),title('ECG SIGNAL'), xlabel('Sampling'),
ylabel('Amplitude (v)');
grid on
subplot(212),plot(data), title('Feature wavelet'),
xlabel('Sampling'), ylabel('Amplitude (v)');;

grid on

% --- Executes on button press in pushbutton2.


function pushbutton2_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global data;
load 1ca3_91
x = sim(results.net,[data]);
[ww ee]=max(x);
if ee==1,
ss='A normal hear';
else ee==2,
ss='An abnormal heart';
end
msgbox(num2str(ss));

% --- Executes on button press in pushbutton3.


function pushbutton3_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
close

% --- Executes on button press in pushbutton4.


function pushbutton4_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton4 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
figure(2)
imshow('Sinyal_Jantung.png')

You might also like