You are on page 1of 4

Sleep Apnea and Hypopnea Events Detection Based on Airflow Signals

Using LSTM Network


Wenming Yang, Jiamin Fan, Xingjun Wang and Qingmin Liao

Abstract— Sleep Apnea-Hypopnea Syndrome (SAHS) is a in many studies. Hilbert-Huang transform was adopted to
sleep-related breathing disorder which involves the reduction the respiration pressure signal by Caseiro et al. for respira-
in breathing airway when patiens sleep. However, a large tion syndromes [11]. Recent studies concentrate on using
proportion of patients are usually undiagnosed and untreated
which may lead to the risk of life. In this paper, we propose an networks like convolutional neural networks to diagnose
automatic SAHS event detection method based on Long Short- respiration syndromes [12-16]. Sounds occurred when people
Term Memory (LSTM) network via nasal airway pressure breathe is also directly related to these syndromes, for what
and temperature signals from clinical polysomnography (PSG) sound signals are also studied for the relationship between
dataset. Focusing on time location of the events, we firstly sleep syndromes. Recorded respiratory sounds were used
segment the two channels of signals into a series of sequences
by feature extraction. Secondly, a LSTM network is established to extract spectrum features and classified utilized K-means
and these sequences are subsequently fed into this LSTM clustering algorithm and machine learning [17]. Voice activ-
network for SAHS event classification. The experimental results ity detection was employed to distinguish airflow signals into
on both our clinical PSG dataset and public MIT-BIH PSG silence and sleep disorder syndromes by Almazaydeh et al.
database show that our method is promising in terms of recall. [18]. Combinations of multiple signals are also presented to
I. I NTRODUCTION diagnose sleep respiration syndromes. By analyzing airway
and other signals, Xie and Min [19] presented an algorithm
Sleep disorder is a common breath syndrome that has for sleeping apnea and hypopnea syndromes. A method
affected numerous people in the world nowadays. Sleep combining oxygen saturations and RR series features based
Apnea-Hypopnea Syndrome (SAHS) is a most common and on oximetry and ECG was proposed. These features are then
dangerous sleep-related breathing disorder. It is diagnosed selected for classification via linear discriminant analysis by
when the reduction in breathing airway appears in a certain Ravelo-Garcia et al. [20]. Also, a number of approaches are
number of times during sleeping. Studies have shown that proposed to reduce the computation complexity and time cost
SAHS occurs in both men and women whose age range from of processing procedure [21].
30 to 60 years or older [1]. A large proportion of the patients In this paper, we develop a method to detect SAHS
are undiagnosed and untreated as only a small number of events by using candidate segmentation and LSTM clas-
people are aware of these symptoms. The symptom remains sification. Two respiration channels from PSG recordings,
untreated and undiagnosed may generally cuase heart and nasal pressure and nasal temperature, are analyzed. These
brain disease and has a risk to patients’ life [2-3]. In terms nasal signals are first segmented by frequency feature and
of SAHS diagnosis, the most reliable method is to analysis energy ratio extracted respectively from two signals. And
patients’ polysomnography (PSG) which is also the most then the candidate segments with longer time signal in both
widely used method. two channels are sent into the classifier, LSTM, to analyze
Multiple algorithms have been proposed to detect ob- the characteristic of three different classes. We focus on
structive sleep apnea (OSA) based on different types of comparatively exact time location of the breathing events
signals or combined approaches [4]. Multiple statistical during sleep. Both sleep apnea syndrome and sleep hypopnea
pattern recognition techniques, logistic regression,k-nearest syndrome are considered.
neighbor, were analyzed based on pulse oximetry [5-6].
Another common approach for detecting sleep disorders is II. R ELATED W ORK
to analyze electrocardiogram (ECG). In these kinds of meth- Recurrent neural network (RNN) is now a widely used
ods, ECG signals are firstly separated into different forms, network on pattern recognition. Typical RNN learning algo-
which will be further analyzed for classification. Multiple rithms perform well on mapping real-valued input sequences
classifiers, linear discriminant analysis (LDA), support vector into output sequences. Long Short-Term Memory network,
machine,as for example [7-10]. Respiration signals is one which is a novel derivative from RNN, performs better than
of the most direct signals of sleep disorders and was used RNNs when the input sequence is too long[22].
The special character of an LSTM network is the memory
*This work is supported by the National Key Research and Development
Program of China (No. 2017YFC0112500). block. The memory cells and gating units help the net-
Wenming Yang (yangelwm@163.com), Jiamin Fan (fanjm1994@1- work store and abandon information from sequences long
63.com), Xingjun Wang (wangxj@tsinghua.edu.cn) and Qingmin Liao time ago. The parameters of the gating system all can be
(liaoqm@tsinghua.edu.cn) are with Shenzhen Key Lab. of Information
Sci&Tech, Department of Electronic Engineering /Graduate School at learned when the network works. These cells help decide
Shenzhen, Tsinghua University, China. the information stored from previous sequence and when

