Introduction

Cardiovascular disorders (CVDs) are one of the major mortality causes worldwide. The building of accurate and fast techniques for automatic Electrocardiogram (ECG) heartbeat signal classification is crucial for clinical diagnosis of different CVDs [53] e.g. an arrhythmia. Notion arrhythmia is used to denote a group of situations where irregular electrical activities originate from heart and are represented by the ECG beats or patterns [10, 38]. ECG is a simple, efficient, non-invasive tool for heart diseases detection. Medical workers analyze different waveforms based on their characteristics (amplitude, polarity, etc.) and make their diagnosis and treatments based on this analysis.

In literature, various techniques are proposed for the automatic ECG heartbeat classification. Recent researches, where computerized algorithms were used, demonstrated that these algorithms are capable of detecting heart arrhythmias with relatively high accuracy rate [24]. Senhadji [44] employed Discrete Wavelet Transform (DWT) as a feature extraction method and linear discriminant analysis as a classifier. Also, a local and global classifier was constructed in tandem with a mixture of experts (MOE) technique [19]. Shyu, et al., [46] used wavelet feature extraction together with Fuzzy Neural Network (FNN) classifier for the classification of Premature Ventricular Contraction PVC heartbeat signals. Hosseini, et al., [18] used a multilayer perceptron (MLP) classifier and obtained accuracy was 88.3 % in the testing set. Power Spectral Density (PSD) was employed for classification ECG signals in [1, 28]. An image-based technique that takes out discriminative data from the ECG signals trajectories in the state space was used. Lagerholm [25] applied a Hermite function together with Self-Organizing Maps (SOM) for ECG heartbeat signals clustering [42]. An automated online heartbeat signal division and classification model built on a Markovian technique was suggested [5]. Particle swarm optimization (PSO) was used to classify Normal heartbeats and five different arrhythmia types by means of the ECG morphology and RR interval features and obtained average accuracy was 93.27 % [34]. One of the main drawbacks of these systems is unsatisfactory classification rate.

As it can be seen, obtained reported classification accuracies, reported in previous researches, are not satisfactory. Classification accuracy rates are below 95 % and in order to have real life system, systems’ classification performances should be as high as possible. From these up-to-date researches, it is obvious that there are a number of significant concerns in the construction of the automatic ECG signal classification system which if appropriately addressed, results in more improved and more proficient diagnostic system design. First concern is related to the preprocessing module. To solve first problem, MSPCA was used in this study. The second concern is related to the selection of suitable feature extraction methods, since the signal features should be taken into account in order to construct system with high performances. The third concern is related to classification approach. Although many researches aimed to design an automatic arrhythmia heartbeat diagnostic system, there is still a need for the improvement of the classification accuracy, sensitivity and specificity when employed for very large databases. Furthermore, majority of the reported techniques employed complex mathematical features resulting in huge computational power during the evaluation of the features. The goal of this study is to design a simple automatic arrhythmia detection and classification system, which will give the highest classification accuracy even when it used for massive databases.

Also, one of the major problems reported in literature in the development of an automatic ECG signal classification systems is related to the preprocessing module. In the signal recording process, different kinds of noise can be introduced and introduced noise can seriously distort the signal. ECG signal de-noising is generally considered in ECG preprocessing phase. In our previous study, we proposed a system with Multiscale Principal Component Analysis (MSPCA) to reduce the signal to noise ratio (SNR) of the ECG heartbeat signal prior to classification [4]. In this study, noise was removed with Multiscale Principal Component Analysis (MSPCA) technique in preprocessing phase in the same way. MSPCA is employed to generate a helpful representation of ECG signals that removes noise and adjusts to the morphological properties of the ECG signal waveform features. After the preprocessing and ECG heartbeat detection phase, the selection of the proper classifier, for correct detection of different arrhythmia types, is an additional problem. The common tendency is to build automatic ECG signal classification systems. For that reason, computer-based ECG signal classification is necessary and tending to be the standard in medical applications [10]. In classification phase, decision tree methods, namely Classification and Regression Tree (CART), C4.5 and Random Forest, were investigated. Decision tree methods, especially Random Forest method, did not almost receive very weak attention in ECG signal classification compared to other research fields. Additional problem is the choice of the proper features. Classification of ECG heartbeats signals should be done based on extracted features so that different arrhythmia types can be identified. Accurate feature extraction is essential for accurate ECG heartbeat classification along with additional different electrocardiograph applications. For ECG feature extraction phase, Discrete Wavelet Transform (DWT) is employed. In the first step, the ECG signals are decomposed into different frequency bands using DWT. In the second step, statistical features extracted from these frequency bands decomposes ECG signals to get better accuracy for heartbeat classification.

