Page 1

Detection of Atrial Fibrillation Using Model-based ECG Analysis

R. Couceiro, P. Carvalho, J. Henriques, M. Antunes†, M. Harris††, J. Habetha††

Centre for Informatics and Systems, University of Coimbra, Coimbra, Portugal

†Centre of Cardio-thoracic Surgery of the University Hospital of Coimbra, Coimbra, Portugal

†† Philips Research Laboratories, Aachen, Germany

E-mail: rcouceir@student.dei.uc.pt, {carvalho,jh}@dei.uc.pt, antunes.cct.huc@sapo.pt,

{matthew.harris, joerg.habetha}@philips.com

Abstract

Atrial Fibrillation (AF) is an arrhythmia that can

lead to several patient risks. This kind of arrhythmia

affects mostly elderly people, in particular those who

suffer from heart failure (one of the main causes of

hospitalization). Thus, detection of AF becomes

decisive in the prevention of cardiac threats. In this

paper an algorithm for AF detection based on a novel

algorithm architecture and feature extraction methods

is proposed. The aforementioned architecture is based

on the analysis of the three main physiological

characteristics of AF: i) P wave absence ii) heart rate

irregularity and iii) atrial activity (AA). Discriminative

features are extracted using model-based statistic and

frequency based approaches. Sensitivity and specificity

results (respectively, 93.80% and 96.09% using the

MIT-BIH AF database) show that the proposed

algorithm is able to outperform state-of-the-art

methods.

1. Introduction

Atrial Fibrillation, the most common atrial

sustained arrhythmia, is a result of multiple re-entrant

wavelets in the atria, which conducts to its partial

disorganization. Although it is not a lethal disease, it

may lead to very disabling complications such as

cardiac failure and atrial thrombosis, with the

subsequent risk of a stroke. One of the characteristics

of AF episodes is the absence of P waves before the

QRS-T complex of the ECG, which are replaced by

'sawtooth'-like pattern waves along the cardiac cycle

(see Figure 1). Additionally, these waves are associated

with irregular cardiac frequency. During the last years,

these two main characteristics of AF have been object

of intense research for the detection and prediction of

AF.

Moody and Mark [3] constructed a Hidden Markov

(HM) model and used the transition probabilities to

detect AF episodes. Cerutti et al. [4] proposes the use

of linear and non-linear indexes for characterization of

RR series and consequent AF detection. Tateno and

Glass [5] estimate the similarity between standard and

test RR interval histograms to reveal the presence or

absence of AF episodes.

Extraction of atrial activity (AA) is of crucial

importance in the detection of AF. Techniques like

Blind Source Separation,

Cancellation and Artificial Neural Networks are the

most promising in this field of research. Despite the

satisfactory results achieved by these approaches, most

of them need several ECG leads to be implemented - a

serious drawback for pHealth applications, where

usually only one ECG lead is available. Senhadj et al.

[6] presents an algorithm for QRS-T cancellation based

on dyadic wavelet transform. Similarly, Sanchez et al.

Spatio-Temporal

0 0.511.522.5

-0.8

-0.6

-0.4

-0.2

0

0.2

0.4

0.6

0.8

1

t(s)

00.20.4

t(s)

0.6

-2

-1.5

-1

-0.5

0

0.5

1

1.5

2

2.5

3

Figure

Figure Figure

Figure 1 1 1 1. (Left) AF episode. (Right) Cardiac cycle.

. (Left) AF episode. (Right) Cardiac cycle.. (Left) AF episode. (Right) Cardiac cycle.

. (Left) AF episode. (Right) Cardiac cycle.

978-1-4244-2175-6/08/$25.00 ©2008 IEEE

Page 2

[7] proposes an algorithm where Discrete Packet

Wavelet Transform is used for the extraction of AA.

Shkurovich et al. [8] uses a median template based

approach to cancel ventricular activity. None of the

above mentioned authors dedicated special attention in

frequency analysis and consequent feature extraction.

Although, the algorithms reported in the literature

cover the most important characteristics of AF, a

robust algorithm for AF detection has not yet been

presented. Furthermore, the most significant existing

methods concentrate on one of the physiological

characteristics of AF. In this paper, an algorithm for

AF detection is presented, which is based on the

extraction of features related to the three principal

characteristics of AF. The architecture of the proposed

algorithm is presented in Figure 2. Some new feature

extraction methods, based on estimated models using

data driven approaches are also presented.

In the following section the proposed feature

extraction algorithm will be outlined. In section 3 the

results achieved with proposed features will be

presented and discussed. In the last section some main

conclusions will be drawn.

2. Methods

In the proposed algorithm, the analysis starts with