978-1-5386-1311-5/19/$31.00 ©2019 IEEE 2576


it is helpful so that it can be used [22]. LSTM performs
well when the amount of input data is too large and the
previous information is important for the current situation.
In our SAHS tasks, the length of the signals can be hold by
the cells enough and the network can work well.
Compared to traditional RNNs, LSTM networks have
better performance on long continues-valued sequence and
work more efficiently. Considering the characteristic of the
relation between the respiration events and nasal signals,
LSTM is of great advantage on the study.

III. M ETHODS
The framework of the proposed algorithm is demonstrated
in Figure 1. It can be divided into two main parts: potential
events detection and classification. The candidate SAHA
events are first detected by manually chosen features. Then
the two signals are segmented by the location of the detected
events into segments with different length. These segments
are finally sent into LSTM network for classification.

A. Experimental Setup
We establish a clinical PSG database consisting of two
Fig. 1. Block diagram of the proposed method. The left part is for the
oronasal airflow signals from PSG signals of 130 adult segmentation and training process. The right part is the testing process.
patients. All these records are of breathing events of vari-
ous occurrence frequency during one night. The sampling
frequency of all acquired signals is 100Hz. The PSG signals is chosen as the main feature. And for the nasal airway
are recorded by devices of polysomnography conducted by temperature signal, the ratio of the energy is selected. The
cooperated hospitals. The labels of the apnea and hypopnea energy ratio is calculated by the total energy of current
symptoms are confirmed by clinical experts for diagnosing window and the energy of the founded nearest normal signal
relating symptoms. While the whole dataset contains other segment with the same length to the window. The normal
signals, which have also been studied to diagnose SAHS, our signal segment here is defined that the segment is not
study extract the two simultaneous nasal breathing signals, included in the nasal temperature candidate segments. And
nasal pressure and nasal temperature signals. it is the nearest one to the current window.
A comparatively low threshold is set for the features to
B. Respiration Signals Pre-processing
extract the segments. This helps reduce the number of events
Respiration siganls are the most related siganls of sleep left out.
syndrome. They are used both on clinical stuies and en- There are conditions that nasal pressure and nasal tem-
gineering for sleep syndrome analysis. The clinical PSG perature signals perform inconsistently during the same oc-
signals often take various kinds of noises. Therefore, the currence of respiration events. In order to keep all potential
PSG signals are first filtered with a low pass Butterworth SAHS events, all segments extracted on the two channels
filter. When breathing apnea occurs, the signals will be flat are reserved. The extracted segments last less than 10s are
and with no change. For those signals with poor quality ,we deleted and if one segment locates too close to another, they
use a band pass filter to remove the disturbing information are merged into one new segment. The main purpose of
.Finally, the filtered signals are normalized to avoid subject- this part is to find all potential locations that the respiration
dependent variations. events may occur as shown in figure 2. The classification and
On account of the fact that SAHS events will not occur distinguish of different type syndromes and normal segments
when the patient is awake, referring to the sleep stage labels, are performed in following procedure.
the potential respiration events during waking hours are not
considered. D. Classification
The chosen segments are of the same length to respiration
C. SAHS Events Segmentation events. As the respiration events last range from 10s to 30s,
The signals pre-processed are then segmented by sliding the chosen segments last range from 1000 points to 3000
window method. For each window, two features are extracted points.
for following processing. Since nasal pressure and temper- As introduced previously, the advantage of LSTM network
ature signals have different characteristics, the method for compared to other traditional neural networks is that LSTM
feature selection is of great importance. For the nasal airway can take advantage of all information of the long sequence
pressure signal, the main frequency of the signal segmented selectively. Coincidentally, the respiration event diagnosis

