International Scholarly Research Notices

International Scholarly Research Notices / 2013 / Article

Research Article | Open Access

Volume 2013 |Article ID 261917 |

Sahar H. El-Khafif, Mohamed A. El-Brawany, "Artificial Neural Network-Based Automated ECG Signal Classifier", International Scholarly Research Notices, vol. 2013, Article ID 261917, 6 pages, 2013.

Artificial Neural Network-Based Automated ECG Signal Classifier

Academic Editor: A. Antonio Alencar De Queiroz
Received28 Mar 2013
Accepted29 May 2013
Published17 Jun 2013


The ECG signal is well known for its nonlinear dynamic behavior and a key characteristic that is utilized in this research; the nonlinear component of its dynamics changes more significantly between normal and abnormal conditions than does the linear one. As the higher-order statistics (HOS) preserve phase information, this study makes use of one-dimensional slices from the higher-order spectral domain of normal and ischemic subjects. A feedforward multilayer neural network (NN) with error back-propagation (BP) learning algorithm was used as an automated ECG classifier to investigate the possibility of recognizing ischemic heart disease from normal ECG signals. Different NN structures are tested using two data sets extracted from polyspectrum slices and polycoherence indices of the ECG signals. ECG signals from the MIT/BIH CD-ROM, the Normal Sinus Rhythm Database (NSR-DB), and European ST-T database have been utilized in this paper. The best classification rates obtained are 93% and 91.9% using EDBD learning rule with two hidden layers for the first structure and one hidden layer for the second structure, respectively. The results successfully showed that the presented NN-based classifier can be used for diagnosis of ischemic heart disease.

1. Introduction

The ECG signal indicates the electrical activity of the heart. Variations in the amplitude and duration of the ECG signal from a predefined pattern have been used routinely to detect the cardiac abnormality. Because of the difficulty to interpret these variations manually, a computer-aided diagnosis system can help in monitoring the cardiac health status. Because of the nonlinear and nonstationary nature of the ECG signal, nonlinear extraction methods are good candidates for extracting the information in the ECG signal [1].

Since artificial neural networks are basically a pattern matching technique based on non-linear input-output mapping, it can be effectively used for detecting morphological changes in non-linear signals such as the ECG signal.

The issue of selecting an optimal set of relevant features plays an important role in pattern classification. To meet higher accuracy in pattern classification it is not adequate if we have the best pattern classification system. The selected features must be capable of separating the classes at least to some useful degree. Otherwise they become irrelevant. It is important that the selected features must be screened for redundancy and irrelevancy [2]. Although different methods can be used to extract diverse features from the same raw data, the integration of a feature extractor and a pattern classifier is essentially important.

Recently different approaches have been proposed for feature extraction, cardiac health diagnosis, and ischemia detection from ECG signals; these include discrete wavelet transform, cosine transform, and the discrete Fourier transform [1, 36]. Moreover, methods including NN and neurofuzzy models have been used for ECG signal classification [3]. In [7, 8] NN models were applied, while [3, 9, 10] utilized neuro-fuzzy approaches and NNs, principal component analysis [11], and multilayer perceptron [9, 12]. Features extracted from higher-order spectra of heart rate variability were used for detecting cardiac abnormalities [13]. Engin et al. [14] used autoregressive coefficients: third-order cumulant and wavelet transform variances as features for arrhythmia classification.

In this paper, slices from the higher-order spectra, namely, the polyspectrum slices and polycoherence indices of normal and ischemic ECG signals are used as input features to an NN classifier. As the HOS preserve phase information, it is hypothesized that these slices will reflect the non-linear character of the signal which will preserve important information that can help locate the differences between normal and ischemic ECG waveforms. An automated ECG signal classifier was implemented using adaptive neural networks with backpropagation (BP) approach to classify normal and ischemic subjects.

2. Materials and Methods

2.1. ECG Data

Normal ECG data from the MIT/BIH CD-ROM, the Normal Sinus Rhythm Database (NSR-DB) [15], and ischemic ECG data from the European ST-T database (E-DB) [16] are used. The NSR-DB contains 18 records, between 20 and 24 hours each, from subjects without diagnosed cardiac abnormalities. The sampling frequency is 128 Hz. The E-DB consists of 90 two-channel records, of two-hour duration each, taken from ambulatory ECG recordings and digitised at 250 Hz. A total of 800,000 samples or about 6420 ECG beats from 18 normal subjects and 1650,000 samples or about 6600 ECG beats from 27 ischemic subjects were analysed. Modified lead II was used for analysis.