the detection of major characteristic waves, namely the

QRS complexes, P and T waves. Difficulties in this

task are mainly due to oscillation in the baseline,

presence of noise, artifacts and frequency overlapping.

To avoid these situations noise filtering and baseline

removal is essential. In the proposed AF detection

algorithm, these steps

morphologic transform concepts, such as erosion and

dilation operations, and opening and closing operators.

For ECG segmentation, the algorithm proposed by Sun

et al. [9] has been adopted.

2.1. Features extraction

Real time AF detection is one of the main priority

aspects of the proposed algorithm. Since the

information contained in single beats is not sufficient

to discriminate AF episodes, a sliding window analysis

are performed using

is used. A minimum of 12 beats per analysis window is

established. For real time applications, the length of the

present analysis window is estimated based on the

heart rate frequency observed in the previous window.

For offline operation, each window length is set

according to the established number of beats.

In each analysis window a set of five features

( ,1,...,5)

is extracted, belonging to one of the

three AF characteristic types. P wave absence is

quantified by measuring the correlation of the detected

P waves to a P wave model. Heart rate variability is

accessed by assuming that the observed ECG is a non-

linear transformed version of a model. The statistical

similarity is determined from the Kullback - Leibler

divergence. AA is extracted using a wavelet analysis

approach, based in the algorithms reported in [6] and

[7].

P wave detection: The absence of P waves during

the fibrillatory process before the QRS complexes is an

important characteristic of AF episodes. Although

segmentation methods can be very accurate in the

detection of most ECG fiducial points, it is observed

that these algorithms tend to breakdown for the

detection of P waves during AF episodes. To avoid

these misclassification errors, a template based P wave

detection approach is proposed. First a P wave model

is extracted by averaging all annotated P waves found

if i =

in the QT Database from Physionet. Let

wave

P

be the

aforementioned model (see Figure 3) and let

be the P wave under analysis. The existence of a P

wave is assessed by (2) using the correlation

( )

i

wave

P

coefficient between

( )

i and

wave

P

wave

P

(1).

()

( )( ),

i P

,1,...,

wavewavebeats

ncc icorrcoef Pi

==

(1)

( )max()( ),1,...,

beats

nS icccc i i

=−=

(2)

The rate of P waves in each window, equation (3),

is accessed by relating the number

S

N of selected P

0.050.10.15

-5

0

5

10

15

20

t(s)

Figure

Figure Figure

Figure 3 3 3 3. . . . P wave model.

P wave model.P wave model.

P wave model.

Figure

Figure Figure

Figure 2 2 2 2. Architecture of the proposed algorithm.

. Architecture of the proposed algorithm. . Architecture of the proposed algorithm.

. Architecture of the proposed algorithm.

Page 3

waves (P waves whose index S is greater than 0.2) and

the number

CB

N

of cardiac beats.

S

CB

N

R

N

=

(3)

Heart rate analysis: The principal and most

important objective of heart rate analysis is to access

the variability/irregularity of the RR intervals.

Following the algorithm proposed by Moody et al.

[3], the RR sequence was modelled as a three state

Markov process (see Figure 4). Each interval is

characterized as small, regular or long. Based on the

transitions between states ( ,

probability matrix is derived, describing the cardiac

rhythm. The regularity of heart rate is characterised by

the probability of transition from state R to itself, since

this transition is more likely to occur when the RR

intervals present approximately the same length. This

is the first feature applied in order to assess RR

regularity.

Consider the matrix of transition probabilities as a

probabilistic distribution

1,...,9

iT i =

), a transition

(,)(|)()

ijiji

P E E P E EP E

=×

where {} {

=

}

123

,, , ,

S R LE E E

.

In Table 1 the probabilistic distributions of an AF

episode (left) and a normal rhythm (right) are

presented. The high regularity of normal rhythms is

represented by a dirak-impulse-like distribution centred

in the transition between two regular states (R). In this

kind of rhythm almost no transition between other

states can be observed. On the other hand, when

studying AF episodes, the presence of various RR

interval lengths result in a flatter probabilistic

distribution. Based on this observation the

concentration/dispersion is assessed using the entropy

of the distribution as described by (4).

()()

3

1

ii

i

H P E H E

=

= −×

∑

(4)

()

()()

3

2

1

|log|

ijiji

j

H EP EEP EE

=

= −×

∑

(5)

The specificity of the probabilistic distributions for

both normal rhythms and AF episodes is also object of

study. The objective is to determine the similarity

between a probabilistic distribution under analysis and

a model that represents AF episodes. Based on the

MIT-BIH Atrial Fibrillation database, a model for the

