Apnea Detection from the ECG 1.0.0

File: <base>/apdet.shtml (16,665 bytes)
<!--#set var="TITLE" value="Detection of Obstructive Sleep Apnea from Cardiac Interbeat Interval Time Series"-->
<!--#include virtual="/head.shtml"-->

<B>
JE Mietus, C-K Peng, PCh Ivanov, AL Goldberger
<BR>
<BR>
Beth Israel Deaconess Medical Center and Harvard Medical School, Boston, USA</B>

<p>
<center><table bgcolor="lightblue">
<tr><td>
<p>
This article originally appeared in <em>Computers in Cardiology 2000</em>,
vol. 27, pp. 753-756 (Piscataway, NJ: The Institute of Electrical and Electronics Engineers, Inc.).  Please
cite this publication when referencing this material.
The software described in this article is freely available <a
href="index.shtml">here</a>.
</td></tr> </table></center>


<H2>Abstract:</H2>
<p>
We present a new automated method to diagnose and quantify obstructive sleep
apnea from single-lead electrocardiograms based on the detection of the
periodic oscillations in cardiac interbeat intervals that are often associated
with prolonged cycles of sleep apnea. This technique employs the Hilbert
transformation of the sinus interbeat interval time series to derive the
instantaneous amplitudes and frequencies of the series and calculates their
averages and standard deviations over a moving 5-minute window. We then apply a
thresholding technique and detect continuous sequences of those windows that
lie within threshold limits. When applied to the <a
href="/physiobank/database/apnea-ecg/">Computers in Cardiology sleep apnea test
data</a>, our algorithm correctly classified 28 out of 30 cases (93.3%) of both
sleep apnea and normal subjects, and correctly identified the presence or
absence of sleep apnea in 14591 out of a total of 17268 minutes (84.5%) of the
data from the test set.

<H2>Introduction</H2>

<P>
Obstructive sleep apnea (OSA), the periodic cessation of breathing during
sleep due to intermittent airway obstruction, is a frequently undiagnosed
condition affecting millions of individuals worldwide, and is associated
with increased morbidity and mortality. Current technology for the diagnosis
of sleep apnea requires overnight monitoring of the patient in a specially
equipped sleep laboratory. Because of the expense and inconvenience of
standard polysomnographic recording, less costly and more easily implemented
techniques for detection of high-risk subjects would be desirable.

<P>
Our approach is based on the finding that OSA frequently alters healthy heart
rate dynamics. In normal healthy respiration, heart rate dynamics exhibit a
broadband, inverse power law spectral distribution [1]. In contrast,
during periods of prolonged OSA, the heart rate typically shows cyclic
increases and decreases associated with the apneic phase and the resumption
of breathing [2]. These cycles which tend to oscillate at a frequency
of between 0.01 and 0.04 Hz, are a distinctive feature of OSA not found during
normal respiration. We hypothesized that we could detect and quantify these
periods of high-density OSA by the fully automated identification of these
oscillatory dynamics in the RR interbeat interval series.

<P>

<H2>Methods</H2>

<P>
The heart rate oscillations accompanying prolonged OSA are transient, and
highly nonlinear and nonstationary, typically with varying amplitudes
and frequencies [Fig 1a]. These properties cause standard spectral
analysis techniques such as the Fourier transformation and autoregressive
methods to be ineffective in reliably detecting and localizing episodes of OSA.

<P>
The Hilbert transform is an analytical technique for transforming a time
series into corresponding values of instantaneous amplitudes and frequencies
[3, 4]. By using this technique to transform the RR interval
time series into its instantaneous amplitude and frequency components and
quantifying the mean values of these components and their stability over
time, it is possible to differentiate the periods of cyclic heart rate
behavior accompanying prolonged apnea from periods of normal respiration.

<P>

<P></P>
<CENTER><A NAME="18"></A>
<TABLE WIDTH=90% BGCOLOR="#E0E0E0" BORDER=0 CELLSPACING=0 CELLPADDING=10 VSPACE=10>
<TR><TD ALIGN=CENTER><IMG
 WIDTH="750" HEIGHT="600" BORDER="0"
 SRC="fig1.png"
 ALT=""></TD></TR>
<TR><TD><EM>Figure 1.</EM>
RR interval preprocessing and Hilbert transform amplitudes and
frequencies: a) raw RR interval series, b) bandpass filtered NN interval
series, and c) Hilbert transformed data showing minimum amplitude (long
dashed line) and maximum frequency (short dashed line) threshold limits.
Black triangles indicate actual apnea episodes. The grey bar indicates
the apnea detection based on our algorithm using the six parameters
described in the text.</CAPTION>
</TABLE>
</CENTER>

