BEAT CLASSIFICATION USING HYBRID WAVELET TRANSFORM BASED FEATURES AND SUPERVISED LEARNING APPROACH

This paper describes an automatic heartbeat recognition based on QRS detection, feature extraction and classification. In this paper five different type of ECG beats of MIT BIH arrhythmia database are automatically classified. The proposed method involves QRS complex detection based on the differences and approximation derivation, inversion and threshold method. The computation of combined Discrete Wavelet Transform (DWT) and Dual Tree Complex Wavelet Transform (DTCWT) of hybrid features coefficients are obtained from the QRS segmented beat from ECG signal which are then used as a feature vector. Then the feature vectors are given to Extreme Learning Machine (ELM) and k-Nearest Neighbor (kNN) classifier for automatic classification of heartbeat. The performance of the proposed system is measured by sensitivity, specificity and accuracy measures.


INTRODUCTION
The Electrocardiogram is the electrical activity of the heart which is very important to diagnose the heart disease. The early detection and treatment of ECG signal prevent the patient life from heart diseases and permanent damage from the tissues of the heart (Yuksel Ozbay & Gulay Tezel, 2010) [1]. It is a very important tool to analyze the abnormality in ECG shape. Arrhythmia is a term used to define the ECG shape in abnormality condition. It is a common term in heart beat diagnosis and it differs from normal sinus rhythm (Tsipouras & Fotiadis, 2004) [2].
There are several types of arrhythmia and each type is defined with pattern and is used to identify and classify its type. The arrhythmia comprises of two major types; the first type is formed by single irregular heartbeat and is called as morphological arrhythmia. The second type is formed by a set of irregular heartbeat and is called as rhythmic arrhythmias The main drawback in heart disease diagnosis is that the normal ECG signal is differ for each person and the symptoms of the heart disease abnormality is not shown all the time in ECG signal record. Due to this several hours is extended for successful diagnosis in manual investigation of ECG records. The manual system is a large time consuming as well as having a possibility of missing vital information (Yakup Kutlu & Damla Kuntalp, 2011 and Berat Dogan & Mehmet, 2012) [5,6].
To alleviate this problem, Computer-based automatic arrhythmia detection and classification system is needed in clinical. Computer based development methods used both signal processing and pattern recognition methods. There are two groups in pattern recognition system based on their learning procedures are supervised learning and unsupervised learning system. In supervised learning system training and testing are two types of modes used. A supervised learning system analyze the output based on training data, a training data is formed for all ECG signal in given database based on two classes. However, unsupervised learning system does not need any training data. It forms cluster from a given dataset based on similarity distance measure it gives the output.
In this paper a supervised learning algorithm is used for detection and classification of ECG signal record. The proposed system for arrhythmia classification from ECG signals in four steps as follows: (1) ECG signal preprocessing; (2) heartbeat segmentation; (3) feature extraction; and (4) identification/classification. In first phase Band pass filter is used to remove the unwanted signal in the ECG record. Segmentation of Q, R, S waveform is described in second phase. Hybrid feature is used for the extraction of P, Q, R, S waveform features and it is used as a input to the classification for identification of ECG signal. The final phase if the classification of ECG signals into normal or abnormal ECG signal based on unsupervised classifier system. The ECG signals in the MIT BIH database are used for accomplishing the proposed framework.
The aim of the paper is focused on classify the largest heartbeat cases in the MIT-BIH arrhythmia database such as (i) left bundle branch block (LBBB) (ii) right bundle branch block (RBBB) (iii) NORM (normal heartbeats).
The organization of the paper is as follows. In Section 2, describes about the literature survey of ECG signal analyses. The proposed method for classification of heartbeat cases is introduced in Section 3. Section 4 presents the MIT-BIH arrhythmia database which can be used to evaluate the effectiveness of the proposed method. In Section 5, discussion and performance comparison are depicted. Finally, Section 6 presents conclusions.