AF episode probability distribution (defined by

( , )

x y ) was extracted (see Table 1 (Left)). Using

AF

P

the Kullback–Leibler divergence (

KL

D

) the similarity

between the distribution

( , )

x y and the distribution

AF

P

under analysis ( ( , )

described by (6).

P x y ) is evaluated. This feature is

()

33

11

( , ),

P x y P

( , )

x y

( , )

P x y

( , )log

P x y

( , )

x y

KLAF

xy

AF

D

P

==

=

=

∑∑

(6)

Atrial

characterized by a fibrillatory wave with specific

frequency between 4 and 10 Hz. To obtain a valid

frequency domain characterization of AF episodes, the

extraction or cancellation of the signal components

associated to the ventricular activity (VA) is needed.

That is, the QRS complex and the T wave are cancelled

out.

For this propose, the methods reported by Senhadj

et al. [6] and Sanchez et al. [7] has been the basis for

our algorithm. The QRS-T cancellation is conducted in

the frequency domain by excluding the values

corresponding to the QRS-T segments and the values

above a predefined threshold. This approach guaranties

that the influence of miss-segmented QRS-T

complexes in the cancelled signal is minimized.

Spectral analysis is performed on the residual ECG

signal using a Fast Fourier Transform. Once the

frequency spectrum has been calculated, it is

parameterized in order to find specific characteristics

for AF episodes. The two main characteristics of AF

episodes, observed in the frequency spectrums, are the

level of concentration around the main peak and its

position in the interval [4, 10] Hz. The concentration of

each spectrum is assessed by calculating the entropy of

each normalized cancelled ECG window spectrum.

activity analysis:

AF episodes are

Table

Table Table

Table 1 1 1 1. (Left) AF episode probabilistic distribution.

. (Left) AF episode probabilistic distribution. . (Left) AF episode probabilistic distribution.

. (Left) AF episode probabilistic distribution.

(Right) Normal sinus rhythm probabilistic distributi

(Right) Normal sinus rhythm probabilistic distributi(Right) Normal sinus rhythm probabilistic distributi

(Right) Normal sinus rhythm probabilistic distribution.

on.on.

on.

S R L

S 0,06 0,11 0,06

R 0,10 0,35 0,10

L 0,06 0,11 0,04

S R L

S 0,01 0,02 0,01

R 0,01 0,91 0,01

L 0,02 0,01 0

Figure

Figure Figure

Figure 4 4 4 4. States and transitions of the HM model

. States and transitions of the HM model . States and transitions of the HM model

. States and transitions of the HM model [3]

[3][3]

[3]. . . .

Page 4

Based on the spectrums extracted from the MIT-

BIH Atrial Fibrillation database, an AF specific

spectrum model has been extracted (see Figure 5). Let

( )

P x be the spectrum under analysis and

( )

Q x be the

aforementioned model. The similarity between

( )

P x

and

( )

Q x is related to the likelihood of the time

window under analysis to be an AF episode. This

similarity is evaluated by the Kullback–Leibler

divergence (

KL

D

) between the two distributions.

3. Results

3.1. Dataset and classifier

A set of 23 available records from the 25 MIT-BIH

Atrial Fibrillation Database long term records were

used for testing the proposed algorithm (two records

have been excluded, since they are not available in the

database). The records were collected from patients

with Atrial Fibrillation (mostly paroxysmal). The

recordings are each 10 hours in duration, two leads

ECG, each sampled at 250 Hz.

The proposed classifier consists of a three layer

(six-six-one) feed-forward neural network with

sigmoid activation functions, trained with the

Levenberg-Marquardt algorithm.

3.2. Classification results

To validate the proposed AF detection algorithm, 23

records from MIT-BIH Atrial Fibrillation were used

(lead MLII). Respectively, 19161 and 29893 windows

of 12 seconds, corresponding to AF and non AF

episodes, compose the training dataset. Validation has

been performed using all 23 dataset records (238321

and 59785 AF and non AF episodes, respectively). The

results obtained by the proposed algorithm are

presented in Table 2, along with the results present in

the literature.

3.3. Discussion

The proposed algorithm presents 93.80% and

96.09% of sensitivity and specificity, respectively (see

Table 2). Moody and Mark [3] proposed an algorithm

whose sensitivity is similar to the proposed algorithm.

The use of P+ to evaluate the correct detection of non

AF episodes prevents a realistic comparison with the

proposed algorithm. Tateno and Glass [5] algorithm

achieved slightly higher specificity (+0.61%) however

slightly lower sensitivity (-0.6%) than the proposed

algorithm. Although this algorithm presents similar

results with only one feature, the need of a 100 beat

segment to classify each beat makes it unusable in real