Figure 1 shows the general configuration of the different stages employed in the classification process. In signal preprocessing stage the ECG signal is high-pass filtered (cutoff frequency: 0.5 Hz) to remove the baseline wander. Then R-peaks of the underlying ECG signals are detected and the segment length (mean value of ECG cycle) has been identified. The Kaiser smoothing window is applied throughout this analysis [17]. In the feature extractor stage the polyspectrum and polycoherence slices are calculated using an algorithm by Zhou and Giannakis [18]. Each slice is the average of fifty slices for each subject. Several Matlab routines have been implemented by the authors for calculation and extraction of the polyspectrum and polycoherence slices and to prepare the input data files with the desired patterns (features) in the format required for the NN training and testing phases. Section 2.3 presents briefly the backpropagation algorithms used for the training of the neural network classifier while the selection of the training data sets is presented in Section 2.4.

2.2. Polyspectrum Slices

An algorithm by Zhou and Giannakis [18] was used to estimate the diagonal slices of the polyspectrum and polycoherence indices with multiple independent records [19]. The diagonal slices of the polyspectrum, , and polycoherence, , indices are as follows: where is the order, is the number of samples in one record, is the self-coupling frequency, is the 2nd-order spectrum, and .

Multiple independent records are required for correct estimation of the polycoherence index, which increases the computations required but still has the advantage of being onedimensional.

2.3. Backpropagation Algorithm

An adaptive BP algorithm is used for the training procedure [20, 21] in two phases. Firstly, the inputs are presented to the network, which propagate forward to produce the output for each neuron, , in the output layer. The activity of each neuron is determined, , where is the sigmoid activation function and are constants. Then the error signal is generated: where is the desired output for neuron at iteration . The BP algorithm changes the weight vector, , of NN so as to minimize the error function, , defined by where the includes all neurons in the output layer. The correction applied to is defined by Training of the NN is based on an adaptive algorithm with the parameter changing. If in (4) 0, a minimum has been reached.

2.4. Selection of the Training Sets

In this paper, two sets of features (S1 and S2) are used in training and testing the NNs; these are [19] as follows:(i)S1 consists of polycoherence index slices in the frequency range 0–20 Hz for polyspectrum order . This set requires an input layer of 20 neurons. S1 consists of 120 patterns for the training phase and 74 different patterns for the test phase. Figure 2 shows examples of this input feature for normal and ischemic ECG signals, (ii)S2 consists of multiple features from the HOS domain, these are [19] as follows:(1)the polyspectrum order and the diagonal slices of the polyspectrum for orders 2 to 10 in the frequency range 0–20 Hz, (2)the Maximum polycoherence Index (MPI): the value of the polycoherence index at the frequency of the maximal intensity (peak frequency) on the polyspectrum slice, (3)the Average polycoherence Index (API): the mean value along the diagonal slice of the polycoherence index.

The data set, S2, is represented by an input layer of 23 neurons and consists of 234 examples for the training phase and 117 different examples for the test phase.

3. Classifier Training and Testing

A feedforward multilayer neural network with error backpropagation learning algorithm is built using NNs software package, (NeuralWorks Pro II Plus and NeuralWorks Predict, NeuralWare Inc.). Three NN structures (NN1, NN2, and NN3) are implemented and tested. NN1 is implemented using the NeuralWorks Pro II package using both S1 and S2 data sets. The NeuralWorks Predict program is used to implement NN2 and NN3 using S1 for NN1 and S2 for NN3.

Traditionally, the user must specify the number of hidden layers and the number of hidden units in each layer and find appropriate transformations and determine the relevance of various combinations of inputs which is largely a trial-and-error process. However, NeuralWorks Predict not only automates network construction using cascade correlation [22] but also automatically applies transformations to raw values and incorporates a genetic algorithm optimizer to identify the most influential variables from raw and transformed values to serve as final inputs to train the neural network. This approach means that the NeuralWorks Predict often produces networks that have minimum structure and sometimes with no hidden units.