<P>

<H2>RR Interval Preprocessing and Hilbert Transformation</H2>

<P>
Since the Hilbert transform requires a bandwidth limited signal, the RR
interval series must first be preprocessed to isolate frequencies of
interest.

<P>
To eliminate the effects of ectopic beats from the RR interval series
[Fig 1a], we select only normal sinus to normal sinus (NN) intervals as detected
by an automated beat detection and classification algorithm. Because QRS
detection algorithms may misclassify some ectopics as normal or may miss
some normal beat detections, we then apply a moving window average filter
to remove the remaining impulse noise due to these outliers as follows. For
each set of 41 contiguous NN intervals, a local mean is computed excluding
the central interval and those intervals which lie outside the range of 0.4
to 2.0 sec. The central interval is considered to be an outlier and is rejected
if its value lies outside of 20% of this mean. This test is applied to each
interval in the series and all such outliers are removed.

<P>
The filtered NN interval series is next linearly resampled at 1 Hz and
bandpass filtered by applying low and high pass filters [Fig 1b]. The
frequency range of the bandpass filter is selected to ensure that OSA
oscillations will not be filtered out. The low pass filter is a moving
window boxcar filter of width 5, giving a 3db cutoff at 0.09 Hz where the
value at each point in the series is replaced by the average value over
the window centered that at point. The high pass filter uses a local
detrending technique over a moving window of 81 data points, giving a
highpass 3db cutoff at 0.01 Hz. At each point in the series, the slope of
the regression line over a window centered at that point is computed, and
the value of this fit at the central point is subtracted from the actual
value at this point.

<P>
The Hilbert transform is then applied to the filtered NN interval series
and the instantaneous amplitude and frequency calculated at each point.
Since the amplitudes and frequencies of the transformed data exhibit
large fluctuations around their mean values, to eliminate this noise they
are each median filtered using a moving window of 60 points. To compensate for
the differing amplitudes of heart rate variability among different subjects,
the amplitudes are then normalized so that their average value over the
entire time series is equal to one [Fig 1c].

<P>

<P></P>
<CENTER><A NAME="25"></A>
<TABLE WIDTH=90% BGCOLOR="#E0E0E0" BORDER=0 CELLSPACING=0
CELLPADDING=10 VSPACE=10>
<TR><TD ALIGN=CENTER><IMG
 WIDTH="750" HEIGHT="550" BORDER="0"
 SRC="fig2.png"
 ALT=""></TD></TR>
<TR><TD><EM>Figure 2.</EM>
Hilbert transform amplitude and frequency probability distributions
for the means, standard deviations and time within threshold limits for the
5-minute windows of all periods of normal respiration and high-density OSA.
Parameter limits indicated by dashed vertical lines optimize minute-by-minute
true positive and true negative apnea detections. Ordinates <IMG
 WIDTH="36" HEIGHT="34" ALIGN="MIDDLE" BORDER="0"
 SRC="img2.png"
 ALT="$p(x)$"> denote
the probability density, where <!-- MATH
 $p(x) \cdot \Delta x$
 -->
<IMG
 WIDTH="67" HEIGHT="31" ALIGN="MIDDLE" BORDER="0"
 SRC="img3.png"
 ALT="$p(x) \cdot \Delta x$"> gives the
probability of a value occurring within a small region <IMG
 WIDTH="26" HEIGHT="15" ALIGN="BOTTOM" BORDER="0"
 SRC="img4.png"
 ALT="$\Delta x$"> centered
at <IMG
 WIDTH="13" HEIGHT="15" ALIGN="BOTTOM" BORDER="0"
 SRC="img5.png"
 ALT="$x$">. The total area under each of the curves is equal to unity.</CAPTION>
</TD></TR>
</TABLE>
</CENTER><P></P>

<P>

<H2>Apnea Detection</H2>

<P>
The median filtered Hilbert amplitudes and frequencies are then analyzed
over 5-minute windows incremented for each minute. Six parameters are
calculated for each window increment: the average and standard deviation
of both the amplitudes and frequencies over the window and the fraction of
time that the amplitudes and frequencies are each separately within their
predefined threshold limits [Fig 1c]. 

