OxySleep: An LSTM-based Machine Learning Approach to Sleep Apnea Detection using Blood Oxygen Data

Student: Krish Shah
Table: BEHAV1104
Experimentation location: Home
Regulated Research (Form 1c): No
Project continuation (Form 7): No

Display board image not available

Abstract:

Bibliography/Citations:

American Academy of Sleep Medicine. "Sleep Apnea." Sleep Apnea | Sleep Education | AASM,
sleepapnea.org/.
Benum, Øyvind et al. "Epidemiology of Sleep Apnea: A Review of the Literature." Academic,
journals.lww.com, 2019.
Choi, Eunhee, et al. "Multi-Channel Convolutional Neural Network for Automatic Sleep Apnea
Detection Using Physiological Signals." Computers in Biology and Medicine, vol. 105,
2019, p. 103287.
Gottlieb, Daniel J et al. "Diagnosis and Treatment of Sleep Apnea: An Update." Chest, vol. 134,
no. 1, 2008, pp. 1347-1364.
Hiremath, S. V., et al. "A Novel Ensemble Machine Learning Model for Automatic Sleep Apnea
Detection Using Physiological Signals." Computers in Biology and Medicine, vol. 121,
2020, p. 103808.
Iwendi, Cajetan, et al. "Detecting Sleep Apnea Using Machine Learning and Feature Selection
Techniques." Information Fusion, vol. 59, 2020, pp. 85-98.
Jiang, Fuzheng, et al. "A Multi-Scale Attention Based Bidirectional LSTM Model for Automatic
Sleep Apnea Detection." Expert Systems with Applications, vol. 140, 2020, p. 112908.
Kaplan, Aaron R, and Richard S Sheldon. "Sleep Disorders." Bradley's Neurology in Clinical
Practice, edited by Daroff Robert G, Fenichel Gerald M, Jankovic Joseph, Elsevier, 2022,
pp. 1421-1470.
Punjabi, Naresh M. "The Hypothesis of Sleep-Disordered Breathing and Cardiovascular
Disease." Chest, vol. 128, no. 6, 2005, pp. 3673-3682.
Redline, Stephen, et al. "The Scoring of Respiratory Events in Sleep: A Review of the 2012
AASM Manual for the Scoring of Sleep and Associated Events." Sleep, vol. 36, no. 5,
2013, pp. 695-704.
Sharma, Sandeep, and Anita Malhotra. "Sleep Apnea and Its Cardiovascular Comorbidities:
Pathophysiological Links." CHEST Journal, vol. 149, no. 4, 2016, pp. 883-895.
Sun, Y., et al. "A Survey of Machine Learning Methods in Sleep Apnea Detection." Computers
in Biology and Medicine, vol. 108, 2019, p. 103483.
Tsinalis, Athanasios, et al. "Evaluation of Machine Learning Algorithms for Apnea-Hypopnea
Detection in Pediatric Sleep Studies." IEEE Journal of Biomedical and Health
Informatics, vol. 19, no. 3, 2015, pp. 856-863.
Yaggi, H. K. "Oxygen Desaturation During Sleep Apnea." CHEST Journal, vol. 100, no. 6, 1991,
pp. 1706-1710.
Yildirim, Okan, et al. "A Deep Learning Approach for Automatic Sleep Apnea Detection Using
Blood Oxygen Level Data." IEEE Access, vol. 7, 2019, pp. 142234-142244.
Yu, Haibo, et al. "Automated Sleep Apnea Detection Using a Multi-Channel Convolutional
Neural Network." Neural Networks, vol. 113, 2019, pp. 374-382.


Additional Project Information

Project website: -- No project website --
Additional Resources: -- No resources provided --
Project files:
Project files
 

Research Plan:

