Subscribe Now Subscribe Today
Research Article

Application of ECG Arrhythmia Classification by Means of Bayesian Theorem

Alaa M. Alturki, Abdulaziz M. Al-Ghamdi, Khaled Daqrouq and Rami Al-Hmouz
Facebook Twitter Digg Reddit Linkedin StumbleUpon E-mail

The electrocardiogram (ECG) is a vital signal to investigate the heart functional, it is one of the most important electrical signals which characterize human heart performance and gives a fast anticipation about the heart condition. The main objective of this study is to use the Bayesian algorithm in application of ECG arrhythmia classification. The investigation of the better performance of the classifier by feature extraction methods analysis is considered. The obtained results showed that Bayesian classifier achieved with Wavelet Packet Energy (WPE) a higher success rate (93.75%). Same methods are used to check the classifier possibility when the signals are contaminated with natural noise taken from other noisy ECG signals after filtration; the obtained results showed that WPE is more appropriate for classification of ECG arrhythmia by means of Bayesian algorithm classifier, 72.13% for 0 SNR and 84.98% for 5 SNR.

Related Articles in ASCI
Similar Articles in this Journal
Search in Google Scholar
View Citation
Report Citation

  How to cite this article:

Alaa M. Alturki, Abdulaziz M. Al-Ghamdi, Khaled Daqrouq and Rami Al-Hmouz , 2014. Application of ECG Arrhythmia Classification by Means of Bayesian Theorem. Journal of Applied Sciences, 14: 165-170.

DOI: 10.3923/jas.2014.165.170

Received: August 15, 2013; Accepted: November 16, 2013; Published: February 01, 2014


Bio-medical engineering could express veriety of human body activities on electrical signal shape, so that we could investigate our bodies statistically and monitor their performance and behavior. The electrocardiogram (ECG) is one of the most important electrical signals which characterize human heart performance and gives a fast anticipation about the heart condition (Paul et al., 2012).

Bio-medical engineering could extract many features from ECG signal as major components to diagnose any human heart (Paul et al., 2012). ECG is nothing but a voltage levels that represent the electrical activities of the heart measured on the body surface (Avia-Cervantes et al., 2006).

Figure 1 (Bayes-de-Luna et al., 2010) illustrates the correspondent human heart muscles that generate the heart beat and the way they represented on ECG waveform.

Fig. 1(a-c): Electrocardiogram and its details