4. Results

4.1. Datasets and NN Structure Assessment

Initially the NeuralWorks II Pro is used to assess the datasets and choose a suitable learning rule and number of hidden layers. The dataset S1 has been used to study the effect of the various learning rules (Delta Rule (DR), Delta-Bar-Delta (DBD), and Extended Delta-Bar-Delta (EDBD)) [21] and the number of hidden layers on the network performance. The results for two NN1 structures, namely, “20-5-2” and “20-5-3-2,” will be presented. A hyperbolic tan activation function for each neuron in the input, hidden, and output layers was used.

Figure 3 shows the RMS error during the learning phase of NN1 as a function of epoch. No convergence is achieved using the DR (Figure 3(a)) while the DBD resulted in slow convergence (Figure 3(b)). The EDBD rule gave a faster convergence and a smaller RMS error (Figures 3(c) and 3(d)) especially for two hidden layers (Figure 3(d)). Table 1 summarises the results obtained using DR, DBD, and EDBD with one and two hidden layers. The training parameters are and , 0.2, and 0.15 for the first and second hidden and output layers, respectively, and an epoch = 30 patterns. On the other hand, using dataset S2 as a training set, under the same conditions mentioned above, resulted in no convergence. In the next subsection, the NeuralWorks Predict will be applied to use its extensive search capabilities to tune the network structure and optimize the most influential inputs.

Learning ruleFinal RMSClassification rate

EDBD with 2 hidden layers0.005693%

4.2. Ischemic ECG Classification

The two previously explained sets of features, namely, S1 and S2 constitute “the basic inputs” to the NN2 and NN3 classifiers, respectively. Direct connections from the input layer to the output layer have been used. Connections from previously established hidden processing elements to more recently established hidden processing elements (i.e., cascade connections) are also employed. The activation functions within each neuron in the input and hidden layers are the hyperbolic tan while a softmax function is used for the output neuron.

NN2 is trained with and without hidden layer structure of (20-3-1) or (20-1), respectively. Much better results are obtained in the structure with one hidden layer. This comes in agreement with the nature of the ECG signal which is highly non-linear. A total of 74 patterns have been used in this test. Forty-three patterns are extracted from normal ECG signals while the rest (31) correspond to ischemic ECG signals. The classifier managed to detect 68 patterns with a classification rate of 91.9%. Table 2 shows the performance of the NN2 classifier. Figure 4 shows the receiver operating characteristics (ROC) of the classifier with the hit rate on the vertical axis and the false alarm rate on the horizontal axis.

ConfusionPredictedTotalClassification rate

ActualIschemic28 (TP)3 (FN)3190.3%
Normal3 (FP)40 (TN)4393.0%


In training NN3 some transformation functions, namely, logarithmic function, inverse fourth-power function, and square function are applied to the input features S2. These inputs are called “the transformed inputs” to distinguish them from the basic inputs. The resulted network structure was 7-2-1 based on the best results for the classifier. A total of 117 patterns have been used in this test. Fifty-four patterns are extracted from normal ECG signals while the rest (63) correspond to ischemic ECG signals. The classifier managed to detect 88 patterns with a classification rate of 75.2%. Table 3 shows the performance of the NN3 classifier. Figure 5 shows the ROC of the classifier. Table 1 is a summary of the all NN structures and classification rates obtained. The resulted accuracy, sensitivity, and specificity of NN2 are 91.9%, 90.3%, and 93%, respectively.

Confusion PredictedTotalClassification rate

ActualIschemic46 (TP)17 (FN)6373%
Normal12 (FP)42 (TN)5477.7%


5. Discussion

