Abstract Introduction Accurate detection of time in bed (TIB) is essential for large-scale sleep research and consumer health applications, yet most high-accuracy systems require dedicated hardware or active user engagement. We developed a zero-effort smartphone-based model that infers time-in-bed from behavioural and sensor-derived signals, requiring no user input beyond normal phone use. This work seeks to demonstrate that accurate time-in-bed estimation is achievable from passive smartphone signals alone. Methods A supervised sequence-to-sequence machine learning model was trained to infer nightly TIB from a PSG-validated contactless sonar smartphone application (SleepScore). Inputs consisted of behavioural and sensor-derived features aggregated into 10-minute epochs spanning full 24-hour periods. Ground-truth labels were obtained from the smartphone app: bedtime onset was defined by a user-initiated button tap signalling intent to sleep, and sleep offset by a button tap upon waking. The full dataset included smartphone-derived sequences from 1,175 training users (3,712 nights) and 392 validation users (1216 nights), with an independent test set of 421 users (1,284 nights). All splits were user-independent. The model architecture combined a convolutional neural network with a long short-term memory layer to capture local and long-range temporal patterns in daily behaviour. The model was implemented in PyTorch and trained using a boundary-aware objective function that emphasised accurate detection of sleep onset and offset transitions. Features captured behavioural indicators (e.g., activity/rest patterns) and contextual signals (e.g., regularity of routines and personalised historical baselines), aggregated into 10-minute epochs. Results Model evaluation on the user-independent holdout set demonstrated strong performance in estimating TIB and detecting sleep boundary transitions. Classification performance was high, with accuracy 97.3%, precision 96.9%, recall 96.9%, F1 score 96.9%, and ROC AUC 99.5%. Timing-related metrics indicated reliable boundary detection, with a mean sleep onset error of +18.8 minutes and a mean sleep offset error of +22.0 minutes. Bias remained minimal, with sleep onset bias of +2.1 minutes and sleep offset bias of −0.1 minutes. Conclusion A deep learning model can accurately estimate TIB from passively collected smartphone signals, without dedicated hardware or active user input. This low-burden approach enables population-scale sleep monitoring, with potential applications in circadian rhythm research and consumer sleep opportunity assessment. Support (if any) Sleep.ai
Gahan et al. (Fri,) studied this question.