The remained of paper is organized in the following way. Section 2 provides the materials and methods used. It presents database used, de-noising module, feature extraction and classifiers. In Section 3, the experimental results are presented and the paper is concluded in Section 4.

Materials and methods

Databases

In this study, two different Physionet database were employed as data sources. These two databases are MIT-BIH Arrhythmia database and St.-Petersburg Institute of Cardiological Technics 12-lead Arrhythmia Database (INCARTDB).

MIT-BIH Arrhythmia database records were obtained by the Beth Israel Hospital Arrhythmia Laboratory between 1975 and 1979. This is a free database available online.Footnote 1 This database contains 48 two-lead ECG records obtained from 47 different patients and duration of each of these records is around 30 min. Sampling frequency is 360 Hz. Two records (201 and 202) come from the same subject. Subjects were 25 men aged 32 to 89 and 22 women aged 23 to 89. All beats were labeled two or more cardiologists. In total, there is more than 109,000 labeled beats from 15 distinct heartbeat classes. The class with the highest amount of data is “Normal beat” and the class with the smallest amount of data is “Supraventricular premature beat” (having just two samples) [36]. Five different heartbeat classes were selected for this study: normal (N), left bundle branch blocks (LBBB), right bundle branch blocks (RBBB), atrial premature contractions (APC) and premature ventricular contractions (PVC) heartbeats.

Unbiased assessment of the classification system proposed in this study is essential, however results in several issued. By employing all MIT-BIH arrhythmia database [36] for assessment of the proposed system looks like logical step, nonetheless there is considerable issue which needs to be solved and this issue is that processing all MIT-BIH database extremely time consuming. For that reason, subset of the MIT-BIH arrhythmia database that is comprised of five characteristic ECG heart beat classes was used to assess the proposed system. In different studies, with same MIT-BIH Arrhythmia data base used, different number of heartbeat was extracted from this database. In [9], 500 heartbeats were taken from MIT-BIH Arrhythmia Database (100 samples from each of the classes: LBBB, RBBB, PVC, Fusion Paced and Normal Beat). In [37], 630 beats was selected for ECG heart beat classification (normal heart beats and 5 arrhythmias types, namely LBBB, RBBB, APC, PVC, Paced beat (PB) and Fusion beats (PB)). In [6], total number of 1367 ECG heartbeats were taken from the same database. In [35], 1500 heartbeat was extracted for ECG signal analysis. In this study, 1800 heartbeats was selected, namely 1000 Normal heartbeats, 300 LBB heartbeats, 200 RBBB heartbeats, 200 PVC heartbeats and 100 APC heartbeats. Each ECG heartbeat is a matrix with one lead used and window length is 320 data points used to extract heartbeats. 320 data points is approximately equal 0.889 s. Every ECG heartbeat has five different points used for ECG signal interpretation and understanding. In this study, we considered R-R intervals.

To prove high performances of medical decision support system for diagnosis of heart arrhythmia proposed in this study, beside MIT-BIH database, St. -Petersburg Institute of Cardiological Technics 12-lead Arrhythmia DatabaseFootnote 2 was also employed. This database contains 75 annotated recordings. These recordings were taken from 32 different Holter recording. Duration of every recording is 30 min and all recordings contain 12 standard leads. Sampling frequency is 257 Hz having gain between 250 and 1100 analog-to-digital converter units per millivolt. These database is comprised more of than 175 000 labeled beats. Subjects were 17 men and 15 women aged 18 to 80 with mean age of 58 [15, 47]. One thousand (1000) heart beats were extracted from each of four different heartbeat classes were selected for this study: normal (N), right bundle branch blocks (RBBB), atrial premature contractions (APC) and premature ventricular contractions (PVC) heartbeats. In total, 4000 heartbeat signals were extracted from this database.

ECG signal de-noising using multiscale PCA

De-noising is the most essential step of the ECG signal classification that generates significant information about numerous heartbeat signal abnormalities. It provides indication for the diagnosis of heart disorders. Due to this significant reason, it received a great attention in which the noise presence and time-varying morphology hardens the ECG signal abnormality detection.

