Introduction

Electrocardiogram (ECG) is a periodic signal which reflects the activity of the heart. From ECG a lot information is obtained for normal and pathological physiology of heart. The ECG signal is non-stationary in nature and very difficult to analyze. Clinical observation takes long time and the signal is non-stationary. So, computer-based technique is used in ECG analysis. The principle of ECG signal is electrical activity. This is transmitted through the body and picked up on the skin. Finally, the ECG machine records the activity using electrodes and display graphically. The ECG signal consists of repetitive complex waveform with a frequency value of 1 Hz.Each cardiac cycle consists of three waves such as P wave QRS wave and T wave. These waves are produced due to the function of atria and ventricular parts of the heart. Cardiovascular disease is one of the major causes of death in the western world where more than 16 million die annually [1].

An Electro cardio graphic signal is recorded on a long timescale for the purpose of identifying intermittently occurring disturbances in the heart rhythm. To reduce the cardiovascular diseases the life style changes such as reduced cholesterol intake and regular exercise are mandatory. Early detection is a crucial step in the cardiovascular disease. To measure the electrical signal from different parts of heart two types of electrodes are used. They are limb electrodes and chest electrodes. The P wave is produced by atrial depolarization and the duration is less than 120 ms and this can be considered as low frequency wave. ORS complex wave has duration of 70-110 ms and T wave is produced by the repolarization of ventricles having duration greater than 300 ms [2]. Feed forward multilayer neural network with error back propagation used to classify the ECG signal as normal or abnormal signal and two data set are tested for different NN structures.

Neural network [3,4,5,6,7] is to classify the ECG signal and it consists of two-dimensional array to implement the digital hardware [8]. Fuzzy logic neural network [9,10,11,12] is to classify and detect the ECG signal. The amplitude and intervals of the cardiac waves are obtained. The amplitude and duration of the wave is more. To remove the unwanted noise in the ECG signal median filter [13,14,15,16,17,18] is used. For extracting the features, classification preprocessing is the important process. For the analysis of low frequency components median filter play an important role. Time and frequency features based random forest [19,20,21] is to classify ECG signal. Different classification techniques [22,23,24,25] are used to classify the ECG signal.

The contribution of the paper is as follows:

  • Remove high frequency noise by low, high pass filter and butter worth filter.

  • Detect the R peak by peak detection algorithm.

  • Classify the ECG signal by using SVM, ANN, Adaboost and Naïve Bayes classifier.

The main aim of the proposed method is to detect the R peak from QRS waveform and classify the ECG signal as normal or abnormal signal. To avoid over fitting problem in the signal cross validation method is used in the classifier. Section “Proposed methodology” describes in detail about feature extraction and classification of the proposed method. Section “Result and discussions” discusses about experimental results of the proposed method followed by conclusion in section “Conclusion”.

Proposed methodology

The aim of the proposed method is to classify the normal and abnormal cell in the ECG signal. Figure 1 shows the block diagram of the proposed method. It mainly consists of three stages such as preprocessing, peak detection and classification. Preprocessing is done by using low, high and butter worth filter to remove the high frequency noise in the signal. Butter worth filter is used to remove excess noise in the signal. After preprocessing detect the QRS [26] peak for Heart Rate Variability (HRV) signal using peak detection algorithm. Statistical features are extracted from ECG signal and finally the signal is classified using classification algorithm such as Feed Forward Neural Network (FFNN), Naïve Bayes and Cascade algorithm to detect if the signal is normal or abnormal. Cascade algorithm is the combination of Support Vector Machine (SVM) and Adaboost algorithm.

Fig. 1
figure 1

Block diagram of proposed system

Signal acquisition

The database for ECG signal is taken from MIT-BIH arrhythmia database. The recording is digitized by 360 samples per second per channel with a resolution of 10mv range. Other database is ECG –ID database and it also used to classify the ECG signal.

Preprocessing

Preprocessing is one of the important tasks in signal and image processing. To eliminate the high frequency noise in the ECG signal filtering techniques such as low pass filter, high pass filter and butter worth filter are used [27]. Filtering techniques avoids the overlap between ECG and muscle noise. Low pass and high pass filter removes the high frequency noise. After removal of noise in the ECG signal high frequency noise sometimes appears [28,29,30]. So, to remove the excess noises in the signal apply Butter worth filter with a sampling frequency of 1000 Hz is used and cut off frequency of 265khz. Hence it is a simple type of filter and in pass band it shows flat response. At zero herz it has 2 N-1 derivative of the magnitude response for order N. The reliability of the proposed work can be incorporated with the protection schemes [27, 31,32,33].

