Assignment Document

A Time-Series Approach to Predict Obstructive Sleep Apnea (OSA) Episodes

Pages:

Preview:


  • "nd Proceedings of the 2 World Congress on Electrical Engineering and Computer Systems and Science (EECSS'16)Budapest, Hungary – August 16 – 17, 2016Paper No. ICBES 117 DOI: 10.11159/icbes16.117A Time-Series Approach to Predict Obstructive Sleep ..

Preview Container:


  • "nd Proceedings of the 2 World Congress on Electrical Engineering and Computer Systems and Science (EECSS'16)Budapest, Hungary – August 16 – 17, 2016Paper No. ICBES 117 DOI: 10.11159/icbes16.117A Time-Series Approach to Predict Obstructive Sleep Apnea (OSA)EpisodesGalip Ozdemir, Huseyin Nasifoglu, Osman ErogulTOBB University of Economics and TechnologySögütözü Cad. No: 43 TOBB Ekonomi ve Teknoloji Üniversitesi 06560, Ankara, [email protected], [email protected], [email protected] – Sleep apnea is a common respiratory disorder during sleep. It is characterized by pauses in breathing or shallow breathingduring sleep for longer than 10 seconds. Except the fact that not having a proper sleep and being rested for the next day, in some casesthe apnea period (not breathing interval) may last more than 30 seconds and this situation can even be fatal. 14% of men and 5% ofwomen suffer from Obstructive Sleep Apnea (OSA) in United States. Patients may experience apnea for more than 300 times in a singlenight sleep. Polysomnography (PSG) is a multi-parametric recording of biophysiological changes, containing EEG, ECG, SpO2, NasalAirflow signals, performed during overnight sleep. In this study, a fully automatic apnea detection algorithm is developed and an earlywarning system is proposed to predict OSA episodes by extracting time-series features of OSA periods and regular respiration usingnasal airflow signal. Extracted features are then reduced to improve the performance of the prediction. Support vector machines (SVM),one of the commonly used classification algorithms in medical applications, is implemented for learning and prediction of the OSAepisodes. The results show that OSA episodes are predicted with 87.6% of accuracy and 91.3% of sensitivity, 30 seconds before patientfaces apnea. By this approach, apnea related health risks can be minimized by foreknowledge.Keywords: obstructive sleep apnea (OSA), prediction of OSA episodes, nasal airflow signal, support vector machines1. IntroductionSleep apnea (SA) is generally expressed as not breathing for at least 10 seconds during the sleep. It is an under- diagnosed sleep disorder and is a fatal risk factor. SA is associated with high risks of hypertension, stroke and also withincreased mortality rates [1]. Approximately 14% of men and 5% of woman in United States are suffering from OSAsyndrome and incidence rate is increasing worldwide [2]. In a sleep study, the severity level of OSA is measured by thenumber of apnea and hypopnea events per hour during sleep; known as the apnea-hypopnea index (AHI). A subject havingclinical symptoms such as excess daytime sleepiness and impaired cognition in addition to AHI greater than 5, is diagnosedas an OSA patient [3]. AHI is usually calculated through overnight polysomnography (PSG) recorded from suspected OSApatients, in sleep study laboratories. Overnight polysomnography (PSG) is the gold standard method for diagnosis of OSA[4]. PSG requires recordings and monitoring of multi-parameter biophysiological signals, including EEG, ECG, respiratoryeffort, nasal airflow and oxygen saturation (SpO ). These recorded signals are then analyzed by sleep specialists for final2 diagnosis of the apnea syndrome. SA is generally characterized by pauses in breathing or shallow breathing when the softtissue in the rear of the throat collapses and closes during whole night sleep [5]. A slow respiratory rate caused by theblockage in the airway, results with less supply of oxygen delivered from the lungs to heart and body. Without breathing (orshallow breathing), CO level in the blood begins to elevate and the patient tries to wake up feeling a choke. There are two2commonly faced types for apnea: Obstructive sleep apnea (OSA) and Cental sleep apnea (CSA). In OSA, the airflow throughnose stalls for a period of time and but the brain struggles with the body to breath. In CSA case, brain is not able to sendstimulus to muscular system to resume breathing. There are two devices to overcome apnea syndrome: continuous positiveairway pressure (CPAP) and bilevel positive airway pressure (BiPAP). Both devices provide positive airway pressure duringthe respiratory cycle. However, the main difference among them is BiPAP applies higher pressures during inspiration thanexpiration [6].There are many studies to detect apnea episodes using PSG recordings. Some of them focus on using ECG signals todetect OSA [7,8]. SA is defined as not or shallow breathing during sleep, for this reason it is more accurate to predict apneaby nasal airflow signal. Han et al. proposed a method to detect apneic events based on second derivatives of the respiratoryICBES 117-1 signal [9]. Some other recent works have focused on apnea syndrome diagnosis, by using nonlinear measures of airflowsignal [10]. 2. Fully Automatic Sleep Apnea Detection Sleep apnea is the syndrome of pause in breathing during sleep longer than 10 seconds. Our data set has nasalrespiratory airflow signals of 6 patients sampled at 32 Hz for an overnight sleep recorded at a sleep study laboratory inhospital. Each of these recordings has duration about 8 hours. 8-hour long nasal airflow signal is first divided into 40 secondssegments (epochs). Every 40-second signal is evaluated independently in terms of energy by using Teager Energy Operator.Epochs containing potential apnea episodes are determined by changes in the energy level. Then, first order derivativeapproach is applied to the nasal airflow signal episodes, previously labelled as potential apnea candidate. This approachensures to determine apnea episode beginning precisely. Figure 1 shows the general schematics of the apnea detectionalgorithm used in this study.Nasal AirflowTeager Decision ofWindowDetectionFirst orderSignalenergyinto 40- potentialof apneaderivativeoperatorsecond apneabeginningsepochs episodesper Fig. 1: Block diagram of sleep apnea detection.2.1. Windowing It is difficult to detect not only a 10-second apnea episode using an 8-hour nasal airflow signal, but also visualize inshorter intervals. For this reason we divided the nasal airflow signal into 40-second epochs. Each epoch is analyzedindependently. The purpose of this independent calculation is to minimize the effects of incorrect samples caused by possiblemovement of the patient or the transducer dislocation during the sleep. Then every epoch is divided into two distinct 20second parts and the energy of each segment is calculated by Teager Energy Operator. ? ? ( n ) = x ( n ) - x ( n + 1 ) x ( n - 1 ) (1) The energy levels of the two 20 second long signals are compared with respect to total energy of the epoch, whetherthe ratio of average energies is < 0.25 (or > 4) or not. The segments that have less than one quarter of average energy thanthe average energy of the epoch are marked as potential apnea episodes. Two potential apnea candidate segments are shownin Figure 2.a and Figure 2.b is an output of the detection algorithm. It can be easily seen that in Figure 2.a the patient couldnot breathe for longer than 10 seconds. On the other hand, mislabelled epoch is detected as potential apnea episode in Figure2.b, where there is actually no problem in respiration.Fig. 2.a: Output of windowing algorithm for an epoch labelled as apnea candidate.ICBES 117-2In Figure 2.a, there happens a pause, up to almost 13 seconds on breathing during the second half of the epoch. On theother hand, the total energy of the epoch is four times greater than the energy of one of the 20-second segments. Fig. 2.b: Output of windowing algorithm for an epoch labelled incorrectly as apnea candidate. In Figure 2.b, the epoch is detected as apnea candidate as there happens four times energy difference between the 20- second segments and the total energy of the epoch. It can be seen that there does not occur any apnea syndrome during theepoch. In order to eliminate the mislabelled regions, first order derivative is applied for the next step. 2.2. First Order Derivative Approach The aim of first order derivative approach is to eliminate mislabelled epochs like in Figure 2.b. In this part, thederivatives of the epochs are calculated. The first order derivative of every 8-sample interval (0.25 seconds for samplingfrequency of 32 Hz) is obtained (Figure 2.c) and compared with a designated threshold value. If the interval length for thederivation is chosen longer, the error in detected apnea beginning precisely increases. Obviously, smaller values may causeother inaccuracies in calculation; considering that nasal airflow signal is not highly deviating. The samples below thethreshold value are marked (Figure 2.d) and they are checked whether there is a segment, composed of consecutive samples,that lasts longer than 10 seconds. If not, these samples are removed from the list of the potential apnea episodes. Moreover,the outputs for the epochs which are labelled incorrectly (like an example in Figure 2.b) will also be eliminated because ofnot containing any 10-second long apnea episodes. In this manner, small deviation values which exist for longer than 10seconds are detected as apnea event and the initial sample value (marked value) for every apnea periods in the whole signalis stored by examining every potential apnea epochs (Figure 2.e).Fig. 2.c: Results for the first order derivative of a potential apnea epoch.ICBES 117-3 st Fig. 2.d: Marked samples after 1 order derivative applied to the nasal airflow signal.Fig. 2.e: Initial sample of the apnea period is marked after apnea detection.The output of the first order derivative approach is a single sample value that determines and marks the beginning ofthe sleep apnea episode. It does not include any other data about the duration of the apnea and it will only be used fordistinguishing a time interval labelled as pre-apnea.After the apnea detection process is accomplished, regular breathing intervals are detected by using similar approach.An example of automatically detected regular air flow (regular breathing) is shown as an example in Figure 2.f. Fig. 2.f: Regular breathing in the airflow signal.ICBES 117-4End of this section, OSA segments are automatically detected by the developed algorithm and beginning time of thesesegments are also marked automatically. Then regular breathing segments are selected from the remaining respiration signalwhere labelled OSA segments are removed from the original recording. Labelled OSA and regular breathing segments willbe used as training inputs to learning algorithm. By this way, the system will be able to predict whether a new signal has anOSA warning or not.3. Prediction Algorithm There are two different classes of input, used for prediction: Pre-apnea and regular breathing. Pre-apnea interval is a1 minute nasal airflow signal which begins 90 seconds before apnea occurs. The beginnings of apnea segments, automaticallymarked by apnea detection algorithm, are used to extract the pre-apnea interval. By this way, pre-apnea and apnea segmentsare disaggregated from each other by 30 seconds margin to minimize the pre-effects of apnea. Similarly, 1 minute signalintervals are extracted starting 90 seconds prior to healthy respiration, representing regular breathing. All of the regularbreathing intervals, having shallow breathing for at most 2 seconds, are detected and sufficient number of these intervals arechosen randomly to be processed. By this way, it is intended to predict a possible apnea episode and alert before patient facesOSA, by having significant amount of time for processing. Time-series features of both classes are calculated and given asinput features to learning algorithms. 131 pre-apnea intervals are extracted for each of 131 marked apnea segments. In orderto decrease possible bias in the classification process, 120 (close to 131) regular breathing intervals are selected randomly,having a total of 251 input signals. Pre-apnea and regular breathing intervals are obtained from 6 patients to eliminate anypersonal effects among individuals. 3.1. Feature Selection In this study only time-series features are considered and used. Most popular features like mean, variance, minimum,maximum, median values of signals are used not only for the original signal but also implemented for the power andderivative of the signal. In addition to these 15 features; minimum, maximum, average inspiration/expiration amplitudes anddurations of nasal airflow signal are also extracted for each of 251 signal intervals (pre-apnea and regular breathing). As aresult, a total of 39 features are extracted to be used in classification.3.2. Support Vector Machines (SVM) In this study, first implemented classification algorithm is Support Vector Machines (SVM). SVM is a popular andwidely used classification algorithm in biomedical studies [11]. SVM basically seperates two different classes of inputs eachrepresented in multi dimensional feature space by generating a boundary function. For the representation of different classes,regular breathing episodes are labelled as ‘0’, as not an apnea episode, and pre-apnea episodes are labelled as ‘1’, as an apneaepisode. SVM algorithm is implemented by using the machine learning tool-box of MATLAB software.3.3. k-Nearest Neighbors (kNN)nd For the 2 classification algorithm k-Nearest Neighbors (kNN) is used. kNN simply measures the distance of an input to all of the training dataset points in multi dimensional feature space. Then, the test input will be labelled as the class of theclosest training point to itself. This approach is known as kNN-1. In another versions of kNN, defined as kNN-t (such askNN-3, kNN-5 etc.), the closest t points to the test sample are detected and then a voting mechanism decides the class of theinput. Consider a test sample that we would like to predict whether it is a pre-apnea segment. If two out of three closestpoints to the test sample belong to pre-apnea class, then this test input will be assigned to pre-apnea class as a result of 2-1voting.3.4. Linear Regression Approach for Classification (LR)Linear Regression (LR) basically is a regression algorithm where the output is a real number, not a class. In this study,we approach this classification problem as regression. Similar to SVM learning, in training set pre-apnea episodes are labelledas ‘1’ and regular breathing will be ‘0’. LR output will be a real number not only 0 or 1. In order to assign the test sample toa class, we should decide a level, call it l. The output higher than l value will be labelled as ‘1’, and if the output is lowerthan l, then it will be assigned to class ‘0’.ICBES 117-5 3.5. Feature Reduction and Performance Measures Selected 39 features are used for classification of a signal interval as pre-apnea or not. However, it is possible todecrease the dimension of the feature space and improve the classification accuracy by eliminating some of the irrelevantfeatures. For this purpose, Randomly Select and Compute (RANSAC) algorithm is used. First, the accuracy of theclassification is calculated by using all 39 features. Results are shown in Results & Discussion section. Then, 35 features outof 39 are randomly selected and accuracy is calculated using these 35 features. RANSAC algorithm is implemented for 1000repetitions and features are noted having highest accuracy in classification. Similar feature reduction algorithm is computedfor 30, 25, 20 features. Results suggest that randomly selected 30 features have the best performance in prediction of OSAepisodes and further reduction of features also diminishes the performance. Feature reduction and classification algorithm isas follows:choose number of features (Repeat for n=35,30,25 and 20)? randomly select n features (Repeat for 1000 times)? train and classify by selected learning algorithm? record features giving highest accuracy in selected learning algorithm? 5-fold cross validation for accuracy, sensitivity, specificity Performance measures are calculated using 5-fold cross validation. The whole data set is randomly divided into twocategories: training set, test set. Training set contains 80% of the data set, and learning algorithm is trained by these inputinstances. The remaining 20% is used for classification and measuring the accuracy, sensitivity and specificity of theproposed approach. The training process repeated for 5 times and in each repetition, a new 80% training set is generated.After training and classifying the signals 5 times, the mean values are noted as final performance measures. 4. Results & Discussion The performance of the proposed prediction algorithm is measured in terms of accuracy, sensitivity, specificity,accuracy for SVM, kNN & LR. Accuracy is the correct prediction of a pre-apnea interval (labelled ‘1’) and regular breathinginterval (labelled ‘0’). Sensitivity is the correct classification of pre-apnea intervals (labelled ‘1’) and similarly specificity isthe correct classification of regular breathing intervals (labelled ‘0’). Primarily, extracted 39 features are used for learningand classification process. 59% of accuracy is recorded which is below accepted levels. Followingly, feature reductionapproach is used and performance is measured for using different features. Table 1 shows the performance measures ofprediction methods for the given parameters.Table 1: Performance measures of the proposed prediction methods. SVM kNN-3 kNN-5Number of Accuracy Sensitivity Specificity Accuracy Sensitivity Specificity Accuracy Sensitivity SpecificityFeatures39 0.591 0.880 0.514 0.602 0.589 0.620 0.749 0.763 0.74035 0.839 0.894 0.798 0.635 0.656 0.624 0.785 0.776 0.79230 0.876 0.913 0.772 0.711 0.724 0.687 0.801 0.795 0.80625 0.853 0.920 0.724 0.685 0.707 0.662 0.784 0.804 0.74320 0.812 0.905 0.746 0.685 0.716 0.632 0.745 0.779 0.708 LR (l=0.5) LR (l=0.6) LR (l=0.2)Number of Accuracy Sensitivity Specificity Accuracy Sensitivity Specificity Accuracy Sensitivity SpecificityFeatures39 0.528 0.726 0.504 0.496 0.724 0.481 0.733 0.786 0.70035 0.745 0.808 0.6920.587 0.798 0.495 0.555 0.826 0.50230 0.533 0.777 0.472 0.511 0.832 0.4610.783 0.868 0.71225 0.505 0.688 0.440 0.504 0.776 0.473 0.716 0.794 0.63820 0.486 0.643 0.421 0.486 0.709 0.443 0.724 0.760 0.653ICBES 117-6As Table 1 states, all of the performance parameters show improvement after a few features are reduced. Eliminationof unrelated features to the apnea prediction, increases prediction accuracy. However, further feature reduction hasunfavorable effect on accuracy and the optimal results are obtained for set containing 30 features. Eliminated features areanalyzed, and it is noticed that following features are always discarded in reduction process:? maximum time between peak of inspiration and average value? maximum time between peak of expiration and average value? minimum time between average value and peak of expiration? minimum time between average value and peak of inspiration? ratio of time that respiratory signal is above the average value to the time respiratory signal is below the averagevalueWe can comment that some of the features representing minimum or maximum time recorded for inspiration orexpiration are generally eliminated in feature reduction. Thus, it can be concluded that extreme (minimum or maximum time)inspiration & expiration durations are not significant to predict OSA. Features providing information on general respiratorystructure, like mean values inspiration/expiration or magnitude of nasal airflow signal, are more crucial and needed to beanalysed especially.SVM has the best prediction performance in accuracy, sensitivity, overall and kNN has the highest specificity rate.kNN-1 & kNN-7 are also tested for the selected features, however accuracy is lower than 0.5 and results are not added in thetable since it does not show any significant meaning.5. Conclusion In an overnight sleep, OSA patients may face apnea more than 300 times. In addition to decrease in sleep quality andinability to maintain resting during sleep, OSA can be associated with other disorders like hypertension, stroke. It is anunderestimated critical disorder, which BPAP or CPAP devices are used to overcome apnea. Having a sleep using thesedevices, discomforts the patients. In this study, an early warning algorithm to predict OSA episodes is proposed. In thismanner, it may be possible to warn or wake the patient up before his/her respiration fails. The accuracy of apnea predictionis over 87% with a sensitivity of 91% when SVM is used. kNN approach has lowest accuracy but in return of highestspecificity slightly above 0.8. For LR as a classification algorithm method, proper classification boundary selection (l value)significantly effects the general accuracy however, still it did not present any satisfactory results in any of the performancemeasures. 77% of specificity value of SVM suggests that there may be some cases, the algorithm labels a nasal airflow periodas pre-apnea where actually it is not. Total computational time of the algorithm for a single 1 minute nasal airflow signal isless than 0.3 seconds. Thus, it may be useful and comfortable approach that a device, records the nasal airflow signal of thepatient throughout the night and runs the proposed algorithm in real-time. By this way we may be able to warn or wake thepatient up before his/her respiration fails. In future studies, specificity ratio will be tried to be improved. Development of ahybrid learning tool, combining the high accuracy, sensitivity performance of SVM and high specificity of kNN, willsignificantly improve the prediction of OSA segments. References[1] F. Roche, V. Pichot, E. Sforza, I. Court-Fortune, D. Duverney, F. Costes, M. Garet, and J-C. Barthe Iemy, “Predictingsleep apnea syndrome from heart period: a time-frequency wavelet analysis,” European Respiratory Journal.[2] P. E. Peppard, T. Young, J. H. Barnet, M. Palta, E. W. Hagen, and K. M. Hla, “Increased prevalence of sleep- disordered breathing in adults,” Am. J. Epidemiol., vol. 177, no. 9, pp. 1006-1014, 2013.[3]M. R. Mannarino, F. Di Filippo, and M. Pirro, “Obstructive sleep apnea syndrome,” Eur. J. Intern. Med., vol. 23, no.7, pp. 586-593, 2012.[4] C. A. Kushida, M. R. Littner, T. Morgenthaler, C. A. Alessi, D. Bailey, J. Jr. Coleman, L. Friedman, M. Hirshkowitz,S. Kapen, M. Kramer, T. Lee-Chiong, D. L. Loube, J. Owens, J. P. Pancer, and M. Wise, “Practice parameters for theindications for polysomnography and related procedures: an update for 2005,” Sleep, vol. 28, no. 4, pp. 499-521, 2005.[5]Sleep Medicine Centers of Western New York. (2016, May 12) Available:http://www.sleepmedicinecenters.com/SleepDisorders/ObstructiveSleepAneaICBES 117-7 "

Related Documents

Start searching more documents, lectures and notes - A complete study guide!
More than 25,19,89,788+ documents are uploaded!

Why US?

Because we aim to spread high-quality education or digital products, thus our services are used worldwide.
Few Reasons to Build Trust with Students.

128+

Countries

24x7

Hours of Working

89.2 %

Customer Retention

9521+

Experts Team

7+

Years of Business

9,67,789 +

Solved Problems

Search Solved Classroom Assignments & Textbook Solutions

A huge collection of quality study resources. More than 18,98,789 solved problems, classroom assignments, textbooks solutions.

Scroll to Top