Paper Title (use style: paper title)

advertisement
Detection of QRS Complexes in ECG using Support
Vector Machine as a Classifier
Monika A. Gayake
Department of Electronics and Telecommunication
MIT College of Engineering, University of Pune,
Pune, India
Prof. Dr. Virendra V. Shete
Department of Electronics and Telecommunication
MIT College of Engineering, University of Pune,
Pune, India
Abstract—Accurate detection of QRS-complexes in the
Electrocardiogram (ECG) decides performance of computer
based analysis of ECG signal. Since QRS is the most prominent
wave within the ECG, other ECG components like P-wave, Twave, PR-segment, are easier to localize after successful detection
of QRS-complexes. This paper presents Support Vector Machine
(SVM) based algorithm for QRS-complex detection in single lead
ECG signal. The ECG signal is filtered to remove noise. Absolute
slope of the filtered ECG signal are calculated to generate feature
signal. The performance of the algorithm is tested using ECG
signals from MIT-BIH Arrhythmia ECG database. Sensitivity of
98.83% is achieved with a positive prediction of 99.66%.
Keywords— Absolute slope; QRS Detection; SVM; MIT-BIH
Arrhythmia ECG database.
I. INTRODUCTION
Bioelectrical signals express the electrical functionality of
different organs in the human body. The Electrocardiogram
(ECG), also called ECG signal, is an important signal among
various bioelectrical signals. An ECG is a graphical recording
of the electrical activity of the heart. It provides valuable
information about the functioning and behavior of heart. Most
of the clinically important information is found in the
amplitudes and intervals defined by characteristics wave peaks
and boundaries in the ECG. An ECG consists of recurrent
wave sequence of P, QRS and T-wave as shown in the Fig. 1.
The QRS-complex is the most prominent waveform, caused by
ventricular depolarization of the human heart. Once the
positions of the QRS-complexes are found, the locations of
other components of ECG like P-wave, T-wave and STsegment, etc as are found relative to the position of QRS, in
order to analyze the complete cardiac period. In this sense,
QRS-detection is the fundamental step in all automated ECG
analysis algorithms [1].
A good amount of research work has been carried out
during the last four decades for the accurate and reliable
detection of QRS-complex in the ECG signal. An in-depth
survey of the different software based QRS detection
algorithms are reported in [2-3]. Analysis by digital computer
was made by Pipberger and his group in 1957. In recent years
fast and robust new approaches based on various classifiers
were developed.
Fig. 1: Components of an ECG Tracing
J. Madeiro developed algorithm for QRS segmentation
based on first- derivative, Hilbert and Wavelet transform [4]. S.
Mehta developed QRS detection using Fuzzy C- Means
algorithm[5]. Indu Saini et al developed K-Nearest Neighbor
Algorithm (KNN) for QRS detection and evaluated using
standard CSE ECG database as well as standard MIT-BIH
Arrhythmia ECG database [6]. Bhaskar et al developed
Probabilistic Neural Network (PNN) based QRS detection
algorithm using slope and entropy as a feature and evaluated
using standard CSE ECG database [7, 8]. These approaches are
trying to pre process the signal to remove the noise and find
distinctive features that will later be used as a features i.e.
variables for classification algorithms. Mehta et al [9]
successfully implemented SVM for QRS complex detection
and the algorithm is validated using standard CSE ECG
database.
As the SVM is applied earlier but testing of algorithm was
done using CSE ECG database. In this paper, SVM algorithm
is implemented using absolute slope as a feature and validated
using standard MIT-BIH Arrhythmia ECG database.
This paper is structured as follows: SVM overview in
section II. Section III presents brief description of SVM
algorithm for QRS detection using slope as a feature.
Implementation and results are discussed in section IV.
II. SUPPORT VECTOR MACHINE OVERVIEW
The technique of SVM was developed by Vapnik. This
technique widely used technique for solving supervised
classification problems due to its generalization ability. SVM
classifiers maximize the margin between training data and the
decision boundary (optimal separating hyperplane), which can
be formulated as a quadratic optimization problem in a feature
space. The subset of patterns those are closest to the decision
boundary are called as support vectors.
Consider a set of training examples (x1 , y1 ),....., (x l , yl ),
where
input x i  R and
N
class
labels yi   1,1 .
sgn(( w.x)  b) is considered,
where ( w.x ) represents the inner product of w and x , w is
Decision function of the form
weight vector and b is bias. It is necessary to find a decision
function fw,b with the properties
i= 1, ……, l.
(1)
yi ((w.x i )  b)  1 ,
In many practical situations, a separating hyperplane does not
exist. To allow for possibilities of violating (1), slack
variables, ξiare introduced like
(2)
 i  0 , i= 1, ……, l.
