QRS Complex Detection and Arrhythmia

0 downloads 0 Views 2MB Size Report
another problem since we have continuous non-zero values at the intermediate locations. To work around this situation, a retriggerable monostable multivibrator ...
2015 International Conference on Communication, Control and Intelligent Systems (CCIS)

QRS Complex Detection and Arrhythmia Classification using SVM Prof. Alka S. Barhatte Department of E & TC, M.LT Pune, India E-mail Id: [email protected]

Dr. Rajesh Ghongade Department of E & TC, V.LLT Pune, India E-mail Id:[email protected]

Abstract-The Electrocardiogram (ECG) is most widely used techniques to detect cardiac diseases. In this paper we propose ECG signal analysis and classification method using wavelet energy histogram method and support vector machine (SVM). The classification

of cardiac

arrhythmia

in the ECG signal

consists of three stages including ECG signal preprocessing, feature extraction and heartbeats classification. The discrete wavelet

transform

is

used

as

preprocessing

tool

for

signal

denoising and feature extraction such as R point location, QRS

Abhishek S. Thakare Department of E & TC, M.LT Pune, India E-mail Id: [email protected]

ECG signal is done using Daubechies (db9) wavelet. Total 9 features are extracted for each beat using discrete wavelet transform, namely R point location, area under QRS complex, duration of QR, RS, RR points, R peak, R normal, area under autocorrelation and SVD of ECG etc. Beat classification is implemented by using binary SVM approach. The raw ECG signals are obtained from the MIT-BIH cardiac arrhythmia database [6].

complex detection. Morphological features extracted from the QRS complex are employed as input to the classifier. Binary SVM is used as a classifier to classify the input ECG beat into four classes i.e. Normal, Left bundle branch block, Right bundle branch block and Premature ventricular contraction. MIT-BIH arrhythmia database is used

for performance analysis. The

proposed classifier performs well with an average sensitivity of

100%, specificity of 99.66%, positive prediction of 99%, false

prediction of 0.0033, and average classification rate of 99.75%.

Keywords-Cardiac Arrhythmia, ECG, MIT-BIH Database, QRS Complex, Support Vector Machine, Wavelet Transform

L

INTRODUCTION

The Electrocardiogram (ECG) is a graphical representation of the heart electrical activity and it used for diagnosing many heart diseases. The normal ECG signals are composed of P wave, QRS complex followed by T wave. Diagnosing of the heartbeat is depends on investigating the shape, the relationship between these waves and the duration of each waves. However, analysis of the heart state or normal ECG waves is not an easy task. In fact, the ECG signal is non stationary and thus, symptoms of a disease, if any, may not occur regularly [1]. Therefore, physicians need to record and monitor the heartbeat for a long time to classify the rhythm into normal or abnormal type. For ECG signal analysis, the size of the generated data can be huge which requires a lot of time and effort, therefore need for an automatic classification system. Fig. 1 shows normal ECG signal waveform. The performance of an automatic ECG classification system depends on the signal quality, the classification algorithm, training and testing dataset. This paper introduce about classification of 4 different ECG heartbeats based on wavelet energy histogram method and SVM algorithm. QRS detection is implemented using wavelet energy histogram method. 3 level decomposition of 978-1-4673-7541-2/15/$31.00 it 2015 IEEE

Fig. 1: A Typical ECG Signal Waveform

Section II describes QRS complex detection using wavelet energy histogram technique. Section III describes about the heartbeats classification using binary SVM technique. Section IV describes experimental results of our methodology and compares it with Backpropagation (BP) algorithm. Section V concludes paper. II.

QRS COMPLEX DETECTION

In the Electrocardiogram signal analysis, QRS complex detection is one of the fundamental issues. It is sufficient to extract the QRS complex with the reference point as the R­ peak. QRS complex is needed to feature extraction. Wavelet energy histogram algorithm used for QRS complex detection. RR interval features for each beat are obtained directly from QRS detection step. The wavelet transform based QRS detection method based on templates determines the position of these complexes and separated the normal and abnormal beats [1, 7].

A.

ECG Database

window of two samples. Fig. 4 (a) and 4 (b) shows the part of raw ECG signal and its corresponding energy curve. We consider here record number 208 for illustration. To bring out the energy change it was further differentiated. Since differentiated waveform having bipolar value, thresholding becomes difficult hence need to find absolute value (or rectification). It can be seen that the QRS complexes are clearly represented plot shown in Fig. 4 (d).

