Background Lecture - IEEE Real World Engineering Projects

Download Report

Transcript Background Lecture - IEEE Real World Engineering Projects

Arrhythmia Detection Algorithms for Implantable Cardioverter
Defibrillators
This presentation will cover a brief description of the heart and arrhythmias,
a history of solutions, and the technical challenges of the solutions.
1. The heart
2. Heart Problems
3. Solutions
4. Technical challenges
5. Our Project
1
The Heart
2
An average heart beats 100,000 times a day, pumping 2,000
gallons of blood through its chambers to the body and back to
the heart.
 An electrical impulse signals the
heart’s four chambers to contract,
pushing blood out through the
body, then relax.
 The heart works in this constant
contract-relax/contract-relax cycle.
3
The normal contract-relax cycle is called a Sinus Rhythm
This cycle follows a regular PQRST pattern.
 Sinus Rhythm waveform
with PQRST peaks.
4
Electrical signals follow a defined path through the heart
during normal sinus rhythm.
 The electrical impulse that starts each beat
originates in the sinoatrial (SA) node. The
electricity then flows through the atria, upper
chambers, of the heart. This is represented in an
ECG by the “P-wave”.
 Electricity next flows through the ventricles,
bottom chambers, in the “QRS-complex” as they
contract and push blood out to the body.
 Finally, the heart resets electrically on the
“T-wave” and is ready for the next beat.
5
6
Heart Problems
7
Many forms of heart disease can interrupt the normal contractrelax cycle and cause abnormally fast or slow heart rates.
 Cardiac Arrhythmia: Irregularity of the heartbeat
caused by damage to (or defect in) the heart tissue
and its electrical system.
Sinus Rhythm
Cardiac Arrhythmia
8
There are several different types of Cardiac Arrhythmias, some
are not as severe, while others are considered life threatening.
 Ventricular tachycardia (VT) – the heart beats too
fast and may not pump enough blood. Very
dangerous and requires immediate treatment.
VT
 Paroxysmal supraventricular tachycardia (SVT) –
The heart has episodes when it beats fast and may
feel unpleasant. However, it is usually not life
threatening and does not require treatment.
SR
SVT
9
10
The Solutions
11
Before the 1960’s no treatment existed for cardiac
arrhythmia.
 The 1960’s saw the introduction of CPR,
cardiopulmonary resuscitation.
 External defibrillation also became a
tool, using an electric shock to stop
cardiac arrhythmia and restart the heart.
12
Implantable Cardioverter Defibrillators (ICD’s) were first
introduced in the 1980’s.
 These ICD’s were large and
required major surgery to be
implanted in the patient’s
abdomen.
 These devices were reserved
only for the highest risk
patients and only lasted 18
months after being implanted.
13
Today’s ICD devices are smaller and more effective than
those used previously.
 Require only simple,
local surgery to be
implanted in the chest.
 Offer programmable
therapy (varying
degrees of electric
shock): about 300 J
in 4-12 msec
 Battery life of up to 9
years.
14
How much is that? Consider two views…
 Watch the ICD surgery in the pre-lab movie to see the
impact on a patient receiving a therapy from his ICD.
 CHALLENGE!
 The energy in an ICD therapy (about 300 J) is roughly the
same amount of energy required to power a 100 W light bulb
for how long?
15
ICDs versus Pacemakers. What’s the difference?
 Pacemakers and ICDs are very similar, but they are
not the same thing.
 Pacemakers send electrical shocks to the heart in
order to speed up a heart that is beating too slowly.
These shocks are small and cannot be felt.
 ICDs shock the heart in order to slow down and
correct a heart beat that is too fast. These shocks
are large and are described as ‘being hit in the chest’.
16
Today’s ICD devices allow people who have heart
problems to live relatively normal lives.
 Many people both young and old can develop heart
problems as the result of disease, defects, or injury
due to accidents.
 Without treatment patients may not be able to be
physically active and healthy. With an ICD device
many patients are able to live normally
active lives.
 In 2002 alone there were about
100,000 ICDs implanted in patients.
17
Prelab Exercises – see Project Assignment
 Review online part of the PBS special
The Mysterious Human Heart
 www.pbs.org/wnet/heart
 About 20 minutes to complete