Capacity of PCA to take out relationship among the variables with the capability of orthonormal wavelets to separate deterministic characteristic from stochastic processes is combined together in MSPCA. To benefit from PCA and wavelets, the quantities of all columns are separated into its wavelet coefficients by applying the identical orthonormal wavelet for all variables. Conversion of the data matrix A into a matrix WA, W is a k × k orthonormal matrix with the orthonormal wavelet conversion operator containing the filter coefficients is the result of MSPCA. The matrices WA and A have equal sizes, on the other hand because of the wavelet decomposition, the deterministic component in all A variables is found in a minor number of coefficients in WA, while the stochastic component in every variable is decorrelated in WA, and is extended over all components based on its power spectrum [4, 7, 21].

Feature extraction using discrete wavelet transform

In this study, Discrete Wavelet Transform (DWT) is used for feature extraction from ECG signals. To generalize, DWT is a linear operator that decomposes the signal into numerous components (wavelets) at different frequency bands. Due to its linearity property, DWT is capable to save the significant phase information. Although DWT does not distinguish the noise coefficients from signal coefficients at low SNRs, DWT is still a smart answer for non-stationary signals since it preserves the behavior of ECG heartbeat signals [39, 49].

The DWT is frequently explained in terms of its recovery transform [43]:

$$ x(t)={\displaystyle \sum_{k=-\infty}^{\infty }{\displaystyle \sum_{t=-\infty}^{\infty }d\left(k,\ell \right)}}{2}^{-k/2}\psi \left({2}^{-k}t-\ell \right) $$
(1)

Here, ψ is wavelet function, (k, j) ∈ Z 2; k is linked to a as: a = 2k; b is linked to as b = 2k ; and d(k, ) refers to a sampling of W(a,b) at discrete points k and . Correlation among waveform and wavelet is described by W(a,b). In the DWT, a novel model is introduced called as the scaling function, a function that simplifies the calculation of DWT. To apply DWT, the optimum resolution is calculated primarily. The calculation then continues to coarser resolutions, but instead of starting over on the original waveform, the calculation applies a smoothed version of the well resolution waveform [43].

DWT studies the signal at various frequency bands, having distinct resolutions. It decomposes the signal into approximation (A – low frequency part of initial signal) and detail (D – high frequency part of initial signal). Both stages of this structure are comprised of two digital filters and two down-samplers by power of 2. The first high-pass filters’ and low-pass filters’ down-sampled outputs and result in detail, D1 and the approximation, A1, in that order. Further on, the first approximation, A 1 is decomposed in the same way into detail D2 and approximation A2, and this procedure is repeated until no more sab-sampling is doable. To reconstruct original signal, approximations and details results are rebuilt with the Daubechies 4 (DB4) wavelet filter. The wavelet coefficients extracted from the signal give a close illustration which demonstrates the ECG heartbeat signal energy distribution in time and frequency domain. More detailed explanations are given in ([3, 48]; Subasi A., EEG signal classification using wavelet feature extraction and a mixture of expert model, 2007).

Very important role in the accurate ECG heartbeat signal classification is the reduction of the dimensionality of the feature extraction. The wavelet coefficients extracted from DWT give a close representation of the ECG signal energy distribution in time and frequency domains. Statistics for classification of ECG signals were utilized for in order to decrease the dimensionality of the set of the wavelet coefficients in DWT domain [20, 49, 50, 52]. Statistical indices utilized to denote the time-frequency distribution of the ECG signals are as follows [50, 51]:

  1. (1)

    Mean of the absolute values of the coefficients in each sub-band.

  2. (2)

    Average power of the wavelet coefficients in each sub-band.

  3. (3)

    Standard deviation of the coefficients in each sub-band.

  4. (4)

    Ratio of the absolute mean values of adjacent sub-bands.

Indices 1 and 2 represent the frequency distribution of the signal and the indices 3 and 4 the amount of changes in frequency distribution. Seven different values for indices (1), (2) and (3); six different values for index (4), or in total 27 features were extracted. These feature vectors, calculated for the frequency bands A6 and D1–D6 were used as an input to classifiers [51].

Decision tree classifiers

Classification and regression tree (CART)

