0% found this document useful (0 votes)
5 views5 pages

Support Vector Machine Based Heartbeat Classification: N P Joshi, P S Topannavar

Uploaded by

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

Support Vector Machine Based Heartbeat Classification: N P Joshi, P S Topannavar

Uploaded by

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

International Journal of Advances in Science Engineering and Technology, ISSN: 2321-9009 Volume- 2, Issue-3, July-2014

SUPPORT VECTOR MACHINE BASED HEARTBEAT


CLASSIFICATION
1
N P JOSHI, 2P S TOPANNAVAR
1
Student, 2Professor JSPM’s I.C.O.E.R., Pune

Abstract- In this paper, a new approach for heartbeat classification is proposed. The system uses the combination of
morphological and dynamic features of ECG signal. Morphological features extracted using Wavelet transform and
independent component analysis (ICA). Each heartbeat undergoes both the techniques separately. The dynamic features
extracted are RR interval features. Support vector machine is used as a classifier, after concatenating the results of both the
feature extraction techniques, to classify the heartbeat signals into 16 classes.Whole process is applied to both the lead
signals and then the classifier results are fused to make final decision about the classification. The overall accuracy in
classifying the signals from MIT-BIH arrhythmia database should be 99% in “class-oriented” evaluation and an accuracy of
86% in the “subject-oriented” evaluation.

Keywords- Heartbeat Classification, Support Vector Machine, Independent Component Analysis, Wavelet Transform.

I. INTRODUCTION V6 leads represent the area of heart. In 45 records,


Lead A signal is a modified limb Lead II while Lead
Electrocardiogram (ECG) analysis used in health B is a modified Lead V1. In remaining 3 records,
centresalways needs advanced research to control Lead A is from position V5 and Lead B signal is V2.
cardiac disorders.Cardiac disorders include Observation shows that peaks in Lead A signal are
conditions such as abnormal behaviour of heart. more prominent than that in Lead B signal.
Some of the disorders in this group need medical
emergencies without which subject can cause B. Evaluation schemes
impulsive death.
Previous literature is divided into two categories
There is another class of arrhythmias which is not according to the evaluation scheme followed.
critical for life but still should be given attention and Following evaluation schemes are used:
treated. Classification of heartbeats depending on 1) Class-oriented evaluation.
classes of heartbeats is an important step towards 2) Subject-oriented evaluation.
treatment. Classes are based on consecutive heartbeat All 48 records contained in MIT-BIH arrhythmia
signal [1].To satisfy the requirements of real-time database are used. Each ECG signal contains its own
diagnosis, online monitoring of cardiac activity is annotation file in database. Those annotations of QRS
preferred on human monitoring & interpretation. Also complex are used for segmentation of ECG signals
automatic ECG analysis is preferred for online from which heartbeat segments can be obtained.
monitoring & detection of abnormal activity observed There are 16 classes of ECG signals as follows:
in heart. Hence, automatic heartbeat classification
using parameters or characteristic features of ECG TABLE I
signals is discussed in this paper. CLASSES OF ECG SIGNAL
Heartbeat type Annotation
II. DATASET Normal Beat N
Left Bundle Branch Block L
A. Arrhythmia database Right Bundle Branch Block R
The MIT-BIH arrhythmia database [2] is the standard Atrial Premature Contraction A
material used for training & testing of the algorithm Premature Ventricular Contraction V
developed for detection & classification of Paced Beat P
arrhythmia ECG signals. By using this database we Aberrated Atrial Premature Beat A
cancompare the proposed method with the Ventricular Flutter Wave !
approaches in published results. MIT-BIH arrhythmia Fusion of Ventricular and Normal F
database is exploited for testing the system. Beat
There are total 48 records. All signals are two lead
Blocked Atrial Premature Beat X
signals denoted as lead A & lead B signal. These
Nodal (Junctional) Escape Beat J
signals are filtered using BPF at 0.1 Hz - 100Hz.
Sampling of these signals is performed at 360 Hz. Fusion of Paced and Normal Beat F
Out of 48 records 23 records are normal sinus rhythm Ventricular Escape Beat E
(NSR) and remaining 25records show clinical cardiac Nodal (Junctional) Premature Beat J
abnormalities. According to the clinical terms, V1 to Atrial Escape Beat E

Support Vector Machine Based Heartbeat Classification