Peak detection

Detect the QRS complex of ECG signal using peak detection algorithm’s complex wave is important for HRV analysis of ECG signal. In QRS wave detection algorithm R wave has the highest or lowest value in the QRS complex.

Feature extraction

Different signal features are extracted using statistical parameters. Based on the peak detection features are extracted in order to classify the ECG signal. Features such as mean, standard deviation, root mean square, pulse transit time, pulse rate variability are extracted.

Pulse transit time (PTT) - It is the time interval for arterial pulse pressure wave travel from aortic valve to peripheral site. Pulse transit time is calculated by following equation. Table 1 gives the symbol for the parameters.

$$ PWV=\frac{L}{PTT}=\sqrt{\frac{E.h}{2 r\rho}} $$
(1)

Where PWV is the pulse wave velocity vessel length, ρ is the blood density, r is the inner radius of vessel, h is the vessel wall thickness and E is the elastic modulus.

Table 1 Symbols

Pulse rate variability (PRV) – For pulse rate variability the fiducial point for each pulse in PPG is the medium amplitude point \( {\eta}_{M_i} \).

$$ THB=N $$
(2)
$$ MRR=\overline{I} = \frac{1}{N-1}{\sum}_{n-2}^NI(n) $$
(3)
$$ SDNN=\sqrt{\frac{1}{N-1}{\sum}_{n=2}^N{\left(I(n)-\overline{I}\right)}^2} $$
(4)
$$ RMSSD=\sqrt{\frac{1}{N-2}{\sum}_{n=3}^N{\left(I(n)-I\left(n-1\right)\right)}^2} $$
(5)
THB:

Total heart beats

MRR:

Mean of RR intervals

SDNN:

Standard deviation of normal to normal RR intervals

RMSSD:

Root mean square of successive NN intervals

Classification

Support vector machine

Support Vector Machine (SVM) (16) is a supervised learning method used for classification and regression prediction tool to maximize the accuracy. It uses hypothesis space of a linear function and it can be used for different applications such as face analysis, handwriting analysis, mainly for pattern classification and regression. It achieves high generalization by maximizing the margin and supports an efficient learning of nonlinear functions is the main properties of SVM. The initial form of SVM classifier is binary classifier, output is either negative or positive. Two class SVM is used to train the data and classify the test signals between normal and abnormal ECG signals. Different combination of features is combined and the output is given to the Adaboost classifier.

Adaboost classifier

Adaboost is the short form of Adaptive Boosting algorithm and is a machine learning meta algorithm to improve the performance. The aim of adaboost classifier is to reduce the error rate of the weak classifier by introducing a new classifier. Here the output of SVM classifier is combined with adaboost classifier represents the final output of the adaboost classifier. Adaboost is sensitive to noise data and the adaboost algorithm is shown below.

$$ H(x)=\sin \left({\sum}_{t=1}^T{\alpha}_i{h}_t(x)\right) $$
(6)

Where ht(x) is the weak classifier,αi weight is chosen such that error rate is miminum.

Artificial neural network

Artificial neural network (ANN) is a biologically inspired network useful in different areas such as classification, pattern recognition etc. Based on the features of input pattern, the decision making of ANN is holistic and is suitable for the classification of biomedical data. ANN is done by using back propagation algorithm and its aim is to reduce the error to minimum. The weights are randomly assigned and for each epoch the weights are updated, the error between desired output and actual output is minimum. The activation function used is sigmoid function. ANN classifier classifies the ECG database into normal or abnormal signal. Sixteen signal dataset is used for classification and ANN classifier plots five various charactertics. They are train state, error histogram, performance, confusion and receiver operating charactertics.

Naive bayes classifier

Naive Bayes (NB) classifier is the form of data analysis that extracts the models describing important data classes. The naïve bayes classifier has various applications such as fraud detection, performance, target marketing and medical analysis. Naive Bayes classifieris used to classify the ECG signal as normal or abnormal implemented in rapid miner tool and it has exhibit high accuracy, applied to large database. In this method naive bayes classifier is to classify the ECG signal into normal or abnormal signal. It is the statistical classifier that predicts the class membership and has high accuracy compared to another classifier. Assume, attribute value on a given class is independent of the values of the other attributes and this is called class conditional independence; simplify the computation and this state is called naïve.

Error measures the discrepancy between the two borders and it is calculated by

$$ \mathrm{Border}\ \mathrm{error}=\frac{FP+ FN}{TP+ FN}\times 100\% $$
(7)

Result and discussions

