Predictive Sleep Modeling: Bridging Daytime Activity and Bedroom Environment
Comparison of machine learning methods to predict sleep quality from daytime activity and nightly bedroom environmental conditions
This study investigates the use of machine learning—specifically Logistic Regression (LR), K-Nearest Neighbor (KNN), and Random Forest (RF)—to predict nine sleep quality metrics using physical activity and Indoor Air Quality (IAQ) data. The research demonstrates SOTA-level predictive performance for metrics like sleep efficiency and self-reported restfulness, achieving adjusted F1-scores as high as 0.92.
TL;DR
Can your bedroom's air quality predict how well you'll sleep? This paper explores a machine learning approach to sleep prediction by merging wearable activity data with Indoor Air Quality (IAQ) sensors. By monitoring 20 participants over 2.5 months, the research proves that traditional ML models like Random Forest can achieve high accuracy (F1-score 0.92) in predicting restfulness and sleep efficiency.
Problem & Motivation: The Missing Environmental Link
In the quest for better sleep, most commercial solutions focus solely on the user—tracking heart rate and movement. However, sleep doesn't happen in a vacuum. Prior work has largely ignored the external environmental "bottleneck". While physical activity (steps and exertion) sets the biological stage for sleep, the quality of that sleep is often dictated by air pollutants (PM, TVOCs) and CO2 levels in the bedroom.
The authors argue that by ignoring IAQ, we are missing half the story. Their goal is to determine if "easily measured parameters" from consumer-grade sensors can provide actionable insights into nightly recovery.
Methodology: Fusing IoT and Wearables
The researchers deployed a multi-modal tracking system:
- Activity Tracking: Fitbit devices collected steps and intensity levels (Metabolic Equivalents).
- Environmental Sensing: Custom monitors measured 6 IAQ parameters including CO2, Particulate Matter (PM), and Temperature.
- Ground Truth: Data was labeled using both device-measured metrics (Sleep Efficiency, REM) and user-reported Ecological Momentary Assessments (EMAs).
The methodology addresses a common pitfall in health data: Class Imbalance. Since most participants (healthy students) generally sleep "well," the "poor sleep" category is a minority. The authors utilized weighted Logistic Regression and Gradient Boosting Random Forests to ensure the models didn't simply default to predicting "good sleep" every time.
Figure 1: Comparison of the sleep metrics captured via Fitbit versus self-reported EMA.
Experiments & Results: RF vs. The World
The study compared Logistic Regression (LR), K-Nearest Neighbors (KNN), and Random Forest (RF).
Key Findings:
- Restfulness & Efficiency: These were the "star" metrics. The RF model achieved an adjusted F1-score of 0.91-0.92, proving that environmental conditions are highly indicative of how "refreshed" a person feels.
- The REM Challenge: All models struggled with REM sleep (F1 ~0.52). This suggests that REM cycles might be more heavily influenced by internal circadian rhythms or neurobiology than by immediate environmental air quality.
- Activity vs. Environment: Interestingly, certain metrics showed higher sensitivity to IAQ than to the number of steps taken the previous day.
Figure 2: Performance breakdown across different ML models and sleep targets.
Critical Insight: The Value of Traditional ML
A significant takeaway from this paper is the efficacy of "Traditional ML" (Random Forest, LR) over complex Deep Learning for small-to-medium sensor datasets. While neural networks (Sathyanarayana et al.) have reached 95% accuracy in other studies, they require massive datasets. This study shows that with well-engineered features (like binarized IAQ levels), ensemble methods can provide robust, interpretable results that are context-aware.
Conclusion & Future Outlook
This work underscores that the "smart home" of the future shouldn't just dim the lights—it should actively management ventilation and air purity based on your daytime activity to optimize recovery.
Limitations: The study was limited to a specific demographic (healthy young students) and a 2.5-month window. Future work integrating larger datasets and more granular temporal IAQ data (tracking changes during the night) could unlock even higher predictive power for elusive stages like REM.
The bottom line: If you want to know how you'll sleep, look at your Fitbit, but don't forget to check your CO2 monitor.