An automated adaptive backpropagation NN-based classifier is implemented. The results show that NN classifier can be used effectively in ECG signal processing for fast and reliable detection of ischemia especially in the case of critical care units and in long-term ECG signal monitoring. It was proven that the polyspectrum and polycoherence indices slices are excellent features to represent these ECG dynamics [19]. In this paper, information from the whole ECG cycle was used. This is considerably different from the previous ischemia detection algorithms [6, 8, 9, 12] in that (1) it avoids the use of the J-point and the ST-segment whose detection is often difficult and time consuming, (2) the training sets are slices from the frequency domain and (3) the effective power of the HOS in preserving nonlinearity was exploited by using features from the higher-order domain. These features are one-dimensional slices and can be calculated within few seconds. Using these slices the NN was trained for ischemic episode detection rather than ischemic beat detection. Classification rates of 93% using NN1 and 91.9% using NN2 were obtained using polycoherence index slices from the 6th-order polyspectral domain as “basic inputs” (S1 dataset), while using multiple features from the higher-order domain has resulted in either no convergence (using S1 and NN1) or a lower classification rate (75.2%) using “transformed inputs” from S2 (NN3) (Table 4). The reason may be attributed to the limited number of input patterns and their variability for different subjects and from a polyspectrum order to another. Another reason may be the proper choice of combination of the multiple features, which puts a big research question of how these multiple features can be utilized efficiently in ECG modelling and classification. This explains why the NN classifier has converged using the “transformed inputs” and failed to converge using “basic inputs.” The ROC curve and the RMS error were used to assess the performance of the NN classifiers.

PackageData set
Data set S1Data set S2

NeuralWorks Pro IINN1 93%No convergence
NeuralWorks PredictNN2 91.9%NN3 75.2%

6. Conclusions

In this paper, several neural network-based classifiers were assessed and deployed to automatically classify normal and ischemic ECGs. These classifiers were trained using the polyspectrum patterns and features extracted from the higher-order spectral analysis of normal and ischemic ECG signals. These input patterns are Gaussian noise-free and contain both amplitude and phase information. The highest classification rate was obtained using the polycoherence index slices as input features, with the Extended Delta-Bar-Delta learning rule and two hidden layers. In the presented work, the use of slices from higher-order statistics shows its strength in analysing and classifying nonlinear ECG dynamics.

Conflict of Interests