18
Technical Challenges
19
There are several technical challenges to consider when
designing an ICD.
 The ICD is constantly monitoring the heart rhythm
and must be able to quickly and accurately detect
abnormal rhythms.
 Speed and Accuracy
are the primary criteria
for a good ICD
detection algorithm.
20
To be effective and practical an ICD must work
continuously over a long period of time.
 A balance must be established between speed and
accuracy while keeping battery life in mind.
 In general, faster algorithms are less accurate while
slower algorithms are more accurate.
 These tradeoffs are constrained by
possibility of death. An ICD cannot
miss a VT but it also has to be fast
enough to catch a VT in time.
21
An ICD that needs to be replaced every year is not very
practical. Long battery life is essential to patients.
 The battery life of an ICD depends on the complexity
of the detection algorithm.

The more complex the algorithm the more power and time
needed to make a decision.
 The battery life also depends on the number of
electrical shocks it sends to the heart.

Unnecessary shocks waste battery life and can be
detrimental to the patient’s health.
 Typical ICDs today are designed to have a battery life
of approximately nine years.
22
The patient should only receive treatments when
necessary, those shocks can hurt!
 The detection algorithm must be complex enough to
be accurate.
 The heart rhythm from exercise can look very similar
to the fast rhythm of a cardiac arrhythmia.
23
Algorithms must detect arrhythmias in real time.
 The algorithm must be able to correctly distinguish
between VT, SVT and exercise.


VT are dangerous and require electrical shock therapy.
SVT and exercise are not dangerous and do not need therapy.
 The algorithm must be complex enough to distinguish
between these but not so complex that it is too slow
and uses too much battery life.
 Balance is key!
24
Your Project
 There are two parts to this project:

The Derivative Method (DM): your team will design a
Matlab program to implement a simple detection algorithm
and use it to distinguish between given VT and SVT signals.

The Energy Fractional Factor (EFF) Method: your team
will be given a program that implements a more complex
detection algorithm and use it to distinguish between VT and
SVT signals.
25
Using what we have learned about detection algorithms
state a hypothesis.
 EFF will be more accurate and slower than DM
because it is more complex.
26
Cardiologists are trained to classify ECGs as SR, VT, or
SVT.
 Cardiologists use several different ECG
characteristics to diagnose cardiac arrhythmias.
 When cardiologists need to quickly diagnose a
cardiac arrhythmia they look at the rate and rhythm
shown on an ECG.
 They often look at rhythm to see if there is a P-peak
before the QRS complex.
27
We need to create an algorithm that allows the ICD to do
what a doctor would do.
 The algorithm must be able to differentiate between
different types of arrhythmias (VT and SVT).
 The algorithm must be accurate enough to safely
replace the intuition and experience that doctors
possess.
28
The Derivative Method (DM):
The primary difference between SR, VT, and SVT is the rate of
voltage change.
 The rate of change of the voltage of an ECG in the
80ms before the R peak is different in SR, VT, and
SVT.
 The rate of change of the voltage = dv/dt
This is simply a first derivative!
29
The ICD is detecting changes in the P-peak similar to
what doctors look for.
 The P-peak normally occurs in the 80ms before the
R-peak.
 By using the first derivative of the 80ms before each
R-peak the ICD will be able to detect changes
between SR, VT and SVT.
30
Each of the ECG test signals in this project have three
peaks, the program needs to detect all three.
Regions of interest: 80 ms before peaks
31
The ICD is detecting changes in the P-peak similar to
what doctors look for.
 The P-peak normally occurs in the 80ms before the R-peak.
 By using the first derivative of the 80ms before each R-peak the ICD
will be able to detect changes between SR, VT and SVT.
 Using a known set of ECGs
(ones that have already
been classified by
cardiologists) we can take
the derivative of each and
determine the difference
between VT and SVT.
32
By taking the first derivative of each signal in the known set we
can begin to find defining features of SR, VT and SVT.
 Two features of the VT and SVT when compared to SR are
peak height and onset.
Peak Height SVT
Peak Height VT
Onset VT
Onset SVT
33
Determining whether a signal is a VT or SVT.
 Onset is the most reliable distinguishing feature of a
VT and SVT; we will use it. Onset is defined as the
time of the first peak in the DM result.
 A threshold onset time must be calculated using the