Figure 1a demonstrate the basic components of the waveform P-wave, QRS complex, T wave and U wave. P-wave is generated when atrium depolarization. Activation of the atria from an ectopic pacemaker in the lower part of either atrium or in the AV junction region may produce retrograde P waves (negative in lead II, positive in lead AVR. After that, QRS complex is generated when ventricle depolarization and T wave is generated when ventricle recovery (Thanapatay et al., 2010; Goldberger, 2011).

Moreover, Heart Rate Variability (HRV) measured by counting number of beats per min. Figure 1 illustrates the duration of cardiac cycle which represents a complete beat. The sample density distribution of R-R (time intervals between two consecutive R peaks) intervals is one of the best ways to analyze the HR to estimate the status of the heart. Frequency domain analysis is another approach wherein usually spectral power is measured (Jovic and Bogunovic, 2009). HRV is a significant identification tool to measure some heart Heart-related problems (Daqrouq and Abu-Isbeih Ibrahim, 2007). Careful analysis showed that the frequency content of HRV consists of a high respiratory frequency (HF, about 0.4 Hz), a low blood pressure regulation arterially frequency (LF, about 0.1 Hz) and a very low frequency caused by thermo-regulation process (VLF<0.05 Hz) (Daqrouq and Abu-Isbeih Ibrahim, 2007).

HRV is the feature to detect cardiac abnormalities such as bradycardia, tachycardia or normocardia. Bradycardia, tachycardia are a major cause of morbidity and mortality in the developed countries (Shi et al., 2010). While normocardia is between 60-100 RH, tachycardia is the rate above the normocardia and bradycardia is the rate below the normocardia (Daqrouq and Abu-Isbeih Ibrahim, 2007).

Extracting the ECG features mathematically has been identified through many Different methods and one of them is the wavelet (WT). Wavelet (WT) is a linear operation that decomposes a signal into components that appear at different scales (Daamouche et al., 2012; Moazzen et al., 2009). The wavelet transform is a decomposition of the signal as a combination of a set of basis functions, obtained by means of dilation (a) and translation (b) of a single prototype wavelet n(t) (Martinez et al., 2000). Thus, the WT of a signal x(t) is defined as:


For discrete-time signals, the dyadic Discrete Wavelet Transform (DWT) is used, the Discrete Wavelet Transform (DWT) results from discretized scale and translation parameters; e.g.:

a = 2j


b = n. 2j

where, j and n are intergers

This choice of a and b leads to the Dyadic DWT (DyWT). Beside it provides a description of the signal in the time-scale domain, it permits the representation of the temporal characteristics of a signal at different resolutions and therefore, it is a suitable tool to analyze the ECG signal, where we have a cyclic occurrence of patterns with different frequently content (Martinez et al., 2000; Kohler et al., 2002). WT ability enables the analysis of a given signal on different frequency bands and serves in defining the most important scale of that signal (Daqrouq and Abu-Isbeih Ibrahim, 2007).

Wavelet proved its ability to extract ECG feature and can be enhanced to be more accurate. Using a wavelet based Bayesian modeling approach for analyzing and classifying unfiltered HRECG signals; shows a high specificity and accuracy to predict HRECG (Prado et al., 2001). One of the techniques to analyze high resolution ECG is to use continuous wavelet before computing different time intervals of terminal region of QRS complex (Bunluechokchai and English, 2003). Discrete wavelet can be used in automatic ECG analysis easier and simpler if we could detect one QRS complex per an iteration which will simplify introducing data blocks of variable length and threshold function of variable level (Josko, 2007). Discrete wavelet could used to classify a heart beat in four types such as normal beat (N), left bundle branch block beat (L), right bundle branch block beat (R) and ventricular premature beat (V) (Thanapatay et al., 2010). Due to complexity that facing and automatic ECG extraction technique, is better to combine more than one detection technique in the analysis like detecting the R wave using wavelet and other features using segmentation approach (Espiritu-Santo-Rincon and Carbajal-Fernandez, 2010).

Extracted information by wavelet is helps to detect heart problems if we could use any classification method to distinguish between cardiac abnormalities. Figure 2 demonstrates a detection system that takes aggregated historical ECG records and analyzes them sequentially by performing segmentation for each heart beat first before classifying the heart beat or any of its features.

Bayesian method is used to update the distribution of a prepared statistical model. The method requires that prior distributions of the required geological characteristics are defined and then calculates the posterior distributions based on the exact model (Ma et al., 2011).

Fig. 2: Block diagram ECG classification system

Bayesian statistics has now permeated all the major areas of medical statistics (Ashby, 2006). Bayes’ theorem is the method of finding the converse probability of relationship between classified parties; to gain probability information about any of them with the known outcome of the other (Wiggins et al., 2008).

Bayesian framework is sufficient to support medical decision in the problem of heart beat classification in ECG historical database records. As an example, Premature Ventricular Beats (PVC) can be classified using Bayesian by aggregating the statistical information for premature beat and Ventricular beat. Bayesian framework depends on the concept of theorem of Bayes:


where, P(A|B) and P(B|A) are the a posteriori probabilities of A and B, respectively and P(A) and P(B) are the a priori probabilities of A and B (De Oliveira et al., 2010):


where, N is the total number of features in feature vector (Fig. 3), under the assumption of conditional independence.

Maximum A Posteriori (MAP) estimation is a special case within the Bayesian which provides a very general basis for parameter estimation. The a priori represents the available prior knowledge and it is most critical parameter that constrains the solution (Kohler et al., 2002; Serinagaoglu and Aydin, 2009).

Bayesian algorithm can be combined with a Markov chain Monte Carlo method to conduct the wave delineation and estimation simultaneously. This method gets benefit of the strong local dependency of ECG signals and gives an accurate estimation of waveforms for each analysis window beside its task to detect P and T wave peaks and boundaries (Lin et al., 2010).


The experimental setup was conducted by means of MIT-BIH Arrhythmia Database (Goldberger et al., 2000; Moody and Mark, 2001), this database contains 48 half-hour excerpts of two-channel ambulatory ECG recordings, taken from 47 subjects investigated by the BIH Arrhythmia Laboratory between 1975 and 1979.

Twenty-three recordings were selected at random from a set of 4000 24 h ambulatory ECG recordings collected from a mixed population of inpatients (about 60%) and outpatients (about 40%) at Boston’s Beth Hospital; the remaining 25 recordings were selected from the same set to include less common but clinically significant arrhythmias that would not be well-represented in a small random sample. The recordings were digitized at 360 Hz channel-1 with 11-bit resolution over a 10 mV range. Each record was annotated by two or more cardiologist experts independently. This investigation of arrhythmias identification system performance is performed via., several experiments using 150 training signals. The records taken from the database are divided into parts of 10 sec time durations. These signals are used as individual signals for training and testing. The number of individual signals used for algorithm investigation are as follows: 170 signals type atrial fibrillation (AF) (80 for training, 90 for testing), 142 signals type normal sinus rhythm (NSR) (70 for training, 72 for testing), 150 signals type premature ectopic beat (PEB) (70 for training, 80 for testing) and 100 congestive heart failure (CHF) (50 for training, 50 for testing) (Fig. 3). Even though the methods proposed for arrhythmias classification, the recognition performance has been maturing and improving over time; it is still inadequate in terms of accuracy (Daqrouq and Al Azzawi, 2012).

In the approach, to reach to inclusive investigation, a research study of the arrhythmias identification by WPT in normal and noise environments is required.

This study may be considered as an investigation work aiming to build a system that recognizes the arrhythmias even in the noisy signals.

Fig. 3(a-l): Average framing energy (AFE) features for different three arrhythmias, (a-b) NSR, (c, d, g, h, k, l) AFE, (e, f) AF and (i, j) PEB

Table 1: Comparison between different feature extraction methods

Table 2: Recognition rate when the signals are contaminated with natural noise taken from other noisy ECG signals after filtration

The system is applied on huge number of training signals. The problem was solved by using the recognition method (feature extraction and then classification). This approach is based on a combination between percentages energy and WT to accomplish feature extraction of the arrhythmias obtained from normalized and interferences removed signals. To classify the obtained feature extraction vector, Naive Bayes method was used to add this feature to classifier.

Different methods were used for comparison to identify which feature extraction method is more suitable to be used with our classifier (Table 1), average framing with PSD of DWT (AFAPD) (Kara and Okandan, 2007), Shannon entropy (AFS) (Kara and Okandan, 2007), log energy entropy (AFLEE) (Qiao and Zhou, 2007) sure entropy (AFSUE) (Avci, 2007, 2009) and Wavelet Packet Energy (WPE). WPE achieved a higher success rate (93.75%), where AFLEE has reached only 89.97% classification. Table 2 illustrates the results of AF and NSR recognition while four arrhythmias are trained by means of the classifier (AV, NSR, PEB and CHF).

Same methods were used to check the classifier possibility when the signals are contaminated with natural noise taken from other noisy ECG signals after filtration.


The Bayesian algorithm has been successfully implemented in application of ECG arrhythmia classification. Different features extraction methods were used in this study. Experimental results showed that WPE is more suitable for the feature extraction method and for the Bayesian algorithm classification. Recognition rate of the same methods with ECG signals contaminated with natural noise taken from other noisy ECG signals after filtration. The obtained results showed that WPE is more appropriate for classification of ECG arrhythmia by means of Bayesian algorithm classifier. The reason of the success of the proposed method is the ability of features generation of Gaussian distribution of small standard deviation due to small fluctuation between features of same arrhythmia type of different signals.

1:  Paul, B., K.T. Shanavaz and P. Mythili, 2012. Towards the development of a new wavelet for ECG classification. Proceedings of the International Conference on Power, Signals, Controls and Computation, January 3-6, 2012, Thrissur, Kerala, pp: 1-5.

2:  Avia-Cervantes, J.G., M. Torres-Cisneros, J.E.S. Martinez and J. Pinales, 2006. Frequency, time-frequency and wavelet analysis of ECG signal. Proceedings of the Multiconference on Electronics and Photonics, November 7-10, 2006, Guanajuato, pp: 257-261.

3:  Bayes-de-Luna, A., D. Goldwasser, M. Fiol and A. Bayes-Genis, 2010. Surface Electrocardiography, Chapter 15. In: Hurst's the Heart, 13th Edition: Two Volume Set, Fuster, V., R. Walsh and R. Harrington (Eds.). McGraw Hill Professional, China.

4:  Thanapatay, D., C. Suwansaroj and C. Thanawattano, 2010. ECG beat classification method for ECG printout with principle components analysis and support vector machines. Proceedings of the International Conference on Electronics and Information Engineering, Volume 1, August 1-3, 2010, Kyoto, pp: V1-72-V1-75.

5:  Goldberger, A.L., 2011. Electrocardiography, Chapter 228. In: Harrison's Principles of Internal Medicine, Longo, D., A. Fauci, D. Kasper, S. Hauser, J. Jameson and J. Loscalzo (Eds.). 18th Edn., The McGraw-Hill Companies Inc., China.

6:  Jovic, A. and N. Bogunovic, 2009. Feature set extension for heart rate variability analysis by using Non-linear, statistical and geometric measures. Proceedings of the ITI 2009 31st International Conference on Information Technology Interfaces, June 22-25, 2009, Dubrovnik, pp: 35-40.

7:  Daqrouq, K. and N. Abu-Isbeih Ibrahim, 2007. Arrhythmia detection using wavelet transform. Proceedings of the IEEE Region 8, EUROCON 2007, September 9-12, 2007, Warsaw, Poland, pp: 122-126.

8:  Shi, W.V., T.N. Chang and M.C. Zhou, 2010. Method to detect cardiac abnormalities based on electrocardiography and sinoatrial pacemaker model. Proceedings of the International Conference on Mechatronics and Automation, August 4-7, 2010, Xi'an, pp: 566-571.

9:  Daamouche, A., L. Hamami, N. Alajlan and F. Melgani, 2012. A wavelet optimization approach for ECG signal classification. Biomed. Signal Process. Control, 7: 342-349.
CrossRef  |  Direct Link  |  

10:  Moazzen, I., M.R. Ahmadzadeh, A.M. Doost-Hoseini and M.J. Omidi, 2009. An intelligent classifier for cardiac arrhythmias recognition. Proceedings of the International Conference on Wireless Communications and Signal Processing, November 13-15, 2009, Nanjing, pp: 1-5.

11:  Martinez, J.P., S. Olmos and P. Laguna, 2000. Evaluation of a wavelet-based ECG waveform detector on the QT database. Proceedings of IEEE Computers in Cardiology, September 24-27, 2000, Cambridge, MA., pp: 81-84.

12:  Kohler, B.U., C. Hennig and R. Orglmeister, 2002. The principles of software QRS detection. IEEE Eng. Med. Biol. Mag., 21: 42-57.
CrossRef  |  

13:  Prado, R., I. Garcia and P. Gomis, 2001. Classification of high resolution ECG from chagasic patients with wavelet based bayesian models. Proceedings of IEEE Computers in Cardiology, September 23-26, 2001, Rotterdam, pp: 501-504.

14:  Bunluechokchai, S. and M.J. English, 2003. Analysis of the high resolution ECG with the continuous wavelet transform. Proceedings of IEEE Computers in Cardiology, September 21-24, 2003, Thessaloniki, pp: 553-556.

15:  Josko, A., 2007. Discrete wavelet transform in automatic ECG signal analysis. Proceedings of the IEEE Conference on Instrumentation and Measurement Technology, May 1-3, 2007, Warsaw, pp: 1-3.

16:  Espiritu-Santo-Rincon, A. and C. Carbajal-Fernandez, 2010. ECG feature extraction via waveform segmentation. Proceedings of the 7th International Conference on Electrical Engineering Computing Science and Automatic Control, September 8-10, 2010, Tuxtla Gutierrez, pp: 250-255.

17:  Ma, J., X. Zhan and S. Zeng, 2011. Real time reliability analysis based on the performance degradation data and Bayesian method. Proceedings of the 9th International Conference on Reliability, Maintainability and Safety, June 12-15, 2011, Guiyang, pp: 90-94.

18:  Ashby, D., 2006. Bayesian statistics in medicine: A 25 year review. Stat. Med., 25: 3589-3631.
CrossRef  |  

19:  Wiggins, M., A. Saad, B. Litt and G. Vachtsevanos, 2008. Evolving a bayesian classifier for ECG-based age classification in medical applications. Applied Soft Comput., 8: 599-608.
PubMed  |  

20:  De Oliveira, L.S.C., R.V. Andreao and M. Sarcinelli-Filho, 2010. Detection of premature ventricular beats in ECG records using Bayesian networks involving the P-Wave and fusion of results. Proceedings of the Annual International Conference of the IEEE Engineering in Medicine and Biology Society, August 31-September 4, 2010, Buenos Aires, pp: 1131-1134.

21:  Serinagaoglu, Y. and U. Aydin, 2009. Imaging the electrical activity of the heart using a Kalman filter based approach: Comparison of results using different STM's. Proceedings of the IEEE International Symposium on Biomedical Imaging: From Nano to Macro, June 28-July 1, 2009, Boston, MA., pp: 153-156.

22:  Lin, C., C. Mailhes and J.Y. Tourneret, 2010. P- and T-wave delineation in ECG signals using a bayesian approach and a partially collapsed gibbs sampler. IEEE Trans. Biomed. Eng., 57: 2840-2849.
CrossRef  |  

23:  Kara, S. and M. Okandan, 2007. Atrial fibrillation classification with artificial neural networks. Pattern Recognit., 40: 2967-2973.
CrossRef  |  Direct Link  |  

24:  Avci, D., 2009. An expert system for speaker identification using adaptive wavelet sure entropy. Exp. Syst. Appl., 36: 6295-6300.
CrossRef  |  Direct Link  |  

25:  Avci, E., 2007. A new optimum feature extraction and classification method for speaker recognition: GWPNN. Exp. Syst. Appl., 32: 485-498.
CrossRef  |  Direct Link  |  

26:  Moody, G.B. and R.G. Mark, 2001. The impact of the MIT-BIH arrhythmia database. IEEE Eng. Med. Biol., 20: 45-50.
PubMed  |  

27:  Goldberger, A.L., L.A.N. Amaral, L. Glass, J.M. Hausdorff and P.C.H. Ivanov et al., 2000. Physio bank, physio toolkit and physio net: Components of a new research resource for complex physiologic signals. Circulation, 101: e215-e220.
Direct Link  |  

28:  Qiao, S. and P. Zhou, 2007. Wavelet and wavelet packet transform analysis in the ECG signals of atrial fibrillation. Proceedings of the IEEE/ICME International Conference, Complex Medical Engineering, May 23-27, 2007, Beijing, pp: 1766-1769.

29:  Daqrouq, K. and K.Y. Al Azzawi, 2012. Average framing linear prediction coding with wavelet transform for text-independent speaker identification system. Comput. Electr. Eng., 38: 1467-1479.
CrossRef  |  Direct Link  |  

©  2021 Science Alert. All Rights Reserved