Arrhythmia Classification of ECG Signals Using Hybrid Features

Automatic detection and classification of life-threatening arrhythmia plays an important part in dealing with various cardiac conditions. In this paper, a novel method for classification of various types of arrhythmia using morphological and dynamic features is presented. Discrete wavelet transform (DWT) is applied on each heart beat to obtain the morphological features. It provides better time and frequency resolution of the electrocardiogram (ECG) signal, which helps in decoding important information of a quasiperiodic ECG using variable window sizes. RR interval information is used as a dynamic feature. The nonlinear dynamics of RR interval are captured using Teager energy operator, which improves the arrhythmia classification. Moreover, to remove redundancy, DWT subbands are subjected to dimensionality reduction using independent component analysis, and a total of twelve coefficients are selected as morphological features. These hybrid features are combined and fed to a neural network to classify arrhythmia. The proposed algorithm has been tested over MIT-BIH arrhythmia database using 13724 beats and MIT-BIH supraventricular arrhythmia database using 22151 beats. The proposed methodology resulted in an improved average accuracy of 99.75% and 99.84% for class- and subject-oriented scheme, respectively, using three-fold cross validation.


Introduction
Cardiac arrhythmias are a type of irregular heartbeats in which the heart rhythm is either too fast (tachycardia) or too slow (bradycardia). A small change in electrocardiogram (ECG) morphology or dynamics may lead to severe arrhythmia attacks, which can reduce the ability of the heart to pump blood and causes shorting of breath, pain in chest, tiredness, and loss of consciousness. ere are several types of arrhythmia, and some of these are dangerous which may lead to cardiac arrest and sudden death if not detected and monitored in time [1]. ere are other types of arrhythmias which are not essentially life-threatening, but still require proper analysis to avoid future clinical problems. A few categories of arrhythmia appear infrequently in the ECG signal and hence require long electrocardiogram recordings in order to be detected. A manual analysis of longer ECG recordings requires time and great effort. e automatic detection and classification of these arrhythmias offer great assistance to physicians [2,3]. Moreover, early diagnosis of arrhythmias would help in proper treatment and support sustained life. erefore, several techniques have been proposed for automatic detection and classification of various types of arrhythmia [4][5][6][7][8][9][10].
A method for classification of sixteen types of arrhythmia based on ECG morphology and dynamics was proposed in [11]. Morphological features were extracted using discrete wavelet transform (DWT) and independent component analysis (ICA), while ECG dynamic features were extracted by calculating RR interval. ese features were then classified using support vector machine with an average accuracy of 99.6%. Five types of heartbeats, namely, normal, premature ventricular contractions (PVC), atrial premature contractions (APC), left bundle branch block (LBBB), and right bundle branch block (RBBB) were recognized in [4]. Stationary wavelet transform (SWT) was applied on each ECG signal to make it noise free. e highorder statistics of ECG signals and three timing intervals were considered as features, which were then fed to a hybrid bees algorithm for training the radial basis function and resulted in an average accuracy of 95.18%.
Some techniques rely on fiducial features, which are temporal and dynamic features that directly depend upon the ECG characteristics, e.g., wave onset point, peaks (maxima/minima), and offset [5]. Nonfiducial features that are directly derived from the fiducial features or obtained by segmenting the ECG signal into several parts have also been used [6]. ese features are not found good enough when used independently for accurate classification of ECG arrhythmia. A combination of both fiducial and nonfiducial features was used for defining a biological marker for person identification [7,12]. e extracted features have usually been analyzed either in time domain or frequency domain. Some of the most important time domain features, including RR interval, ST segment, and T height, require identification of key time points within the signal [13]. An approach for heartbeat classification with dynamic rejection thresholds was proposed using QRS morphology, frequency information, AC power of QRS detail coefficients, and RR intervals as features to represent ECG beats [8]. A support vector machine (SVM) was used to classify with an improved accuracy of 97.2% and minimum rejection cost. A combination of time and frequency information has also been used in [9,11,[14][15][16], giving better extraction of information from a quasiperiodic ECG signal using wavelet transform, which provides a good time and frequency resolution. Five important types of arrhythmia, namely, nonectopic, ventricular ectopic, supraventricular ectopic, unclassifiable beats, and fusion betas, were analyzed and detected in [9]. Features were extracted using DWT, and only significant coefficients were selected by applying independent component analysis which in combination with neural network yielded an accuracy of 99.28%.
All methods discussed above have the following shortcomings: (1) Performances of most of the methods have been tested only on smaller data sets, and there is a need to verify their performance on larger databases (2) Selected classes of arrhythmia have been evaluated, and there is a need to test all arrhythmia classes (3) e classification accuracy on sparsely occurring arrhythmia classes is not good In this paper, a novel technique for ECG beat classification of arrhythmia is proposed that considers a hybrid of enhanced morphological and dynamic features to overcome these shortcomings. Morphological features are obtained using DWT on each heartbeat. e resulting features consist of DWT approximation coefficient and detail coefficients at level 4. Independent component analysis is applied on both approximation and detail coefficients independently to extract only important coefficients. In addition, four types of RR interval features are calculated to represent the dynamic features of ECG heartbeats. Moreover, to enhance the dynamic features of ECG heartbeats corrupted with Gaussian noise, Teager energy operator (TEO) [17] is used. All these features are combined and fed to a neural network (NN) for automatic classification of heartbeats into different arrhythmia types according to both class-oriented scheme (18 classes) and subject-oriented scheme (5 classes). e rest of the paper is organized as follows. Firstly, the proposed methodology is explained in detail in Section 2. Class-and subject-oriented evaluation of the proposed system is presented in Section 3, followed by conclusion in Section 4.

Methodology
e proposed methodology is presented in Figure 1, which consists of four major phases, namely, preprocessing, heartbeat segmentation, feature extraction, and feature classification. e details of these phases are presented in the following subsections.

ECG Signal Preprocessing.
Mostly ECG signals are affected by baseline wander or power line interface (PLI). Different methods were introduced to remove these types of noises from the ECG signal [18]. Experiments showed that baseline wander significantly affects the detection of arrhythmia and makes the ECG signal analysis difficult for an expert [19]. PLI is a type of noise that occurs due to broken electrodes, offset voltages in the electrodes, movement of patient, respiration errors, or electrode resistance while recording the ECG signal. It is a low frequency noise and typically exists in the frequency range of 0-0.3 Hz. For baseline wander removal, the expected value of the signal was subtracted from the raw ECG signal to obtain the noisefree ECG signal using where x[n] is the denoised signal, x r [n] represents the raw ECG signal, and μ is the expected value of the raw EEG signal.

Heartbeat Segmentation.
ree basic constituents of a heart cycle are QRS complex, T wave, and P wave, termed as fiducial points. e correct splitting of the ECG signal into heartbeat segments involves recognition of borders and peak locations of these fiducial points. e information about the R-peak locations given in the dataset was used to obtain these heartbeat segments. A single heartbeat consisted of 200 samples including the R-peak and the samples around the peak. is segment size contained maximum information of a single heartbeat and is shown in Figure 2.

Feature Extraction.
In feature extraction, improved features based on DWT, RR interval, and Teager energy operator were selected, which were able to represent the morphological and dynamic changes in the ECG signal with more significance.

Discrete Wavelet Transform (DWT).
Statistical features of biomedical signals usually change over position or time. Wavelet transform offers signal representation in both time and frequency domains, which makes it capable for analyzing quasiperiodic signals like ECG. Wavelet transform was employed in processing of the ECG signals for feature extraction [1], denoising [11], and heartbeat recognition [20]. In the proposed method, DWT was used as a feature extraction technique. After applying DWT, the ECG signal decomposed into low-frequency approximation components and high-frequency detail components. e most commonly used wavelets which provide orthogonality properties are Daubechies, Coiflets, Symlets, and Discrete Meyer [21]. Each heartbeat was disintegrated using the finite impulse response (FIR) approximation of the Discrete Mayers wavelet transform. e frequency range of fourth-level approximation subband was 011.25 Hz, and the frequency range for fourth level detail subband was 11.2522.5 Hz. A total of 200 coefficients were extracted as wavelet features, which were processed using ICA for dimensionality reduction. Six major ICA components were selected from each of the two DWT subbands, resulting in a total of twelve morphological features from the two subbands.

RR Interval
Features. R is a point corresponding to the highest peak of the ECG waveform, and RR interval is the time between the successive QRS complexes. e ECG signal has a nonlinear dynamic behavior, and during arrhythmia, nonlinear dynamic components change more significantly than the linear counterparts. RR interval is simple, easy to calculate, and less prone to noise. Four types of RR interval features, namely, previous-RR, post-RR, average-RR, and local-RR interval, were derived from the RR sequence, to characterize the dynamic features of the heartbeat. e calculation of these features uses the following equations: where i shows the location of the current R-peak and RR pre , RR post , RR local , and RR ave represent the previous, post, local, and average RR interval, respectively. R(i) is the current R-peak, R(i − 1) and R(i + 1) represent the previous and post R-peaks, respectively, and N RR shows the total number of RR intervals in an ECG segment.

Teager Energy Operator (TEO).
An independent analysis of RR interval does not capture the nonlinear nature of RR interval inconsistency. TEO was utilized to represent the nonlinear behavior of the RR interval, which is a nonlinear operator for energy tracking [17]. It measures the instantaneous frequency, amplitude envelope, and the energy of the system that generated the signal. e energy required by a source to generate signals with different frequencies and same energy and amplitude would be different. More energy is needed to generate a high-frequency signal as compared with a low-frequency signal. TEO reflects the source energy; hence, any instability in the conduction path and impulse generation gets revealed in the Teager energy where N represents the total number of samples in ECG heartbeat.

Neural Network (NN)
Classifier. An artificial neural network consists of interconnected neurons which send and receive messages between each other. ese interconnections are assigned weights, which represent a network state and are updated during the learning process. A feedforward neural network with 10 hidden layers was used for the classification of arrhythmia in this study. e network was implemented on MATLAB R2013a. e number of neurons in each hidden layer was limited to 50, which allowed training this network on a core-i5 CPU-based system with a RAM of 8 GB. An activation function based on rectified linear unit (ReLU) was used for the hidden layers, and a sigmoid function was used at the output layer. Back propagation with stochastic gradient decay was used for updating the network weights. e learning rate was optimized to a value of 0.63, using grid search for accuracy and to avoid over fitting.

Experimental Results
e details of the dataset used and the experimental results are presented in the following subsections.

Dataset.
e MIT-BIH arrhythmia database (MITDB) [22] and MIT-BIH supraventricular arrhythmia database (SVDB) [23] from physionet were used for evaluation of the performance of the proposed algorithm. e MITDB includes 48 ECG recordings of 47 subjects, whereas the SVDB contains 78 half-hour ECG recordings. e data in SVDB were recorded to increase the supraventricular arrhythmias examples in MITDB. e databases contain an annotation file with locations of the "QRS" complex and the type of the heartbeat for each record. ese class annotations for heartbeats were exploited as reference annotations for evaluation purpose of the proposed model.
In addition, subject-oriented strategy was also evaluated. All 126 records from both the datasets were divided into a similar training and testing ratio as for the class-oriented scheme, but performance was reported according to ANSI/AAMI EC57:1998 standard [25]. e original 18 classes of heartbeats were grouped into five bigger classes, namely, nonectopic beats (N), ventricular ectopic beat (V), supraventricular ectopic beat (S), unknown beat (Q), and fusion beat (F). e mapping from the MITDB and SVDB classes to the ANSI/AAMI heartbeat classes is presented in Table 1.
e ECG signal from MITDB and SVDB datasets are first denoised to remove baseline wander. e denoised signal was segmented into different heartbeats of same length (200 samples each) by using R-peak location information in the given annotations. In total, 35875 beats form both databases (13724 from MIT-BIH arrhythmia dataset and 22151 beats from MIT-BIH supraventricular arrhythmia dataset) were considered. FIR approximation of Mayers wavelet was applied on each heartbeat segment. ICA was applied on the resulting 4 th level approximation and 4 th level detail coefficients independently to remove the redundancy between feature coefficients. In addition, dynamic features of the ECG signal were represented by four types of RR interval features, and Teager energy operator was used to represent the nonlinear dynamics of the ECG signal.
A 3-fold cross-validation method was used for training and testing of the classifier. e complete dataset (35, 875 beats) was subsampled into two sets, one having 70% of the total samples and the other with the remaining heartbeats from each of the classes (50% data was selected for training from atrial escape beat (e), due to very low number of beats). 70% of total heartbeats were utilized for training purpose, and the rest of the heartbeats were used in testing and evaluation of the performance of the classifier. e process was repeated three times with different heartbeats used for training and testing. e average results of the three folds were calculated to assess the general performance of the proposed method. Sensitivity (Se), specificity (Sp), positive predictive value (PPV), and accuracy (Acc) were calculated to analyze the performance.

Class-Oriented Evaluation.
In class-oriented evaluation scheme, a neural network was trained to predict the class of test heartbeats among 18 different classes of arrhythmia. e specificity, sensitivity, and PPV of each individual class are summarized in Table 2, which shows that the proposed approach demonstrates a reasonable individual-class performance, showing greater specificity, good sensitivity, and PPV. Moreover, it has given better results on classes whose presence was low like "Q," "e," and "x." e performance evaluation measures are shown for all three folds in Table 2, where the best accuracy achieved was 99.9%. In addition, 98.7% average sensitivity, 99.9% average specificity, 99.8% average PPV, and 99.75% overall accuracy were achieved. e confusion matrix is presented in Table 3, which shows the correctly classified and misclassified arrhythmia classes.
A comparison of the classification accuracy of the proposed approach and state-of-the-art methods based on class-oriented strategy is presented in Table 4. An improvement in accuracy with increased number of classes and reduced feature dimension is observed. In addition, other performance parameters such as sensitivity, specificity, and PPV have also shown improvement. ese results depict that the proposed method is more generalized and computationally efficient for arrhythmia classification. An assessment based solely on "class-oriented" scheme is not a faithful measure for the performance analysis of a real-time heartbeat classification system. e performance of the subject-oriented scheme is also analyzed for practical evaluation.

Subject-Oriented Evaluation.
In subject-oriented scheme, results have reported according to the ANSI/ AAMI standard. e specificity, sensitivity, PPV and accuracy of each individual class in ANSI/AAMI standard is shown in Table 5. e hybrid feature approach demonstrated reasonable individual-class performances, showing greater specificity, good sensitivity, positive PPV, and accuracy for all classes. e fusion beats showed lower PPV in Fold II, which can be attributed to smaller number of beats in this class. e peak accuracy achieved was 99.9% with 99.7% average sensitivity, 99.9% average specificity, 99.1% of average PPV, and 99.8% average accuracy. Table 6 shows the confusion matrix depicting an improved performance on all classes with an average accuracy of 99.8%. A comparative analysis is presented in Table 7 with state-of-the-art techniques for subject-oriented classification. A significant improvement is observed, when taking this fact into account that 18 arrhythmia classes were classified. e comparison is reported for methods using the MIT-BIH data for adding credence to the results.

Conclusion
In this paper, a new technique for automatic heartbeat classification of all types of arrhythmia was presented. An improved hybrid feature representation of heartbeat segments was used based on a mixture of a set of derived morphological and dynamic features. e classification was done using twelve ICA projection coefficients computed   Computational and Mathematical Methods in Medicine 5 from the DWT features, plus four RR interval features, and Teager energy value. Two types of evaluation schemes, classand subject-oriented, were implemented for analyzing the system. On the standard benchmark of MIT-BIH arrhythmia database and MIT-BIH supraventricular arrhythmia database, an average accuracy of 99.75% with a peak accuracy in a single fold of 99.9% in the class-oriented evaluation was achieved. An accuracy of 99.8% in the subjectoriented evaluation was achieved. In future, an automatic patient customization scheme will be considered, allowing  N  8656  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  A  2  65  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  F  0  0     Data Availability e data used in this study are available for download at the physionet MIT-BIH website.  [15] RR interval series and WT -3 93 80 82 de Lannoy et al. [5] Waveform + HOS + RR 249 5 (16) 94 --