<P>
To compare the distributions of these parameters for normal respiration and for
periods of prolonged OSA, we combined the PhysioNet <a
href="/physiobank/database/slpdb/">Polysomnographic</a> and <a
href="/physiobank/database/nsrdb/">Normal Sinus Rhythm</a> (NSR) databases [5]
together with the <a href="/physiobank/database/apnea-ecg/">Computers in
Cardiology (CinC) training dataset</a> [5]. For the periods of normal
respiration, in addition to the eight hours of data from each of the 10 normal
subjects in the CinC training set, we selected from the 18 subjects in the NSR
database the six hours of lowest heart rate, corresponding to periods of sleep,
giving a total of 188 hours of normal respiration. For periods of prolonged
OSA, we selected from the the CinC training set and Polysomnographic database
those periods of time that were 15 minutes or greater in duration during which
there was at least 1 episode of apnea per minute, giving a total of 117 hours
of prolonged high-density OSA.

<P>
Since the probability distributions of these six parameters are different for
the periods of prolonged sleep apnea compared to periods of normal respiration
[Fig 2], by an appropriate selection of ranges for these parameters, it is
possible to selectively isolate windows of periodic NN interval behavior.

<P>
However, due to the overlap between the distributions, to discriminate
the periods of prolonged periodic heart rate dynamics in high-density OSA
from periods of intermittent heart rate periodicity found in normals, we
further require that each of these six parameters be continuously within
their specified limits (defined below) for a minimum of 15 minutes to qualify
as a detection of an apnea episode.

<P>
To determine the particular values of the Hilbert amplitude threshold and
the distribution parameter limits that give the best apnea detection, each of
these parameters were incrementally varied, and statistics were calculated
from multiple computer runs using data from the combined Polysomnographic,
NSR and CinC training set databases. The parameters selected were those that
gave the highest percentage of minute-by-minute true positive and true negative
apnea detections in these combined sets.

<P>
By this method, the ``optimal'' minimum Hilbert amplitude threshold was
determined to be a linear function of the minimum and maximum Hilbert
amplitudes given by
<BR><P></P>
<CENTER>
<IMG 
 WIDTH="135" HEIGHT="27" BORDER="0"
 SRC="img7.png"
 ALT="a + b * ( mid + 1 ) /2">
</CENTER>
<BR CLEAR="ALL">
<P></P>
where <IMG
 WIDTH="32" HEIGHT="15" ALIGN="BOTTOM" BORDER="0"
 SRC="img8.png"
 ALT="$mid$"> = the midpoint of the minimum and maximum amplitudes, 
<IMG
 WIDTH="12" HEIGHT="15" ALIGN="BOTTOM" BORDER="0"
 SRC="img9.png"
 ALT="$a$"> = -0.555 and <IMG
 WIDTH="11" HEIGHT="15" ALIGN="BOTTOM" BORDER="0"
 SRC="img10.png"
 ALT="$b$"> = 1.3.<A NAME="tex2html3"
  HREF="#foot33"><SUP>*</SUP></A> The maximum Hilbert frequency
threshold was fixed at 0.06 Hz. The ranges for the six distribution
parameters giving the best detection ratios of all computer runs were
determined to be:

<P>
<CENTER>
<TABLE BORDER=0>
<TR>
<TD>mean amplitude (normalized)</TD>
<TD>:</TD>
<TD>0.65</TD>
<TD>-</TD>
<TD>2.5</TD>
</TR>
<TR>
<TD>standard deviation of amplitude</TD>
<TD>:</TD>
<TD>0</TD>
<TD>-</TD>
<TD>0.6</TD>
</TR>
<TR>
<TD>mean frequency (Hz)</TD>
<TD>:</TD>
<TD>0.01</TD>
<TD>-</TD>
<TD>0.055</TD>
</TR>
<TR>
<TD>standard deviation of frequency</TD>
<TD>:</TD>
<TD>0</TD>
<TD>-</TD>
<TD>0.01</TD>
</TR>
<TR>
<TD>time above amplitude threshold</TD>
<TD>:</TD>
<TD>0.006</TD>
<TD>-</TD>
<TD>1.0</TD>
</TR>
<TR>
<TD>time within frequency thresholds</TD>
<TD>:</TD>
<TD>0.7</TD>
<TD>-</TD>
<TD>1.0</TD>
</TR>
</TABLE>
</CENTER>

<P>
Finally, to separate subjects with severe OSA from normal subjects, we require
that a minimum of 5% of the total time of the RR interval series be detected
as apnea.

<P>

<H2>Results</H2>

<P>
Applying this technique to the CinC training set, we are able to correctly
classify 26 out of 30 (86.6%) of combined sleep and normal subjects, and
correctly identify the presence or absence of sleep apnea in 13985 out of
a total of 17045 minutes (82.1%) of the data.

