Detection, segmentation and classification of heart sounds Daniel Gill Advanced Research Seminar May...

37
Detection, segmentation and classification of heart sounds Daniel Gill Advanced Research Seminar May 2004

Transcript of Detection, segmentation and classification of heart sounds Daniel Gill Advanced Research Seminar May...

Page 1: Detection, segmentation and classification of heart sounds Daniel Gill Advanced Research Seminar May 2004.

Detection, segmentation and classification of heart sounds

Daniel GillAdvanced Research Seminar May 2004

Page 2: Detection, segmentation and classification of heart sounds Daniel Gill Advanced Research Seminar May 2004.

Automatic Cardiac Signals Analysis

Problems :

1. Pre-processing and noise treatment.

2. Detection\segmentation problem.

3. Classification problem: a. Feature extraction – waveshape & temporal

information.

b. The classifier.

Page 3: Detection, segmentation and classification of heart sounds Daniel Gill Advanced Research Seminar May 2004.

Outline

• Methods based on waveshape :

- Envelogram

- Wavelet decomposition and reconstruction

- AR modeling

- Envelogram estimation using Hilbert

transform• Suggested method : Homomorphic

analysis• Suggested temporal modeling : Hidden Markov

Models

Page 4: Detection, segmentation and classification of heart sounds Daniel Gill Advanced Research Seminar May 2004.

Heart beat, why do you miss when my baby kisses me ?

B. Holly (1957)

Page 5: Detection, segmentation and classification of heart sounds Daniel Gill Advanced Research Seminar May 2004.

PCG Analysis

• We will concentrate mainly on S1 and S2.• We will discuss only methods which do not use

external references (ECG, CP or other channels).• Most of the methods are non-parametric or semi-

parametric (parametric models for the waveshape but non-parametric in the temporal behavior).

• Suggestion for parametric modeling.

Page 6: Detection, segmentation and classification of heart sounds Daniel Gill Advanced Research Seminar May 2004.

Features of PCG

• The envelope of PCG signals might convey useful information.

• In order to detect\segment\classify cardiac events we might need temporal information.

Page 7: Detection, segmentation and classification of heart sounds Daniel Gill Advanced Research Seminar May 2004.

Segmentation Using Envelogram (S. Liang et al. 1997)

• Use Shannon energy to emphasize the medium intensity signal.

• Shannon Energy: E=-x2log(x2)

Page 8: Detection, segmentation and classification of heart sounds Daniel Gill Advanced Research Seminar May 2004.

Segmentation Using Envelogram

• The Shannon energy eliminates the effect of noise.

• Use threshold to pick up the peaks.

Page 9: Detection, segmentation and classification of heart sounds Daniel Gill Advanced Research Seminar May 2004.

Segmentation Using Envelogram

• Reject extra peaks and recover weak peaks according to the intervals statistics.

• Recover lost peaks by lowering the threshold

Page 10: Detection, segmentation and classification of heart sounds Daniel Gill Advanced Research Seminar May 2004.

Segmentation Using Envelogram

• Identify S1 and S2 according the intervals between adjacent peaks.

Page 11: Detection, segmentation and classification of heart sounds Daniel Gill Advanced Research Seminar May 2004.

Segmentation Using Wavelet Decomposition and Reconstruction

(Liang et al. 1997)• Use the frequency bands that contain the

majority power of S1 and S2.

• Daubechies filters at frequency bands :

a4 : 0-69Hz

d4 : 69-138Hz

d5 : 34-69Hz

Page 12: Detection, segmentation and classification of heart sounds Daniel Gill Advanced Research Seminar May 2004.

Segmentation Using Wavelet Decomposition and Reconstruction

• Use Shannon energy to pick up the peaks above certain threshold.

• Identify S1 and S2 according to set of rules similar to those used in segmentation with envelograms.

• Compare the segmentation results of d4, d5 and a4.

• The choosing criterion : more identified S1s and S2s and less discarded peaks.

Page 13: Detection, segmentation and classification of heart sounds Daniel Gill Advanced Research Seminar May 2004.

