
Research Article


Application of ECG Arrhythmia Classification by Means of Bayesian Theorem 

Alaa M. Alturki,
Abdulaziz M. AlGhamdi,
Khaled Daqrouq
and
Rami AlHmouz



ABSTRACT

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.





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


INTRODUCTION
Biomedical 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).
Biomedical 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 (AviaCervantes
et al., 2006).
Figure 1 (BayesdeLuna et al.,
2010) illustrates the correspondent human heart muscles that generate the
heart beat and the way they represented on ECG waveform.

Fig. 1(ac): 
Electrocardiogram and its details 
Figure 1a demonstrate the basic components of the waveform
Pwave, QRS complex, T wave and U wave. Pwave 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 RR (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 Heartrelated problems (Daqrouq and AbuIsbeih
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 thermoregulation process (VLF<0.05 Hz) (Daqrouq
and AbuIsbeih 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 60100 RH, tachycardia is the rate above
the normocardia and bradycardia is the rate below the normocardia (Daqrouq
and AbuIsbeih 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 discretetime signals, the dyadic Discrete Wavelet Transform (DWT) is used,
the Discrete Wavelet Transform (DWT) results from discretized scale and translation
parameters; e.g.:
and:
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 timescale 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 AbuIsbeih 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 (EspirituSantoRincon
and CarbajalFernandez, 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(AB) and P(BA) 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):
And:
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).
SIMULATION, RESULTS AND DISCUSSION
The experimental setup was conducted by means of MITBIH Arrhythmia Database
(Goldberger et al., 2000; Moody
and Mark, 2001), this database contains 48 halfhour excerpts of twochannel
ambulatory ECG recordings, taken from 47 subjects investigated by the BIH Arrhythmia
Laboratory between 1975 and 1979.
Twentythree 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 wellrepresented in a small random sample. The
recordings were digitized at 360 Hz channel^{1} with 11bit 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(al): 
Average framing energy (AFE) features for different three
arrhythmias, (ab) NSR, (c, d, g, h, k, l) AFE, (e, f) AF and (i, j) PEB

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

REFERENCES 
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 36, 2012, Thrissur, Kerala, pp: 15.
2: AviaCervantes, J.G., M. TorresCisneros, J.E.S. Martinez and J. Pinales, 2006. Frequency, timefrequency and wavelet analysis of ECG signal. Proceedings of the Multiconference on Electronics and Photonics, November 710, 2006, Guanajuato, pp: 257261.
3: BayesdeLuna, A., D. Goldwasser, M. Fiol and A. BayesGenis, 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 13, 2010, Kyoto, pp: V172V175.
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 McGrawHill Companies Inc., China.
6: Jovic, A. and N. Bogunovic, 2009. Feature set extension for heart rate variability analysis by using Nonlinear, statistical and geometric measures. Proceedings of the ITI 2009 31st International Conference on Information Technology Interfaces, June 2225, 2009, Dubrovnik, pp: 3540.
7: Daqrouq, K. and N. AbuIsbeih Ibrahim, 2007. Arrhythmia detection using wavelet transform. Proceedings of the IEEE Region 8, EUROCON 2007, September 912, 2007, Warsaw, Poland, pp: 122126.
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 47, 2010, Xi'an, pp: 566571.
9: Daamouche, A., L. Hamami, N. Alajlan and F. Melgani, 2012. A wavelet optimization approach for ECG signal classification. Biomed. Signal Process. Control, 7: 342349. CrossRef  Direct Link 
10: Moazzen, I., M.R. Ahmadzadeh, A.M. DoostHoseini and M.J. Omidi, 2009. An intelligent classifier for cardiac arrhythmias recognition. Proceedings of the International Conference on Wireless Communications and Signal Processing, November 1315, 2009, Nanjing, pp: 15.
11: Martinez, J.P., S. Olmos and P. Laguna, 2000. Evaluation of a waveletbased ECG waveform detector on the QT database. Proceedings of IEEE Computers in Cardiology, September 2427, 2000, Cambridge, MA., pp: 8184.
12: Kohler, B.U., C. Hennig and R. Orglmeister, 2002. The principles of software QRS detection. IEEE Eng. Med. Biol. Mag., 21: 4257. 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 2326, 2001, Rotterdam, pp: 501504.
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 2124, 2003, Thessaloniki, pp: 553556.
15: Josko, A., 2007. Discrete wavelet transform in automatic ECG signal analysis. Proceedings of the IEEE Conference on Instrumentation and Measurement Technology, May 13, 2007, Warsaw, pp: 13.
16: EspirituSantoRincon, A. and C. CarbajalFernandez, 2010. ECG feature extraction via waveform segmentation. Proceedings of the 7th International Conference on Electrical Engineering Computing Science and Automatic Control, September 810, 2010, Tuxtla Gutierrez, pp: 250255.
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 1215, 2011, Guiyang, pp: 9094.
18: Ashby, D., 2006. Bayesian statistics in medicine: A 25 year review. Stat. Med., 25: 35893631. CrossRef 
19: Wiggins, M., A. Saad, B. Litt and G. Vachtsevanos, 2008. Evolving a bayesian classifier for ECGbased age classification in medical applications. Applied Soft Comput., 8: 599608. PubMed 
20: De Oliveira, L.S.C., R.V. Andreao and M. SarcinelliFilho, 2010. Detection of premature ventricular beats in ECG records using Bayesian networks involving the PWave and fusion of results. Proceedings of the Annual International Conference of the IEEE Engineering in Medicine and Biology Society, August 31September 4, 2010, Buenos Aires, pp: 11311134.
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 28July 1, 2009, Boston, MA., pp: 153156.
22: Lin, C., C. Mailhes and J.Y. Tourneret, 2010. P and Twave delineation in ECG signals using a bayesian approach and a partially collapsed gibbs sampler. IEEE Trans. Biomed. Eng., 57: 28402849. CrossRef 
23: Kara, S. and M. Okandan, 2007. Atrial fibrillation classification with artificial neural networks. Pattern Recognit., 40: 29672973. CrossRef  Direct Link 
24: Avci, D., 2009. An expert system for speaker identification using adaptive wavelet sure entropy. Exp. Syst. Appl., 36: 62956300. CrossRef  Direct Link 
25: Avci, E., 2007. A new optimum feature extraction and classification method for speaker recognition: GWPNN. Exp. Syst. Appl., 32: 485498. CrossRef  Direct Link 
26: Moody, G.B. and R.G. Mark, 2001. The impact of the MITBIH arrhythmia database. IEEE Eng. Med. Biol., 20: 4550. 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: e215e220. 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 2327, 2007, Beijing, pp: 17661769.
29: Daqrouq, K. and K.Y. Al Azzawi, 2012. Average framing linear prediction coding with wavelet transform for textindependent speaker identification system. Comput. Electr. Eng., 38: 14671479. CrossRef  Direct Link 