II. LITERATURE SURVEY
The analysis of ECG signal for classifying the heartbeat cases has received considerable attention. (Koski, 1996) [7] proposed the Hidden Markov models for detection and classifying the heartbeats.

III. METHODOLOGY
The overview of the proposed system for ECG signal classification has been shown in Fig.1. The ECG signals for training and testing dataset are taken from MIT-BIH database. The proposed ECG signal system is divided into three groups are preprocessing, feature extraction and classification. In training stage, all signals from MIT-BIH database are processed by preprocessing and feature extraction and formed feature vector. In testing stage the input signal from MIT-BIH database is processed by first two groups and obtained features from feature extraction group is matched with feature vector from testing stage. The matching process is taken by supervised learning approach in classification stage and provides the result as ECG normal or ECG abnormal. The ECG signal is filtered with band pass filter for removing EMG artifacts from muscles; motion artifacts from the subject and electrodes, baseline wander and power line interference.

Detection of QRS Peak
The QRS complex detection in an ECG signal is an important factor to diagnose the cardiac disease. QRS feature is most significant feature compared to any ECG feature because it provides the information of the heart rate computation. The QRS complex is based on the (i) Differences & Approximation Derivatives, (ii) Inversion and (iii) Thresholding.
First calculate the difference between the adjacent elements of the ECG signal. If X is a 1D vector of an ECG signal then differences and approximation derivative of the filtered ECG signal is implemented as: Once again differences and approximation derivation is calculated for obtained Y1 signal The output of Y1 and Y2 is cumulated for the detection of R-peak and is given as follows: Where indicates the sampling frequency The s-wave peak is detected by finding local minimum value on the inverted Y signal.
The detection of a Q-wave peak is achieved by comparing the threshold on minimum peak value on Y signal. The thresholding scheme for searching the q-wave peak is formulated as: Where THV is the threshold herein the threshold are 0.2mv and 0.5mv and m is the minimum amplitude value in Y signal. The ECG signal taken from the record 100 of MIT BIH database are shown in fig. 2. The filtered output done by band pass filter is shown in fig.3. The QRS complex of the filtered ECG signal is shown in fig.4.

Hybrid Feature Extraction
The Feature extraction stage is the key to the success for the ECG signal classification. The feature extraction discriminate the different types of signals in the given database. The features can be extracted from the ECG segmented contains arrhythmia or non-arrhythmias beat. Moreover, the feature extraction method provides the descriptive of the heartbeat segmentation. In this paper, Hybrid features are used to extract the features from heart beat segmentation using combination of DWT and DTCWT decomposition method.

Discrete Wavelet Transform
DWT provides good resolution at high frequency and good frequency resolution at low frequency. Due to this advantage, DWT can extract the local characteristics of the input heart beat segmentation. DWT decomposes the QRS complex using DWT techniques. The input signal is decomposed into low pass and high pass filter followed by down sampling in each stage. The ECG heart beat signal is decomposed into three level is illustrated in figure 5. In that Fig, the output of the first stage high pass filter provides the detail coefficient D1 and low pass filter provides the approximation coefficient A1. The Quadrature Mirror Filter (QMF) is used in each stage of low pass and high pass filter. QMF condition is satisfied using below equation: In the above equation and are the z transform of low pass and high pass filter and it is related to time domain analyses is given by below form: Length of the filter is given by variable "L". The low pass and high pass filter for an output signal is given by below form:

