Document Type : Original Research


PhD, Department of Biomedical Engineering, Faculty of Health, Tehran Medical Sciences, Islamic Azad University, Tehran, Iran



Background: Due the long-time admission of patients in the ICU, it is very expensive. Therefore, solutions, which can increase the quality of care and decrease costs, can be helpful.
Objective: Separation of the patients based on the acute conditions can be useful in providing appropriate therapy. In this study, we present a classifier to predict the OSA based on heart rate variability of patients.
Material and Methods: In this analytical study, we used the recorded ECG signals from PhysioNet Database. At first, in the preprocessing stage, the noise from the ECG signal was removed, and R spikes were detected to generate the HRV. The next stage was related to linear and non–linear features extraction. We used the paired sample t-test that is a statistical technique to compare two periods (apnea and non-apnea). These features were applied as the inputs of two different classifiers, including MLP and SVM to find the best method and distinguish patients with higher death risk.
Results: The results showed that the SVM classifier is more capable to separate the four periods seperated from each other. The sensitivity for detecting the OSA event was 95.46% and the specificity was 97.57% for the non-OSA period.
Conclusion: Accurate and timely diagnosis of the disease can ensure the health of the individual, family, and community. Based on the proposed algorithm, the HRV signal and novel feature, presented in this study, had the highest specificity and sensitivity for the detection of the OSA event of the non-OSA, respectively.



The obstructive sleep apnea (OSA) is a chronic, lifelong medical condition affecting the sleep, health, and quality of life. The OSA is proven as a critical risk factor for cardiovascular disease. It leads to increasing the probability of brain stroke and pressure in blood vessels, insufficient heart pumping, arterial hypertension, decreasing blood flow, irregular heart rhythms, and heart attacks [ 1 ].

The OSA severity is based on disturbances of the parasympathetic nervous system (PNS) activity. PNS activity will be obvious in the time since eye movements are not rapid. In rapid eye movement sleep, PNS activity decreases compared to NREM sleep [ 2 ]. This is especially true in the stage 2 sleep compared to the REM sleep.

For the detection of sleep apnea episodes, several methods have been presented by the researchers using less number of physiological signals.

Many methods have been presented in the different manuscripts for the classification of sleep apnea, using several time-frequency domain features from the ECG signal [ 3 ]. For the apnea detection via the ECG, most of the existing algorithms in the literature used the features extracted from the HRV signal to discriminate the periods of apnea from the normal one.

The most usually used time-domain HRV parameter is SDNN (the standard deviation of all NN intervals). Heart rate variability is strongly inspired via sleep stages, and for some researchers, these changes do not differ notably when comparing OSA and non-OSA patients. It has been shown that the R-R interval in the early morning between sleep and wakefulness is at a maximum possible distance [ 4 , 5 ]. Moreover, the R-R intervals have been shown to have a continuous increase from wake to non-REM sleep, then a decrease during REM sleep in healthy subjects. Changes inside the variances in R-R intervals have been associated with the severity of OSA. However, other recent researchers have believed that spectral analysis of HRV may cause as a better algorithm to specify OSA severity [ 6 , 7 ].

Material and Methods

In this analytical study, we used the data belonging to the PhysioNet database, including the OSA patients admitted in ICU [ 8 ].

The HRV signal was analyzed in the five-minutes intervals. Linear and nonlinear features were used to evaluate the HRV signal changes at different time intervals. The HRV signal of each patient was divided to two intervals, including 5min before apnea (period 1), 10-5 min before apnea (period 2), 15-10 min before apnea (period 3) and 20-15 min before apnea (period 4). The features were extracted from these intervals to consider whether any change can be seen in the interval close to the apnea.