The Classification and Regression Tree (CART) algorithm is based on determining the most excellent split of all features, and then divides the resulting branches. If we take into consideration a regression problem with inputs X1 and X 2 and continuous output Y and, all of them take values in the unit interval. In all separated elements, Y can be designed having distinct constant. Opposite to this, there is a problem: although all separated lines have an uncomplicated description such as X1 = c, a number of resulting regions are hard to be explained [16].

CART is well-known decision tree technique. It is a one of binary recursive partitioning types. The notion “binary” refers to the entire sets of subjects, characterized by a “node” in a decision tree, and may just be fragmented into two segments. Consequently, every node might be fragmented into two child nodes, and the first node is labelled as a parent node. The notion “recursive” denotes to the binary partitioning procedure which is competent to be used many times. As a result, all parent nodes may produce two child nodes and, and after this, all these child nodes may be fragmented, resulting in new generations. The notion “partitioning” denotes that the dataset is fragmented into segments [27].

C4.5

A “divide-and-conquer” strategy of the learning task from a set of self-governing samples is represented by a model known as a decision tree. Attributes are tested in decision tree nodes. Typically, the test at a node contrasts an attribute value with a constant. On the other hand, a number of trees contrasts two attributes among themselves, or apply certain function having at least one attribute. Classification(s) or probability distribution over every potential classification is done in the leaf nodes. In order to classify signals, signal propagates from top to down in accordance with the values of the attributes being verified in consecutive nodes. Classification process finishes when signal reaches the leaf and signal is classified based on the leaf class [39, 57].

If the verified attribute at a node is a nominal one, the number of children and the number of potential values of the attribute are equal in most of the cases. For every potential value there is one branch. Due to this, the identical attributes will not be tested again in the rest of the tree. From time to time, the attribute values can be split into two different subsets. If it is the case, decision tree will branch into two different modes, according to which subset the attribute value belongs. If this happens, the attribute may be verified several times in the route. If the attribute is quantitative, there will be a two-way split at the node being verified and decision will be made according to the attribute value; i.e. if it is bigger or smaller than some pre-determined value [54].

Random forest (RF)

Random Forest (RF) is a classification technique first used by Breiman [8]. RF applies a group of classification trees [8, 16, 41]. All types of classification trees are built by applying a bootstrap data model. At every division, the candidate variables group is chosen in random manner from a set of all variables. Therefore, random forest applies bagging [8, 16], and random variable assortment for tree construction. All trees are grown completely to produce low-bias trees. Random Forest results in group that is able to attain low bias and low variance. Random forest obtains exceptional performance in classifications. It owns a number of properties:

  1. (a)

    May be applied when the amount of variables is bigger than amount of observations;

  2. (b)

    May be applied for multi-class problems;

  3. (c)

    Has outstanding prognostic performance;

  4. (d)

    Do not result in over-fitting;

  5. (e)

    Can handle both categorical and continuous predictors combined together;

  6. (f)

    Good quality and free implementation codes in different languages and packages are obtained [13].

RF can be used for both; classification and regression. In the case that RF is used in classification tasks, RF receives a class vote for all trees, and at that point does the classification by means of the majority vote. In the case that RF is used in regression tasks, the predictions from all trees at a target point x are only averaged. In reality, the most suitable parameters values depend on task being done, and these parameters are supposed to be understood and used as tuning parameters [16].

Results and discussion

Two different Physionet databases were used in this study, namely MIT-BIH database and St.-Petersburg Institute of Cardiological Technics 12-lead Arrhythmia Database. From MIT-BIH arrhythmia database, five different types of heartbeat signals, namely N (normal heart beat), RBBB (Right Bundle Branch Block), LBBB (Left Bundle Branch Block), APC (Atrial Premature Contraction) and PVC (Premature Ventricular Complex) were examined. St.-Petersburg Institute of Cardiological Technics 12-lead Arrhythmia Database, four different heartbeat signal types were extracted (N, PVC, APC and RBBB).

Experimental results

There are different approaches in literature to evaluate performances of proposed models. In this study, we considered three different statistical indices, namely F-measure, ROC area and overall accuracy.

A ROC area is obtained by plotting all sensitivity values (true positive part) on the y axis and their correspondent (1-specificity) values (false positive part) for each of the available thresholds on the x-axis. Beside good sides it has, the ROC area does not offer a rule for the classification. Still, there are techniques accepted to generate decisions from the ROC area plot [61]. Determining the proper threshold from a ROC plot is reliant on existing values for the relative costs of false-positive and false-negative values.

