CD-HMM For Normal Sinus Rhythm: V.K.Srivastava, Dr. Devendra Prasad
CD-HMM For Normal Sinus Rhythm: V.K.Srivastava, Dr. Devendra Prasad
}
t b
a
| |
|
\ .
( ) f t dt
where a is a scale and b is a time shift. Time-frequency spectrum enables to measure time-frequency changes in
spectral components. Interpretation of a time-frequency resolution by CWT is as follows: CWT represents time-
frequency decomposition realized by correlation of signal f(t) with basic functions derived from the mother
wave (t). Haar function was used as the mother wavelet for its simplicity:
ABSTRACT
To diagnose the cardiac abnormalities, it is important to detect and classify the cardiac arrhythmias. To
achieve this we have to use the specialized program tools and visual demonstrations of new methods, as
propagated by researcher from time to time. Our work is focused on classification of normal sinus rhythm
and premature ventricular contractions of the human heart. We are using the wavelets for the feature
selection and extraction (searching for a local maximum in the contour envelope successfully detects R-
peaks) and Continuous Density Hidden Markov Models (CD-HMM) for the classification. The ECG data
is taken from standard MIT-BIH arrhythmia database.
Cd-Hmm For Normal Sinus Rhythm
www.ijceronline.com ||May ||2013|| Page 120
0 t
1
1
2
1
H
(t )
1 t 1 (2)
2
0 others ,
Fig. 1: Continuous wavelet transform of the raw time data series (left panel premature ventricular
contraction, right panel normal sinus rhythm).
Scales were finally chosen from an interval of <1; 40>. The signals were extracted as periods of 250
samples (f
s
=360 Hz) containing R-waves of each QRS complex. After transforming by CWT, the wavelet
coefficients were squared and normalized.
2.2 Continuous Density Hidden Markov Model (Cd-Hmm)
The Hidden Markov model is a finite state machine having a set of states Q, each of which is associated
with probability distribution, an output alphabet O, transition probabilities A, output probabilities B, and initial
state probabilities . The current state is not observable. Instead, each state produces an output with a certain
probability B. The CD-HMM stage is proceeded by the pre-processing step (CWT).
Continuous emission probability B = {b
j
(O
t
)}, where O = O
1
,O
2
, . . . ,O
T
, the emission probability density
function of each state is defined by a finite multivariate Gaussian mixture:
M
b
j
(O
t
) d
jm
N (O
t
,
jm
, C
jm
), 1 j N (3)
M 1
where O
t
is the feature vector of the sequence being modelled, d
jm
is the mixture coefficient from the mth
mixture in state j and N is a Gaussian probability with mean vector
jm
and covariance matrix C
jm
for the mth
mixture component in state j. We will refer to these models as a continuous density HMM (CD-HMM).
The used CD-HMM had left-to-right topology. The number of states is possible to change. The first state
is designated as the initial state and the last state as the output state.
Cd-Hmm For Normal Sinus Rhythm
www.ijceronline.com ||May ||2013|| Page 121
Fig. 2: Structure of the used hidden Markov model.
Initial transition probability A (for example for 10 state model) is:
A=
0100000000
00.330.330.33000000
00.330.330.3300000
...
0000000000
(
(
(
(
(
(
(
Three problems are considered as fundamental in hidden Markov modelling applications:
1) Estimation of hidden Markov model parameters from a set of representative training data (parameters
include state transition probabilities, output probabilities).
2) Efficient calculation of P (O|) - the probability that a given observation sequence was generated by a
particular hidden Markov model .
3) Determination of X*, the most likely underlying state sequence corresponding to a given observation
sequence 0 such that P (0| X*,) is maximum.
The importance of solving the first problem is obvious; model parameters must first be estimated before
the models can be used for classification purposes.
Baum-Welch algorithm was used as a training method to find hidden Markov model parameters A, B
with the maximum likelihood of generating the given symbol sequence in the observation vector.
The probability of state occupation must be calculated. This is done efficiently using the so-called
Forward-Backward algorithm.
The solution to the second problem is often used as the basis for a classification system. By computing P
(O|) for each of i possible models and choosing the most likely model, classification can be inferred.
An alternative classification approach uses the solution of the third problem to find the single best state
sequence which maximizes P (0| X*,). Classification can then be inferred by choosing the model with the most
likely best state sequence, which requires less computation than determining the most likely model.
The logarithmic Viterbi algorithm was used for the recognizing. It determines the most probable route to
the next state, and remembers how to get there. This is done by considering all products of transition
probabilities with the maximal probabilities already derived for the preceding step. The largest such is
remembered, together with what provoked it.
Scaling the computation of Viterbi algorithm to avoid underflow is non-trivial. However, by simply
computing of the logarithm it is possible to avoid any numerical problems.
Cd-Hmm For Normal Sinus Rhythm
www.ijceronline.com ||May ||2013|| Page 122
III. RESULTS
The proposed method was used in an educational graphical program in Matlab environment. The
program allows selection of a number of states and initial transition probabilities of the HMM model. After the
reading of signals, students can visually follow whole classification process. They can also see results of the
wavelet transform of the signal and the training process. They can compare results of the classification using
transformed and raw ECG data.
The ECG data were taken from the standard MIT-BIH arrhythmia database automatically as a sequence
of 250 samples (100 samples before R-waves and 150 after the R-waves. Graphical interface of the realized
program is depicted on Fig.3.
Fig. 3: Custom-made program tool interface
IV. CONCLUSSION
An algorithm employs unsupervised way of the classification. Our work is focused on classification of
normal sinus rhythm and premature ventricular contractions. It is demonstrated that wavelet methods can be
used to generate an encoding of the ECG which is tuned to the unique spectral characteristics of the ECG
waveform features. Left-to-right CD-HMM was used.
REFERENCES
[1] Kimerov, D.: Detection and classification of ECG signals in time-frequency domain. Diploma Thesis. Brno University of
Technology, 2004.
[2] Rabiner, L R.: A tutorial on hidden Markov models and selected applications in speech recognition. Proceedings of the IEEE,
77(2):257286 , 1989.
[3] Bardoov, J., Provaznk, I., Novkov, M., Novkov,HiddenZ.: Markov model in wavelet analysis of myocardial ischemia in rabbit.
In Computers in Cardiology, p. 419 422, Boston, 2000.