54
International Journal of Advances in Science Engineering and Technology, ISSN: 2321-9009 Volume- 2, Issue-3, July-2014

Unclassifiable Beat Q concatenate corresponding coefficients. Now we use


TOTAL: 16 Principal component analysis (PCA) and represent
these coefficients in a lower dimensional space. Now
The records from MIT-BIH arrhythmia dataset are the resulting principal components that represent
divided as follows: most of the variance are selected and a morphological
descriptor of the heartbeat is obtained by utilizing
these components. RR interval features are derived,
44 ECG
which give descriptive information about dynamic
signals
features of the heartbeat. After performing the feature
extraction, the main classification algorithm is
applied. Heartbeats are then classified into 16 above
classes by using a classifier based on Support vector
Data Set 1 Data Set 2 machine (SVM) is used. According to the data given
Testing set (22 Training set in [2] all the ECG signals are two-lead signals, all the
ECG signals) (22 ECG signals) above process is separately applied to the signals
from leads A & B. The two sovereign decisions for
Fig. 1 Formation of ECG signal datasets each heartbeat are obtained, which then are fused to
build the final composed decision of heartbeat
44 ECG signals are divided into 2 datasets. One of classification. By integrating both leads signals,
them is used as a training dataset and another one is confidence about classification can be improved for
used as testing dataset. This division is done for the the final decision.
experiment purpose.
Above datasets are prepared by selecting a random A. Pre-processing
amount of fraction from each of the 16 classes.
Training dataset constitutes following fractions of It is necessary to perform the pre-processing of raw
beats. Normal class contributes 13% of the beats, ECG signals as they can contain various types of
40% contribution is from each of the five bigger noise. These noises must be reduced so that signal-to-
classes i.e. ‘L’,’A’,’R’,’V’ & ‘P’ while 50% noise ratio(SNR) is improved. Improved SNR helps
contribution is of all the small ten classes. Mapping in detection of the subsequent fiducial point. Types of
of these 16 classes is done in 5 classes. noise like power-line interference, baseline wander,
artifacts due to muscle contraction, and electrode
TABLE II movement affect the quality of ECG signals. In this
MAPPING OF MIT-BIH CLASSES TO AAMI study, the pre-processing of ECG signals consists of
CLASSES baseline wander correction. The baseline wander is
AAMI MIT-BIH Classes removed by using a wavelets-based approach. The
Classes pre processed signals were used in subsequent
N NOR, LBBB, RBBB, AE, NE processing.
S APC, AP, BAP, NP
V PVC, VE, VF B. Heartbeat segmentation
F VFN
Q FPN,UN There are three waveform components of one heart
cycle of ECG signal known as P wave, QRS complex
III. PROPOSED METHODOLOGY and T wave. To have the full segmentation of ECG
signal, the boundaries and peak locations i.e. fiducial
Section I contains a brief introduction of the proposed points should be properly detected.To obtain
automatic heartbeat classification system. In this heartbeat segments the annotations provided for R-
section, we have discussed all the theoretical details peak locations are utilized. The performance of the
and the techniques used in the process. Fig. 2 shows proposed method can be compared by using manual
the flow of the proposed system. The process has annotations in the reference work. In real
following blocks Pre-processing, Heartbeat applications, an automatic R-peak detector may be
segmentation, Feature extraction, Classification, used so that the classification method can actually be
Two-lead fusion and Decision. Lead I& Lead II fuly automatic. But there are two disadvantages of
signals are nothing but raw ECG signals. Artefacts this automatic R-peak detector. 1. If some leading
contained in these raw ECG signals are removed by heartbeats are missed then error may get added in
using the first block of the process i.e. Pre- those heartbeat signals and hence they cannot be
processing. After pre-processing, these ECG signals classified correctly. A number of heartbeat detection
are divided to obtain heartbeat segments. For this schemes do exist [3]-[5], which have capacity to
purpose, we use provided R peak locations. We apply detect heartbeat signals present in MIT-BIH
Wavelet transform (WT) and independent component arrhythmia database with an error rate less than
analysis (ICA) separately to each heartbeat and 0.5%.2. The quality of RR interval features will be

Support Vector Machine Based Heartbeat Classification

55
International Journal of Advances in Science Engineering and Technology, ISSN: 2321-9009 Volume- 2, Issue-3, July-2014