time detection of AF episodes. When comparing with

the remaining algorithms, higher sensitivity and

specificity have been achieved by the algorithm

presented in this paper. It should be noted that the

results reported by these authors are not only based on

the MIT-BIH Atrial Fibrillation records, but also on

individual patient records. These results outline the

accuracy of the proposed algorithm, suggesting its

reliability for the detection of AF episodes.

4. Conclusions

In this paper an algorithm for the detection of AF

episodes was presented. The architecture used in the

proposed algorithm, approaches the three main

physiological characteristics of AF using a pre-defined

model-based setup. The use of template based

approaches, along with information theory concepts

together with the simultaneous application of features

related to the main physiological characteristics of AF

were the main innovative aspects presented in the

present paper. Experimental results revealed that the

proposed algorithm presents

discrimination performance compared to the state-of-

overall better

Table

Table Table

Table 2 2 2 2. Sensitivity (Se) and Specificity (Sp).*These

. Sensitivity (Se) and Specificity (Sp).*These . Sensitivity (Se) and Specificity (Sp).*These

. Sensitivity (Se) and Specificity (Sp).*These

values correspond to Positive Pre

values correspond to Positive Prevalues correspond to Positive Pre

values correspond to Positive Predictiveness (+P).

Proposed algorithm

Moody and Mark [3]

Cerutti et al. [4]

Tateno and Glass [5]

Shkurovich et al. [8]

dictiveness (+P).dictiveness (+P).

dictiveness (+P).

Se (%)

93.8

93.58

93.3

93.2

78

Sp (%)

96.09

85.92*

94*

96.7

92.65

05 1015202530

0

0.5

1

1.5

2

2.5

3x 10-3

Frequency(Hz)

Figure

Figure Figure

Figure 5 5 5 5. Normalized frequency spectrum model of an

. Normalized frequency spectrum model of an . Normalized frequency spectrum model of an

. Normalized frequency spectrum model of an

AF episode.

AF episode. AF episode.

AF episode.

Page 5

the-art methods reported in literature. Based on these

evaluations, it is possible to conclude that the proposed

architecture, while using features related to the main

areas of AF detection research, can be the direction to

solve some of remaining issues in the AF detection

area. The algorithm is currently integrated into the

Heart Failure Management concept of the MyHeart

project, a large EU integrated project in the pHealth

area, which will initiate soon its clinical trial using 200

patients. This will provide the opportunity to fine tune

the algorithm, based on data collected using wearable

ECG sensors.

5. Acknowledgments

This project was partially financed by the MyHeart

project IST-2002-507816 supported by the European

Union and by the LifeStream project supported by PT

Inovação.

References

[1] Lepage R., Boucher J., Blan J. and Cornilly J.,

“ECG segmentation

extraction: application to patients prone to atrial

fibrillation”, IEEE EMBS 2001; 1:298-301.

[2] Censi F., Calcagnini G., Mattei E., Ricci R. P.,

Ricci C., Grammatico A., Santini M. and Bartolini

M., “Morphological analysis of P-wave in patients

prone to atrial fibrillation”, IEEE EMBS 2006;

1:4020-4023.

and p-wave feature

[3] Moody B. G. and Mark R. G., “A new method for

detecting atrial fibrillation using R-R intervals”,

IEEE Computers in Cardiology 1983; 10:227-230.

[4] Cerutti S., Mainardi L. T., Porta A. and Bianchi A.

M., “Analysis of the Dynamics of RR Interval

Series for the Detection of Atrial Fibrillation

Episodes”, IEEE Computers in Cardiology 1997;

24:77-80.

[5] Tateno K. and Glass L., “A Method for Detection

of Atrial Fibrillation Using RR intervals”, IEEE

Computers in Cardiology 2000; 27:391-394.

[6] Senhaji L., Wang F., Hernandez A. I. and Carrault

G., “Wavelets Extrema Representation for QRS-T

Cancellation and P Wave Detection”, IEEE

Computers in Cardiology 2002; 29:37-40.

[7] Sánchez C., Millet J., Rieta J. J., Castells F.,

Ródenas J., Ruiz-Granell R. and Ruiz V., “Packet

Wavelet Decomposition: An Approach for Atrial

Activity Extraction”,

Cardiology 2002; 29:33-36.

[8] Shkurovich S., Sahakian A. and Swiryn S., IEEE

Transactions on Biomedical Engineering 1998;

Vol. 45, No. 2: 229-234.

[9] Sun Y., Chan K. L. and Krishnan S. M.,

“Characteristic wave detection in ECG signal

using morphological

Cardiovascular Disorders 2005; 5:28.

IEEE Computers in

transform”, BMC