JMIR mHealth and uHealth (Oct 2021)

Open-source Longitudinal Sleep Analysis From Accelerometer Data (DPSleep): Algorithm Development and Validation

  • Habiballah Rahimi-Eichi,
  • Garth Coombs III,
  • Constanza M Vidal Bustamante,
  • Jukka-Pekka Onnela,
  • Justin T Baker,
  • Randy L Buckner

DOI
https://doi.org/10.2196/29849
Journal volume & issue
Vol. 9, no. 10
p. e29849

Abstract

Read online

BackgroundWearable devices are now widely available to collect continuous objective behavioral data from individuals and to measure sleep. ObjectiveThis study aims to introduce a pipeline to infer sleep onset, duration, and quality from raw accelerometer data and then quantify the relationships between derived sleep metrics and other variables of interest. MethodsThe pipeline released here for the deep phenotyping of sleep, as the DPSleep software package, uses a stepwise algorithm to detect missing data; within-individual, minute-based, spectral power percentiles of activity; and iterative, forward-and-backward–sliding windows to estimate the major Sleep Episode onset and offset. Software modules allow for manual quality control adjustment of the derived sleep features and correction for time zone changes. In this paper, we have illustrated the pipeline with data from participants studied for more than 200 days each. ResultsActigraphy-based measures of sleep duration were associated with self-reported sleep quality ratings. Simultaneous measures of smartphone use and GPS location data support the validity of the sleep timing inferences and reveal how phone measures of sleep timing can differ from actigraphy data. ConclusionsWe discuss the use of DPSleep in relation to other available sleep estimation approaches and provide example use cases that include multi-dimensional, deep longitudinal phenotyping, extended measurement of dynamics associated with mental illness, and the possibility of combining wearable actigraphy and personal electronic device data (eg, smartphones and tablets) to measure individual differences across a wide range of behavioral variations in health and disease. A new open-source pipeline for deep phenotyping of sleep, DPSleep, analyzes raw accelerometer data from wearable devices and estimates sleep onset and offset while allowing for manual quality control adjustments.