degraded to some extent because of addition of the in DWT. These coefficients are thus extracted as the
error by the automatic R peak detector. The sampling wavelet features.
rate is given as 360 Hz. Hence in each heartbeat
segment there are 100 samples before the R peak C. Independent component analysis- Morphological
location as the pre-R segment & 200samples after the Feature extraction
R peak as the pro-R segment, i.e.,a total of 300
samples. The 300 samples correspond to 0.83s. The In this study, ICA is used for feature extraction. Five
segment size is selected such that it includes most of sample beats are randomly selected from every class
the information of one heart cycle. The segment size for preparation of training set. These training sets are
of heartbeat is kept fixed. The ratio of lengths of the used to compute Independent components. If the total
pre-R segment and the pro-R segment is kept so that number of beats in any of the recording is less than
it matches with lengths of PR interval & the QT five, then all beats are taken. This makes a training
interval. There is an advantage to keep the fixed set of total 626 beats taken from all 16 classes. These
segment size it avoids the detection of the P wave and beats are used for calculating ICs.The ICs obtained
T wave. These waves are more immune which are used as source signals for ICA and hence applied
usually are more susceptible to noise as they have to both the datasets viz. training and testing datasets.
lower magnitudes. There is also a serious drawback To obtain actual number of ICs, tenfold cross
of fixed heartbeat segment size. If the heart is in a validation is evaluated. Number of independent
condition where it beats a bit faster, then there occurs components are varied between 10 & 30, the ICA
shortening of the interval between the consecutive coefficients obtained after that are actually considered
beats. Hence the information from neighbouring beats as features and given as input to SVM classifier. This
may get added to the present beat and results in false process is performed in 5 iterations. And average is
alarms of an arrhythmia detector. taken. When average performance is observed, the
accuracy increases at number of ICs between 10 & 14
C. Wavelet transform- Morphological and afterwards it decreases. So number of ICs is
Feature extraction selected to be 14.

ECG signals i.e. biomedical signals in real exhibit D. Principal component analysis-Morphological
non-stationary nature. Non-stationary nature actually feature extraction
means the presence of some statistical characteristics.
These signals change over position or time. Due to The two features obtained i.e. ICA features and
this nature, they cannot be responsive and hence wavelet features are combined together and PCA is
cannot be analysed using classical Fourier transform applied to obtain the reduction in feature dimension.
(FT). Therefore, it becomes must to use wavelet Then 10-fold cross validation is performed and final
transform (WT). Wavelet transform is capable of morphological features are obtained.
performing analysis in both the
E. RR Interval Features

RR interval features are extracted to obtain dynamic


information of the heartbeat signal input. These are
known as “dynamic” features. There are four RR
interval features namely, previous RR, post RR, local
Fig. 2 Flow of proposed system RR, and average RR interval features.

domains i.e. time & frequency domains. It is possible The previous RR feature is nothing but the interval
to analyse ECG signal by using WT. There are between a present R peak and the previous R peak.
various purposes of using WT in ECG signal Post RR feature is calculated as the interval between
processing. It includes de-noising, heartbeat detection current R peak and next R peak. The local RR
and feature extraction. We use WT as a feature interval is calculated by taking average of all the RR
extraction method in this study. As can be seen, intervals withinpast 10-s period of the given
Daubechies wavelets of order 8 have most similar heartbeat. Likewise, the average RR interval is
characteristics as that of QRS complex, hence are calculated as the average of RR intervals within past
selected. Since the sampling frequency is given to be 5-min period of the heartbeat.
360 Hz, the maximum frequency is 180 Hz. The
maximum energy of ECG signals is concentrated in In previous literature, the local RR & average RR
the frequency range of 0.5–40 Hz [28]. After feature extraction shows poor performance when
applying the four-level wavelet decomposition, this applied in real-time application. The local RR feature
frequency range corresponds to the detail coefficients is calculated as average of consecutive 10 heartbeats
at level 3 & 4 i.e. D3 & D4). The down-sampling is whose centre will be at given beat. Whereas average
applied and even indexed elements are kept, resulting RR feature is calculated as average of all beats from

Support Vector Machine Based Heartbeat Classification

56
International Journal of Advances in Science Engineering and Technology, ISSN: 2321-9009 Volume- 2, Issue-3, July-2014

same recording. In the proposed method, these


features are calculated such that they ensure to work
at real-time.

F. Support vector machine

In this paper, the technique used for classification of


the heartbeats is an SVM classifier which classifies
the heartbeat under consideration into one of the 16
classes.

