Database Restricted Access

Ordinal Sleep Depth - Data and Code

Erik-Jan Meulenbrugge Haoqi Sun Wolfgang Ganglberger Samaneh Nasiri Robert Thomas M Brandon Westover

Published: April 24, 2025. Version: 1.0


When using this resource, please cite: (show more options)
Meulenbrugge, E., Sun, H., Ganglberger, W., Nasiri, S., Thomas, R., & Westover, M. B. (2025). Ordinal Sleep Depth - Data and Code (version 1.0). Brain Data Science Platform. https://doi.org/10.60508/2653-7s09.

Abstract

This provides data and code to accompany the Ordinal Sleep Depth (OSD), a data-driven continuous measure of sleep depth developed using deep learning. In the manuscript, we evaluate OSD's correlation with arousal probability and its association with age, sex, sleep-disordered breathing (SDB), and cognitive impairment using 21,787 polysomnography recordings from 18,116 unique patients. OSD shows a strong linear correlation with arousal probability (Pearson's r = 0.994), slightly outperforming the Odds Ratio Product (ORP) measure (r = 0.923). Both measures reflect expected decreases in sleep depth with advancing age and demonstrate that females have significantly deeper sleep than males. OSD more accurately captures sleep depth reductions associated with SDB and increasing levels of cognitive impairment.


Background

Conventional sleep analysis divides recordings into 30-second epochs and categorizes them into five discrete stages defined by the American Academy of Sleep Medicine (AASM): wakefulness (W), non-rapid eye movement (NREM) stages N1, N2, N3, and rapid eye movement stage (REM). While this facilitates manual scoring, it provides only a coarse characterization of what is physiologically a continuous process. Sleep can be recognized at finer time resolutions, and a continuous approach to state characterization could more accurately quantify sleep depth and quality.

Previous research shows that arousal threshold increases gradually as sleep depth increases, reinforcing the notion that sleep depth lies along a continuum. While machine learning approaches have been used to analyze large-scale sleep datasets, most have focused on automating conventional AASM scoring rather than developing continuous measures of sleep depth.
 


Methods

Retrospective analysis of polysomnography (PSG) data was approved by the MGB (protocol # 2013P001024) and BIDMC Institutional Review Boards (# 2016P000058) without requiring additional consent. Data was recorded as part of routine clinical care in the Massachusetts General Hospital (MGH) Sleep Laboratory from 2009 to 2020 using equipment from Natus Neuro, CA, US.

We developed a deep neural network architecture consisting of 5 convolutional blocks to analyze 3-second EEG segments. The model was trained using two complementary objectives: 1) an ordinal regression objective, which captures the ordered nature of NREM sleep stages (W < N1 < N2 < N3), and 2) a classification objective, which estimates the likelihood of conventional sleep stage classification. We compared OSD with the Odds Ratio Product (ORP) and evaluated correlations with conventional sleep stages, arousal index, and clinical variables including age, sex, sleep-disordered breathing, and cognitive impairment.


Data Description

A total of 21,787 PSG recordings from 18,116 unique patients were used for this study. These recordings were obtained from the Human Sleep Project. The dataset was split into "No known cognitive decline" (19,302 recordings, 16,139 patients) and "Known cognitive decline" (2,485 recordings, 1,977 patients) groups. Recordings from the "No known cognitive decline" group were split into 85% development and 15% validation using a patient-wise split, while data from the "Known cognitive decline" group was added to the validation set. This resulted in 15,940 records from 13,004 patients for development and 5,847 records from 5,112 unique patients for validation.


Usage Notes

Code to generate all results and figures from the publication are provided here.
 


Ethics

This study of human subjects was approved by the MGB (protocol # 2013P001024) and BIDMC Institutional Review Boards (# 2016P000058) without requiring additional consent for its use in this study. All data is deidentified.


Conflicts of Interest

M.B.W. is a co-founder of and holds equity in Beacon Biosignals. Beacon Biosignals did not contribute funding nor played any role in the study.


Parent Projects
Ordinal Sleep Depth - Data and Code was derived from: Please cite them when using this project.
Share
Access

Access Policy:
Only registered users who sign the specified data use agreement can access the files.

License (for files):
BDSP Restricted Health Data License 1.0.0

Data Use Agreement:
BDSP Restricted Health Data Use Agreement

Corresponding Author
You must be logged in to view the contact information.

Files