Abstract

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 and for class- and subject-oriented scheme, respectively, using three-fold cross validation.

1. 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. There 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]. There 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. The 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. Therefore, several techniques have been proposed for automatic detection and classification of various types of arrhythmia [410].

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. These features were then classified using support vector machine with an average accuracy of . 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. The high-order 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 .

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]. These 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].

The 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 and minimum rejection cost. A combination of time and frequency information has also been used in [9, 11, 1416], 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 .

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)The 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. The 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).

The 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.

2. Methodology

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

2.1. 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 noise-free ECG signal usingwhere is the denoised signal, represents the raw ECG signal, and μ is the expected value of the raw EEG signal.

2.2. Heartbeat Segmentation

Three basic constituents of a heart cycle are QRS complex, T wave, and P wave, termed as fiducial points. The correct splitting of the ECG signal into heartbeat segments involves recognition of borders and peak locations of these fiducial points. The 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. This segment size contained maximum information of a single heartbeat and is shown in Figure 2.

2.3. 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.

2.3.1. 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.

The 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. The frequency range of fourth-level approximation subband was  Hz, and the frequency range for fourth level detail subband was  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.

2.3.2. 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. The 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. The calculation of these features uses the following equations:where i shows the location of the current R-peak and , , , and represent the previous, post, local, and average RR interval, respectively. is the current R-peak, and represent the previous and post R-peaks, respectively, and shows the total number of RR intervals in an ECG segment.

2.3.3. 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. The 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 function. For a discrete time signal , the Teager–Kaiser nonlinear energy (NE) and the average nonlinear energy (ANE) in the time domain are given aswhere N represents the total number of samples in ECG heartbeat.

2.4. Neural Network (NN) Classifier

An artificial neural network consists of interconnected neurons which send and receive messages between each other. These 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. The network was implemented on MATLAB R2013a. The 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. The learning rate was optimized to a value of 0.63, using grid search for accuracy and to avoid over fitting.

3. Experimental Results

The details of the dataset used and the experimental results are presented in the following subsections.

3.1. Dataset

The 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. The MITDB includes 48 ECG recordings of 47 subjects, whereas the SVDB contains 78 half-hour ECG recordings. The data in SVDB were recorded to increase the supraventricular arrhythmias examples in MITDB. The databases contain an annotation file with locations of the “QRS” complex and the type of the heartbeat for each record. These class annotations for heartbeats were exploited as reference annotations for evaluation purpose of the proposed model.

3.2. Evaluation Strategy

Two different types of evaluation strategies were considered, namely, class-oriented [24] and subject-oriented [9]. In class-oriented strategy, all signals from both databases were segmented down using already annotated QRS locations. The resulting segments were divided into 18 different types of beats, namely, normal beat (NOR “N”), atrial premature contraction (APC “A”), fusion of ventricular and normal beat (FVN “F”), left bundle branch block (LBBB “L”), unclassifiable beat (UN “Q”), premature ventricular contraction (PVC “V”), right bundle branch block beat (RBBB “R”), ventricular flutter wave (VF “!”), atrial escape beat (AE “e”), fusion of paced and normal beat (FPN “f”), nodal (junctional) premature beat (NP “J”), isolated QRS-like artifact (—), aberrated atrial premature beat (AP “a”), ventricular escape beat (VE “E”), nodal (junctional) escape beat (NE “j”), nonconducted P-wave (blocked APB “x”), paced beat (PACE “/”), and supraventricular premature beat (SP “S”).

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]. The 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). The mapping from the MITDB and SVDB classes to the ANSI/AAMI heartbeat classes is presented in Table 1.

The ECG signal from MITDB and SVDB datasets are first denoised to remove baseline wander. The 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 level approximation and 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. The complete dataset ( beats) was subsampled into two sets, one having of the total samples and the other with the remaining heartbeats from each of the classes ( data was selected for training from atrial escape beat (e), due to very low number of beats). 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. The process was repeated three times with different heartbeats used for training and testing. The 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.

3.2.1. 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. The 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.” The performance evaluation measures are shown for all three folds in Table 2, where the best accuracy achieved was . In addition, average sensitivity, average specificity, average PPV, and overall accuracy were achieved. The 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. These 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. The performance of the subject-oriented scheme is also analyzed for practical evaluation.

3.2.2. Subject-Oriented Evaluation

In subject-oriented scheme, results have reported according to the ANSI/AAMI standard. The specificity, sensitivity, PPV and accuracy of each individual class in ANSI/AAMI standard is shown in Table 5. The hybrid feature approach demonstrated reasonable individual-class performances, showing greater specificity, good sensitivity, positive PPV, and accuracy for all classes. The fusion beats showed lower PPV in Fold II, which can be attributed to smaller number of beats in this class. The peak accuracy achieved was with average sensitivity, average specificity, of average PPV, and average accuracy. Table 6 shows the confusion matrix depicting an improved performance on all classes with an average accuracy of . 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. The comparison is reported for methods using the MIT-BIH data for adding credence to the results.

4. 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. The classification was done using twelve ICA projection coefficients computed from the DWT features, plus four RR interval features, and Teager energy value. Two types of evaluation schemes, class- and 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 with a peak accuracy in a single fold of in the class-oriented evaluation was achieved. An accuracy of in the subject-oriented evaluation was achieved. In future, an automatic patient customization scheme will be considered, allowing the heartbeat classification method to be able to adjust to individual physiological features using wearable sensors.

Data Availability

The data used in this study are available for download at the physionet MIT-BIH website.

Conflicts of Interest

The authors declare that there are no conflicts of interest regarding the publication of this paper.

Authors’ Contributions

Syed Muhammad Anwar and Maheen Gul contributed equally to the study.