2577
considers the signals far ahead as reference. On the one In classification stage, each segment is classified into
hand, this characteristic makes the LSTM network a great one of three classes: normal, apnea, hypopnea. The ground
advantage to learn. On the other hand, the segments fed truth comes from experts of cooperative hospitals. Generally,
into the network cannot be too long or too short. Too long the number of normal segments is far more than SAHS
segments may contain two or more sleep disorders which events. To overcome the imbalance of the database of the
can lead to the confusion of the specific syndrome of the three classes (normal signals are much more than abnormal
current location. Too long segments cannot be used to detect signals), random extraction on three classes are processed
the events because the exact location of the event’s feature both when training and testing.
that makes sense is unknown. Conversely, too short segment
loses valuable discriminative information of signals. As in
short term, the signal of the hypopnea events performs almost
the same as the normal signals.
Under this consideration, we take the time location of the
segments, and take longer sequences of signals into consid-
eration on the basis of the segments extracted. A certain
length of signal sequences before and after the segments
are also extracted. The segments fed into the network are
with two channels at the same location of the two signals,
nasal pressure and nasal temperature channel. The segments
with various locations can have various length, ranging from
30 seconds to 50 seconds,depending on the length of the Fig. 2. A sample of SAHS events segmentation on nasal temperature
signals . The red boxes are the candidate events extracted by our method
respiration events occurrence, the length of similar normal and the green boxes are the breathing events occurred.
signals.
Before feeding the resulting signal segments into the
network, the data is sorted by sequence length to reduce
the amount of padding or discarded data. The sorted and
split data is then normalized to fed into the LSTM network.
Figure 3 shows one observation of the data to be trained,
feature 1 represents the nasal pressure signal and feature 2
represents the nasal temperature signal. The sequence input
is with two dimensions acting as features.
The network adopted in the experiment is with 5 different
function layers. They are sequence input layer, LSTM layer,
fully connected layers, SoftMax layer and classification out-
put layer respectively. The numbers of each layer are related
to the sequence input. In this study, we try to classify the
signals into three classes, normal signals, sleep apnea events
and hypopnea events. The number of the fully connect layers
is three.
The trained model is then used to test the testing data. The
potential events segmentation is also operated on the testing Fig. 3. One training observation of the data to be trained. feature 1
signals. The trained LSTM model output the classification represents the nasal pressure signal and feature 2 represents the nasal
results of the segments. temperature signal.

IV. E XPERIMENTS A ND D ISCUSSION Figure 3 shows an example of the segments derived from
the processed signal to fed to the network. It contains the
Our clinical database consists of two oronasal airflow sig- breathing events period, the normal period before and after
nals from PSG signals of 130 adult patients. All these records the normal period.
are of breathing events of various occurrence frequency dur- The segments classification results are shown in Table I,
ing one night. The experimental procedures involving human which presents the recall of classification. The recall and
subjects described in this paper were approved by related precision are calculated according to the events occurrence.
institute. The segmentation is processed on every subject. The total accuracy of the classification is 81.6%.
And then the segments are shuffled randomly regardless of Our method is also performed on MIT-BIH polyso-
the subjects. 70% of the segments are taken as training mnography database [23-24]. We take the 14 records which
data and the left 30% just for test. The candidate segments include signal measured through nasal thermistor. However,
detection as shown in figure 2 performs well and 99% of the this database does not provide start and stop locations
SAHS events are extracted. annotations. It only provides 30 seconds epoch annotations.