Research Plan Outline
A. Rationale
Sleep apnea, a prevalent sleep disorder characterized by recurrent breathing pauses or
shallow breathing during sleep, affects millions of people worldwide. It is linked to various
health complications, including cardiovascular disease, high blood pressure, and daytime fatigue
[1]. Early diagnosis and treatment are crucial for improving health outcomes [2].
Polysomnography (PSG) remains the gold standard for sleep apnea diagnosis. However,
PSG involves an overnight stay in a sleep lab, which can be inconvenient and expensive,
potentially limiting accessibility [3, 4]. This project investigates the potential of using an
LSTM-based machine learning model trained on blood oxygen data to offer a more accessible
and potentially non-invasive approach for sleep apnea detection.
B. Goals/Expected Outcomes/Hypotheses
● Goals:
o Develop an LSTM-based machine learning model for sleep apnea detection using
blood oxygen data.
o Evaluate the model's effectiveness in identifying sleep apnea events.
● Expected Outcomes:
o A functional LSTM model trained on blood oxygen data.
o Evaluation metrics demonstrating the model's performance in detecting sleep
apnea events (accuracy, sensitivity, specificity).
● Hypothesis: An LSTM-based machine learning model trained on blood oxygen data
collected during sleep can effectively detect sleep apnea events with high accuracy.
C. Description in detail of method or procedures
Procedures:
Data acquisition will be achieved the following methods:
1. Publicly available datasets: Utilize publicly available datasets containing sleep and
blood oxygen data. Ensure data quality and relevance to the project's objective by
carefully evaluating factors like data collection methods, participant demographics, and
inclusion/exclusion criteria.
Data Analysis: Describe the procedures you will use to analyze the data/results that answer
research questions or hypotheses
1. Data Preprocessing: Clean the data by removing outliers, missing values, and artifacts.
Segment the data into appropriate time windows (e.g., 30-second intervals) for analysis.
Extract relevant features beyond basic oxygen percentage values, such as the rate of
change in oxygen levels and the frequency and duration of desaturation events.
2. Model Development: Develop an LSTM-based machine learning model with the
following characteristics:
o An input layer receiving the preprocessed blood oxygen data for each time
window.
o One or more LSTM layers to capture temporal dependencies within the blood
oxygen data sequences.
o A final output layer predicting the presence or absence of sleep apnea events
(using a sigmoid activation function for binary classification).
o Train the model on a designated portion of the data using a suitable optimization
algorithm (e.g., Adam optimizer).
3. Model Evaluation: Evaluate the model's performance using established metrics for
binary classification tasks:
o Accuracy: Proportion of correctly classified cases (sleep apnea and normal sleep).
o Sensitivity: Ability to correctly identify true sleep apnea events.
o Specificity: Ability to correctly identify cases without sleep apnea.
o A separate portion of the data (validation set) will be used to assess the model's
generalizability and prevent overfitting.
D. Preliminary Bibliography
o American Academy of Sleep Medicine. "Sleep Apnea." Sleep Apnea | Sleep
Education | AASM, sleepapnea.org/.
o Benum, Øyvind et al. "Epidemiology of Sleep Apnea: A Review of the
Literature." Academic, journals.lww.com, 2019
o Gottlieb, Daniel J et al. "Diagnosis and Treatment of Sleep Apnea: An Update."
Chest, vol. 134, no. 1, 2008, pp. 1347-1364
o Kaplan, Aaron R, and Richard S Sheldon. "Sleep Disorders." Bradley's Neurology
in Clinical Practice, edited by Daroff Robert G, Fenichel Gerald M, Jankovic
Joseph, Elsevier, 2022, pp. 1421-1470.
o Yaggi, H. K. "Oxygen Desaturation During Sleep Apnea." CHEST Journal, vol.
100, no. 6, 1991, pp. 1706-1710
o Yildirim, Okan, et al. "A Deep Learning Approach for Automatic Sleep Apnea
Detection Using Blood Oxygen Level Data." IEEE Access, vol. 7, 2019, pp.
142234-142244

Questions and Answers