ECG signals required for analysis are taken from MIT­ BIH arrhythmia database that contained different heartbeat types [6]. The MIT-BIH database contains 48 records. Each record has duration of 30 minutes with sampling frequency of 360 Hz. These records are selected from 24 hours recordings of 47 different individuals. Our study is focused on the classification of four heartbeat classes in the MIT-BIH arrhythmia database: Normal rhythm (N), Left bundle branch block (LBBB), Right bundle branch block (RBBB), Premature ventricular contraction (PVC). Table I shows the distribution of these heartbeat types among the various ECG recordings present in the database. Fig. 3 shows four heartbeat type waveforms considered for this work. B.

TABLE I: DISTRIBUTION OF N, LBBB, RBBB AND PVC BEATS IN MlT-BIH DATABASE Heartbeat Type

N LBBB RBBB PVC

ECG Recording Containing Respective Type

100,101,105,112,115,116,119 109,111,207,214 124,212,231,232 105,109,116,119,214,215,221

System Diagram

The system block diagram is shown in Fig. 2. The proposed methodology consist of three steps includes preprocessing, feature extraction using DWT and classification using SVM classifier.

Fig. 2: Block Diagram of the System C.

QRS Detection using Wavelet Energy Histogram Method

The discrete wavelet transform (DWT) is useful tool for analysis of aperiodic, transients and non-stationary signals. All biomedical signals are non-stationary in nature therefore to observe such kind of signals, DWT is most commonly used. While using DWT for ECG signal analysis, the selection of the wavelet type and number of decomposition levels are crucial. The Daubechies wavelet is more complex but it picks up detail components that are missed by the Haar wavelet. Also the shape of Daubechies wavelet family is similar to QRS complex hence it is most widely used instead of Haar wavelet. A novel wavelet transform based approach is developed for the QRS detection [I]. QRS complex has peculiar shape and hence due to this the energy of signal is different during occurrence of the QRS complex. The energy change is occurred to the transition from the Q point to R point and back to S point. This energy change can be picked by decomposing the signal with DWT at a suitable level. Here db9 is used as a mother wavelet. For decomposition however, a window (segment) of the signal is to be considered. The change of energy can be captured by a

Fig. 3: Four Heartbeat Type's Waveform under Classification (N, LBBB, RBBB, PVC)

240

is obtained. We can now simply fmd the maximum value between the detector output limits and declare it as the R point Fig. 4(c) shows detected R peak point.

Original signal

1500 ,------,,--,---,--.--

III. A. 500 L------''--'-_---'--_---L_---_--'--_-'---_"---"_--.J o 200 400 600 800 1000 1200 1400 1600 1800 2000

Energy of the signal

0

200

400

600

800

1000

1200

1400

1600

1800

Principles

SVM is a new paradigm learning system. The technique of SVM, develop by vapnik, is a powerful technique used for solving supervised classification problem due to its generalization ability [4]. SVM was originally developed for solving binary classification problem but it can use for multiclass problem. Training set is a set of known object where each object of the training set consists of a feature vector and class label. Based on the training dataset, the learning algorithm extracts a decision function to classify the unknown input dataset [2, 4].

(a) Raw ECG Signal (Record no.208)

99.985

SUPPORT VECTOR MACHINE CLASSIFIER

Suppose the training set, ( Xi, Yi) i 1, ... . . 1, where Xi and Yi E (-1, 1) can be separated by the hyperplane is

2000

=

(b) Energy Plot of 3 Level DWT Coefficients

w.x + b

=

0

E Rd

(1)

Where w is the weight vector orthogonal to the hyperplane and b is constant. A hyperplane (w,b) separate data given by function

f(x)

=

sgn(w.x + b)

(2)

This correctly classifies the training dataset. If this hyper­ plane maximizes the margin, then the following inequality is valid for all input data:

(c) Detected R Point

Yi(W. x + b)

Detected peaks



1 f o r all I

(3)

To fmd the geometric distance from the hyperplane to a data point, we must normalize by the magnitude of w [4]. This distance is given by

d((w. b) , xI.) 700 �o

- �

�----c�� 8�00 ,---= - ' O" ' OO�'=2"'"'OO�,--OC40=O----=''''' 60=O�'

=

_1_ Yi(Xi·w+b) > IIwll -llwll

(4)

The hyperplane that maximizes the geometric distance to the closest data points is needed. This is accomplished by minimizing IIwll [4].

2000 -=' 8"=OO � ----

(d) Detected Q, R, S Points Fig. 4: Results of Feature Extraction from Record 208m

B.