to get
yi (( w.xi )  b)  1   i i= 1, ……, l.
(3)
The support vector approach for minimizing the generalization
error consists of the following:
Minimize:  (w ,  )  (w.w )  C
l

i 1
i
(4)
subject to constraints (2) and (3).
The C is a user defined constant. It is called regularizing
parameter and determines the balance between the maximization
of the margin and minimization of the classification error.
The above minimization problem can be posed as a constrained
quadratic programming (QP) problem. The solution gives rise to
a decision function of the form:
 l

f (x)  sgn  yi i (x.x i )  b (5)
 i 1

where αi are Lagrange multipliers.
Only a small fraction of the αi coefficients are nonzero. The
corresponding pairs of x i entries are known as support
vectors and they fully define the decision function. By
replacing the inner product (x.x i ) with kernel functionK(x,
xi); the input data are mapped to a higher dimensional space.
It is then in this higher dimensional space that a separating
hyperplane is constructed to maximize the margin [10-12].
2. Use digital filtering techniques to remove noise and
baseline wander.
3. Calculate absolute slope at every sampling instant of the
filtered ECG signal to generate feature signal.
4. Apply moving average algorithm with 20 samples in
order to enhance QRS-region of the feature signal.
5. Normalize the QRS-enhanced feature signal to reduce the
burden on the classifier.
Step2: Training of SVM
1. Normalized values of the feature signal obtained from the
filtered ECG signals are used for the training of SVM.
2. Certain portions of different ECGs representing a wide
variety of QRS-morphologies are selected from the MITBIH database to form a training set to train SVM.
3. During the training of SVM, a sliding window of size of
ten sampling instants is moved over the normalized
absolute slope values. The first pattern vector is formed
by taking first ten normalized absolute slopes from first to
tenth sampling instant. The window is then moved
forward by one sampling instant and the second pattern
vector is formed by taking another set of ten normalized
absolute slopes but now from second to eleventh
sampling instant and so on. This way, a sliding window
of size of ten sampling instants and a jump size of one
sample is moved over the normalized absolute slope
curve. This method of forming a training matrix is
explained in Mehta et al [9].
4. When the window lies completely in the QRS-region, the
desired output of the SVM is set to 1 and when it lies
completely in the non-QRS-region, the desired output is
set to -1.
Step 3: Testing of SVM
1. After the training of SVM, each record of the MIT-BIH
database is tested for the detection of the QRScomplexes. The database contains original ECG
recordings of 48 patients covering a wide variety of
pathological cases.Every record picked from MIT-BIH
database is of 10 seconds duration sampled at 360Hz,
thus giving 3600 samples.
2. During testing, a set of ten calculated normalized absolute
slope values are used to form the input vector for the
SVM. Then the window is moved forward by one
sampling instant and again a set of ten absolute slopes of
the ECG signal are taken to form next input pattern
vector.
3. A train of 1’s is obtained at the output of SVM, for QRSregion and -1’s for non-QRS-region.
4. The best kernel obtained during training and its
parameters are used to test the subject.
III. SVM BASED ALGORITHM FOR QRS DETECTION
This section describes SVM based algorithm for the
detection of QRS-complexes in single lead ECG signal.
Step1: Preprocessing
1. Acquire raw ECG signal
Step 4: Post Processing
1. Club the continuous train of labels of 1‘s from the
predicted labels to form a pulse of unit amplitude.
2. In some cases, when the P or T waves are peaky in
nature, the SVM gives a train of 1’s but of smaller
duration as compare to that of QRS complex. In order to
differentiate between trains of 1’s for QRS complex and
for P or T waves, an average duration of all the trains of
1’s is calculated. Those trains whose duration is greater
than average pulse duration are picked up as QRS
complexes by the algorithm and those duration is smaller
than the average pulse duration are discarded . Thus false
positive detection of QRS complexes can be reduced.
IV. IMPLEMENTATION AND RESULTS
Before you begin to format your paper, first write and save
the content as a separate text file.
Implementation of SVM for QRS detection in ECG
signal is done by using LIBSVM software [13] and MATLAB
[14]. LIBSVM is an integrated software package for support
vector classification, regression and distribution estimation. In
the present problem of QRS detection, SVM is constructed
using sigmoid kernel function and four different features like
absolute slope, entropy, power and energy. The proposed
algorithm is validated using 48 records form the MIT-BIH
database [15]. To evaluate the performance of SVM in the
detection of QRS-complexes, two parameters, sensitivity (Se)
and positive prediction (+P) are calculated. They are defined
as:
𝑆𝑒 =
𝑇𝑃
𝑇𝑃 + 𝐹𝑁
(1)
𝑇𝑃
𝑇𝑃 + 𝐹𝑃
(2)
+𝑃 =
whereTP stands for true positive, FP for false positive and FN
for false negative. Detection is said to be true positive (TP) if
the algorithm correctly identifies the QRS complex and it is
said to be false negative (FN) if the algorithm fails to detect
the QRS complex. False positive (FP) detections are obtained
if non-QRS wave is detected as a QRS complex.The
sensitivity (Se) of 98.83% and positive prediction (+P) of
99.83% is obtained for QRS detection. The record-wise results
of the algorithm are displayed in Table 1.
Fig 2 shows results obtained after preprocessing steps for
QRS-detection algorithm using SVM absolute slope as feature
for Record 100.
TABLE 1 Results using Absolute slope as a Feature
Record
No.
100
101
102
103
104
105
106
107
108
109
111
112
113
114
115
116
117
118
119
121
122
123
124
200
201
202
203
205
207
208
209
210
212
213
214
215
217
219
220
221
222
223
228
230
231
232
233
234
48
Patients
Actual
Peaks
13
11
12
11
13
14
10
11
10
15
11
14
9
9
10
14
9
12
10
10
15
8
8
15
14
8
18
14
10
16
15
16
15
18
12
18
12
13
12
13
13
13
12
14
10
8
17
15
600
Detected
peaks
13
11
12
11
13
14
10
11
10
15
11
14
9
9
10
14
9
12
10
10
15
8
8
15
14
8
10
14
10
13
15
16
15
18
12
18
12
13
12
12
13
13
12
14
10
8
17
15
592
TP
FP
FN
13
11
12
11
13
14
10
11
10
15
11
14
9
9
10
14
9
12
10
10
15
8
8
15
14
8
10
14
10
13
15
16
15
18
12
18
12
13
12
12
13
13
12
14
10
8
17
15
592
1
-
7
7
Fig 5: QRS Detection in Record 118
Fig 6 QRS detection results for Record 119. In this record the
morphology of 2nd and 8th QRS complexes is different
compared with the morphologies of other QRS complexes.
The proposed SVM based algorithm correctly identifies these
odd morphology QRS complexes showing its effectiveness.
Fig 2 : Preprocessing steps for QRS-detection algorithm using SVM and
absolute slope as feature for Record 100 (a) Raw ECG (b) Filtered ECG (c)
Absolute Slope of the filtered ECG (d) QRS Enhanced Signal (e) Normalized
Signal
Following illustrative cases demonstrates the effectiveness
of the proposed SVM based algorithm for QRS-detection.
Fig 3 shows QRS detection results for Record 114. In this
record amplitude of T wave is higher than the amplitude of the
QRS complexes. Also the width of the QRS complexes is very
narrow. SVM correctly identified all the QRS complexes.
Fig 6: QRS Detection in Record 119
Fig7 shows QRS detection results for Record 200. In this
Record morphology of QRS complexes is “rS” type and also T
wave are peaky. SVM correctly identified all the QRS
complexes.
Fig 3: QRS Detection in Record 114
Fig 4 shows QRS detection results for Record 117. In this
record amplitude of T wave is comparable to that of amplitude
of the QRS complexes. Also the width of the QRS complexes
is very narrow. SVM correctly identified all the QRS
complexes.
Fig 7: QRS Detection in Record 200
Fig 8 QRS detection results for Record 210. In this record 4th
peak is inverted and T waves are inverted. Morphology of 4th
peak is odd compare with other. Here SVM correctly
identified all the QRS complexes.
Fig 4: QRS Detection in Record 117
Fig 5 shows QRS detection results for Record 118. In this
Record QRS complexes are narrow and T waves are inverted.
SVM correctly indentifies all the QRS complexes.
Fig 8: QRS Detection in Record 210
Fig 9 shows QRS detection results for Record 214. In this
record 8th and 12th QRS complex has different morphology.
Also the magnitude of these QRS complexes is comparable to
that of the corresponding T waves. These QRS complexes are
also successfully detected by the proposed SVM based
algorithm. Thus total 12 QRS complexes are accurately
detected without any false detection.
[5] S. Mehta, C. Trivedi, N. Lingayat, “ Identification and Delineation of
[6]
[7]
[8]
Fig 9: QRS Detection in Record 214
[9]
Fig 10. shows QRS detection results for Record 233. 1st, 6th,
11th and 15th QRS complex has less amplitude compared with
corresponding T wave. Thus this SVM based algorithm
accurately detects all QRS complexes without any false
detection.
[10]
[11]
[12]
[13]
[14]
[15]
Fig 10: QRS Detection in Record 233
V. CONCLUSION
Much work has been carried out in the field of QRSdetection. Though the performance is good, each method has
situations where it fails. In this paper, Support Vector Machine
is efficiently applied for the detection of ECG QRScomplexes. Various algorithmic considerations along with the
preprocessing stages for the ECG QRS-Complex detection are
explained. Using records of MIT-BIH arrhythmia ECG
database, the algorithm performed effectively with accurate
QRS-detection over 99.83% of the total beats, even in the
presence of peaky P and T-waves and wide variety of QRSmorphologies. The results obtained can be further used for
detailed analysis of the ECG signal.
VI. REFERENCES
[1] G. D. Clifford, F. Azuaje, P. E. McSharry, “Advance Methods and Tools
for ECG Data Analysis”, Artech House, 2006.
[2] Kohler B.U., Henning C. and Orglmeister R., “The principles of
software QRS-detection,” IEEE Engineering in Medicine and Biology
Magazine, vol. 21, no. 2, pp. 42-57, 2002.
[3] Marko Velic , Ivan Padavic , Sinisa Car, “Computer Aided ECG
Analysis - State of the Art ,and Upcoming Challenges”, Arxiv-Cornell
university Computer Vision and Pattern Recognition, June 2013.
[4] J. Madeiro, P. Cortez, J. Marques, C. Seisdedos, C. Sobrinho, “An
innovative approach of QRS segmentation based on first- derivative,
Hilbert and Wavelet transform”, Medical Engineering and Physics,
SciVerse Science Direct, pp 1236-1246, 2012.
QRS Complexes in Electrocardiogram using Fuzzy C-means Algorithm
” , Journal of Theoretical and Applied Information Technology, 2009
I Saini, D Singh, A Khosla, “QRS detection using K-Nearest Neighbor
algorithm (KNN) and evaluation on standard ECG databases”, Journal
of Advanced Research, July 2012.
M. K. Bhaskar, S. S. Mehta, N. S. Lingayat, “Probabilistic Neural
Network for the Automatic Detection of QRS-complexes in ECG using
Slope”, International Journal of Emerging Technology and Advanced
Engineering”, Vol3, June 2013.
M. K. Bhaskar, S. S. Mehta, N. S. Lingayat, G. S. Mehta “PNN based
Detection of QRS-complexes in Electrocardiogram using Entropy”,
International Journal of Engineering and Computer Science”, Vol 2, pp
2155-2161, July 2013.
S. Mehta , N. S. Lingayat, “Comparative Study of QRS Detection in
Single Lead and 12-Lead Electrocardiogram using Support Vector
Machine ” , Engineering Letters, Nov 2007.
Abe S., “Support vector machine for pattern classification,” Springer,
2005.
Burges C.J.C., “A tutorial on support vector machines for pattern
recognition,” Data Mining and Knowledge Discovery, vol. 2, no. 2, pp.
121-167, 1998.
Chang C.C. and Lin C.J., “LIBSVM: A library for support vector
machines,” Technical report, National Taiwan University, Taiwan, 2004.
Hsu C.W., Chang, C.C. and Lin C.J, “A practical guide to support vector
classification,” Technical report, Department of Computer Science and
Information Engineering, National Taiwan University, Taiwan, 2003.
www.mathswoks.in
http://www.physionet.org/physiobank/database/mitdb/
Download