The authors declare that they have no relevant or material financial interests that relate to the research described in this paper.


  1. R. J. Martis, U. R. Acharya, A. K. Ray, and C. Chakraborty, “Application of higher order cumulants to ECG signals for the cardiac health diagnosis,” in Proceedings of the 33rd Annual International Conference of the IEEE Engineering in Medicine and Biology Society (EMBS '11), pp. 1697–1700, September 2011. View at: Publisher Site | Google Scholar
  2. C. Kamath, “ECG beat classification using features extracted from teager energy functions in time and frequency domains,” IET Signal Processing, vol. 5, no. 6, pp. 575–581, 2011. View at: Publisher Site | Google Scholar
  3. J. L. Camargo-Olivares, R. Clemente, S. Hornillo-Mellado, M. M. Elena, and I. Román, “The maternal abdominal ECG as input to MICA in the fetal ECG extraction problem,” IEEE Signal Processing Letters, vol. 18, no. 3, pp. 161–164, 2011. View at: Publisher Site | Google Scholar
  4. C. J. Horne, K. J. Zhang, J. Propst, V. K. Murthy, and L. J. Haywood, “St-t segment evaluation by discrete cosine and fourier transforms,” Computers in Cardiology, pp. 265–268, 1984. View at: Google Scholar
  5. Y. Özbay, R. Ceylan, and B. Karlik, “Integration of type-2 fuzzy clustering and wavelet transform in a neural network based ECG classifier,” Expert Systems with Applications, vol. 38, no. 1, pp. 1004–1010, 2011. View at: Publisher Site | Google Scholar
  6. S. Khoshnoud, M. Teshnehlab, and M. A. Shoorehdeli, “Probabilistic neural network oriented classification methodology for Ischemic Beat detection using multi resolution Wavelet analysis,” in Proceedings of the 17th Iranian Conference of Biomedical Engineering (ICBME '10), pp. 1–4, November 2010. View at: Publisher Site | Google Scholar
  7. M. Moavenian and H. Khorrami, “A qualitative comparison of Artificial Neural Networks and Support Vector Machines in ECG arrhythmias classification,” Expert Systems with Applications, vol. 37, no. 4, pp. 3088–3093, 2010. View at: Publisher Site | Google Scholar
  8. N. Maglaveras, T. Stamkopoulos, C. Pappas, and M. Gerassimos Strintzis, “An adaptive backpropagation neural network for real-time ischemia episodes detection: development and performance analysis using the European ST-T database,” IEEE Transactions on Biomedical Engineering, vol. 45, no. 7, pp. 805–813, 1998. View at: Publisher Site | Google Scholar
  9. H. Tonekabonipour, A. Emam, M. Teshnelab, and M. A. Shoorehdeli, “Comparison of neuro-fuzzy approaches with artificial neural networks for the detection of ischemia in ECG signals,” in Proceedings of IEEE International Conference on Systems, Man and Cybernetics (SMC '10), pp. 4045–4048, October 2010. View at: Publisher Site | Google Scholar
  10. M. Engin, “ECG beat classification using neuro-fuzzy network,” Pattern Recognition Letters, vol. 25, no. 15, pp. 1715–1722, 2004. View at: Publisher Site | Google Scholar
  11. P. Langley, E. J. Bowers, and A. Murray, “Principal component analysis as a tool for analyzing beat-to-beat changes in ECG features: application to ECG-derived respiration,” IEEE Transactions on Biomedical Engineering, vol. 57, no. 4, pp. 821–829, 2010. View at: Publisher Site | Google Scholar
  12. A. Emam, H. Tonekabonipour, and M. Teshnelab, “Applying MLP as a predictor and ANFIS as a classifier in ischemia detection via ECG,” in Proceedings of IEEE International Conference on Systems, Man, and Cybernetics (SMC '11), pp. 2958–2962, October 2011. View at: Publisher Site | Google Scholar
  13. K. C. Chua, V. Chandran, U. R. Acharya, and C. M. Lim, “Cardiac state diagnosis using higher order spectra of heart rate variability,” Journal of Medical Engineering and Technology, vol. 32, no. 2, pp. 145–155, 2008. View at: Publisher Site | Google Scholar
  14. M. Engin, M. Fedakar, E. Z. Engin, and M. Korürek, “Feature measurements of ECG beats based on statistical classifiers,” Measurement, vol. 40, no. 9-10, pp. 904–912, 2007. View at: Publisher Site | Google Scholar
  15. MIT-BIH Arrhythmia Database CD-ROM, Harvard-MIT Division of Health Sciences and Technology, 3rd edition, 1997.
  16. A. Taddei, G. Distante, M. Emdin et al., “The European ST-T database: standard for evaluating systems for the analysis of ST-T changes in ambulatory electrocardiography,” European Heart Journal, vol. 13, no. 9, pp. 1164–1172, 1992. View at: Google Scholar
  17. F. J. Harris, “On the use of windows for harmonic analysis with the discrete Fourier transform,” Proceedings of the IEEE, vol. 66, no. 1, pp. 51–83, 1978. View at: Publisher Site | Google Scholar
  18. G. Zhou and G. B. Giannakis, “Retrieval of self-coupled harmonics,” IEEE Transactions on Signal Processing, vol. 43, no. 5, pp. 1173–1186, 1995. View at: Publisher Site | Google Scholar
  19. S. El-Khafif, Application of higher-order statistics and subspace based techniques to the analysis and diagnosis of electrocardiogram signals [Ph.D. thesis], City University, School of Engineering, 2002.
  20. R. A. Jacobs, “Increased rates of convergence through learning rate adaptation,” Neural Networks, vol. 1, no. 4, pp. 295–307, 1988. View at: Google Scholar
  21. J. A. Freeman and D. M. Skapura, Neural Networks: Algorithms, Applications and Programming Techniques, Addison-Wesley, Reading, Mass, USA, 1991.
  22. S. E. Fahlman and C. Lebiere, The Cascade Correlation Architecture, Advances in Neural Information Processing Systems, vol. 2, Morgan Kaufmann, San Mateo, Calif, USA, 1990.

Copyright © 2013 Sahar H. El-Khafif and Mohamed A. El-Brawany. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

More related articles

 PDF Download Citation Citation
 Download other formatsMore
 Order printed copiesOrder

Related articles

We are committed to sharing findings related to COVID-19 as quickly as possible. We will be providing unlimited waivers of publication charges for accepted research articles as well as case reports and case series related to COVID-19. Review articles are excluded from this waiver policy. Sign up here as a reviewer to help fast-track new submissions.