Dual Tree Complex Wavelet Transform
The conventional DWT technique is a powerful tool for analyzing the ECG signal in a 1D signal but it has a drawback of oscillation, shift invariance and aliasing. It is very complicated to detect and analyse the signal with singularities because of wavelet coefficient oscillates around the singularities. The shift variance is occurred due to the down sampling operation at each stage. Hence, there is a change in the energy of the wavelet coefficient in the input pattern for a small time shift. This property leads to fail to distinguish the input signal shifts. Undecimated form of dyadic tree provides shift invariance but it suffers from increased computation requirements and high redundancy in the output. Aliasing is appear in the conventional DWT due to the calculation of wavelet coefficient using iterative time discrete operations with the non-ideal high and low pass filters. This aliasing property s canceled using inverse DWT, but only if the wavelet coefficients are not processed (Kadambe & Srinivasan, 2006) [16].
To alleviate the problem of conventional method of DWT, a simple technique DTCWT is introduced. The magnitude of Fourier Transform does not oscillate positive and negative instead of these produce a small positive envelope on frequency domain. Second the shift invariant is perfect with the simple linear phase offset encoding with shift. Third, there is no aliasing part as well as no need of complicated aliasing cancelation property to reconstruct the signal. The below equation defines the Fourier transform which is based on complex valued oscillating sinusoids.
The cosine and sine part in the above equation is derived from Hilbert transform pair and both parts are 90 0 out of phase with each other. Based on Fourier transform inspiration, the DTCWT also employs complex valued wavelet and scaling function and it is given in below equation: In the above two equation real part and the imaginary part of the complex wavelet function is represented by and and they are Hilbert transform pair to each other. Two real wavelet filters are used in dual tree approach for acquired the real and imaginary part of the transform. Two filters are combined and defined as analytic filter. This filter gives a new structure and is similar to two standard DWT filter bank structure operating in parallel and is illustrated in figure. The fig shows two part are called as Tree A and Tree B; where tree A is called as sub-band signal of upper DWT it defines the real part of the complex wavelet transform while Tree B is called as sub-band signal of lower DWT and it provides the imaginary part of the complex wavelet transform. Both Tree A and Tree B used different set of filters for the reconstruction.
Let low pass and high pas filter of the upper filter bank is represented as 0 1 ( ) in the same way low and high pass filter for the lower filter bank is denoted as 0 1 ( ). The low pass filter from both filter banks is designed such that wavelet functions are approximate Hilbert transform pair and they are related as The below figure illustrates the structure of ID Q-shift dual tree proposed by (Kingsbury) where are two sets of filter was used; one set of filters for level and the other set of filters for higher level. There is even length and group delay of ¼ after the level 1 filter. The dual tree complex wavelet transform consists of two real DWT and the complex coefficients are occurred only if the two trees are combined.

Figure 6: Dual Tree Complex Wavelet Transform
Hybrid feature set are obtained using combination of DWT and DTCWT and is implemented as follows: The DWT feature provides the details low frequency and high frequency of given QRS complex whereas DTCWT feature gives the shift invariance property of the QRS complex.

The k-nearest neighbor (kNN)
The kNN method is one of the non parametric methods introduced by (Malini suvarna and Venkategowda, 2011) [17]. kNN is easy to implement and needs to be determine the number of nearest neighbor. Performance of kNN classification is based on number of nearest neighbor. kNN classification classifies the new samples from testing samples to the training samples depend on minimum distance function obtained from Euclidean distance.
The Euclidean distance between two points such as X 1 = x 11 , x 12 , . . , x 1n and X 2 = x 21 , x 22 , . . , . x 2n can be obtained from below equation: The basic steps for k-NN algorithm are:


Initialize the k value based on class.  Calculate the Euclidean distance between the training and testing samples.  Sort the obtained distance result in ascending order and take the minimum distance value as a predicted result.

