Engineering, 2013, 5, 259-263
http://dx.doi.org/10.4236/eng.2013.510B054 Published Online October 2013 (http://www.scirp.org/journal/eng)
Copyright © 2013 SciRes. ENG
Sleep Apnea Detection Using Adaptive Neuro Fuzzy
Inference System
Cafer Avci1, Gökhan Bilgin2
1Department of Computer Engineering, Yalova University, Yalova, Turkey
2Department of Computer Engineering, Yildiz Technical University, Istanbul, Turkey
Email: cafer.avci@yalova.edu.tr, gbilgin@yildiz.edu.tr
Received June 2013
ABSTRACT
This paper presents an efficient and easy implemented met h od for detecting minute based analysis of sleep apnea. The
nasal, chest and abdominal based respiratory signals extracted fro m polysomnography recordings are obtained from
PhysioNet apnea -ECG database. Wavelet transforms are applied on the 1-minute and 3-minute length recordings. Ac-
cording to the preliminary tests, the variances of 10 th and 11th detail components can be used as discriminative features
for apneas. The features obtained from total 8 recording s are used fo r training and testing of an adaptive neuro fuzzy
inference system (ANFIS). Training and testing process have been repeated by using the randomly obtained five differ-
ent sequences of whole data for generalization of the ANFIS. According to results, ANFIS based classification has suf-
ficient accuracy for apnea detection considering of each type of respiratory. However, the best result is obtained by
analyzing the 3-minute length nasal based respiratory signal. In this study, classification accuracies have been obtained
greater than 95.2% for each of the five sequences of entire data.
Keywords: Sleep Apnea; Wavelet Decomposition; Adaptive Neuro Fuzzy Inference System
1. Introduction
Sleep apnea is a common respiratory disorder that affects
people by stopping breathing during their sleep [1]. It is a
crucial problem occurred approximately 4% in men and
2% in women of the people between the ages of 30 and
60 years [2]. A sleep apnea episode is defined as the
complete disruption or near disruption of breathing mor e
than 10 s in an adult [3]. Patients with sleep apnea could
suffer from daytime sleepiness, tiredness, low concentra-
tion and exh austion [4].
Currently, analysis of the patient’ s polysomnography
(PSG) is con s idered as the effective diagnosis of the
sleep apnea [5]. PSG requires overnight recordings of
several electrophysiological signals during a night’s
sleep such as electrocardiogram, respiratory effort, air-
flow, etc. in sleep laboratories using specific systems and
participating personnel [6]. To derive respiration from
electrocardiography (ECG) which is a simpl e, low cost
and non-invasive recording is an alternative way. The
correctness of such an idea using the comparison exam-
ple recordings of the ECG derived respiration (EDR)
with common respiration measurements are showed in
Moody et al. work [7]. Thus, different methods have
been proposed to derive respiratory signal from the ECG
[8-10]. Numerous studies show that EDR methods using
the band-pass filter application can be accepted as the
most successful methods in the field of apnea detection
[11,12].
Numerous methods are available in the literature to
detect sleep apnea based on the evaluation of PSG
[13-16]. These methods are most ly based on analysis of
the frequency and amplitude. These algorithms can de-
tect sleep apnea at 80% - 90% precision [17]. There are
several algorithms for the detection of sleep apnea based
on the evaluation of the EDR signals [18-20].
The aim of this work is to evaluate the performance of
the sleep apnea detection methods based on the analysis
of the EDR signal and respiratory signals. Features ob-
tained by wavelet decomposition of derived and meas-
ured signals are classified by an AN F IS for real time
sleep apnea detections. Preliminary research in the field
of PSG is mad e by authors [21].
This paper presents new results for detection of sleep
apnea using wavelet analysis with adaptive neuro fuzzy
inference system. In Section 2, materials and methods are
introduced including brief data description, derivation of
EDR, wavelet based feature extraction and ANFIS clas-
sification method. Experimental results are discussed in
Section III and the paper will be concluded in Section IV
with summarized results.
C. AVCI, G. BILGIN
Copyright © 2013 SciRes. ENG
260
2. Materials and Methods
For the evaluation of the proposed algorithm, PSG re-
cordings of 8 sleep apnea subjects were used. Recording
were acquired from Apnea-EC G database in the Physio-
Net databank. It is an online library of physiologic data
and analytic tool sponsored by the US National Institutes
of Health [22].
2.1. Data
The free distribution Apnea-ECG Database was used to
evaluate our approach in this study, combined for the
PhysioNet/Computers in Cardiology Challenge 2000 [19 ].
The database contains 70 ECG recordings, sampled at
100 Hz, approximately 8 hours long each, with append-
ing annotations acquired from a study of simultaneously
recorded respiration signals. Only 8 of them include res-
piration signals (age: 43.3 ± 8.3 years, 7 M and 1F). The
apnea annotation in the recordings was done by sleep
disorder experts using standard criteria with respiratio n
signals analysis (nasal airflow, abdominal and oxygen
saturation). So, each minute of the recording has label as
‘A’ or ‘N’ and it indicates the existence or non-existence
of apnea respectively during that min .
A minute is classified as apneic if apnea was in ad-
vance at the beginning of the related minute; otherwise, it
is classified as nor mal . The apnea/hypopnea standards
(AHI) are used to classify a minute as apneic or norma l
by calculating the number of apneic minutes over a given
recording and averaging these counts on a per-hour basis
[23].
2.2. Derivation of EDR
EDR sign a l is derived using band-pass filter method over
the ECG signal in the respiratory frequency band for the
first time (normally 0.2 - 0.4 Hz). Boyle et al. [24] spec-
ify that a band-pass filter of 0.2 - 0.8 Hz provides a more
accurate respiratory signal than a band-pass filter of 0.2 -
0.4 Hz. Therefo re, EDR signal is derived from 1-minute
and 3 minutes length ECG recording by using a band-
pass filter of 0.2 - 0.8 Hz .
2.3. Feature Extraction by Wavelet Analysis
Wavelet transform is a practical computational method
for a several image and signal processing implementa-
tions. Wavelet transform uses multi-resolution technique
and breaks the signal into low and high frequency [25,
26]. Wavelet is a linear, quick transform with the idea of
describing a time scale show of a signal by decomposing
it onto a set of basic functions. These functions are suit-
able for the analysis of non-stationary signals because of
synchronic localization in t ime and scale [27]. For a
given signal x(t), wavelet decomposition is given as be-
low:
( )
( )
( )
,
/2
,
1
2
22
N
Nk
k
Njj
jk
jk
xtct k
d tk
ϕ
ψ
+∞
=−∞
−−
= =−∞
= −
+−
∑∑
(1)
In (1),
,Nk
c
is approximation coefficients at level N
and, (j = 1, …, N) is detail coefficien ts at level j. The
function
()t
ψ
is the wavelet function and
()t
ψ
is a
scaling function [28 ].
So me different types of wavelets functions can be used
to obtain the decomposition. Empirically, it was specified
that the best classification result was obtained in this
work by using the variances of the level-10 and level-11
detail coefficients. In spite of experimentation using dif-
ferent wavelet famil y and detail coefficients at different
levels, the results were prominently worse. Daubechies
[29] wavelet is selected to decomposition with length of
the filter equal to 3.
2.4. ANFIS Based Classification
ANFIS model has been used as a classifier in this wor k.
ANFIS is a classifier like a neural network that uses
fuzzy inference system. ANFIS concatenates fuzzy logic
principles and neural networks. ANFIS has a set of fuzzy
if-then rules with suitable member sh ip functions to gen-
erate the input-output values. ANFIS is a hybrid classi-
fier that uses a learning algorithm to specify parameters
of Sugeno-type fuzzy inference systems. It implies both
of the least-square method and the back-propagation gra-
dient descent method for training fuzzy inference system
membership function parameters.
ANFIS consists of five layers to generate inference
system. These layers are fuzzification layer, inferences
process, defuzzification layer and summation layer, re-
spectively. Typical architecture of ANFIS is shown by
Figure 1. Feature values are given as input to be fuzzy-
fied in Layer I. Then, values are used in inference
process in Layer II and III where rules applied. Output
values are calcu lated for each related rules in L ayer IV .
Finally, in Layer V, all of the output values from the
Layer IV are summed up to take one final output. Train-
Figure 1. ANFIS architecture.
C. AVCI, G. BILGIN
Copyright © 2013 SciRes. ENG
261
ing and testing process have been repeated by using the
randomly generated 5 different sequences from whole
data for generalization of the ANFIS.
3. Experimental Results
Feature vectors as 1-minute and 3-minute sections were
extracted from datasets. Totally 3235 and 32,191-minute
and 3-minute based feature vectors were obtained using
annotations of the data sets. By using the randomly ob-
tained 5 different sequences of the data set with its re-
lated outputs which are annotated originally, ANFIS has
been for med and trained for each of data sequences. The
classification accuracies due to the obtained 1-minute
and 3-minute based c lassification results for chest, nasal
and abdominal respiratory signals are given in Tables 1
and 2, respectively.
According to the results given in Table 1, abdominal
respiratory signal based classification has the best per-
formance. Due to the results given in Table 2, nasal res-
piratory signal based c lassification has the best perfor-
mance. However, chest respiratory signal based classifi-
cation has the lowest accuracy values for both of the
1-minute and 3-minute based classification.
4. Discussion and Conclusion
In this study, an efficient and easy implementation me-
thod for detecting minute based analysis of sleep apnea
has been proposed. The nasal, chest and abdo minal bas ed
respiratory signals extracted from polysomnography re-
cordings have been obtained from PhysioNet apnea-ECG
database. Wavelet transforms have been applied on the
1-minute and 3-minute length recordings. According to
the preliminary tests, the variances of 10th and 11th detail
components can be used as discriminative features for
apneas. The features obtained from total 8 recordings
have been used for training and testing of an adaptive
neuro fuzzy inference system (ANFIS). Training and
testing process have been repeated by using the randomly
obtained five different sequences of whole data for ge-
neralization of the ANFIS. According to results, ANFIS
based classification has sufficient accuracy for apnea
detection considering of each type of respiratory. How-
ever the best result has been obtained by analyzing the
3-minute length nasal based respiratory signal. In this
study, classification accuracies have been obtained
greater than 95.2% for each of the five sequences of en-
tire data. Due to the results of the 1-minute based analy-
sis, the classification accuracies of ANFIS have obtained
between 80.6% - 81.5%, 89.2% - 90.9%, 90.8% - 92.9%
and 88.6% - 90.4% respectively for the chest, nasal, ab-
dominal respiratory and EDR signals. For the analysis of
3-minute length data, the classification accuracies have
obtained between 84.8% - 86.5%, 95.2% - 96.5%, 93.4%
- 95.4% and 92.0% - 94.0%, respectively. According to
these results, both of the 1-minute and 3-min ut e length of
chest, nasal, abdominal based respiratory and EDR sig-
nals can be used sufficiently for proposed method. How-
ever the best result can be obtained by analyzing the sec-
tion of the 3-minute le ng th nasal based respiratory
Table 1. ANFIS based classification accuracies for the analysis of 1-minute length signal.
Dataset
Classification Accuracies (%)
Chest Nasal Abdominal EDR
train test train test train test train test
X1 80.9 80.4 89.9 89.8 91.9 91.4 89.3 89.0
X2 81.4 81.0 90.9 90.8 92.9 91.9 90.4 90.1
X3 81.1 80.8 89.7 89.5 90.8 91.5 89.9 89.4
X4 81.5 81.2 89.3 89.2 92.4 92.1 88.9 88.6
X5 80.7 80.6 89.6 89.4 91.5 91.3 89.4 89.0
Table 2. ANFIS based classification accuracies for the analysis of 3-minute length signal.
Dataset
Classification Accuracies (%)
Chest Nasal Abdominal EDR
train te st train test train test train test
X1 85.5 85.1 95.2 95.7 95.4 93.9 93.5 92.0
X2 85.4 85.7 95.5 95.3 93.4 93.4 93.6 93.4
X3 86.2 84.8 96.5 95.9 93.7 94.0 93.4 92.7
X4 86.5 85.0 95.7 95.6 93.8 93.8 93.3 92.7
X5 85.3 85.2 96.2 96.1 94.3 93.7 94.0 93.5
C. AVCI, G. BILGIN
Copyright © 2013 SciRes. ENG
262
signal. Due to the results given in Tables 1 and 2; all the
accuracy scores related to the data sets X1-X5; the
trained ne twork is a generalized network that can be used
for sleep apnea detection. As a future work, it is planned
to develop a new diagnosing method for sleep apnea us-
ing different classifiers and feature extraction methods.
REFERENCES
[1] C. Guilleminault, J. van den Hoed and M. Mitler, “Clini-
cal Overview of the Sleep Apnea Syndromes,” In: A. R.
Liss, Ed., Sleep Apnea Syndromes, New York, 1978, pp.
1-11.
[2] T. Young, M. Palta, J. Dempsey, et al., “The Occurrence
of Sleep Disordered Breathing among Middle-Aged
Adults,” The New England Journal of Medicine, Vol. 328,
1993, pp. 1230-1235.
http://dx.doi.org/10.1056/NEJM199304293281704
[3] American Academy of Sleep Medicine, “Sleep Related
Breathing Disorders in Adults: Recommendations for
Syndrome Definition and Measurement Techniques in
Clinical Research ,” Sleep, Vol. 22, 1999, pp. 667-689.
[4] T. Young, P. E. Peppard and D. G. Gottlier, “Epidemiology
of Obstructive Sleep Apnea, a Population Health Perspec-
tive,” American Journal of Respiratory and Critical Care
Medicine, Vol. 165, 2002, pp. 1217-1239.
http://dx.doi.org/10.1164/rccm.2109080
[5] M. Cabrero-Canosa, E. Hernandez-Pereira and V. Mo-
ret-Bonillo, “Intelligent Diagnosis of Sleep Apnea Syn-
drome,” Engineering in Medicine and Biology Magazine,
Vol. 23, No. 2, 2004, pp. 72-81.
http://dx.doi.org/10.1109/MEMB.2004.1310978
[6] A. H. Khandoker, J. Gubbi and M. Palaniswami, “Auto-
mated Scoring of Obstructive Sleep Apnea and Hypopnea
Events Using Short-Term Electrocardiogram Recordings,
IEEE Transactions on Information Technology in Biome-
dicine, Vol. 13, No. 6, 2009, pp. 1057-1067.
http://dx.doi.org/10.1109/TITB.2009.2031639
[7] G. B. Moody, R. G. Mark, A. Zoccola and S. Mantero,
Derivation of Respiration Signa l from Multi-Lead ECGs,”
Computers in Cardiology, 1985, pp. 113-116.
[8] C. O’Brien and C. Heneghan, A comparison of Algo-
rithms for Estimation of a Respiratory Signal from the
Surface Electrocardiogram,” Computers in Biology and
Medicine, Vol. 37, 2007, pp. 305-314.
http://dx.doi.org/10.1016/j.compbiomed.2006.02.002
[9] J. E. Mietus, C. K. Peng, P. Ch. Ivanov and A. L. Gold-
berger, “Detection of Obstructive Sleep Apnea from Car-
diac Interbeat Interval Time Series,” IEEE Computers in
Cardiology, Vol. 27, 2000, pp. 75 3-756.
[10] M. O. Mendez, D. D. Ruini, O. P. Villantieri, M. Mat-
teucci, T. Penzel, S. Cerutti and A. M. Bianchi, “Detec-
tion of sleep Apnea From Surface ECG Based on Fea-
tures Extracted by an Autoregressive Model,” Annual In-
ternational Conference of the IEEE Engineering in Medi-
cine and Biology SocietyEMBC, Lyon, 2007, pp. 6105-
6108.
[11] D. Cysarz, R. Zerm, H. Betterma n, M. Frühwirth, M.
Moser and M. Kröz, “Comparison of Respiratory Rates
Derived from Heart Rate Variability, ECG Amplitude,
and Nasal/Oral Airflow Ambulatory Single-Lead ECG,”
Annals of Biomedical Engineering, Vol. 36, No. 12, 2008,
pp. 2085-2094.
http://dx.doi.org/10.1007/s10439-008-9580-2
[12] C. Avcı, S. Beşli and A. Akbaş, “Performance of the EDR
Methods; Evaluations Using the Mean and Instantaneous
Respiratory Rates,” The 5th International Conference on
Bioinformatics and Biomedical Engineering, Wuhan,
10-12 May 2011.
[13] L. J. Epstein, D. Kristo and P. J. Strollo, “Clinical Guide-
line for the Evaluation, Management and Long-Term
Care of Obstructive Sleep Apnea in Adults,” Journal of
Clinical Sleep Medicine, Vol. 5, No. 3, 2009, pp. 263-
276.
[14] F. C. Yen, K. Behbeha ni, E. A. Lucas, J. R. Burk and J. R.
Axe, “A Noninvasive Technique for Detecting Obstruc-
tive and Central Sleep Apnea,” IEEE Transaction on
Biomedical Engineering, Vol. 44, No. 12, 1997, pp. 1262-
1268. http://dx.doi.org/10.1109/10.649998
[15] American Sleep Disorders Association Task Force, The
Chicago Criteria for Measurements, Definitions, and Se-
verity of Sleep Related Breathing Disorders in Adults,”
Associated Professional Sleep Societies Conference, New
Orleans, 1998.
[16] M. E. Tagluk and N. Sezgin , “Classification of Sleep
Apnea through Sub-band Energy of Abdominal Effort
Signal Using Wavelets + Neural Networks,” Journal of
Medical Systems, Vol. 34, No. 6, 2010.
http://dx.doi.org/10.1007/s10916-009-9330-5
[17] J. R. Stradling, “New Approaches to Monitoring Sleep-
Related Breathing Disorders,” Sleep, Vol. 18, No. 3, 1996,
pp. 77-84.
[18] P. Várady, T. Micsik, S. Benedek and Z. Benyó, “A Nov-
el Method for the Detection of Apnea and Hipopnea
Events in Respiration SignalsTransactions on Biomedi-
cal Engineering, Vol. 49, No. 9, 2002, pp. 936-942.
http://dx.doi.org/10.1109/TBME.2002.802009
[19] J. Y. Tia n and J. Q. Liu “Apnea Detection Based on Time
Delay Neural Network,” The 27th Annual International
Conference of the IEEE Engineering in Medicine and Bi-
ology Society, Shanghai, September 2005, pp. 2571-2574.
[20] L. S. Correa, E. Laciar, V. Mut, A. Torres and R. Jane,
Sleep Apnea Detection Based on Spectral Analysis of
Three ECG—Derived Respiratory Signals,” A nnual In-
ternational Conference of the IEEE Engineering in Medi-
cine and Biology Society, 3-6 September 2009, pp. 4723-
4726.
[21] C. Avcı and A. Akbaş, Comparison of the ANN Based
Classification accuracy for Real Time Sleep Apnea De-
tection Methods,” The 9th International Conference on
Biomedical Engineering (BIOMED 2012), Innsbruck, 15-
17 February 2012.
[22] A. L. Goldberger, L. A. N. Amaral, L. Glass, J. M.
Hausdorff, P. Ch. Ivanov, R. G. Mark, J. E. Mietus, G. B.
Moody, C.-K. Peng and H. E. Stanley, “PhysioBank,
PhysioToolkit, and PhysioNet: Components of a New
Research Resource for ComplexPhysiologic Signals,”
C. AVCI, G. BILGIN
Copyright © 2013 SciRes. ENG
263
Circulation, Vol. 101, No. 23, 2000, pp. e215-e220.
http://circ.ahajournals.org/cgi/content/full/101/23/e215
[23] W. R. Ruehland, P. D. Rochford, F. J. O’Donoghue, R. J.
Pierce, P. Singh and A. T. Thornton, “The New AASM
Criteria for Scoring Hypopneas: Impact on the Apnea Hy-
popnea Index,” Sleep, Vol. 32, No. 2, 2009, pp. 150-157.
[24] J. Boyle, N. Bidargaddi, A. Sarela and M. Karunanithi,
Automatic Detection of Respiration Rate from Ambula-
tory Singlelead ECG,” I EE E Transactions on Information
Technology in Biomedicine, Vol. 13, No. 6, 2009, pp.
890-896. http://dx.doi.org/10.1109/TITB.2009.2031239
[25] Y. Chan, “Wavelet Basics,” Kluwer Academic Publishers,
1995. http://dx.doi.org/10.1007/978-1-4615-2213-3
[26] F. W. David, “An Introduction to Wavelet Analysis,”
Birkhauser, 2002.
[27] M. Misiti, Y. Misiti, G. Oppenheim and J. M. Poggi,
Wavelet Toolbox for Use with Matlab,User’s Guide,
Version 3, 2004.
[28] F. Ebrahimi, M. Mikaeili, E. Estrada and H. Nazeran,
Automatic Sleep Stage Classification Based on EEG
Signals by Using Neural Networks and Wavelet Packet
Coefficients,”30th Annual International IEEE Conference,
Vancouver, 2008, pp. 1151-1154.
[29] I. Daubechies, “Ten Lectures on Wa velets (CBMS-NSF
Regional Conference Series in Applied Mathematics,”
Society for Industrial & Applied Mathematics, Vol. 61,
1992.