Understanding Sleep Dynamics Gathered from Wearable Devices with Explainable Recurrent Neural Networks

Abstract

The assessment of sleep quality and related health disorders often involves the analysis of sleep dynamics. In this context, the integra- tion of wearable devices and artificial intelligence presents an opportunity for a deeper analysis. The objective of this study is to explore more com- plex algorithms for next sleep stage classification using machine learn- ing models. For that, first, the benefits or including the sleep dynamics of all the users are explored and then, several classification algorithms are trained for next sleep stage classification. With the best algorithm, explainability techniques, such as attention weights and SHAP values, are employed to elucidate the influence of preceding sleep stages on the following one. The findings demonstrate that training machine learning models with all the users’ data enhances classification performance, im- proving the performance of LGBM classifier in 4.92% and allowing the development of more sophisticated methods. Thus, an accuracy score of 72.29% is obtained with a recurrent neural network when considering 25 previous sleep stages, representing a relative increase of 29.48% over the baseline. In addition, individual stage classification scores improve by up to 30.41% in terms of F1-score. Furthermore, the explainability analysis reveals that next sleep stage prediction is influenced by patterns of pre- ceding sleep stages and the onset of the night. These insights contribute to a deeper understanding of sleep dynamics and opens room for the de- velopment of advanced algorithms to understand the effects of different health conditions on sleep dynamics.