It is hard task to allocate values to these costs, perhaps biased and subjected to the environment where the classification decisions will be employed. Zweig and Campbell [61] suggested that if the false-positive costs (FPCs) exceed the false-negative costs (FNCs), the threshold ought to brace specificity, while sensitivity should be braced if vice versa. Joining these expenditures with the prevalence (p) of positive cases permits the slope calculation:

$$ \mathrm{m}=\left(\frac{\mathrm{FPC}}{\mathrm{FNC}}\right)\times \left(\frac{1-p}{p}\right) $$
(2)

where m stands for the slope of a tangent to the ROC area if it is a flat and parametric curve. The intersection point between tangent and curve depicts the specific sensitivity/specificity pair that might be employed to select the threshold.

Second statistical index used to measure performance in this study is F-measure. F-Measure, also known as effectiveness measure, describes the classification performance in precision-recall space [26, 40]. It is described as the weighted harmonic average of the precision (P) and recall (R) metrics [26]:

$$ F=\frac{1}{\alpha \cdot \frac{1}{P}+\left(1-\alpha \right)\cdot \frac{1}{R}} $$
(3)

where

$$ \begin{array}{l}P=\frac{N_{TP}}{N_{TP}+{N}_{FP}}\\ {}R=\frac{N_{TP}}{N_{TP}+{N}_{FN}}\end{array} $$
(4)

TP stands for true positive, FN stands for false negative, FP stands for false positive beats. The parameter α depends on the end-user purpose, and have control over the comparative significance of P and R. The aim is to find the ideal parameters by detecting the highest F-Measure aimed at a known α [26].

The most fundamental statistical index for evaluation of total system performance is overall accuracy. It can be calculated as follows:

$$ Accuracy=\frac{N_T-{N}_E}{N_T}\times 100 $$
(5)

NE and NT stand for the total number of incorrectly classified ECG beats and total number of ECG beats in the file, in that order [22].

In this study, two different experiments were done. In the first experiment we used DWT without de-noising the ECG signal with MSPCA. In the second experiment we used MSPCA to remove noise from ECG heartbeat signals and DWT is utilized to decompose the ECG signals to different sub-bands. After decomposing signal into sub-bands using DWT, statistical features extracted from the signal. To perform signal de-noising (MSPCA) and feature extraction (DWT), MATLAB was employed. Daubechies 4 (db4) wavelet functions in MATLAB was used. For solving classification problem, decision tree methods were applied. Decision methods were implemented in Weka and default parameters were used. To improve generalization capabilities of decision tree methods, our training and testing sets were generated from different subject. In total we conducted two different experiments to show the effects of MSPCA de-noising [4]. The flowchart with whole procedure followed in this system is given in Fig. 1.

Fig. 1
figure 1

Procedure for ECG heartbeat classification proposed in this study

When decision tree methods are used, we need to make decision on in what way to separate data into training and testing data set. Training set is utilized to generate a classification model. Testing set is used to confirm its effectiveness. In all experiments, 10-fold cross validation was used. This means that whole set is divided into 10 mutually exclusive subsets (folds) of approximately equal size. 9 folds are used for training and testing is done on the remaining one fold. The procedure of training and testing is repeated 10 times [4, 39].

Experiment 1: ECG signal classification without MSPCA de-noising

In the first experiment, DWT was utilized to extract significant feature vectors from every ECG signal segment without MSPCA de-noising. The outcome of this extraction is feature set that typifies different ECG signal patterns. Then, decision tree methods were applied for classification; obtained results are shown in Table 1 for MIT-BIH database and in Table 2 for St.-Petersburg Institute of Cardiological Technics 12-lead Arrhythmia Database.

Table 1 Comparison of the obtained results without using MSPCA denoising for MIT-BIH
Table 2 Comparison of the obtained results without using MSPCA denoising for St.-Petersburg Institute of Cardiological Technics 12-lead arrhythmia database

For MIT-BIH database, CART classifier gave the lowest the accuracy of 79 %. CART classifier also resulted in the lowest F-measure (F-measure = 0.873). ROC area for CART was 0.873, slightly higher than ROC area of C 4.5 (ROC area = 0.860), but still noticeably lower than RF (ROC area = 0.960). C4.5 gave somewhat higher performance results (Accuracy = 80.44 %). F-measure for C 4.5 classifier was 0.799, slightly higher than F-measure of CART classifier (0.785). The best performance result (highest F-measure, ROC area and overall accuracy) was obtained with RF classifier where F-measure, ROC area and overall accuracy were 0.848, 0.960 and 85.33 % respectively.