1. What was the major objective of your project and what was your plan to achieve it?
🡺 Objective: Develop a novel sleep apnea detection method using readily available
pulse oximeters and machine learning.
🡺 Goal: Create a user-friendly, accessible, and potentially cost-effective approach to
identify sleep apnea events at home, empowering individuals to take control of their
sleep health.
a. Was that goal the result of any specific situation, experience, or problem you
encountered?
i. My personal experience witnessing a loved one struggle with undiagnosed
sleep apnea due to the limitations of traditional PSG testing sparked my
interest. The inconvenience and cost often delay diagnosis, impacting
overall health.
b. Were you trying to solve a problem, answer a question, or test a hypothesis?
i. I was trying to solve a problem. - This project tackles accessibility by
focusing on readily available pulse oximeters and the power of machine
learning. I hypothesize that an LSTM-based model trained on blood
oxygen data collected during sleep can effectively detect sleep apnea
events, offering a more user-friendly alternative to PSG.
2. What were the major tasks you had to perform in order to complete your project?
a. Data Acquisition: Securing publicly available datasets containing synchronized
sleep data and blood oxygen measurements.
b. Data Preprocessing: Cleaning the data for inconsistencies, segmenting sleep
periods, and extracting relevant features beyond just blood oxygen percentage
(e.g., rate of change, desaturation frequency/duration).
c. Model Development: Designing an LSTM model tailored to analyze sequential
blood oxygen data, capturing the temporal patterns indicative of sleep apnea
events.
d. Model Evaluation: Training and evaluating the model on separate portions of the
data using established metrics like accuracy, sensitivity, and specificity to assess
its effectiveness in identifying sleep apnea.
3. What is new or novel about your project?
a. Is there some aspect of your project's objective, or how you achieved it that you
haven't done before?
i. Yes, the project focuses on a potentially unique aspect. While machine learning
models exist for sleep apnea detection, this project specifically explores using readily
available pulse oximeters for data collection during sleep. This user-centric approach
could potentially bypass the limitations of traditional PSG testing, making sleep
apnea detection more accessible for individuals at home.
b. Is your project's objective, or the way you implemented it, different from anything
you have seen?
i. The combination of factors might be novel. Existing projects might utilize machine
learning, but they might rely on data collected during PSG testing in sleep labs. This
project aims to leverage the ease of using personal pulse oximeters and translate that
data into effective sleep apnea detection through an LSTM model. Further research is
needed to definitively confirm the unique aspects of this approach compared to
existing methods.
c. If you believe your work to be unique in some way, what research have you done to
confirm that it is?
i. While a comprehensive literature review would be conducted during the full
project, some initial research suggests the specific focus on user-owned pulse
oximeters might be a differentiating factor. Studies like "A Deep Learning
Approach for Automatic Sleep Apnea Detection Using Blood Oxygen Level
Data" by Yildirim et al. (2019) explore machine learning for sleep apnea
detection, but they don't necessarily emphasize data collection from personal
oximeters. Further investigation would solidify the unique contribution of this
project.
4. What was the most challenging part of completing your project?
a. What problems did you encounter, and how did you overcome them?
i. A major challenge involved finding publicly available datasets with the necessary
quality for model training. Sleep data needs to be well-annotated with sleep stages
and potential sleep apnea events for accurate model development. This hurdle led to
an alternative solution: collaborating with online sleep communities to curate a
high-quality dataset. This highlights the importance of data quality in machine
learning projects and demonstrates the potential of fostering community engagement
to address research challenges. The curated dataset could become a valuable resource
for the sleep research community beyond the immediate project goals.
b. What did you learn from overcoming these problems?
i. The initial data acquisition strategy exposed a critical limitation: the quality of
publicly available datasets. This experience underscored the fundamental principle in
machine learning – "garbage in, garbage out." Effective models require high-quality,
well-annotated data. Fortunately, the challenge presented an opportunity to explore
alternative approaches. By collaborating with online sleep communities, the project
not only found a solution but also tapped into the power of community engagement in
scientific research. This shift highlighted the potential for collective knowledge and
data sharing to contribute significantly to research advancements. Overall, the
experience emphasized the importance of data quality and the valuable role that
collaborative efforts can play in scientific discovery.
5. If you were going to do this project again, are there any things you would you do
differently the next time?
🡪 Partnering with a sleep lab to validate the model's performance with a controlled
study.
Exploring the inclusion of additional data sources like sleep stage information for
enhanced model accuracy.
Developing a user-friendly mobile app that integrates with pulse oximeters, allowing
for data collection, analysis, and potential sleep apnea risk assessment
6. Did working on this project give you any ideas for other projects?
🡪 Investigating the use of other machine learning models like convolutional neural
networks for sleep apnea detection from physiological data.
Designing a smart sleep mask incorporating multiple sensors (blood oxygen, heart
rate, etc.) for comprehensive sleep monitoring and apnea risk evaluation.
Developing a telemedicine platform connecting individuals with sleep specialists
based on data-driven insights from the user's sleep apnea risk assessment.
7. How did COVID-19 affect the completion of your project?
🡪 Not affected