Content uploaded by Khaled Elleithy
Author content
All content in this area was uploaded by Khaled Elleithy on Jun 07, 2016
Content may be subject to copyright.
International Journal of
Intelligent Systems and
Applications in Engineering
Advanced Technology and Science
ISSN:2147-67992147-6799 www.atscience.org/IJISAE
Original Research Paper
This journal is © Advanced Technology & Science 2013 IJISAE, 2016, 4(1), 1–4 |
SVM-Based Sleep Apnea Identification Using Optimal RR-Interval
Features of the ECG Signal
Laiali Almazaydeh 1, Khaled Elleithy 2, Miad Faezipour 3 , Helen Ocbagabir 4
Accepted 15th August 2014 DOI: 10.18201/ijisae.7907510.1039/b000000x
Abstract: Sleep apnea (SA) is the most commonly known sleeping disorder characterized by pauses of airflow to the lungs and often
results in day and night time symptoms such as impaired concentration, depression, memory loss, snoring, nocturnal arousals, sweating
and restless sleep. Obstructive Sleep Apnea (OSA), the most common SA, is a result of a collapsed upper respiratory airway, which is
majorly undiagnosed due to the inconvenient Polysomnography (PSG) testing procedure at sleep labs. This paper introduces an
automated approach towards identifying sleep apnea. The idea is based on efficient feature extraction of the electrocardiogram (ECG)
signal by employing a hybrid of signal processing techniques and classification using a linear-kernel Support Vector Machine (SVM).
The optimum set of RR-interval features of the ECG signal yields a high classification accuracy of 97.1% when tested on the Physionet
Apnea-ECG recordings. The results provide motivating insights towards future developments of convenient and effective OSA screening
setups.
Keywords: sleep apnea, PSG, ECG, RR interval, features extraction, SVMs.
1. Introduction
Sleep is the circadian rhythm which is among the most crucial
needs in our day to day activities. On average, humans spend
approximately one-third of their lifespan sleeping. Getting
enough hours of sleep indicate repaired blood pressure, heart rate,
and relaxed muscles and tissues [1].
A sleeping disorder occurs when one cannot sleep and has
symptoms like excessive daytime sleepiness and fatigue. Sleep
Apnea (SA) is among the very common respiratory sleeping
disorders characterized by cessations of airflow to the lungs or
having a very low breath. The cessations lasting in more than 10
seconds considered as apnea event might occur 5 to 30 times in
an hour and up to 400 per night [2]. Clinically, sleep apnea is
divided into Obstructive Sleep Apnea (OSA) and Central Sleep
Apnea (CSA). OSA, being the most common SA, is generally
caused by a collapse of the upper respiratory airway. CSA is a
neurological condition where brain fails to appropriately control
breathing [3] [4].
Statistics show that out of 18 million Americans suffering from
OSA, around 10 million remain undiagnosed [5]. The
undiagnosed cases are due to inconvenience, expenses and
unavailability of testing. The Polysomnography (PSG) is the
current and traditional testing process which is a standard
procedure ordered for all sleep disorders. This testing records the
breath airflow, respiratory movement, oxygen saturation, body
saturation, body position, electroencephalogram (EEG),
electroculogram (EOG), electromyogram (EMG), and
electrocardiogram (ECG) to determine the sleep stages [6].
To summarize, PSG needs to be replaced by more convenient
detection methods and faster treatment. In this regard, we present
the fully automated identification of the apnea periods based on
Support Vector Machines (SVMs) using the RR-interbeat interval
series in ECG signal that will be used in a larger real time system
for SA diagnosis. The objective of the system is to alert a patient
who might be subject to an apnea attack.
This paper is organized as follows. In Section II, we glance at a
variety of sleep apnea detection methods. In section III, the
methodology of our proposed system is described. Section IV
demonstrates the results of our system. Finally, we conclude our
paper in section V, and highlight some directions for future
research.
2. Related Works
Over the past few years, most of the related research has focused
on detecting OSA through statistical features of different signals
such as thorax and abdomen effort signals, nasal air flow, oxygen
saturation, electrical activity of the heart (ECG), and electrical
activity of the brain (EEG).
In our previous published research, we developed a Neural
Network (NN) as a predictive tool for OSA using oxygen
saturation signal (SpO2) measurements obtained from pulse
oximetry [7].
Many studies perform detection of OSA through heart rate
variability (HRV) and the ECG signal. Quiceno-Manrique et al.
[8] proposed a simple diagnostic tool for OSA with a high
accuracy (up to 92.67%) using time-frequency distributions and
dynamic features in ECG signal. Moreover, based on spectral
components of heart rate variability, frequency analysis was
performed in [9] using Fourier and Wavelet Transformation with
appropriate application of the Hilbert Transform, where the
sensitivity was 90.8%. In addition, in [10] a bivariate
_______________________________________________________________________________________________________________________________________________________________
1 Department of Software Engineering, Al Hussein Bin Talal University,
Jordan
2,3,4 Department of Computer Science and Engineering, University of
Bridgeport, CT 06604, USA
* Corresponding Author:email: lalmazay@my.bridgeport.edu
# This paper has been presented at the International Conference on
Advanced Technology&Sciences (ICAT'14) held in Antalya (Turkey),
August 12-15, 2014.
IJISAE, 2016, 4(1), 1-4 This journal is © Advanced Technology & Science 2013
autoregressive model was used to evaluate beat-by-beat power
spectral density of HRV and R peak area, where the classification
results showed accuracy higher than 85%.
During periods of prolonged OSA, cyclic increases and decreases
of heart rate are typically associated with the apneic phase and the
resumption of breathing [11]. Therefore, the technique in this
work also relies on features of the ECG signal to detect and
quantify these periods of OSA by the fully automated
identification of these dynamic features in the RR-interbeat
interval series based on the ones suggested by Chazal et al. [6],
and Yilmaz et al. [12].
3. Proposed Methodology
In this work, the overall design involves acquiring the ECG
signal. This signal is then processed to cancel the noise and detect
RR-interval. Then, a combination of the most effective set of RR-
interval based features of the ECG signal is calculated for
classification. In what follows, our detection system design is
described and shown in Figure 1.
Figure 1. Schematic diagram of the system
3.1. Database
In this work, the overall design involves acquiring the ECG
signal. This signal is then processed to cancel the noise and detect
RR-interval. Then, a combination of the most effective set of RR-
interval based features of the ECG signal is calculated for
classification. In what follows, our detection system design is
described and shown in Figure 1.
A. Database
The database used in this study is available from the PhysioNet
web site [13]. The Apnea-ECG Database contains 70 recordings,
containing a single continuous ECG signal varying in length of
approximately 8 hours duration. The sampling frequency of ECG
signal is 100 Hz, with 16-bit resolution, with one sample bit
representing 5μV [6].
The database was scored by clinical experts by dividing the
recordings into a set of one-minute segments. The segments were
classified as “apnea”, if at any time during that minute there was
evidence of SA on the basis of respiration and oxygen saturation.
Otherwise, it was classified as “normal” [6].
3.2. Noise cancellation and R Wave detection
SA episodes consist of bradycardia during apnea followed by
tachycardia upon its cessation, which represent cyclic variations
in the duration of a heartbeat, also known as RR intervals of ECG
signal [6].
Generally, the ECG sleep apnea recognition techniques used have
two parts: characteristics (or features) extraction, and waveform
classification and recognition [14].
The characteristics extraction includes noise cancellation and
QRS complex wave detection. The R-wave which has the highest
(or lowest) value in the QRS complex wave is the outstanding
characteristic of the ECG signal.
The R-wave detection technique used in this paper is a modified
version of the traditional “Pan and Tompkins” algorithm [15]
with the use of adaptive filters in noise cancellation. The whole
algorithm is divided into five-steps; noise cancellation using
adaptive filtering, signal slope detection, squaring, windowing,
and RR-wave interval calculation.
1) Adaptive Filtering: The Least Mean Square adaptive algorithm
is one of the most robust techniques used to reduce any random
noise signal interfaced to the ECG. A step size of 0.8×10-5 and
filter length of 106 can be used to cancel any noise added to the
recorded ECG.
2) Signal Slope Detection: A differentiator is used to compute the
QRS complex slope waveform information. A five point
derivative is used with the following transfer function:
)22)(8/1()( 2112 ZzzzTzH
(1)
The difference equation is:
)]2()(2)(2)2()[8/1()( TnTxTnTxTnTxTnTxTnTy
(2)
3) Squaring: The point by point squaring function is described by
the following equation:
2
)]([)( nTxnTy
(3)
This results in positive data points and also performs nonlinear
amplification of the differentiated ECG frequencies.
4) Windowing: Additional waveform features are calculated by a
moving-window integration equation given by:
(4))]()....)2(
())1(()[/1()(
nTxTN
nTxTNnTxNnTy
Where N is the number of samples in the width of the integration
window. For a sample rate of 200, window of 30 samples wide...
5) RR wave interval calculation: Automatically adjustable
thresholds to float over the noise are applied to the integrated
wave form. The applied set of thresholds are calculated from:
SPKPEAKSPK 875.0125.0
(5)
(if PEAK is the signal peak)
NPKPEAKNPK 875.0125.0
(6)
(if PEAK is the noise peak)
)(25.01 NPKSPKNPKTHRESHOLD
(7)
15.02 THRESHOLDTHRESHOLD
(8)
In the above equations, all the variables refer to the integration
waveform: PEAK is the overall peak, SPK is the running estimate
of the signal peak, NPK is the running estimate of the noise peak,
THRESHOLD1 is the first threshold applies, and THRESHOLD2
is the second threshold applied. Every time a peak is recognized,
a QRS complex is identified in the filtered and integrated
waveform. The RR average is then given by taking the mean of
the eight most recent consecutive RR intervals.
)...(125.0 67 nnnAVERAGE RRRRRRRR
(9)
3.3. Feature Extraction
Our technique relies on a large set of an effective combination of
ECG signal features. These features could potentially be used for
classification. The features considered are a novel hybrid of
features extracted from [6] and [12]. The following are the most
effective set of RR-interval based features of the ECG signal for
apnea detection:
Mean epoch and recording RR-interval.
Standard deviation of the epoch and recording RR-interval.
The NN50 measure (variant 1), defined as the number of
pairs of adjacent RR-intervals where the first RR-interval
exceeds the second RR-interval by more than 50 ms.
The NN50 measure (variant 2), defined as the number of
pairs of adjacent RR-intervals where the second RR-interval
exceeds the first RR interval by more than 50 ms.
Two pNN50 measures, defined as each NN50 measure
divided by the total number of RR-intervals.
The SDSD measures, defined as the standard deviation of
the differences between adjacent RR-intervals.
The RMSSD measures, defined as the square root of the
mean of the sum of the squares of differences between
adjacent RR-intervals.
Median of RR-intervals.
Inter-quartile range, defined as difference between 75th and
25th percentiles of the RR-interval value distribution.
Mean absolute deviation values, defined as mean of absolute
values obtained by the subtraction of the mean RR-interval
values from all the RR-interval values in an epoch.
3.4. Data Randomization
Since apnea is defined as a pause in breathing, and can last from a
few seconds to minutes (almost >=10 sec), we investigate and
analyze three cases of data partitioning to determine the best
accuracy that can be achieved. The apnea and regular data are
partitioned into 10sec, 15sec, and 30 sec pieces. In this step, we
separate the training data and testing data with 80% for
training and 20% for testing. A MATLAB built-in function
(rand) is used to determine whether a feature set in 10sec, 15 sec
or 30 sec of data belongs to test group or rule creation group.
After the signals are separated, we perform the training for
SVMs. Table 1. 10 sec. (Accuracy is 86.1%)
Input\Output
Regular
Apnea
Regular
97.2%
2.78%
Apnea
25%
75%
Table 2. 15 sec. (Accuracy is 96.5%)
Input\Output
Regular
Apnea
Regular
100%
0%
Apnea
7.1%
92.9%
Table 3. 30 sec. (Accuracy is 95%)
Input\Output
Regular
Apnea
Regular
100%
0%
Apnea
10%
90%
3.5. Data Randomization
In order to investigate apneic epoch detection, we use SVMs as a
classification method. SVM is one of a powerful machine
learning technique from supervised learning category, which used
as a training algorithm for analyzing data and recognizing
patterns. When we have two classes of data, SVM performs
classification by building a maximal margin hyperplane that
optimally separates the data into two groups. In general, the
larger the margin is, the lower the generalization error of the
classifier. SVM handles the separation by using a kernel function
to map the data into a different space with a hyperplane. There
are many kernels available for SVM, which provides flexibility
for the constructed hyperplane to partition the data [4]. In our
implementation, we use a linear kernel function to map the
training data into kernel space. In the optimization process, we
use a method called sequential minimal optimization to find the
separating hyperplane.be
4. Results
To build our model, we used MATLAB toolset. The data records
were imported as MATLAB matrices (.mat) from physionet web
site. We evaluated the effectiveness of our model on the Apnea
ECG database, using different records available in that database.
We ran two scenarios in our experiment: the whole combination
of the features, and a combination of every two separate features.
4.1. All Features
To evaluate the performance of the classification system, two
statistical indicators, Sensitivity (Se) and Specificity (Sp) in
addition to the Accuracy (Acc) have been used. The sensitivity of
a test is the percentage of patients in the OSA positive group
correctly diagnosed, whereas the specificity is the percentage
of subjects in the OSA negative group correctly classified by
the test.
Tables I, II and III show the classification results with all
extracted features for the three cases mentioned in the data
partitioning step. Our model was based on a linear kernel SVM
using set of RR-interval features of the ECG signal. The three
cases used here are: (i) 10 sec, (ii) 15 sec, and (iii) 30 sec. The
accuracy of our approach is 86.1%, 96.5%, and 95%,
respectively. From Table II, SVM with linear kernel using 15
second epochs shows the best classification accuracy with high
successful rate of correct prediction.
4.2. Every Two Separate Features
The idea here is to reduce the feature set for classification for less
processing, while simultaneously maintaining high classification
accuracy. In this part of analysis, the 15 sec data are used. The
analysis randomly selected 80% of normal data and randomly
selected 20% of apnea data. The program has a for loop to run the
training and classification process for 10 times to take the average
value.
Table IV shows the classification accuracy results for the
combination set of every two features. From the table we can
conclude that the best two feature-combinations are 25 and 75
percentiles of RR interval along with the mean absolute value
IJISAE, 2016, 4(1), 1-4 This journal is © Advanced Technology & Science 2013
feature, yielding a high degree of accuracy, approximately 97.1%.
5. Conclusion
In this work, we studied the possibility of the detection of SA
events from the ECG signal variation patterns. We evaluated the
effectiveness of our model on the Apnea ECG database, using
different records available in that database.
Our model was based on a selective set of RR-interval based
features that were given to SVM for classification. We evaluated
our model on three different epoch lengths and different
combination of two-features set scenarios. From the
experimental results, we conclude that SVM with linear kernel
shows the best accuracy with 15 second epoch length. Two
optimum features were also derived from statistical analysis. A
future direction to this work would be incorporating this work
into a real time monitoring system that acquires and analyzes the
ECG signal of subjects during sleep.
References
[1] W. Mendelson, Human Sleep: Research and Clinical
Care. Plenum Medical Book Company, New York and
London.
[2] Sleep Disorders Guide. www.sleepdisorderguide.com.
[3] S. Isa, M. Fanany, W. Jatmiko and A. Arymurthy,
"Sleep Apnea Detection from ECG Signal, Analysis on
Optimal Features, Principal Components, and
Nonlinearity," in Proceedings of the 5th IEEE
International Conference on Bioinformatics and
Biomedical Engineering (iCBBE), pp. 1-4, May 2011.
[4] L. Almazaydeh, K. Elleithy, and M. Faezipour,
"Detection of obstructive Sleep Apnea through ECG
Signal Features," in Proceedings of the 2012 IEEE
International Conference on Electro Information
Technology (IEEE eit2012), pp. 1-6, May 2012.
[5] SleepMedInc. www.sleepmed.md.
[6] P. Chazal, T. Penzel and C. Heneghan, "Automated
Detection of Obstructive Sleep at Different Time Scales
Using the Electrocardiogram," Institute of Physics
Publishing, Vol. 25, no. 4, pp. 967-983, Aug 2004.
[7] L. Almazaydeh, M. Faezipour, and K. Elleithy," A
Neural Network System for Detection of Obstructive
Sleep Apnea through SpO2 Signal fFeatures," in
International Journal of Advanced Computer Science
and Applications, (IJACSA) , vol. 3, no. 5, pp. 7-11,
Jun. 2012.
[8] Q. Manrique, A. Hernandez, T. Gonzalez, F. Pallester
and C. Dominquez," Detection of Obstructive Sleep
Apnea in ECG Recordings Using Time-Frequency
Distributions and Dynamic Features," in Proceedings of
the IEEE International Conference on Engineering in
Medicine and Biology Society (EMBS 2009), pp. 5559-
5562, Sep. 2009.
[9] M. Schrader, C. Zywietz, V. Einem, B. Widiger, G.
Joseph, "Detection of Sleep Apnea in Single Channel
ECGs from the PhysioNet Data Base," Computers in
Cardiology 2000, vol. 27, pp. 263-266, Sep. 2000.
[10] M. Mendez, D. Ruini, O. Villantieri, M. Matteucci, T.
Penzel and A. Bianchi, "Detection of Sleep Apnea from
Surface ECG Based on Features Extracted by an
Autoregressive Model, " in Proceedings of the IEEE
International Conference on Engineering in Medicine
and Biology Society (EMBS 2007), pp. 6105-6108,
Aug. 2007.
[11] JE. Mietus, CK. Peng, P Ch. Ivanov and AL.
Goldberger, "Detection of Obstructive Sleep Apnea
from Cardiac Interbeat Interval Time Series,"
Computers in Cardiology 2000, vol. 27, pp. 753-756,
2000.
[12] B. Yilmaz, M. Asyali, E. Arikan, S. Yektin and F.
Ozgen, "Sleep Stage and Obstructive Apneaic Epoch
Classification Using Single Lead ECG," in Biomedical
Engineering Online, vol. 9, 2010.
[13] PhysioNet, www.physionet.org.
[14] R. Lee, I. Chou, C. Lai, M. Liu and M. Chiu, "A Novel
QRS Detection Algorithm Applied to the Analysis for
Heart Rate Variability of Patients with Sleep Apnea," in
Biomedical Engineering Applications, Basis &
Communications, vol. 17, no. 5, pp. 44-48, Oct. 2005.
[15] J. Pan and W. Tompkins, "A Real-Time QRS Detection
Algorithm," in IEEE Transactions on Biomedical
Engineering, vol. BME-32, no. 3, pp. 230-236, Mar.
1985.
Table 4. Classification accuracy of the combination of every two different features.