For St.-Petersburg Institute of Cardiological Technics 12-lead Arrhythmia Database, C 4.5 classifier gave the lowest the accuracy of 92.43 %. C 4.5 classifier also resulted in the lowest F-measure (F-measure = 0.924) and ROC area (ROC area =0.955). Performance results CART and C 4.5 classifiers are still noticeably lower than performance results of RF. CART gave somewhat higher performance results (Accuracy = 92.93 %). F-measure and ROC area for CART classifier were 0.929 and 0.974 respectively, slightly higher than F-measure and ROC area of C 4.5 classifier. The best performance result (highest F-measure, ROC area and overall accuracy) was obtained with RF classifier where F-measure, ROC area and overall accuracy were 0.955, 0.994 and 95.45 % respectively.

From these approaches, it can be seen that obtained performance results are not very high and one of the reasons for this is noise found in the signal. Therefore, prior to applying DWT, a de-noising technique should be used in order to obtain higher performances and classification results.

Experiment 2: ECG signal classification by using MSPCA de-noising

In order to show the effect of de-noising, in the second experiment, we applied MSPCA de-noising technique to de-noise ECG signals. Figure 2, part (a) illustrates the original normal ECG signal and part (b) illustrates the normal ECG signal after MSPCA is applied. The effect of MSPCA based on Signal-to-Noise Ratio (SNR) before and after de-nosing step is considered in this study. For original signal shown in Fig. 2, SNR was equal to 5.0097 dB for original ECG signal and SNR for de-noised signal was equal to 0.7923 dB. This proves that the noise was removed in order to improve the quality of the acquired ECG signals. After the elimination of noise, we applied DWT again (as in the first experiment) to decompose the ECG signals into different sub-bands. After decomposing signal into sub-bands using DWT, statistical features extracted from the signal. Afterwards, we applied decision tree methods for classification.

Fig. 2
figure 2

ECG Signal a) before de-noising b) after de-noising with MSPCA

Obtained performance results are given in Table 3 for MIT-BIH database and in Table 4 for St.-Petersburg Institute of Cardiological Technics 12-lead Arrhythmia Database. As it can be seen from the tables, obtained performance results are higher than that of without MSPCA de-noising.

Table 3 Comparison of the obtained results by using MSPCA denoising for MIT-BIH
Table 4 Comparison of the obtained results by using MSPCA denoising for St.-Petersburg Institute of Cardiological Technics 12-lead arrhythmia database

For MIT-BIH database, the accuracies for CART method were found to be 99.0, 90.0, 100.0, 95.5 and 98.7 % for heartbeat cases Normal, APC, PVC, RBBB and LBBB heartbeats respectively and ROC area, F-measure and overall accuracy were 0.992, 0.987 and 98.7 % respectively. The accuracies for C4.5 method were found to be 99.7, 93.0, 100.0, 94.5 and 97.7 % for heartbeat cases Normal, APC, PVC, RBBB and LBBB heartbeats respectively and ROC area, F-measure and overall accuracy were 0.991, 0.984 and 98.4 % respectively. The best performance results were obtained by using RF classifier where ROC area, F-measure and overall accuracy were 0.999, 0.993, and 99.33 % respectively. The accuracies for RF method were found to be 100.0, 96.0, 100.0, 98.0 and 98.7 % for heartbeat cases Normal, APC, PVC, RBBB and LBBB heartbeats respectively.

For St.-Petersburg Institute of Cardiological Technics 12-lead Arrhythmia Database, the accuracies for CART method were found to be 99.50, 100.0, 99.80 and 99.90 % for heartbeat cases Normal, APC, PVC and RBBB heartbeats respectively and ROC area, F-measure and overall accuracy were 0.999, 0.998 and 99.80 % respectively. The accuracies for C4.5 method were found to be 99.40, 100.0, 99.80 and 100.0 % for heartbeat cases Normal, APC, PVC and RBBB heartbeats respectively and ROC area, F-measure and overall accuracy were 0.999, 0.998 and 99.80 % respectively. The best performance results were obtained by using RF classifier where ROC area, F-measure and overall accuracy were 1, 0.999, and 99.95 % respectively. The accuracies for RF method were found to be 100.0, 100.0, 99.80 and 100.0 % for heartbeat cases Normal, APC, PVC and RBBB heartbeats respectively.