The proposed method uses ECG signal and it is taken from MIT-BIH database and classify the output as normal or abnormal signal. The input signal is preprocessed by using filter methods such as low pass, high pass and butter worth filter. By using low pass and high pass filter low frequency noise is removed and in order to remove the excess noise butter worth filter is used with a sampling frequency of 1000 Hz. Detect the peak for the QRS waveform and extract the features for the HRV signal. Classify the signal using four techniques such as ANN, SVM, Naïve Bayes, Adaboost classifier. The experimental result is simulated by using Matlab 2016a.

Figure 2 to 5 shows the ECG signal preprocessing and peak detection of the normal signal. The ECG signal is filtered by using low, high, and butter worth filter to remove the unwanted noise in the signal. Raw ECG is plotted for the signal and peak points are detected for the QRS waveform using peak detection algorithm. In this the peaks are detected for the signal and HRV (Heart Rate Variable) signal is displayed. After HRV signal is displayed, point care is detected for the signal and finally PRV (Pulse Rate Variable) is detected for the ECG signal. The same process is repeated for abnormal signal as shown in Figs. 6, 7, 8 and 9.

Fig. 2
figure 2

Original ECG, noise signal for normal signal

Fig. 3
figure 3

Raw ECG data plotting, filtered ECG signal for normal signal

Fig. 4
figure 4

Peak points detected, HRV display for normal signal

Fig. 5
figure 5

Point care plot and PRV for the normal signal

Fig. 6
figure 6

Original ECG, noise signal for abnormal signal

Fig. 7
figure 7

Raw ECG data plotting, filtered ECG signal for abnormal signal

Fig. 8
figure 8

Peak points detected, HRV signal for abnormal signal

Fig. 9
figure 9

Point care plot and PRV for the abnormal signal

Figure 10 shows the confusion matrix output of SVM classifier and here the accuracy of the classifier is 87.5%, sensitivity is 75%,specificity is 100%.Figure 11 shows the Adaboost classifier output. To classify the ECG signal into normal or abnormal signal totally 16 ECG signal are taken from the database. The accuracy of the SVM classifier is 87.5%and the accuracy of the Adaboost classifier is 93%. An SVM classifier is added with adaboost classifier in the final output of the adaboost classifier. Figure 12 shows the neural network classifier tool box and Figures 13 to 17 show the various charactertics of the ANN classifier. The overall accuracy of the ANN classifier is 94%. The total number of iteration used for the process is 21. Figure 18 shows the naïve bayes classifier output and the accuracy of the classifier is 99.7%.Naïve bayes classifier shows the better accuracy compared to another classifier.

Fig. 10
figure 10

Confusion matrix of SVM classifier

Fig. 11
figure 11

Adaboost classifier

Fig. 12
figure 12

Neural network classifier tool box

Fig. 13
figure 13

performance plot

Fig. 14
figure 14

Training state plot

Fig. 15
figure 15

Error histogram plot

Fig. 16
figure 16

Confusion matrix for ANN

Fig. 17
figure 17

Receiver operating charactertics plot

Fig. 18
figure 18

Naïve bayes classifier

Totally four classifiers are used to classify the ECG signal database such as ANN, SVM, Adaboost and Naïve bayes classifier. These classifiers classify the ECG signal into normal or abnormal ECG signal. The accuracy of SVM classifier is 87.5%, Adaboost is 93%, ANN classifier is 94% and for Naïve Bayes 99.7%. The accuracy of Naïve Bayes classifier is high compared to SVM, ANN and Adaboost classifier. The classifier accuracy and error values of all the classifier are compared. Table 2 shows the comparison table for classifier accuracy and error values.

Table 2 Comparison of classifier accuracy and error values

Figure 19 shows the classifier accuracy and error comparison, the accuracy of the Naïve bayes classifier is high compared to other classifier. If the error value is low the accuracy is high.

Fig. 19
figure 19

Comparison of classifier accuracy and error

Conclusion

In this paper the various types of classifiers are used to classify the ECG signal into normal or abnormal ECG signal. The input image is preprocessed by various filtering technique to remove high frequency noise. Peak value is detected by peak detection algorithm and HRV signal is detected. Features are extracted for signal and the signals are classified by ANN, SVM, Adaboost and Naive bayes classifier. From experimental results the accuracy of the SVM, Adaboost, ANN and Naïve Bayes classifier is 87.5%,93%,94 and 99.7%.Naive Bayes classifier has the highest accuracy compared to other classifier.

Future scope

In future detect the peak for other waveform such as P and T waveform and classify the signal.