Classification of ECG Signals Report PDF
Classification of ECG Signals Report PDF
A Project
MASTER OF SCIENCE
in
by
Sahana Ramesh
Tejaswini Sumanam
FALL
2016
CLASSIFICATION OF ECG SIGNALS
A Project
by
Sahana Ramesh
Tejaswini Sumanam
Approved by:
____________________________
Date
ii
Student: Sahana Ramesh
Tejaswini Sumanam
I certify that these students have met the requirements for format contained in the University format
manual, and that this project is suitable for shelving in the Library and credit is to be awarded for
the project.
iii
Abstract
of
by
Sahana Ramesh
Tejaswini Sumanam
device used in cardiology, which records heart’s electrical signals over time. ECG can be used to
determine various heart diseases or damages to the heart along with the pace at which the heart
beats as well as the effects of drugs or devices used to control the heart. The interpretation of the
ECG signals is an application of pattern recognition. The technique used in this project integrates
the study of the ECG signals and their classification. Analysis of ECG signals is done using neural
network pattern recognition and classification methods. The study includes simulation of ECG
signals, comparison between ECG signals, and detection of any abnormalities in the signal by using
The processed signals used in this project are obtained from an arrhythmia database, which was
Israel Hospital (MIT-BIH). The neural clustering application available in the pattern recognition
tool software is used to classify ECG signals based on self-organizing maps. Self-organizing maps
are used to cluster the data, based on the similarity and topology, which reduces the dimensionality
iv
of the data. Thus, after training the network using the classification tool, a given ECG signal can
____________________
Date
v
ACKNOWLEDGEMENTS
I would like to take an opportunity to express my deepest gratitude to Dr. Fethi Belkhouche,
Electrical and Electronic Engineering, Department Coordinator Dr. Preetham B. Kumar, California
State University Sacramento (CSUS), for their support and guidance throughout the project. I
would like to thank all my advisors and extend my sincere thanks to the organization which gave
A special thanks to my teammate, who gave me her constant support in developing the project and
Finally, I would like to thank my family and friends, for their continuous support and
vi
TABLE OF CONTENTS
Page
Acknowledgements……………………………………………………………………………......vi
List of Tables………………………………………………………………………………………ix
List of Figures………………………………………………………………………………………x
Chapter
1. INTRODUCTION ................................................................................................................... 1
vii
2.4. Architecture and Training Methods .......................................................................... 24
References.................................................................................................................................... 46
viii
LIST OF TABLES
Tables Page
ix
LIST OF FIGURES
Figures Page
12. Generic Flowchart Indicating the Steps for Classification of ECG Signal ............................. 16
19. Neural network Clustering Tool (nctool) for Pattern Classification ....................................... 31
x
21. Loading Data in the Neural Network Clustering Tool (nctool) .............................................. 32
23. Training the Network in the Neural Network Clustering Tool (nctool) ................................. 33
24. Detailed Options of the Plots Obtained after Training the Neural Network. .......................... 34
xi
1
Chapter 1
INTRODUCTION
In today’s world, because of the increasing stress and unhealthy diet, problems related to heart
in 1901 [1]. ECG is a device which measures and records the heart’s electrical activity over a period
of time [2]. Since then, the procedure has become one of the routine check-ups to monitor and
obtain information about the structure, function, and condition of the heart.
An electrocardiogram is the most important diagnostic tool used in the field of medicine, to record
and measure the electrical activity of the heart as waveforms [2]. Understanding the obtained
waveforms helps in the diagnosis of the heart condition which can range from minor to life-
threatening.
A nerve impulse stimulus to the heart generates an ECG signal. When current diffuses over the
surface of the body, it develops a voltage drop in the range of μV to few mV with an impulse
variation [2].
2
The heart is a muscular organ, located in the middle compartment of the chest. It has four chambers.
The upper left and right chambers are called Atria and the lower left and right chambers are called
Ventricles [3]. The heart is protected by ribs and has many one-way valves as shown in figure 1.
The main functionality of the heart is to pump blood through blood vessels of the circulatory
system.
The contraction and expansion of the muscles of the heart enable the blood to be pumped. Under
normal conditions, these contractions are triggered in two areas of the heart – Sinoatrial (SA) and
The triggered electrical signals are detected by ECG. Because of the electrical activity, currents are
produced in the body which radiates around the skin tissue. When electrodes come in contact with
the skin, they sense the electrical currents and transmit them to electrocardiograph [2]. The obtained
electrical current is then transformed into waveforms which represent the heart’s depolarization-
Depolarization is defined as the sudden change within a cell, during which the cell undergoes a
dramatic electric change from negative to positive in a brief time. The electrical changes on the
skin that arise from heart muscle depolarization during each heartbeat are detected by the electrodes
first in atria
then in ventricles
The typical waveform generated during depolarization looks like figure 2 as shown below.
Referring to figure 1, the sinoatrial (SA) node on the wall of the right atrium initiates depolarization
at the right & left atria. This causes atrial contraction resulting in the generation of P wave (figure
3). The resulted QRS complex is generated due to ventricular depolarization, caused by the
spreading of the electrical activity from the Atrioventricular node (AV node) through the ventricles.
This precedes ventricle contraction. At this time, atrial repolarization also occurs. Finally, the T
wave is the result of ventricular repolarization. Repolarization is slower than depolarization, hence
the T wave is usually wider than the P wave and the QRS complex [5].
Repolarization- This is the relaxation phase [2]. ECG measures a precise sequence of electrical
events occurring in cardiac cells throughout the process. Any conduction abnormalities and rhythm
An ECG tracing of a normal heartbeat typically looks like figure 4. The ECG signal comprises of
three distinguishable waves which are known as deflection waves, each representing an important
aspect of cardiac function [5]. The three main elements of ECG signals are a P wave, a QRS
complex wave, and a T wave. Parameters such as the values of amplitude, range etc.., of P, QRS &
T waves together with durations are measured. The typical PR, QRS, QT and RR intervals are
shown in figure 4. The isoelectric line is the baseline voltage of the electrocardiogram at point 0 on
the y-axis, i.e.., at 0mV [2]. The waveform below the baseline is the negative deflection. The
portion of the tracing after the T wave to starting of the next P wave is indicated as the isoelectric
line.
From these calculations, the heart condition is determined based on the amount of variation, so that
the cardiologist can recommend the amount of dose required for medication.
6
Each point of the heartbeat produces different deflection on the ECG signal. Referring to figure 4,
one complete ECG wave is divided into various segments and intervals which relate directly to the
phases of cardiac conduction. Each component is important in the detection of abnormalities since
they occur at a specific time and have a particular range. Limits can then be set on these components
1. The PR interval,
2. The PR segment,
4. The QT interval,
6. The RR interval.
PR interval – PR interval can be identified as the region from the starting of the P wave to starting
of the QRS complex as shown in figure 5. Since Q wave is frequently absent, this interval is termed
as PR interval. PR interval can be defined as the time the impulse takes to reach the ventricles from
the sinus node [6]. The normal PR interval range is between 0.12-0.2s. If the value of the PR interval
is less than 0.12 seconds, it is termed as a short PR interval. If the value of the PR interval is greater
PR segment - The region of the PR segment is the endpoint of the P wave to the beginning of the
QRS complex as shown in figure 6. The duration of the conduction in the atrioventricular muscle
systole and ventricular diastole. The isoelectric property deviates in the presence of an atrial injury
[6].
QRS complex - This indicates the interval of ventricular depolarization. The region of the QRS
complex begins at the Q wave and ends at the S wave. QRS complex is as shown in figure 7. It tells
us the amount of time the signal takes to spread throughout the ventricles, which normally should
be 0.12s [6]. However, various conditions can cause a lengthened QRS duration. Generally, all
QRS complexes look alike. Even if one of the waves of QRS complex is absent, they are still termed
as QRS complexes.
QT interval – The QT interval indicates the duration of the ventricles from the depolarization to the
repolarization. The region begins at the beginning of the QRS complex and extends to the endpoint
of the T wave as shown in figure 8. The duration varies with gender, seniority, and the heart rate.
Some of the diseases like hypercalcemia, hyperthyroidism, and hyperkaliemia are due to short QT
intervals [6]. Few others such as, slow heart rates, myocarditis, hypokalemia, hypocalcemia are due
ST segment – It starts at the endpoint of the S wave and finishes at the onset of the T wave, as
shown in figure 9. It is normally isoelectric. During this period, the electrical activity is not visible
since the atrial cells experience relaxation and the ventricles experience contraction. ST segment
depression, termed as myocardial ischemia is occurred due to blocked arteries [6]. Cardiac injury
RR interval - The RR interval is measured as the time between the R wave of two adjacent
heartbeats. This is as shown in figure 10. The RR intervals are normally regular, but the irregularity
The electrical current radiates in many directions over the surface of the skin and the diffused
current builds a voltage drop. This is usually a couple of μV to mV with an impulse variation [2].
Since this is a very small amplitude, the signal has to be amplified in order to get a complete picture
of the electrical activity. To measure the electrical activity, electrodes are placed at different
locations on the body. The electrocardiogram then records the information from different
Leads: A lead provides a view of the electrical activity between two points or poles. Each lead
consists of one positive and one negative pole. There is an imaginary line between two poles which
11
represents lead axis, indicating the direction of current moving through the heart. Since each lead
measures the heart’s electrical potential, each generates its characteristics tracing obtained from a
different direction [2]. The direction in which the electric current flows, tells us how the waveform
appear on the ECG tracing [2]. When the current flows along the axis towards the positive pole of
the electrode, the waveform deflects upward and is called positive deflection. If the current flows
in an opposite direction, the waveform deflects downwards below the baseline, which is called
negative deflection. When the current goes perpendicular to the axis, it may go in both directions
or may be very small. However, if there is the absence of electrical activity or if the amount is
negligible to measure, the resulted waveform will be a straight line, called an isoelectric deflection
[2].
Plane: It provides a different view of the electrical activity [2]. The frontal plane is a vertical cut
through the middle of the heart that is from top to bottom. The electrical activity is viewed from
the right and left [2] (the plane of the body that is parallel to the ground when one is lying on the
back [5]). The horizontal plane is a horizontal cut through the middle of the heart, dividing it into
upper and lower portions. The electrical activity is viewed as moving anteriorly and posteriorly [2]
(the plane of the body that is parallel to the ground when one is standing straight [5]). For two or
three channel ECG, only the leads in the frontal plane are required [5].
12
Generally, there are three basic leads in the frontal plane of an electrocardiogram, resulting in a
combination of a pair of electrodes, placed at Right Arm (RA), Left Arm (LA) and Left Leg (LL)
of the patient. The leads are defined as, Lead I – LA to RA, Lead II – LA to RA and Lead III – LL
to LA [5].
Bipolar leads record the voltages between the electrodes placed on the wrist and legs [5]. The types
of ECG recording obtained from the lead method are shown in figure 11. They are as follows:
Lead I – recordings are obtained between Right Arm and Left Arm
Lead II – recordings are obtained between Right Arm and Left Leg.
Lead III – recordings are obtained between Left Arm and Left Leg.
13
The standard 12-lead electrocardiogram represents the heart’s electrical activity in three orthogonal
directions. The electrical activity is obtained from the recording of four limb electrodes and six
chest electrodes placed on the surface of the body. The three directions are from Right to Left and
vice versa, Superior to Inferior and vice versa, Anterior to Posterior and vice versa [8]. The recorded
electrical activity is obtained from 12 different positions, 6 standard limb leads and 6 precardial
Each lead monitors a specific portion of the heart in the positive electrode’s point of view
Each of 12 leads represents a particular orientation in space indicated as RA- (Right Arm), LA-
The bipolar limb leads towards frontal plane have the following leads. Namely:
The augmented unipolar limb leads towards frontal plane have the following leads.
Namely:
15
c. Lead AVF (aVF), indicates the measurement from LL (positive) to [RA & LA]
The unipolar (positive) chest leads towards horizontal plane have the following leads.
Namely:
b. V4, V5, V6, indicates the measurement from right left or lateral.
ECG is the device which takes electrical activity of human heart into consideration and records the
readings which on further analysis helps in saving human life. The recorded ECG signal has noise
such as baseline wandering, power line interface, muscle noise, instability of electrode-skin
Hence, the ECG signal must be preprocessed before classification and then features are extracted
The ongoing research aims at reducing noise and better classification methods to get more accurate
results.
Figure 12: Generic Flowchart Indicating the Steps for Classification of ECG Signal
17
Since noise removal also plays an important role in the signal detection and the nature of most noise
sources are known, we can reduce noise or even attenuate it completely. In recent times, many
noise removal techniques have been developed such as band pass filters, Fourier-based analysis
and transforms etc.., which are dependent on averaging and smoothing the signal or transforming
the signal from time domain to frequency domain. By using the above mentioned techniques, it
Generally, classification is a two-step process. Supervised learning is the first step, in which the
predefined class labels are assigned the training data. The second step is to evaluate the
classification accuracy.
Based on the present situation and medical literature inspection, we can conclude that future work
in this field should be focused on the efforts to further standardize annotations and testing principles
and methodologies. Algorithms need to be proposed for effective classification and multi-lead
analysis.
The features related to other cardiac conditions should be identified in the feature extraction step,
an important step in classification. This research can be applied in the field of telemedicine. Remote
access of ECG diagnosis is a very useful service. The clustering and the pattern recognition tool
should train the network effectively to classify the signals at an early stage of training.
18
Many algorithms have been developed so far for the detection of ECG signal, feature extraction of
the signal and classification of ECG signals. A.B Ramli and P.A.Ahmad [9] used cross-correlation
analysis technique for the extraction of features from 12-lead ECG signal measurement technique.
They also concluded that the cross-correlation and auto-correlation methods work better in
evaluating and analyzing the parameters which are extracted. Thus differentiating between normal
Pawel Tajedko and Waldemar Rakowski [10] used Kohonen maps or self-organizing maps. They
also used learning vector quantization algorithms to classify and compare the QRS complexes.
Normal or arrhythmatic beats are accessed for their performance. They used MIT-BIH arrhythmia
Xiaomin Xu and Ying Liu [11] proposed sloped waveform vector algorithm for ECG QRS complex
detection and evaluation of the RR interval. They used variable stage differentiation and non-linear
B. Castro, D. Kogan and A.B. Geva [12] proposed an algorithm based on wavelet transformation
for feature extraction and identification of abnormal heartbeats. Thus helped in finding out the best
correlation with ECG signal. The ECG signal is preprocessed first to attenuate noise and using
optimal wavelet function, each PQRST cycle is divided into coefficients vector. The ECG signal
19
components P wave, QRS complex and T wave are separated and summed up to obtain the feature
K. Zhu, P.D. Noakes and A.D.P. Green [13] discussed the use of artificial neural networks to detect
abnormalities in ECG. The proposed method uses waveform slope to locate the QRS complex and
H. Gholam Hosseini, D. Luo, K.J. Reynolds [14] proposed a two-stage feed forward neural
network. Here they have chosen two network architectures based on single stage and two stage feed
forward networks to recognize abnormalities. They concluded that the two-stage network used
Chapter 2
An Artificial Neural Network (ANN) is an information processing entity, which is inspired by how
biological nervous systems process information [15]. The information processing system’s
structure is made up of many interconnected processing elements called neurons, working together
biological systems requires adjustments to the connections between the neurons [15].
interconnected process unit, which consists of a summing part and an output. The process unit
computes output according to N input values, weights and their sum (sum of the product of input
and corresponding weight). The weighted sum is the activation value on which the output is based
[15].
For pattern recognition tasks, interconnections are needed. To achieve the pattern recognition task,
many processing units are connected with particular topologies. These processing units get inputs
from an output of another process unit or from an external source. At each time, the output has the
unique value due to its unique weighted input values during computation. The activation value at
21
any particular instant is nothing but the set of N activation values of the network. Similarly, the
output at any particular instant is the set of N output values of the network [15].
During operation, each unit of ANN will get inputs from other units or externally from another
source. The activation value determines the output from the functional unit. A pattern is stored in
the network when an input is provided to the activation dynamics. To store a pattern, the weights
corresponding to the input connections are to be adjusted. A weight vector is the set of all weights
on all connections, which is nothing but the weight space [15]. Synaptic dynamics can be found by
There are three classical models of artificial neurons (processing units) namely, McCulloch-Pitts
Model, Perceptron and Adaline [15]. Neuronal dynamics govern every neural network’s operation.
Neuronal dynamics consist of 2 parts. The first one corresponds to the activation state and the
second to the synaptic weights. The short-term and long-term memory networks are modeled by
activation state of the network which correspond to an encoded pattern information in weights due
to learning [15]. The process of adjusting the weights to store the pattern is called learning. After
the learning process, the final set of weight values corresponds to the long-term memory function
of the network.
22
A neural network is known as the MART, which is an abbreviation for multi-channel adaptive
resonance theory developed by Carpenter and Grossberg [3]. A computer-aided diagnosis system
is required in monitoring cardiac health status since it is difficult to understand and replicate the
ECG signals due to their nonlinear and nonstationary nature. MART performs a process where, the
weights are updated with each QRS. It is governed by on-line and supervised learning.
Artificial neural networks are nothing but pattern matching techniques. They can be used for
detecting morphological changes in non-linear signals like ECG signal. Selection of an optimal set
of relevant features plays a vital role in pattern classification [15]. Having the best pattern
classification technique is not enough to meet higher accuracy in pattern classification. The selected
features should be able to separate the classes up to a considerable extent, otherwise, they become
irrelevant. It is necessary to check the selected features for redundancy and irrelevancy. Even
though various methods can be used to extract different features from the same raw data, the role
The flowchart below represents the different stages before feeding the signal to the pattern
Pattern recognition is the study of how machines can observe the environment and analyze the
different patterns in order to categorize them into groups [15]. Even after 60 years of research, the
best pattern recognizers are humans, yet we do not understand how we recognize patterns [15]. Our
goal here is to use the best possible pattern recognition technique using artificial neural networks
The recognition problem is grouped as a classification, where the system designer defines classes
(supervised classification) or a categorization, in which patterns are learned, based on the similarity
between them (unsupervised classification). There are many applications such as data mining,
document classification, biometrics and organization and retrieval of multimedia databases. It plays
a crucial role in the data analysis and classification because of the rapid growth and availability of
computing power, while enabling faster processing of huge data sets. At the same time, due to high
performance requirements and immense database availability, demand for automatic pattern
24
recognition system increases. The design of a pattern recognition system involves the following
three aspects:
Decision making.
To perform pattern classification or clustering efficiently, the learning process is very important. It
involves updating network architecture, connections and weights. In addition to the existing feature
extraction and classification, Artificial Neural Networks (ANNs) provide a new technique of
nonlinear algorithms for efficient implementation. Learning process or training the network is an
important feature of the most pattern recognition systems. The four best known approaches for
Template matching,
Statistical classification,
Neural networks.
Based on the connections of the network, ANNs are classified into two types:
In the feed-forward neural network, data flows forward from the input to the output as shown in
figure 14.
Single-layer perceptron network is one of the simplest kind of feed-forward neural networks where
the inputs are directly fed to the output through a series of weights. The output obtained at each
node of a single layer network is the sum of products of the weights and the inputs [16]. The neuron
excites if the computed value is above the threshold (which is typically 0) and takes the activated
value (which is typically 1) else, it takes the deactivated value (which is typically -1). These neurons
with activation function are also called artificial neurons or linear threshold units [15]. The
term perceptron in this literature refers to networks consisting of just one of these units [16]. Single-
In multi-layer perceptron network, each neuron of one layer is connected to another neuron of the
subsequent layer in a feed-forward way which results in multiple layers of computational units as
shown in figure 16. Among the various learning techniques, it uses the most popular technique
Recurrent Neural Networks (RNNs) form a cycle between units to create network states, enabling
the dynamic behavior. Figure 17 shows recurrent artificial neural network. RNNs use memory to
process random inputs [15]. RNNs find their application in handwriting and speech recognition.
As mentioned above, the process adjusting the weights is called learning and it is carried out using
algorithms like back-propagation techniques [15]. Depending on the application and architecture,
In supervised learning, set of inputs and outputs are given and the training algorithm will adapt the
weights in a way to produce an exact output corresponding to the input [15]. The network can
produce expected output for sample inputs, because of which, they are suited to model and control,
dynamic systems, hence they can differentiate noisy data, and predict events [17].
28
In unsupervised learning, ANN creates an algorithm by using variable features in the unlabeled
dataset [15] where the network is trained by varying inputs and finding a correlation between data
to classify it [17]. Neural Network toolbox has self-organizing, unsupervised networks. They are
In reinforcement learning, weights are changed by considering environment support with respect
to the training algorithm. Neural Network toolbox supports various supervised and unsupervised
network architectures. Custom network architecture can be built using neural modular approach.
29
Chapter 3
RESEARCH METHODOLOGY
Automated ECG interpretation makes use of the artificial intelligence and pattern recognition
software knowledge to carry out the interpretation automatically, test reporting, and computer-
aided diagnosis of electrocardiogram tracings. The first automated ECG programs were developed
in the 1970s, during which the digital ECG machines also became practicable by third generation
digital signal processing boards and few commercial models developed by Hewlett-Packard,
assimilated these programs into clinically used devices [18]. In order to improve the accuracy
compared to first models, extensive research was carried out by universities during the 1980s and
1990s.
As discussed, the methods of classifying ECG signals involve various steps, including signal
acquisition, noise removal, QRS detection, feature extraction and most importantly, the artificial
neural networks techniques. In this project, the dataset for the classification of the ECG signal is
extracted from MIT-BIH database and fed as an input to the Neural Network Toolbox which further
classifies the ECG signals. We use the concept of Self-Organizing Maps (SOMs) which is also
known as Kohonen maps in order to categorize the given set of signals. It incorporates unsupervised
Neural network toolbox provides algorithms and functions to visualize and simulate neural
networks. It also includes auto encoder and deep learning algorithms for pattern recognition
30
techniques [19]. To speed up the training of large datasets, we can distribute computations and data
across multicore processor, computer clustering using parallel computing toolbox. The toolbox
contains functions for the creation, visualization, and analysis of Self-Organizing Maps [20]. The
features are used to classify input vectors according to the groups in the input space [17].
Neural network classification or clustering toolbox from the MATLAB is used in this study. Here
are the steps to be followed in the nctool (Neural Network Classification or Clustering Tool) in
Step 1: To classify patterns with Neural Networks, start the neural network GUI command – nnstart,
Step 2: Select the “Clustering app” to perform classification with nctool – Neural Network
Clustering Tool.
Figure 19: Neural network Clustering Tool (nctool) for Pattern Classification
Step 3: Click on the highlighted “Next” button to select the data to feed as an input to the tool. The
Step 4: Load the dataset for classification. Click on the highlighted “Next” option. The selected
data is loaded.
Figure 21: Loading Data in the Neural Network Clustering Tool (nctool)
Step 5: Select the network size (number of neurons to train the network) as shown in figure 22. The
network has one layer where neurons are organized in a grid. The network can be created by
specifying the required number of rows and columns in the grid. For the first iteration, required
number of rows and columns are set to 5, which gives the number of neurons. The network
architecture is created by the tool for the specified number of neurons. To improve the functionality
of the network, the number of neurons of the network can be changed by navigating back to this
step.
33
Step 6: Next, click on “Train” button to train the network in order to learn the topology and
distribution of the input samples. The performance depends on the number of neurons in the hidden
layer. Training multiple times generates different plots and outputs, as inputs and sampling change
each time. The number of epochs can be defined before training the network.
Figure 23: Training the Network in the Neural Network Clustering Tool (nctool)
34
Once the network is trained, various plot options are obtained in order to study the behavior of
Figure 24: Detailed Options of the Plots Obtained after Training the Neural Network.
At this step, a number of plots such as- Plot SOM Neighbor Distances (plotsomnd), Plot SOM
Sample Hits (plotsomhits), Plot SOM Weight Planes (plotsomplanes), Plot SOM Weight
Step 7: Next step is to evaluate the network as shown in figure 25, either with a new set of data or
increasing the performance by increasing the number of neurons (Go to Step 5).
Step 8: Then we deploy and save the results and obtain the code of the entire procedure followed
Step 9: Next step is to complete the training process and exit. The following window appears, where
Chapter 4
While investigating the work in chronological order we realized that there are various ways and
techniques through which the most accurate output can be obtained. Computerized detection and
classification of cardiac conditions is an active area of research. Though there are merits in the
implementation of ANN for pattern recognition and classification, it always gives sound results.
The automatic cardiac classification has a vast number of applications and may provide a
research provides a complete description of the procedure required in a system that categorizes and
The most important step in ECG signal classification is to detect and measure the peaks and
different waveforms which form the entire ECG signal. Various supervised and unsupervised
Artificial Neural Network models have been proposed for ECG signal feature extraction and
classification in the literature. Neural network clustering tool, based on self-organizing maps is
The various plots obtained for five neurons, meaning, a 5 * 5 two-dimensional map are as shown
a) SOM Neighbor Distances (MATLAB function: plotsomnd): The distance between each neuron
b) SOM Sample Hits (MATLAB function: plotsomhits): Representation of the classified input
vectors of each neuron and the relative number of vectors for each neuron via the size of colored
patch.
c) SOM Weight Positions (MATLAB function: plotsompos): Here we see that the neurons are
located at different positions when we train the network for the first time. This means that the
required value of the weight vectors is not assigned to the inputs at the first iteration. So,
training the network is necessary till the neurons get closer to the groups. Once the appropriate
weights get adjusted to the corresponding inputs, the response to the input space is very strong.
e) SOM Neighbor Connections (MATLAB function: plotsomnc): This plot gives us the
f) SOM Weight Planes (MATLAB function: plotsomplanes): SOM weight planes give the plots
of weights with different inputs. Figure 33 shows the weight panel for each element of the input
vector. If two inputs are very similar, then we can assume that the inputs are highly correlated.
For SOM training, the weight vector attached to each neuron moves to the center of the cluster.
These cluster of input vectors along with the neurons gets organized in a structured manner. When
an n - dimensional data is fed as an input to the SOM, it organizes all the input data into different
classes.
Among all input data available, there will be an input which is a stimulus to the corresponding
winning (output) neuron. Depending on that particular input value, the output updates it's
displacement with other neurons and categorizes into groups. The minimization of the distance
Additionally, the neurons that are next to each other in the network topology also move close to
each other because of which we can interpret high-dimensional input space in the two dimensions
From the MIT- BIH database, 16 sets of data were used for classification. Training the network for
Case1: n=5,
Case2: n=15,
Case3: n=25,
Case5: n=60.
42
Comparisons were made between different network topology plots for each case. In order to
classify the signals, one has to train the network until the required distribution of weights and the
required topology are obtained. Based on the neighboring distances, weight planes, and distribution
APPENDIX
x = data;
% Plots
% Uncomment these lines to enable various plots.
%figure, plotsomtop(net)
%figure, plotsomnc(net)
%figure, plotsomnd(net)
%figure, plotsomplanes(net)
%figure, plotsomhits(net,x)
%figure, plotsompos(net,x)
44
Advanced script
x = data;
% Plots
% Uncomment these lines to enable various plots.
%figure, plotsomtop(net)
%figure, plotsomnc(net)
%figure, plotsomnd(net)
%figure, plotsomplanes(net)
%figure, plotsomhits(net,x)
%figure, plotsompos(net,x)
% Deployment
% Change the (false) values to (true) to enable the following code blocks.
% See the help for each generation function for more information.
45
if (false)
% Generate MATLAB function for neural network for application
% deployment in MATLAB scripts or with MATLAB Compiler and Builder
% tools, or simply to examine the calculations your trained neural
% network performs.
genFunction(net,'myNeuralNetworkFunction');
y = myNeuralNetworkFunction(x);
end
if (false)
% Generate a matrix-only MATLAB function for neural network code
% generation with MATLAB Coder tools.
genFunction(net,'myNeuralNetworkFunction','MatrixOnly','yes');
y = myNeuralNetworkFunction(x);
end
if (false)
% Generate a Simulink diagram for simulation or deployment with.
% Simulink Coder tools.
gensim(net);
end
REFERENCES
http://www.lww.com/opencms/opencms/PEMR/content/WCZ623/ECG_Strip_Ease_p30_
https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=4&ved=0ahUKE
wjY9NHPw6fQAhVjylQKHcoBCEMQFggsMAM&url=https%3A%2F%2Fptop.only.wip.la%3A443%2Fhttps%2Fxa.yimg.co
m%2Fkq%2Fgroups%2F16244888%2F105180463%2Fname%2FGaoQ.pdf&usg=AFQj
CNG52jcFFUVq8_l801qdSuNxlKZPng&sig2=RTg1u8RecyGVXWhrSqV7JQ&bvm=bv
[4] Gambar. “Human Heart Outline HH001 References of Human Heart”. [Online].
October 2016].
https://www.studyblue.com/notes/note/n/cardiovascular/deck/13827179 [Accessed:
October 2016].
[8] ECG Learning Center. “The Standard 12 Lead ECG”. [Online]. Available:
[9] A.B. Ramli and P.A. Ahmad, “Correlation analysis for abnormal ECG signal features
[10] Pawel Tadejko and Waldemar Rakowski “Mathematical Morphology Based ECG Feature
and Industrial Management Applications, 2007. CISIM '07. 6th International Conference
[11] NCBI. “ECG QRS complex detection using slope vector waveform (SVW) algorithm”.
September 2016].
[12] B. Castro, D. Kogan and A.B. Geva “ECG feature extraction using optimal mother
wavelet” in Electrical and Electronic Engineers in Israel, 2000. The 21st IEEE Convention
[13] K.Zhu, P.D.Noakes and A.D.P.Green “ECG Monitoring with artificial neural networks” in
2016].
48
[14] The comparison of different feed forward neural network architectures for ECG signal
https://www.researchgate.net/publication/7642798_The_comparison_of_different_feed_f
2016].
[15] B.Yegnanarayana “Artificial Neural Networks”, New Delhi: Prentice Hall of India
https://www.mathworks.com/products/neural-network/features.html#network-
http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.97.179&rep=rep1&type=pdf.
https://www.mathworks.com/help/nnet/gs/cluster-data-with-a-self-organizing-map.html.