Discussion

The performances reveled by the decision tree methods for ECG signal classification is due to the next three particular significances: de-noising, extraction of the significant features and classification method miscellany. The most of the significant features extracted from the ECG is subject to the signal processing technique utilized. The features extracted, which are the best suited for ECG signal representation and classification, should be utilized as the inputs for classifiers. For this reason, DWT is selected as a convenient feature extraction for ECG, since it can be used for classification of the nonlinear dynamics underlying heart activity and since it permits understanding of the progress of complexity and consistency of the ECG.

Overall comparison of both approaches for two different databases is given in Table 5 and Fig. 3. In order to have accurate both diagnosis and treatment evaluation, it is of crucial to have precise recognition of ECG signals. Acquired Random Forest model classifies ECG signals using MSPCA de-noising and statistical features of DWT as the input with an accuracy of 99.33 %. This effect also resulted in improvement of ROC area (AUC = 0.999) and F-measure (0.993) of RF classifier. These obtained results were higher than results obtained by sing CART and C4.5 decision tree classifiers. Even though it permits alterability of the input signals, RF classifier has competence to construct a detection scheme established on repetitive patterns. RF classifier, described in this study, is competitive with other methods, found in literature, in classification of ECG signals. It is verified that the RF classifier with MSPCA de-noising and statistical features of DWT is robust enough to alternations in the heartbeat signals for classification of ECG signals.

Table 5 Overall accuracy comparison of classifiers
Fig. 3
figure 3

Comparison of accuracy results in (%) for different ML methods

In order to show the efficiency and strength of suggested system, performance results obtained are compared with the results obtained in other studies. Although it is hard to make such comparison due to different arrhythmia types analyzed, data sets, performance evaluations some conclusions can be generated.

Dingfei, et al., [14] applied autoregressive (AR) modeling and generalized linear model technique were used to classify Normal, Atrial Premature Contraction (APC), Supra Ventricular Tachycardia (SVT), Ventricular Tachycardia (VT), Premature Ventricular Contraction (PVC) and Ventricular Flutter (VF) ECG beats, and they achieve classification accuracy of 93.2 %. A. Khazaee and A. Ebrahimzadeh, [22] used support vector machines (SVMs) and genetic algorithms (GAs) using power spectral features for classification of these five ECG heartbeat types and obtained accuracy was 93.97 %. Gaussian Mixture Model (GMM) was employed to classify principal components of two kinds of abnormal ECG beats and the obtained accuracy was higher than 94 % [30]. Obtained accuracy with cluster analysis (CA) method was 94.3 % for five different ECG heartbeat types (N, RBBB, LBBB, PVC and APC) [56].

Khazaee and Ebrahimzadeh [22] employed SVMs and genetic algorithms using power spectral features and obtained accuracy was 96.00 %. Acir [2] applied support vector machines (SVMs) and discrete cosine transform (DCT) for classification of ECG signals and obtained accuracy was 96.5 %. Zade, et al., [59], achieved accuracy of 97.14 % by using SVM with Gaussian radial basis function (GRBF) kernel for three different types (Normal, PVC and others). Yu and Chou [58] employed Independent Component Analysis (ICA) and, the independent components arrangement scheme was suggested and eight different ECG heartbeats types (Normal, Left Bundle Branch Block (LBBB), Right Bundle Branch Block (RBBB), PVC, APC, paced beats, Ventricular Flutter wave and ventricular ectopic beats) were classified by means of Support Vector Machine (SVM) and Probabilistic Neural Network (PNN) and with this approach the obtained accuracy was higher than 98 %. Particle Swarm Optimization (PSO) and Radial Basis Function Neural Network (RBFNN) were applied to classify six different ECG heartbeats types, namely Normal, PVC, fusion of ventricular and Normal beats, APC, RBBB, fusion of paced and Normal beats, and the obtained sensitivity was higher than 95 % of and specificity was higher than 98 % [23].