given known ECG signals.
 Do SVT onset earlier than VT, or vice versa?
 What are the maximum/minimum onset times?
34
Overview of the Derivative Method
 Detect three R-peaks from an ECG test signal
 Extract the 80ms interval before each peak
 Calculate the first derivative of each of the three 80ms




intervals
Compute the average of the three derivatives
Rectify the average derivative signal
Normalize the signal to the maximum SR value
Plots these DM results for the ECG test signal against
the DM results for the SR signal
Note the onset time for the ECG test signal by visual
inspection (i.e. looking at it)!
35
How to calculate a threshold:
 Given a table like this, a threshold can be calculated:
tD = (max VT onset time + min SVT onset time)/2
ECG Signal Name
Classification
Onset Time (ms)
Known_1
VT
-72
Known_2
VT
-32
Known_3
VT
-32
Known_4
VT
-56
Known_5
VT
-56
Known_6
SVT
-24
Known_7
SVT
-24
Known_8
SVT
-24
Known_9
SVT
-24
Known_10
SVT
-24
Use this threshold
to classify the
unknown ECG
signals!
NOTE: our ECG
signals are from
patients and have
been classified by
cardiologists
36
Overview of the DM Matlab program
 What you need to design:


Main Program
•
Read in DM results for SR signal and normalize it
•
Read in test ECG signal, calculate its DM results
and normalize it
•
Plot SR and ECG DM results on one graph
Functions
1. Detect 3 R-peaks and extract intervals
2. Calculate the first derivative, average, rectify
3. Normalize a signal
37
TPS: Think-Pair-Share
 We know how to find the first derivative of a continuous
signal (e.g. x(t) = 2t2 + 3), but how do you calculate the
first derivative of a digital signal (e.g. a vector of
numbers)?
38
Recall how you first thought about differentiation.
rise = ___________
x(t+h) – x(t)
slope = ______
h
run
x(t+h)
x(t)
t
t+h
x'(t) =
x(t+h) – x(t)
__________
h 0
h
lim
space between the time points
values of the signal at discrete points
39
Introduction to the EFF Algorithm
 ECG signals are often analyzed in the time domain.
However there are other ways to analyze signals.
The frequency domain is one of these ways.
 The EFF algorithm uses frequency information from
an ECG signal to calculate the Energy Fractional
Factor.
40
A Simple Example of Frequency Analysis
Time
Domain
Frequency
Domain
41
A More Complex Signal Frequency Analysis.
42
Working in the frequency domain the EFF algorithm can
classify VT and SVT signals.
 First, the EFF algorithm is used to analyze known
ECG signals; one plot provides a quick visual
comparison of EFF values for VT and SVT.
 Next, a threshold value is calculated from the
analysis of the known signals.
 Finally, the EFF algorithm is used to analyze each
unknown ECG signal; the threshold is applied to the
EFF value and classifies the ECG as VT or SVT.
43
EFF Results for Known Signals
Known Signals
0.93
0.92
HOW?
0.91
t=
0.90292
7
8
Average EFF
0.9
0.89
0.88
0.87
0.86
VT
SVT
0.85
0
1
2
3
4
5
6
9
10
11
Index
44
What is the IDEA behind EFF? In other words, why
does is distinguish between VT and SVT?
 The P-wave is usually missing in VT, but not SVT
 Consequently, VT has more energy concentrated in
fewer frequency modes than SVT
 EFF method captures energy concentration by
frequency
 EFF values will be higher for VT than SVT
45
Analyze the unknown ECG signals with DM and EFF
then compare the results.
 For an unknown ECG signal, do the DM and EFF
results…


agree?
disagree?
 How long does it take DM to analyze and classify an
ECG signal?
 How long does it take EFF?
We will assess the accuracy of your results
during lab AND in your project report.
46
Strategies that will help your group achieve accurate
results in short order.
 Read the background information (these slides) and





assignment carefully and thoroughly; do the pre-lab
exercises.
Use the effective team practices that we have
reviewed.
Begin with brainstorming.
Use your time during lab wisely.
Meet with your team and continue working outside of
lab: plan on spending about 5 hours/week on this
project outside of lecture and lab.
Understand and follow all directions.
47