Segmentation Using Wavelet Decomposition and Reconstruction

Page 14: Detection, segmentation and classification of heart sounds Daniel Gill Advanced Research Seminar May 2004.

AR modeling of PCG (Iwata et al. 1977, 1980)

AR model :

• Used narrow sliding windows (25ms) to compute 8th order AR model.

• Features used : dominant poles (below 80Hz) and bandwidth.

• Detected S1, S2 and murmurs.

)()()(1

nknyanyp

kk

Page 15: Detection, segmentation and classification of heart sounds Daniel Gill Advanced Research Seminar May 2004.

Segmentation and Event Detection - Cons

• Most of the methods are based on rules of thumb – no physical basis.

• In most cases there is no parametric model of the waveshape and\or timing mechanism.

• Not suitable for abnormal\irregular cardiac activity.• In case of AR model, there is still question of

optimality : window size, order etc. In addition, there is no model for the timing mechanism of the events.

• Heart sounds are highly non-stationary – AR model is very much inaccurate.

Page 16: Detection, segmentation and classification of heart sounds Daniel Gill Advanced Research Seminar May 2004.

Suggested Methods

• Waveshape analysis – Homomorphic Filtering.

• Temporal Model – (Semi) Hidden Markov Models.

Page 17: Detection, segmentation and classification of heart sounds Daniel Gill Advanced Research Seminar May 2004.

Waveshape analysis - Homomorphic filtering

• Express the PCG signal x(t) by

where a(t) is the amplitude modulation (AM) component (envelope) and f(t) is the Frequency modulation (FM) component.

• Define )(ln)(ˆ txtx

Page 18: Detection, segmentation and classification of heart sounds Daniel Gill Advanced Research Seminar May 2004.

…• Thus

• If the FM component is characterized by rapidly variations in time - apply an appropriate linear low-pass filter L.

• we have

• L is linear so :

• By exponentiation :

)(ln)(ln)(ˆ tftatx

)](ˆ[)(ˆ txLtxl

)(ln)]([ln)]([ln)(ˆ tatfLtaLtxl

)()](exp[ln)](ˆexp[ tatatxl

Page 19: Detection, segmentation and classification of heart sounds Daniel Gill Advanced Research Seminar May 2004.

AM envelopes

)a (Normal beat, (b) Atrial septal defect, (c) Mitral stenosis (d) Aortic insufficiency.

Page 20: Detection, segmentation and classification of heart sounds Daniel Gill Advanced Research Seminar May 2004.

Identifying Peaks

• A simple threshold was used to mark all the peak locations of the AM envelogram.

• Suppose that two consecutive peaks are found at and .• We might have to reject extra peaks or recover

lost peaks.

1tt 2tt

Page 21: Detection, segmentation and classification of heart sounds Daniel Gill Advanced Research Seminar May 2004.

• Extra peaks were rejected by the following rules:

if (splitted peak)

if

choose

else choose

else choose (not splitted)

mstt 5012 )(6.0)( 21 tata

1t2t

2t

Page 22: Detection, segmentation and classification of heart sounds Daniel Gill Advanced Research Seminar May 2004.

• When an interval exceeds the high-level limit, it is assumed that a peak has been lost and the threshold is decreased by a certain amount. It is repeated until the lost peaks are found or a certain limit is reached.

Page 23: Detection, segmentation and classification of heart sounds Daniel Gill Advanced Research Seminar May 2004.

Labeling

• The longest interval between two adjacent peaks is the diastolic period (from the end of S2 to the beginning of S1).

• The duration of the systolic period (from the end of S1 to the beginning of S2) is relatively constant

Page 24: Detection, segmentation and classification of heart sounds Daniel Gill Advanced Research Seminar May 2004.

Thus

• Find the longest time interval.

• Set S2 as the start point and S1 as the end point.

• Label the intervals forward and backward.

Labeling

Page 25: Detection, segmentation and classification of heart sounds Daniel Gill Advanced Research Seminar May 2004.

Normal heart beat with the labels found

Page 26: Detection, segmentation and classification of heart sounds Daniel Gill Advanced Research Seminar May 2004.

Homomorphic Filtering Pros

• Provides smooth envelope with physical meaning.• The envelope resolution (smoothness) can be

controlled.• Enables parametric modeling of the amplitude

modulation for event classification (polynomial fitting ?).

• Enables parametric modeling of the FM component (pitch estimation, chirp estimation ?)

Page 27: Detection, segmentation and classification of heart sounds Daniel Gill Advanced Research Seminar May 2004.

Temporal Model – (Semi) Hidden Markov Model

• HMM is a generative model – each waveshape feature is generated by the cardiological state of the heart.

• HMM models have been already used for ECG signals.

• The ECG state sequence obeys Markov property – each state is solely dependent on previous state.

Page 28: Detection, segmentation and classification of heart sounds Daniel Gill Advanced Research Seminar May 2004.

HMM Formalism

• An HMM can be specified by 3 matrices {• are the initial state probabilities

• A = {aij} are the state transition probabilities = Pr(xj|xi)

• B = {bik} are the observation probabilities = Pr(ok|xi)

oTo1 otot-1 ot+1

x1 xt+1 xTxtxt-1

Page 29: Detection, segmentation and classification of heart sounds Daniel Gill Advanced Research Seminar May 2004.

Generating a sequence by the model

Given a HMM, we can generate a sequence of length n as follows:

1. Start at state xi according to prob i

2. Emit letter o1 according to prob bi(o1)

3. Go to state xj according to prob aij

4. … until emitting oT

1

2

N

1

2

N

1

2

K

1

2

N

o1 o2 o3 oT

2

1

N

2

0

b2o1

2

Page 30: Detection, segmentation and classification of heart sounds Daniel Gill Advanced Research Seminar May 2004.

The three main questions on HMMs

1. EvaluationGIVEN a HMM , and a sequence O,FIND Prob[ O | ]

2. Decoding GIVEN a HMM , and a sequence O,

FIND the sequence X of states that maximizes P[X | O, ]

3. LearningGIVEN a sequence O,FIND a model with parameters , A and B that maximize P[ O | ]

Page 31: Detection, segmentation and classification of heart sounds Daniel Gill Advanced Research Seminar May 2004.

Segmentation of ECG Using a Hidden Markov Model (L. Claveier et al.)

• Purpose: – Segment ECG (12

parts);

– Detect accurately P-wave, recognize cardiac arrhythmias.

• Parameters:– Amplitude;

– Slope.

Page 32: Detection, segmentation and classification of heart sounds Daniel Gill Advanced Research Seminar May 2004.

Segmentation of ECG Using a Hidden Markov Model (Con.)

• Possible state jumps of the HMM

• Other jumps and states could be added to recognize various shapes of the P and T waves.

Page 33: Detection, segmentation and classification of heart sounds Daniel Gill Advanced Research Seminar May 2004.

Segmentation of ECG Using a Hidden Markov Model (Con.)

• Automatic segmentation of an ECG beat.

• Automatic segmentation of a P-Wave

Page 34: Detection, segmentation and classification of heart sounds Daniel Gill Advanced Research Seminar May 2004.

ECG segmentation using HSMM

• N. Hughes et al. (2003) used HMM in a supervised manner.

• Training signals were segmented and labeled by group of expert ECG analysts.

• Used raw data and wavelet encoding.

Page 35: Detection, segmentation and classification of heart sounds Daniel Gill Advanced Research Seminar May 2004.

Segmentation using HSMM - results

Page 36: Detection, segmentation and classification of heart sounds Daniel Gill Advanced Research Seminar May 2004.

Conclusions

• Homomorphic (or cepstral) analysis may provide parametric modeling of S1 & S2 and reduce significantly the dimension of the problem.

• Parametric\probabilistic modeling like HMM (or HSMM) may provide robust segmentation of irregular cardiac activity.

• It can make automatic classification easier.

Page 37: Detection, segmentation and classification of heart sounds Daniel Gill Advanced Research Seminar May 2004.

Thank You !