<P>
When this technique is applied to the CinC test set, this algorithm correctly
classified 28 out of 30 (93.3%) of the subjects, and correctly identified the
presence or absence of sleep apnea in 14591 out of a total of 17268 minutes
(84.5%) of data from the test set.

<P>

<H2>Discussion</H2>

<P>
By using the Hilbert transformation of the RR interval time series, we have
shown that it is possible to detect prolonged episodes of high-density OSA
from single-lead electrocardiograms with a high degree of accuracy,
discriminating both subjects with OSA and determining the onset and offset
of prolonged high-density OSA. In addition, this technique is able to quantify
both the amplitude of OSA heart rate oscillations and their frequencies.
Improvements in filtering techniques and parameter adjustments may further
increase the efficacy of this technique.

<P>
Although this technique is ineffective in detecting the small number of sleep
apnea subjects who do not exhibit the oscillatory heart rate dynamics
commonly found in prolonged OSA, it may prove to be a cost-effective and
convenient means to screen for OSA and to monitor response to therapy. It
may also be useful in detecting and quantifying other pathologic heart rate
oscillations, such as those found in Cheyne-Stokes syndrome or periodic
breathing at high altitude [6], as well as fetal distress syndromes
[7].

<P>

<H2>Acknowledgements</H2>

<P>
This work was supported in part by grants from NIMH(MH54031),
NCRR(RR13622), the G. Harold and Leila Y. Mathers Charitable Foundation and
The Fetzer Institute. We thank G. B. Moody for helpful discussions.

<P>

<H2>References</H2>

<OL>
<LI>Kobayashi, M. and Musha, T., 1/f fluctuation of heartbeat period.,
<EM>IEEE Trans Biomed Eng</EM>, 29:456-457. 1982.

<LI>Guilleminault, C. and Connolly, S. and Winkle, R. and Melvin, K. and Tilkian, A., 
Cyclical variation of the heart rate in sleep apnoea syndrome. Mechanisms, and usefulness 
of 24 h electrocardiography as a screening technique, <EM>Lancet</EM>, 1:126-131. 1984.

<LI>Ivanov, P. C. h. and Rosenblum, M. G. and Peng, C-K. and Mietus, J. and Havlin, S. 
and Stanley, H. E. and Goldberger, A. L., Scaling behaviour of heartbeat intervals obtained 
by wavelet-based time-series analysis, <EM>Nature</EM>, 383:323-327. 1996. 

<LI>Peng, C-K. and Mietus, J. E. and Liu, Y. and Khalsa, G. and Douglas, P. S. and Benson, 
H. and Goldberger, A. L., Exaggerated heart rate oscillations during two meditation techniques,
<EM>Int J Cardiol</EM>, 70:101-107. 1999.

<LI>PhysioNet: An NIH/NCRR Research Resource for Complex Physiologic Signals. 
http://www.physionet.org

<LI>Lipsitz, L. A. and Hashimoto, F. and Lubowsky, L. P. and Mietus, J. and Moody, G. 
and Appenzeller, O. and Goldberger, A. L., Heart rate and respiratory rhythm dynamics on 
ascent to high altitude, <EM>Br Heart J</EM>, 74:390-396. 1995. 

<LI>Kang, A. H. and Boehm, F. H., The clinical significance of intermittent fetal sinusoidal
heart rate, <EM>Am J Obstet Gynecol</EM>, 180:151-152. 1999. 

<P>

<BR><HR><H4>Footnotes</H4>
<DL>
<DT><A NAME="foot33"
 HREF="#tex2html3"><SUP>*</SUP></A>
<DD>Note: in the original published
version of this paper the values for <IMG
 WIDTH="12" HEIGHT="15" ALIGN="BOTTOM" BORDER="0"
 SRC="img9.png"
 ALT="$a$"> and <IMG
 WIDTH="11" HEIGHT="15" ALIGN="BOTTOM" BORDER="0"
 SRC="img10.png"
 ALT="$b$"> were incorrectly
given as <IMG
 WIDTH="12" HEIGHT="15" ALIGN="BOTTOM" BORDER="0"
 SRC="img9.png"
 ALT="$a$"> = 0.3 and <IMG
 WIDTH="11" HEIGHT="15" ALIGN="BOTTOM" BORDER="0"
 SRC="img10.png"
 ALT="$b$"> = 1.85.

</DL>

<hr>
<!--#include virtual="/footer.shtml"-->
</BODY>
</HTML>