0343 A Transformer-Based Deep Learning Model for Sleep/Wake Classification in Actigraphy

Abstract Introduction Actigraphy enables cost-effective, long-term sleep monitoring; however, accurate sleep scoring based on activity counts remains challenging. Existing algorithms (e.g., the Cole-Kripke and Actiware) depend strongly on absolute activity-count levels without considering the temporal activity patterns during sleep-wake transition, making them sensitive to device-specific differences and limiting cross-device implementation. Methods We developed a novel deep learning algorithm with a Transformer-based architecture that leveraged self-attention mechanisms to capture complex sleep/wake transition patterns in activity counts and tested the performance for sleep/wake classification per 30-sec epoch. Positional embeddings preserve temporal order while self-attention captures local dependencies (30 minutes), such as sustained quiescence preceding sleep onset. Attended features are aggregated via global average pooling for binary classification. Training and internal validation were evaluated using the Multi-Ethnic Study of Atherosclerosis (MESA) datasets (n=1,404). Generalizability of the transformer-based model was assessed using external Out-of-Sample (OOS) datasets (n=25) collected in an in-laboratory study of daytime and nighttime workers, which involved sleep during nighttime and simulated daytime sleep schedules. For both training/validation and testing datasets, sleep/wake status was determined using polysomnography-based sleep scoring. Results In MESA, the model achieved an average accuracy of 0.79 +/- 0.01, an average AUC of 0.82 +/- 0.01, and an average F1 score of 0.82 +/- 0.01 across participants, effectively distinguishing between sleep and wakefulness. The model demonstrated a high stability on the external OOS datasets, achieving an average accuracy of 0.95 +/- 0.01, AUC of 0.97 +/- 0.01, and F1 score of 0.84 +/- 0.02. Conclusion Our results demonstrate that a streamlined, attention-based Transformer model achieves robust sleep/wake classification using actigraphy. Future work will further evaluate its performance in larger, independent datasets and assess its capability in detecting sleep events outside the primary window (e.g., naps). Support (if any) R01AG083799

Authors

Institutions

Publication Details

Journal
SLEEP
Published
2026-05-01
DOI
https://doi.org/10.1093/sleep/zsag091.0343
Primary Topic
Sleep and related disorders
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

0343 A Transformer-Based Deep Learning Model for Sleep/Wake Classification in Actigraphy

P H M Li, Frank Scheer, Shahab Haghayegh, Hu K et al.
SLEEP
Sleep and related disorders
article

0343 A Transformer-Based Deep Learning Model for Sleep/Wake Classification in Actigraphy

P H M Li, Frank Scheer, Shahab Haghayegh, Hu K, Sebastian Moguilner, Susan Redline, Hui-Wen Yang
article en

Abstract

Abstract Introduction Actigraphy enables cost-effective, long-term sleep monitoring; however, accurate sleep scoring based on activity counts remains challenging. Existing algorithms (e.g., the Cole-Kripke and Actiware) depend strongly on absolute activity-count levels without considering the temporal activity patterns during sleep-wake transition, making them sensitive to device-specific differences and limiting cross-device implementation. Methods We developed a novel deep learning algorithm with a Transformer-based architecture that leveraged self-attention mechanisms to capture complex sleep/wake transition patterns in activity counts and tested the performance for sleep/wake classification per 30-sec epoch. Positional embeddings preserve temporal order while self-attention captures local dependencies (30 minutes), such as sustained quiescence preceding sleep onset. Attended features are aggregated via global average pooling for binary classification. Training and internal validation were evaluated using the Multi-Ethnic Study of Atherosclerosis (MESA) datasets (n=1,404). Generalizability of the transformer-based model was assessed using external Out-of-Sample (OOS) datasets (n=25) collected in an in-laboratory study of daytime and nighttime workers, which involved sleep during nighttime and simulated daytime sleep schedules. For both training/validation and testing datasets, sleep/wake status was determined using polysomnography-based sleep scoring. Results In MESA, the model achieved an average accuracy of 0.79 +/- 0.01, an average AUC of 0.82 +/- 0.01, and an average F1 score of 0.82 +/- 0.01 across participants, effectively distinguishing between sleep and wakefulness. The model demonstrated a high stability on the external OOS datasets, achieving an average accuracy of 0.95 +/- 0.01, AUC of 0.97 +/- 0.01, and F1 score of 0.84 +/- 0.02. Conclusion Our results demonstrate that a streamlined, attention-based Transformer model achieves robust sleep/wake classification using actigraphy. Future work will further evaluate its performance in larger, independent datasets and assess its capability in detecting sleep events outside the primary window (e.g., naps). Support (if any) R01AG083799

SLEEPVol. 49(Supplement_1)
Brigham and Women's Hospital (US), Harvard University (US), Tzu Chi University (TW), Massachusetts General Hospital (US), Circadian (United States) (US)
Openalex Percentile: Top 7%
Sleep and related disorders
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.