We can now threshold the absolute value, but this poses another problem since we have continuous non-zero values at the intermediate locations. To work around this situation, a retriggerable monostable multivibrator like mechanism can be used. This ensures that there is no false triggering outside the QRS complex. A value of 70 samples was kept as the "on time" of this software multivibrator mechanism. Here thresholding value is set as 0.015 based on trial and error. Since our objective is locating the QRS complex and determining the R peak, the first objective of locating the QRS complex is easily done [1, 7].

Hierarchical SVM for Multiclass Classification

In this paper, a nonlinear SVM utilizing binary decision tree (SVM-BDT) based on Radial Basis Function (RBF) has been studied for Multiclass Classification problem. While using SVM model, the selection of the kernel function and its parameter values are crucial. The parameters that should be optimized include the sigma (cr) value for the kernel function. Here several SVM's can be used to address several binary class problems. While using this architecture, (N - 1) SVMs are needed to be trained for an N class problem, but only at most (Iogz N) SVMs are required to classify a sample [10]. The proposed classifier architecture SVM-BDT that solves a 4-class arrhythmia classification problem utilizing a

To find the R peak we multiply the raw signal by the detector output so that only some portion of the QRS complex 241

binary tree, in which each node makes binary decision using a SVM, is shown in Fig. 5. This proposed classifier uses several SVMs arranged in a binary tree structure. The hierarchy of binary decision subtasks should be carefully designed before the training of each SVM classifier. Each node of the tree consists of one SVM and it trained using two of the classes. The algorithm then employs probabilistic outputs to measure the similarity between the remaining samples and the two classes used for training. All samples in the node are assigned to the two sub nodes derived from the previously selected classes by similarity. This step repeats at every node until each node contains only samples from one class. The main advantages of SVM-BDT tree architecture are computationally efficient and high classification accuracy of SVMs [10].

normal and abnormal samples and tested it by varying value of sigma for another 400 normal and abnormal samples. Table 3 shows confusion matrix for sigma value of 0.9. In confusion matrix the diagonal elements represents correctly classified ECG beats and the off diagonal elements of the matrix represents the misclassified ECG beats. The training and testing datasets for each class is prepared by mixing same class beats from various ECG records. For performance evaluation, we used three standard metrics: sensitivity (Se.), specificity (Sp.), and accuracy (Acc.). These metrics are used to quantify the performance of the system. The sensitivity is measures of the capacity of test the positive samples [5]. Se.

=

(TP/TP+FN)* 100

(6)

Where TP represents the true positive and FN represents the false negative. The specificity is measures of the capacity of test the negative samples [5]. Sp.

=

(TN/TN+FP)* lOO

(7)

Where TN represents the true negative and FP represents the false positive. The accuracy is defmed as the ability of the test to correctly identify a classified type with and without positives. It reflects both sensitivity and specificity [5]. Fig. 5: Binary Hierarchical SVM Classifier Flow Chart C.

Acc.

SVM Kernel Function

=

(TP+TN)I(TP+TN+FP+FN)* 100

(8)

TABLE 2: NUMBER OF TRAINING AND TESTING BEATS USED IN THE EXPERIMENTS

In machine learning, the radial basis function (also known as Gaussian kernel) or RBF kernel function mostly used in SVM classification. The RBF kernel on two samples x and z represent as feature vectors in some input space is defmed as

Class Trainin� Beats Test Beats

L

N

R

V

100 100

100 100

100 100

100 100

TABLE 3: CONFUSION MATRIX FORL=0.9

K(x, z)

=

exp {-1;::12}

(5)

Where cr is the width of the function and Ix - zl2 represented as the squared Euclidean distance between two feature vectors. IV.

L

N

R

V

100 0 0 0

0 99 0 0

0 I 100 0

0 0 0 100

Aetual/ Predicted L N R V

TABLE 4: PARAMETER CALCULATION

RESULT AND DISCU SSION

Parameters

This section describes the results of detection and classification of heartbeats. For binary SVM classifier, total of 800 heartbeats samples corresponding to four ECG heartbeat types i.e. N, L, R, V are considered. The dataset of 800 samples are divided randomly into two mutually exclusive sets. Out of which one set is used for training the SVM model and the other set is used for testing the classifier performance. We have used binary SVM approach to classify four types of arrhythmia using Gaussian Radial Basis Function kernel (RBF) with a scaling factor sigma (cr). We have obtained results for different values of sigma. Default value for sigma is one. We have trained our classifier with combination of 400

Sensitivity Specificity Positive Prediction False Prediction Classification Rate

SVM 0.5

SVM 0.9

SVM 1

I 0.96 0.892857 0.04 0.97

I 0.996667 0.990099 0.003333 0.9975

0.99 0.98 0.942857 0.02 0.9825