This classifier is given by Vapnik.It builds a prime


hyperplane which separates two classes from each
other due to increase in margin between them. As this
approach has an excellent ability to build the Fig. 3 Results showing pre-processing& heartbeat
classification model on general basis it is enough segmentation for lead 1 signal of 109 ECG recording.
powerful to be used in many applications.
Segmentation gives the actual separation of the QRS
The training set contains N examples. It is used in complex from whole recording. The recording
two-class classification problem. N examples are undergoes wavelet transform after pre-processing and
given as {(xi, yi), i = 1, . . . ,N}, where xi is nothing hence gives a segment showing R peak. In results of
but d-dimensional feature vector of the ith example R-peak detection 3 types of RR interval features are
and xi d whereas yi is the class label of ith example obtained i.e. pre-R, post-R and average R interval
and yi€ {±1}. Now a decision function is to be features
constructed on the basis of the training set. This
function is used to predict output class labels of test
examples. These are based on input feature vector.
The resultant decisionfunction is given as

f (x) = sign ( ∑ αi yi K (xi, x) + b)


i SVs
where,K(., .) is kernel function.αiis
Lagrangemultiplier for each training datasample. Few
Lagrange multipliers are nonzero. The examples of
training set which are nonzero are known as Support
vectors. These support vectors actually determine
f(x). Two seperate classifiers are applied to signals
from lead A & lead B.

G. Two-lead fusion
Fig. 5 Results showing pre-processing& heartbeat
As two different classifiers are applied, each classifier
segmentation for lead 2 signal of 109 ECG recording.
gives its seperate answer. Now the two answers are
fused together to get a final answer which actually
gives the class of the heartbeat it belong to. Two
seperate answers can be fused together by using
rejection approach.

IV. RESULTS

The pre-processing of signal results into reduction in


noise. The baseline wander is removed after pre- Fig. 4 Segmentation results of lead 1 signal
processing.

As can be seen in results of lead 2 signal, pre-


processing also helps in proper detection of
fiducialpoints. In this case R-peak detection is proper
because of pre-processing.

Fig.6 Segmentation results of Lead 2 signal

Support Vector Machine Based Heartbeat Classification

57
International Journal of Advances in Science Engineering and Technology, ISSN: 2321-9009 Volume- 2, Issue-3, July-2014

REFERENCES [5] S. Kadambe, R. Murray, and G. F. Boudreaux, “Wavelet


transform-based QRS complex detector,” IEEE
Trans.Biomed. Eng., vol. 46, no. 7, pp. 838–848, Jul. 1999.
[1] Can Ye, B. V. K. Vijaya Kumar, Miguel Tavares Coimbra,
[6] P. de Chazal, M. O. Dwyer, and R. B. Reilly, “Automatic
“Heartbeat Classification Using Morphological and
classification of heartbeats using ECG morphology and
Dynamic Features of ECG Signals,” IEEE Trans. Biomed.
heartbeat interval features,” IEEETrans. Biomed. Eng., vol.
Eng., vol. 59, no. 10, pp. 2930-2941, Oct. 2012.
51, no. 7, pp. 1196–1206, Jul. 2004.
[2] MIT-BIH Arrhythmias Database. Available online at:
[7] P. de Chazal andR. B.Reilly, “Apatient-adapting heartbeat
http://www.physionet.org/physiobank/database/mitdb/.
classifier using ECG morphology and heartbeat interval
[3] P. Laguna, R. Jane, and P. Caminal, “Automatic detection
features,” IEEE Trans. Biomed.Eng., vol. 53, no. 12, pp.
of wave boundaries in multilead ECG signals: Validation
2535–2543, Dec. 2006.
with the CSE database,” Comput.Biomed. Res.,vol. 27, no.
[8] G. de Lannoy, D. Francois, J. Delbeke, andM. Verleysen,
1, 1994.
“Weighted conditional random fields for supervised
[4] V. X. Afonso, W. J. Tompkins, T. Q. Nguyen, and L. Shen,
interpatient heartbeat classification,” IEEE Trans. Biomed.
“ECG beat detection using filter banks,” IEEE Trans.
Eng., vol. 59, no. 1, pp. 241–247, Jan. 2012.
Biomed. Eng., vol. 46, no. 2, pp. 192–202, Feb. 1999.



Support Vector Machine Based Heartbeat Classification

58

You might also like