The algorithm comprises of five steps, as follows:

  1. 1) Preprocessing (noise cancelation, ECG segmentation to five-minutes intervals, R detection, HRV reconstruction) [ 9 ].
  2. 2) Feature extraction (time-domain, frequency-domain, nonlinear methods) [ 3 , 10 ].
  3. 3) Apply vector mapping of HRV (VMoH) [ 10 ] of each window and extract the angle between the vectors. 4) Feature selection (based on principal component analysis (PCA) method) [ 11 ].
  4. 5) Classification of apnea and non-apnea periods using Multi-Layer Perceptron (MLP) and Support Vector Machines (SVMs) classifiers [ 12 ].
  5. 6) Evaluation of classification performance (sensitivity and specificity, positive productivity and accuracy).


This algorithm was performed for 70 patients for nearly 8 h continuously (the length of man and woman recordings vary from slightly less than or equal to 7 h to approximately 10 h) and each ECG signal was digitized at 100 samples per second, with 16-bit resolution. The number of male and female patients are the same. The volunteers of these recordings were men and women between 27 to 60 years old, with weights between 53 to 135 kg. The optimum window for feature extraction was selected for 5 min.

The variations of selected features for the four mentioned intervals were analyzed. The results are presented in Table 1. The time-domain analysis of the periods did not show any significant changes. Based on the Table 1, the correlation dimension between the data of period 2, period 3 and period 4 is lower than the period 1, showing less variation of HRV in interval far from the onset of the sleep apnea. The ApEn of period 1 is higher than the period 2, emphasizing more complexity of HRV time series of period 1 in comparison with the period 2. Based on the SD1 and SD2 of each period, it can realize that the fluctuations of periods 2, 3 and 4 are lower than period 1.

Features period 1 period 2 period 3 period 4
α 53.12±17.6 36.18±11.1 34.45±10.2 32.17±9.18
CD 6.51±2.3 5.34±1.9 4.47±1.2 4.46±1.1
ApEn 1.98±1.3 1.32±1.07 1.24±0.92 1.24±0.91
SD2 /SD1 1.48±0.37 1.06±0.26 0.78±0.13 0.75±0.23
CD: Correlation Dimension, ApEn: Approximate Entropy, SD: Standard Deviation
Table 1.Features selected from the four periods

The results obtained based on SVM and MLP classifiers show that the SVM classifier is enabled to distinguish high and low-risk periods with the total classification, sensitivity, specificity rate of 95.46%, 97.57%, respectively.


Prolonged admission in ICU is associated with the high cost for patients and hospital. The unpredictable status of the patients admitted in this section requires very high accuracy and speed in the delivery of medical services. Given the high probability of death in patients with this disease, putting them together and observing the death scenes of the other patients can lead to increased stress and irreparable damage. Therefore, these methods to isolate and distinguish between patients who are at higher risk can be effective to solve the problems raised.

Although several studies to predict the OSA in patients are done, each of them has been faced with challenges. Dependency on multiple parameters to predict the risk of attack is one of the most significant problems. In this study, we present a method to examine the potential of HRV as a predictor of the OSA risk in the patients admitted to ICU. The evaluation of HRV in different periods (approximately far from and near to the OSA) showed that there are significant changes in the dynamic of HRV in periods close to apnea. In comparison to pathologic parameters used in previous studies [ 13 ], our non-linear features could better show the entrance of the patient to the onset of the sleep apnea (period1). Moreover, we used fewer parameters and computations in our algorithm to predict the OSA risk compared to other methods [ 13 , 14 ].

One of the reasons leading to prediction with the high accuracy of the presented algorithm is the implementation of a robust classifier. Feeding the classifier with good feature vectors improved prediction accuracy. This experimental result indicates that this proposed algorithm can predict the OSA risk using a small set of features. Furthermore, the proposed method required less computation and time in contrast with pervious works. It should be mentioned that although the algorithm has good results compared with other methods, it could not be generalized for a larger population of samples due to different types of illness.