TABLE 5: COMPARISON BETWEEN SVM AND BACK PROPAGATION ALGORITHM Parameters

Sensitivity Specificity Positive Prediction False Prediction Classification Rate

242

SVM

Back Propagation

I 0.996667 0.990099 0.003333 0.9975

I 0.99 0.970874 0.01 0.9925

V.

From the results it can be concluded that building classification system using SVM based on wavelet energy histogram technique can achieve high classification rate that reaches 99.75% for sigma value 0.9. The extracted features are reliable and classifiable. The performance of the classifier depends on the optimal choice of sigma value. Here the performance of SVM classifier is compare with the most common BP-ANN algorithm for same database. It is observed that there is significant improvement in the performance parameters of SVM classifier. Also the computational competency of SVM classifier is higher as compared to BP­ ANN algorithm.

Fig. 6: Graphical Representation of Performance Parameters for Different Values of (J

REFERENCES

From the performance parameter it is clear that 0.9 value of sigma gives best results, hence we have chosen sigma equal to 0.9. A.

Ghongade, Rajesh and Dr. Ghatol, Ashok (2009), "A Novel QRS Detection Method", international Journal of Applied Computing, Vol. 2. supp. Issue 1,2009, ISSN: 0974-6277. [2] Joshi, Aniruddha J., Chandran, Sharat, Jayaraman, V.K., Kulkarni, BD., (2009), "Hybrid SVM for Multiclass Arrhythmia Classification", IEEE International Conference on Bioinformatics and Biomedicine 2009, pp. 287-290. [3] Roland Adams, E., Choi, Anthony, (2012), "Using Neural Networks to Predict Cardiac Arrhythmias", 2012 IEEE International Collference on Systems, Man, and Cybernetics October 14-17, 2012, COEX, Seoul, Korea. [4] Faziludeen, Shameer and P.V. Sabiq, (2013), "ECG Beat Classification Using Wavelets and SVM", IEEE Conference on Illformation and Communication Technology (ICT) 2013, pp. 815-818. [5] Park, Juyoung, Lee, Kuyeon, and Kang, Kyungtae, "Arrhythmia Detection from Heartbeat Using k-Nearest Neighbor Classifier", IEEE International Conference on Bioinformatics and Biomedicine 2013, pp. 15-22. [6] Sarma, Pratiksha, Nirmala, S.R., Sarma, Kandarpa Kumar, (2013), "Classification of ECG Using Some Novel Features", international Collference on Emerging Trends and Applications in Computer Science (ICETACS) 2013. [7] Sasikala, P. and Dr. Wahidabanu, R.S.D., "Robust R. Peak and QRS Detection in Electrocardiogram Using Wavelet Transform", International Journal of Advanced Computer Science and Applications (IJACSA), Vol. 1, No.6, December 2010. pp. 48-53. [8] Kohli, Narendra, Verma, Nishchal K. and Roy, Abhishek, (2010), "SVM Based Methods for Arrhythmia Classification in ECG", International Con! on Computer & Communication Technology (ICCCT) 2010, pp. 486-490. [9] Gholam Hosseini, H., Reynolds, KJ. and Powers, D. (2001), "A Multi­ Stage Neural Network Classifier for ECG Events", 200i Proceedings of the 23"d Annual EMBS International Conference, October 25-28, Istanbul, Turkey. [10] Madzarov, Gjorgji, Gjorgjevikj, Dejan and Chorbev, Ivan, (2009), "A Multi-class SVM Classifier Utilizing Binary Decision Tree", Informatica 33 (2009), pp. 233-241. [11] Shan-xiao, Yang, Cai-ming, Chen, Yu-liang, Dai, Guang-ying, Yang, (2010), "The Research of Arrhythmia Algorithm Based on Fuzzy Neural Network", 2010 Third International Symposium on Electronic Commerce and Security, pp. 131-133. [12] www.physionet.org, MIT-BIH arrhythmia database. [ I]

Comparison of Performance Parameters

The ECG arrhythmia classification has been done using binary SVM and ANN based method. It was found that the binary SVM classifier shows highest percentage of accuracy as compared to ANN based Backpropagation (BP) algorithm. The binary SVM model was trained and optimized by classifying the dataset at various sigma values. That sigma value was chosen and fixed, which gives highest percentage of accuracy rate. Also the total training time required for the SVM is shorter than the BP-ANN algorithm. 1.2

08

06

-SVM_09 • BackJm

04

0.2

sensitivity

specificity positive pred

false pred

CONCLUSION

classifiaction rate

Fig. 7: Comparison Plot between SVM and Back Propagation Algorithm

243

Suggest Documents