Extreme Learning Machine
In some existing approach, if the number of classes is increases the complexity of the overall classifier also increases [18]. The multicategory classification problem is reduced by the introduction of Neural Network (Linder, 2004) [19]. It can map the input data into different classes directly with one network. Basically, the parameters such as weights and biases of the feed forward ANN is tuned by the learning algorithm in their training scheme. Most of the gradient descent based learning algorithm in feed forward ANN are slower due to their improper learning steps and may converge to local minima. (Huang et al., 2004a, 2004b and 2005)  represents the weight connecting the ith hidden node to the output node. , , indicates the output of the ith hidden node with respect to the input x.
For the additive hidden node with activation function is represented as: represents the weight vector connecting the ith hidden node and the input nodes, is the bias of the ith hidden node and . represents the inner product of the in . The two above equation can be written as: = Where H represents the hidden layer output matrix of the network; the ith column and jth row of the hidden node output with respect to their input vector 1 , 2 , . . , .
In real application the hidden nodes will be less than their training samples then only training error cannot be made exactly zero but can approach a non training error . The hidden node parameter of SLFN need not be tuned in the time of training condition instead it simply be assigned with random values based on continuous sampling distribution. Equation (14) can be written as: = † (21) Where † represents the Moore-Penrose generalized inverse of the hidden layer output matrix H. The ELM algorithm consist of three steps can be given as follows: ELM Algorithm: Given a training set ℵ = X i , t i X i ∈ R n , t i ∈ R m , i = 1, … , N , activation function g(x), and hidden node number N . STEP 1: Assign random hidden nodes by randomly generating parameters a i , b i according to any continuous sampling distribution, i = 1, . . , N . STEP 2: Calculate the hidden layer output matrix H. STEP 3: Calculate the output weight β β = H + T

IV. RESULTS AND DISCUSSION
The Experimental results are carried out in MATLAB software package. The ECG signal is collected from the MIT-BIH database it consists of 48 recordings with duration of 30 minutes [23]. The sampling frequency of the respective database is 360 Hz and the resolution of the signal is 200 samples per mv. The database is divided into two classes are normal and abnormal class. To evaluate the performance of the proposed system using performance metrics such as sensitivity (Se), specificity (Sp) and Accuracy (ACC) which are given as follows: Sensitivity defines the ratio of number of correctly detected events to the total number of events in the given events are calculated by below equation: Where True Positive (TP) defines the total number of events and False Negative (FN) indicates the number of missed events Specificity defines the ratio of the number of correctly rejected non-events to the total number of non-events is calculated using below equation: Where True Negative (TN) defines the total number of non events and False Positive (FP) relates the number of falsely detected events.
The overall accuracy for the respective event is given below:    Table 1 & 2 provides the comparison of different events using performance metrics such as sensitivity, specificity and accuracy using two different classifier ELM and kNN. The performance metrics are evaluated for two different types of diseases or events are LBBB, RBBB and also comparison are carried over for normal ECG signal. The metrics are obtained on the ECG signal using kNN and ELM classifier with the hybrid features generated by the combination of (DWT-DTCWT) and DWT features. The ECG signal were divided into two separate datasets are training and testing dataset.
The training dataset was used to train the kNN & ELM classifier using three different types of heart beats whereas the testing dataset was used to testing the three classes of ECG signal and it verify the effectiveness of kNN and ELM classifier.
It is obvious from the table 1 & 2 that the higher accuracy is given by RBBB & LBBB using kNN with hybrid feature compared to kNN with DWT features, ELM with hybrid feature and ELM with DWT feature. From this analysis observed that hybrid features overcomes that DWT features.
Also observed that hybrid feature with kNN classifier provides better accuracy compared to hybrid feature with ELM classifier because proposed hybrid feature have an advantage of both individual features as well as kNN classifier is good for small dataset with small set of features. The ELM classifier also used as regression and classification with given set of feature mapping function and it have ability to handle both large and small dataset it have a drawback of unnecessary input weight and hidden layer basis due to random selection of input weight and hidden layer.

V. CONCLUSION
In this paper, we proposed an ECG beat classification based on hybrid features and classifier. The hybrid features are extracted from QRS complex of the ECG signal. In this paper supervised learning approach of kNN and ELM classifier is used as a classifier because it provides good results compared to unsupervised classifier and it is easy to implement. The proposed method of hybrid features with kNN classifier provides an promising sensitivity, specificity and accuracy compared to hybrid feature with ELM classifier. The results reveals that kNN classifier is an good method for computer aided diagnosis of cardiac arrhythmias. The Experimental results also reveal that the performance of the hybrid feature with kNN classifier is better than DWT feature with kNN and ELM classifier.