2578
So we mark the 30 seconds epoch annotations as the events [5] J. Marcos, R. Hornero, D. Alvarez, F. Campo and C. Zamarron, ”As-
and send the only respiration signal of this database into our sessment of four statistical pattern recognition techniques to assist in
obstructive sleep apnoea diagnosis from nocturnal oximetry,” Medical
LSTM network. The recall of our method performed on MIT- Engineering & Physics, vol. 31, no. 8, pp. 971- 978, 2009.
BIH polysomnography database is 90.0%, 87.1%, 83.2%, [6] J. Marcos, R. Hornero, D. AAlvarez, F. Campo and M. Aboy, ”Au-
representing norm, apnea and hypopnea events respectively. tomated detection of obstructive sleep apnoea syndrome from oxygen
saturation recordings using linear discriminant analysis,” Medical &
biological engineering & computing, vol. 48, no. 9, pp. 895-902, 2010.
TABLE I
[7] C. Cheng, C. Kan and H. Yang, ”Heterogeneous recurrence analysis
C LASSIFICATION R ESULTS of heart beat dynamics for the identification of sleep apnea events,”
Computers in Biology and Medicine, vol. 75, pp. 10-18, 2016.
[8] A. Hassan, ”Computer-aided obstructive sleep apnea detection using
Class Normal Apnea Hypopnea normal inverse Gaussian parameters and adaptive boosting,” Biomed-
Recall on our clinical database 81.3% 87.9% 75.5% ical Signal Processing and Control, vol. 29, no. 1, pp. 22- 30, 2016.
Recall on MIT-BIH database 90.0% 87.1% 83.2% [9] C. Travieso, J. Alonso, M. Pozo-Banos, J. Ticay-Rivas and K. Lopez-
Precision on our clinical database 82.0% 84.5% 78.1% de-Ipina, ”Automatic Apnea Identification by Transformation of the
Precision on MIT-BIH database 90.8% 83.6% 85.8% Cepstral Domain,” Cognitive Computation, vol. 5, no. 4, pp. 1-8, 2013.
F1-score on our clinical database 0.81 0.86 0.77 [10] P. Chazal, T. Penzel and C. Heneghan, ”Automated Detection of
F1-score on MIT-BIH database 0.9 0.85 0.84 Obstructive Sleep Apnoea at Different Time Scales Using the Electro-
cardiogram,” Physiological Measurement, vol. 25, no. 4, pp.967-983,
2004.
The classification of the hypopnea events is quite dif- [11] P. Caseiro, R. Fonseca-Pinto and A. Andrade, ”Screening of ob-
structive sleep apnea using Hilbert-Huang decomposition of oronasal
ficult issue in aspect of SAHS detection since it seems airway pressure recordings,” Medical Engineering & Physics, vol. 32,
extremely similar to normal signal. Our experiments show no. 6, pp. 561-568, 2010.
when choosing only energy or frequency feature on nasal [12] R. Haidar, I. Koprinska and B. Jeffries, ”Sleep Apnea Event De-
tection from Nasal Airflow Using Convolutional Neural Networks,”
temperature signals, the classification results of hypopnea in 2017 International Conference on Neural Information Processing,
events and normal signals decrease. The feature extraction Guangzhou, China, October, 2017.
on nasal temperature signal and the normal segments chosen [13] N. Selvaraj and R. Narasimhan, ”Detection of Sleep Apnea on a Per-
Second Basis Using Respiratory Signals,” in 35th Annual International
when calculating energy ratio help improve the classification Conference of the IEEE Engineering in Medicine and Biology Society,
results of hypopnea events. Osaka, Japan, July, 2013.
[14] A. Ng, T. Koh, E. Baey, T. Lee, U. Abeyratne and K. Puvanendran,
V. CONCLUSIONS ”Could formant frequencies of snore signals be an alternative means
for the diagnosis of obstructive sleep apnea?,” Sleep Medicine, vol. 9,
In this paper we develop a deep learning-based method no. 8, pp. 894-898, 2008.
to detect sleep syndromes including sleep apnea syndrome [15] R. Pozo, J. Murillo, L. Gomez, E. Gonzalo, J. Ramirez and D.
Toledano, ”Assessment of Severe Apnoea through Voice Analysis,
and hypopnea syndrome by using airflow signals segmen- Automatic Speech, and Speaker Recognition Techniques,” EURASIP
tation and LSTM network. Two respiration channels from Journal on Advances in Signal Processing, vol. 2009, no. 1, pp. 1-11,
polysomnography recordings, nasal pressure and nasal tem- 2009.
[16] G. Ozdemir, H. Nasifoglu and O. Erogul, ”A Time-Series Approach
perature, are analyzed in our study. We first extracted seg- to Predict Obstructive Sleep Apnea (OSA) Episodes,” in The 2nd
ments which may not occur with respiration events but with World Congress on Electrical Engineering and Computer Systems and
exact time locations by feature extraction. Furthermore, the Science, Budapest, Hungary, July, 2016.
[17] T. Praydas, B. Wongkittisuksa and S. Tanthanuch, ”Obstructive Sleep
candidate segments with longer time signal in both two Apnea Severity Multiclass Classification Using Analysis of Snoring
simultaneous channels are sent into the classifier, LSTM Sounds,” in 2nd World Congress on Electrical Engineering and Com-
network, to analyze the characteristics of two different puter Systems and Science, Budapest, Hungary, August, 2016.
[18] L. Almazaydeh, K. Elleithy, M. Faezipour and A. Abushakra, ”Apnea
breathing events for classification. Most normal signals are Detection Based on Respiratory Signal Classification,” in The 3rd
separated from abnormal signals in the first stage. In the International Conference on Current and Future Trends of Information
next stage, we focus on comparatively exact location of the and Communication Technologies in Healthcare, Ontario, Canada,
October, 2013.
breathing disorder during sleep. The segmentation detects [19] B. Xie and H. Minn, ”Real-Time Sleep Apnea Detection by Classi-
the breathing events of exact occurrence moment and helps fier Combination,” IEEE Transactions on Information Technology in
remove interferential data. The network helps analyze the Biomedicine, vol. 16, no. 3, pp. 469-477, 2012.
[20] A. Ravelo-Garcia, J. Kraemer, J. Navarro-Mesa, E. Hernandez- Perez,
characteristic of different syndromes. All these combination J. Navarro-Esteva, G. Julia-Serda, T. Penzel and N. Wessel, ”Oxy-
mechanism makes our algorithm effective. gen Saturation and RR Intervals Feature Selection for Sleep Apnea
Detection,” Entropy, vol. 17, no. 5, pp. 2932-2957, 2015.
R EFERENCES [21] W. W. Flemons et al, ”Home Diagnosis of Sleep Apnea: A Systematic
Review of the Literature,” Chest, vol. 124, pp. 1543-1579, 2003.
[1] S. Ryan and W.T. McNicholas, Obstructive Sleep Apnea, in: In- [22] F.A.Gers,J.Schmidhuber,andF.Cummins.Learningtoforget:Continual
ternational Encyclopedia of Public Health, Harald Kristian (Kris) prediction with LSTM. NeuralComputation,12(10):2451-2471,2000.
Heggenhougen, ed., Academic Press, Oxford, 2008, pp. 621-627. [23] Ichimaru Y, Moody GB. Development of the polysomnographic
[2] D.E. Wardly, Intracranial hypertension associated with obstructive database on CD-ROM. Psychiatry and Clinical Neurosciences 53:175-
sleep apnea: A discussion of potential etiologic factors, Medical 177, 1999.
Hypotheses 83 (2014), 792-797. [24] G. Goldberger et al., ”Physiobank, physiotoolkit, and physionet: Com-
[3] Owen D. Lyons and Clodagh M. Ryan, Sleep apnea and stroke, ponents of a new research resource for complex physiologic signals,”
Canadian Journal of Cardiology 31 (2015), 918-927. Circulation, vol. 101, no. 23, pp. 215-220, 2000.
[4] A. Yadollahi, E. Giannouli and Z. Moussavi, ”Sleep apnea monitoring
and diagnosis based on pulse oximetry and tracheal sound signals,”
Medical & Biological Engineering & Computing, vol. 48, no. 11, pp.
1087-1097, 2010.

2579

You might also like