A novel fuzzy c-means method was used for classification of five types of ECG heartbeats, namely N, RBBB, LBBB, PVC, APC, and obtained accuracy was 98.28 % [55]. N, RBBB, LBBB, PVC and APC heartbeat types were studied by using PCA analysis and obtained classification accuracy was 98.11 % [31, 32]. Homaeinezhad, et al., [17] performed ECG arrhythmia detection was by means of neuro-SVM-kNN hybrid classifier and achieved accuracy was 98.20 % for 7 different arrhythmias. Shen, et al., [45], achieved classification accuracy of 98.92 % for 12 different ECG heartbeat types by using adaptive feature extraction and modified support vector machines. Principal components of segmented ECG beats in tandem with LS-SVM was used to classify five different ECG heartbeat signal types, namely Normal (N), RBBB, LBBB, APC and PVC [31, 32]. In [31, 32], DWT was used to extract features and PCA was used compress feature space, and extrcated features were fed into gaussian mixture models (GMM), error back propagation neural network (EBPNN) and SVM, and reported performances were 87.36, 93.41 and 95.6 % respectively. Martisa, et al., [33] applied DWT together with ICA as feature extractor and PNN was employed as classifier for classification of five types of ECG hearbeat signals, namely normal, RBBB, LBBB, APC and PVC, and obtained accuracy was 99.28 %. Zidelmala, et al. [60], employed Genetic Algorithm SVM as classifier and obtained the accuracy of 99 % for classification of N, RBBB and LBBB signals. Daqrouq, et al. [12], introduced average framing percentage energy (AFE) of terminal wavelet packet transform (WPT) sub signals as a feature extraction method. PNN was used as a classifier and achieved accuracy was 97.92 %. Recently, Cho et.al. [11] proposed optimized compression algorithm for real time ECG data transmission in wireless networks. Also, Lin et.al. [29] proposed community-based ECG monitoring system that wirelessly detect heart rate, offer individual healthcare improves social contacts. If possibility for classification, similar to approach proposed in this study, is added to these recently proposed systems, quality of patients’ lives would be greatly enhanced.

Based on the results of this study, the followings can be highlighted:

  • The MSPCA de-noising is plays crucial role in the classification of ECG heartbeats.

  • The classifiers with high classification accuracy give insights into the features used for defining the ECG signals. It can be seen easily that the statistical features of DWT coefficients characterize well ECG signals. Good distinction between different ECG signal classes can be achieved if these features are utilized.

  • The classification results and the values of statistical parameters designated that the Random Forest has notably significant accomplishments in the classification of ECG heartbeat signals when compared to other classification results found in literature. Random Forest classifier, proposed in this study, can be exploited in classification of different non-stationary biomedical signals.

  • According to achieved performances, RF-based diagnostic system, proposed in this study, is found to be practical and this system can be utilized in many different clinical studies after it is constructed. This system results in the objectivity of the appraisal of ECG signals and its computerized environment generates easiness of the usage in clinical systems. Moreover the workability of a real-time system construction of this diagnosis system may be improved by expanding parameters range.

Conclusion

In this study, we proposed the automated system for classification of ECG heartbeat signals. Two different database, namely MIT-BIH and St. -Petersburg Institute of Cardiological Technics 12-lead Arrhythmia Database, were used to verify the high performances of the system proposed in this study. Five ECG signal patterns from MIT-BIH (normal (N), Premature Ventricular Complex (PVC), Atrial Premature Contraction (APC), Right Bundle Branch Block (RBBB) and Left Bundle Branch Block (RBBB)) and four ECG patterns from St. -Petersburg Institute of Cardiological Technics 12-lead Arrhythmia Database (N, APC, PVC and RBBB) were considered in this study. The suggested Random Forest classifier together with DWT and MSPCA is competent for ECG signals classification and results in high accuracy rate. This system is able to classify five most frequent arrhythmia types with very high classification rate, 99.33 % for MIT-BIH database and 99.95 % for St. -Petersburg Institute of Cardiological Technics 12-lead Arrhythmia Database. F-measure and ROC area values for this structure were also very high, 0.993 and 0.999 for MIT-BIH database and 0.999 and 1 for St. -Petersburg Institute of Cardiological Technics 12-lead Arrhythmia Database respectively. Besides we also used CART and C 4.5 methods for comparison purposes. Accuracies obtained for these two methods were also very high. Obtained results give encouragement to design and evaluate proposed system in order to evaluate the contribution of a cardiovascular disorder diagnosis. To show the efficiency and effectiveness of our proposed system, we compared performance results achieved in this study with results obtained in other studied. Our proposed system is an efficient, simple and express tool for cardiac arrhythmia detection and diagnosis from ECG signals.