The important finding of our paper is that patients with the OSA showed a decrease and an increase in parasympathetic and sympathetic activity, respectively, which can be a marker of impaired vagal activity, associated with increased cardiovascular risk. The proposed method in this paper, based on the HRV signal, can help physicians in diagnose of patients with obstructive sleep apnea and as a complementary method, it plays an important role in identifying the condition of patients in different stages of sleep. Moreover, the final decision about the patient’s condition during the various stages of sleep will be more accurate.

Ethical Approval

This research as well as the human data used in it was approved by the Committee of Ethics in Research of the General Hospital of Mexicali, B.C.

Conflict of Interest



  1. Çifçi N, Uyar M, Elbek O, Süyür H, Ekinci E. Impact of CPAP treatment on cardiac biomarkers and pro-BNP in obstructive sleep apnea syndrome. Sleep and Breathing. 2010; 14(3):241-4. DOI | PubMed
  2. Tabata R, Yin M, Nakayama M, Ikeda M, Hata T, et al. A preliminary study on the influence of obstructive sleep apnea upon cumulative parasympathetic system activity. Auris Nasus Larynx. 2008; 35(2):242-6. DOI | PubMed
  3. Behbahani S, Moridani MK. Non-linear Poincaré analysis of respiratory efforts in sleep apnea. Bratislavske Lekarske Listy. 2015; 116(7):426-32. DOI | PubMed
  4. Dumont M, Jurysta F, Lanquart JP, Noseda A, Van De Borne P, Linkowski P. Scale-free dynamics of the synchronization between sleep EEG power bands and the high frequency component of heart rate variability in normal men and patients with sleep apnea–hypopnea syndrome. Clinical Neurophysiology. 2007; 118(12):2752-64. DOI | PubMed
  5. Penzel T, Kantelhardt JW, Grote L, Peter JH, Bunde A. Comparison of detrended fluctuation analysis and spectral analysis for heart rate variability in sleep and sleep apnea. IEEE Transactions on Biomedical Eengineering. 2003; 50(10):1143-51. DOI | PubMed
  6. Baumert M, Smith J, Catcheside P, McEvoy RD, Abbott D, Sanders P, Nalivaiko E. Variability of QT interval duration in obstructive sleep apnea: an indicator of disease severity. Sleep. 2008; 31(7):959-66. Publisher Full Text | PubMed
  7. Park DH, Shin CJ, Hong SC, Yu J, Ryu SH, et al. Correlation between the severity of obstructive sleep apnea and heart rate variability indices. Journal of Korean Medical Science. 2008; 23(2):226-31. Publisher Full Text | DOI | PubMed
  8. Goldberger AL, Amaral LA, Glass L, Hausdorff JM, et al. PhysioBank, PhysioToolkit, and PhysioNet: components of a new research resource for complex physiologic signals. Circulation. 2000; 101(23):e215-20. DOI | PubMed
  9. Electrophysiology TF. Heart rate variability: standards of measurement, physiological interpretation, and clinical use. Circulation. 1996; 93(5):1043-65. DOI
  10. Karimi Moridani M, Setarehdan SK, Motie Nasrabadi A, Hajinasrollah E. Non-linear feature extraction from HRV signal for mortality prediction of ICU cardiovascular patient. Journal of Medical Engineering & Technology. 2016; 40(3):87-98. DOI | PubMed
  11. Zhang YX. Artificial neural networks based on principal component analysis input selection for clinical pattern recognition analysis. Talanta. 2007; 73(1):68-75. DOI | PubMed
  12. Zanaty EA. Support vector machines (SVMs) versus multilayer perception (MLP) in data classification. Egyptian Informatics Journal. 2012; 13(3):177-83.
  13. Moridani MK, Setarehdan SK, Nasrabadi AM, Hajinasrollah E. Mortality risk assessment of ICU cardiovascular patients using physiological variables. Universal Journal of Biomedical Engineering. 2013; 1:6-9. DOI
  14. Sokolova M, Lapalme G. A systematic analysis of performance measures for classification tasks. Information Processing & Management. 2009; 45(4):427-37. DOI