Apache Spark SVM for Predicting Obstructive Sleep Apnea
Abstract
:1. Introduction
2. Background
2.1. Support Vector Machines
2.2. Apache Spark
3. Related Works
4. Methodology
4.1. Data Preprocessing
4.1.1. Data Denoising
4.1.2. QRS Detection
- Find the maximum value method: Find the position corresponding to a value of the slope >0, assign a value of 1, and the rest are 0. The maximum value is a sequence similar to 1, 0, that is, the position where the previous value is larger than the subsequent value or location point.
- Find the minimum value method: Find the position corresponding to the value of the slope <0, assign a value of 1, and the rest are 0. The minima are in positions corresponding to the sequence 1, 0, that is, the position where the previous value is lower than the later value.
- Set the threshold. The R-wave is extracted. The value of the R-wave is significantly larger than the value at other positions, and the characteristics of the detail coefficients at the three levels are similar. In this manner, a reliable threshold is set to extract a set of adjacent maximum and minimum pairs. (That is, divide all points into four parts. Find the average value T of the maximum value of each part. The threshold value is T/3). The zero crossing between the maximum and minimum is the R-wave point corresponding to the original signal.
- Compensate the R-wave point. In the process of the binary spline wavelet transform, there is a 10-point shift in the three-level detail coefficients and the corresponding position of the original signal; hence, compensation is required.
- Find the QS-wave. Based on the position of the R-wave, the first three poles at the position of the R-wave (under the layer 1 detail coefficient) are Q-waves. The last three poles at the position of the R-wave (with a detail coefficient of 1) are S-waves. Hence, the QRS-wave is detected.
4.1.3. Feature Selection
- The average RR—interval duration.
- Standard deviation of RR—interval.
- GT50—the number of adjacent RR intervals, where the first RR interval exceeds the second RR interval by more than 50 milliseconds.
- LT50—the number of adjacent RR intervals whose second RR interval exceeds the first RR interval by more than 50 milliseconds.
- avgGT50, avgLT50—the above two variables (GT50 and LT50) are divided by the total number of RR intervals.
- SDSD—the standard deviation of the differences between adjacent RR intervals.
- The median of the RR interval.
- Interquartile range—the difference between the 75th and 25th percentiles of the RR interval value distribution.
- Mean Absolute Deviation—the average of the absolute values obtained by subtracting the average.
- RR interval value of all RR interval values in one period.
- Age of the observations.
- Sex of the observations.
4.2. SVM-Based Algorithm
4.2.1. Linearly Separable SVM
- Select the penalty parameter C > 0 to construct and solve the convex quadratic programming problem.Get the optimal solution .
- Calculate . Select a component of α* to meet the constraint:
- Find the separation hyperplane w*. x + b* = 0.
- Classification decision function: .
4.2.2. Linear SVM
4.2.3. Nonlinear SVM
5. The Dataset
6. Results and Analysis
7. Conclusions
8. Future Work
Author Contributions
Funding
Acknowledgments
Conflicts of Interest
References
- Khandoker, A.H.; Palaniswami, M.; Karmakar, C.K. Support Vector Machines for Automated Recognition of Obstructive Sleep Apnea Syndrome from ECG Recordings. IEEE Trans. Inf. Technol. Biomed. 2009, 13, 37–47. [Google Scholar] [CrossRef] [PubMed]
- Coleman, J. Complications of Snoring, Upper Airway Resistance Syndrome, and Obstructive Sleep Apnea Syndrome in Adults. Otolaryngol. Clin. North Amer. 1999, 32, 223–234. [Google Scholar] [CrossRef]
- Vgontzas, A.N.; Papanicolaou, D.A.; Bixler, E.O.; Hopper, K.; Lotsikas, A.; Lin, H.M.; Kales, A.; Chrousos, G.P. Sleep Apnea and Daytime Sleepiness and Fatigue: Relation to Visceral Obesity, Insulin Resistance, and Hypercytokinemia. J. Clin. Endocrinol. Metab. 2002, 85, 1151–1158. [Google Scholar] [CrossRef] [PubMed]
- Young, T.; Palta, M.; Dempsey, J.; Peppard, P.E.; Nieto, F.J.; Hla, K.M. Burden of Sleep Apnea: Rationale, Design, and Major Findings of the Wisconsin Sleep Cohort Study. WMJ 2009, 108, 246–249. [Google Scholar]
- Gibson, G.J. Obstructive Sleep Apnoea Syndrome: Underestimated and Undertreated. Br. Med Bull. 2004, 72, 49–65. [Google Scholar] [CrossRef] [PubMed]
- Almazaydeh, L.; Elleithy, K.; Faezipour, M. Obstructive Sleep Apnea Detection Using SVM-Based Classification of ECG Signal Features. In Proceedings of the 34th Annual International Conference of the IEEE EMBS, San Diego, CA, USA, 28 August–1 September 2012; pp. 4938–4941. [Google Scholar]
- Common Signs of Sleep Apnea. Available online: https://www.nhlbi.nih.gov/health-topics/sleep-apnea (accessed on 18 July 2020).
- Golbidi, S.; Badran, M.; Ayas, N.; Laher, I. Cardiovascular Consequences of Sleep Apnea. Lung 2012, 190, 113–132. [Google Scholar] [CrossRef] [PubMed]
- Dimsdale, J.E.; Loredo, J.S.; Profant, J. Effect of Continuous Airway Pressure on Blood Pressure. Hypertension 2000, 35, 144–147. [Google Scholar] [CrossRef] [PubMed]
- Canessa, N.; Castronovo, V.; Cappa, S.F.; Aloia, M.S.; Marelli, S.; Falini, A.; Alemanno, F.; Ferini-Strambi, L. Obstructive Sleep Apnea: Brain Structural Changes and Neurocognitive Function Before and After Treatment. Am. J. Respir. Crit. Care Med. 2011, 183, 1419–1426. [Google Scholar] [CrossRef] [PubMed]
- Young, T.; Peppard, P.E.; Gottlieb, D.J. Epidemiology of Obstructive Sleep Apnea: A Population Health Perspective. Am. J. Respir. Crit. Care Med. 2002, 165, 1217–1239. [Google Scholar] [CrossRef]
- Yaggi, H.K.; Concato, J.; Kernan, W.N.; Lichtman, J.H.; Brass, L.M.; Mohsenin, V. Obstructive Sleep Apnea as a Risk Factor for Stroke and Death. N. Engl. J. Med. 2005, 353, 2034–2041. [Google Scholar] [CrossRef] [Green Version]
- Manoochehri, Z.; Salari, N.; Rezael, M.; Khazaie, H.; Manoochehri, S.; Pavah, B.K. Comparison of Support Vector Machine Based on Genetic Algorithm with Logistic Regression to Diagnose Obstructive Sleep Apnea. J. Res. Med Sci. 2018, 23, 1–14. [Google Scholar] [CrossRef]
- Le, T.Q. A Nonlinear Stochastic Dynamic Systems Approach for Personalized Prognostis of Cardiorespiratory Disorders. Ph.D. Thesis, Oklahoma State University, Stillwater, OK, USA, 2013. [Google Scholar]
- Le, T.Q.; Cheng, C.; Sangasoongsong, A.; Wongdhamma, W.; Bukkapatnam, S.T. Wireless wearable multisensory suite and real-time prediction of obstructive sleep apnea episodes. IEEE J. Transl. Eng. Health Med. 2013, 1, 2700109. [Google Scholar] [CrossRef] [PubMed]
- Le, T.Q.; Bukkapatnam, S.T. Nonlinear dynamics forecasting of obstructive sleep apnea onsets. PLoS ONE 2016, 11, e0164406. [Google Scholar] [CrossRef] [Green Version]
- Ramírez-Gallego, S.; Krawczyk, B.; García, S.; Woźniak, M.; Benítez, J.M.; Herrera, F. Nearest neighbor classification for high-speed big data streams using spark. IEEE Trans. Syst. Manand Cybern. Syst. 2017, 47, 2727–2739. [Google Scholar] [CrossRef]
- Shao, S.; Wang, T.; Song, C.; Chen, X.; Cui, E.; Zhao, H. Obstructive Sleep Apnea Recognition Based on Multi-Bands Spectral Entropy Analysis of Short-Time Heart Rate Variability. Entropy 2019, 21, 812. [Google Scholar] [CrossRef] [Green Version]
- Vladimir, N.V. Statistical Learning; Wiley: Hoboken, NJ, USA, 1998. [Google Scholar]
- Guller, M. Big Data Analysis with Spark; Apress: New York, NY, USA, 2015. [Google Scholar]
- Al-Angari, H.M.; Sahakian, A.V. Automated Recognition of Obstructive Sleep Apnea Syndrome Using Support Vector Machine Classifier. IEEE Trans. Inf. Technol. Biomed. 2012, 16, 463–468. [Google Scholar] [CrossRef] [PubMed] [Green Version]
- Maali, Y.; Al-Jumaily, A.; Laks, L. Self-Advising SVM for Sleep Apnea Classification. 2012. Available online: https://www.semanticscholar.org/paper/Self-advising-SVM-for-sleep-apnea-classification-Maali-Al-Jumaily/a833ab4f2f10a3b7b87919d0df65ddaed8a12160 (accessed on 21 September 2020).
- Liu, W.-L.; Wu, H.-T.; Juang, J.-N.; Wisniewski, A.; Lee, H.-C.; Wu, D.; Lo, Y.-L. Prediction of the severity of obstructive sleep apnea by anthropometric features via support vector machine. PLoS ONE 2017, 12, e0176991. [Google Scholar] [CrossRef] [PubMed] [Green Version]
- Electrocardiography. Available online: https://en.wikipedia.org/wiki/Electrocardiography (accessed on 18 November 2019).
- “Limb Leads—ECG Lead Placement—Normal Function of the Heart—Cardiology Teaching Package—Practice Learning—Division of Nursing—The University of Nottingham”. Nottingham.ac.uk. Available online: https://www.nottingham.ac.uk/nursing/practice/resources/cardiology/function/limb_leads.php (accessed on 15 August 2019).
- P Wave_(electrocardiography). Available online: https://en.wikipedia.org/wiki/P_wave_(electrocardiography) (accessed on 18 July 2020).
- QRS Complex. Available online: https://en.wikipedia.org/wiki/QRS_complex (accessed on 18 July 2020).
- T Wave. Available online: https://en.wikipedia.org/wiki/T_wave (accessed on 18 July 2020).
- Goldberger, A.L.; Amaral, L.A.N.; Glass, L.; Hausdorff, J.M.; Ivanov, P.C.; Mark, R.G.; Mietus, J.E.; Moody, G.B.; Peng, C.-K.; Stanley, H.E. PhysioBank, PhysioToolkit, and PhysioNet: Components of a New Research Resource for Complex Physiologic Signals. Circulation 2003, 101, e215–e220. [Google Scholar] [CrossRef] [PubMed] [Green Version]
C | Gamma | Accuracy (%) | Sensitivity (%) | Specificity (%) | ||
---|---|---|---|---|---|---|
Regular SVM | Linear | 1 | 86.16 | 89.64 | 83.51 | |
Polynomial | 1 | 87.6 | 93.36 | 83.22 | ||
RBF | 1 | 0.1 | 88.86 | 93.2 | 87.66 | |
RBF | 1 | 0.2 | 87.46 | 91.67 | 80.52 | |
Spark-SVM | Linear | 1 | 85.72 | 82.25 | 91.4 | |
Polynomial | 1 | 89.42 | 85.67 | 92.88 | ||
RBF | 1 | 0.1 | 90.52 | 86.1 | 93.4 | |
RBF | 1 | 0.2 | 90.35 | 84.79 | 86.2 | |
Regular SVM | Linear | 0.1 | 82.2 | 40.2 | 91.1 | |
Polynomial | 0.1 | 84.1 | 56.8 | 87.1 | ||
RBF | 0.1 | 0.1 | 83.82 | 53.08 | 84.35 | |
RBF | 0.1 | 0.2 | 81.58 | 52.8 | 78.82 | |
Spark-SVM | Linear | 0.1 | 83.6 | 48.5 | 81.8 | |
Polynomial | 0.1 | 84.1 | 61.6 | 92.88 | ||
RBF | 0.1 | 0.1 | 85.5 | 81.68 | 91.48 | |
RBF | 0.1 | 0.2 | 85.15 | 79.35 | 86.96 |
© 2020 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).
Share and Cite
Jin, K.; Bagui, S. Apache Spark SVM for Predicting Obstructive Sleep Apnea. Big Data Cogn. Comput. 2020, 4, 25. https://doi.org/10.3390/bdcc4040025
Jin K, Bagui S. Apache Spark SVM for Predicting Obstructive Sleep Apnea. Big Data and Cognitive Computing. 2020; 4(4):25. https://doi.org/10.3390/bdcc4040025
Chicago/Turabian StyleJin, Katie, and Sikha Bagui. 2020. "Apache Spark SVM for Predicting Obstructive Sleep Apnea" Big Data and Cognitive Computing 4, no. 4: 25. https://doi.org/10.3390/bdcc4040025