AI-Based Automated Sleep Staging Using Heart Rate Variability

Automated sleep staging using only heart rate variability data can classify sleep stages with nearly 80% accuracy, according to a new study in the National Medical Journal of India that tested both random forest and deep learning approaches on over 600 subjects.

The research, led by Suvradeep Chakraborty (Nil Ratan Sircar Medical College, Kolkata) and colleagues from AIIMS Bhubaneswar and the University of Alberta, addresses a key bottleneck in sleep medicine: polysomnography is expensive, requires specialized facilities, and is inaccessible for large-scale population screening.

What They Found

The team used ECG data from 645 subjects in the PhysioNet/Computing in Cardiology Challenge 2018 dataset, extracting time-domain, frequency-domain, and nonlinear heart rate variability features. They then tested two classification architectures:

  • Random Forest Classifier (RFC): 79.6% accuracy (SD 1.6) on internal validation
  • Bidirectional LSTM (deep learning): 74.70% accuracy (SD 1.05)

The random forest outperformed the more complex deep learning model, likely because the feature space was well-structured and the dataset was not large enough to justify a deep network’s additional parameters.

Crucially, the researchers incorporated the sleep epoch index as an explicit temporal feature rather than treating each sleep segment as independent. This accounted for the sequential structure of sleep — the fact that N3 sleep typically follows N2, and REM sleep is more likely in later sleep cycles.

In an external validation on an independent dataset (Haaglanden Medisch Centrum, 43 subjects), the RFC achieved 78.9% accuracy with a Cohen’s kappa of 0.70 and a macro F1 score of 0.789 — closely matching the internal validation performance and suggesting good generalizability.

Why It Matters

Polysomnography remains the gold standard for sleep staging, but it requires overnight stays in sleep laboratories, skilled technicians for scoring, and expensive equipment that is unavailable in many regions worldwide. An automated system that classifies sleep stages from a single-lead ECG signal — or ultimately from a consumer wearable — could dramatically expand access to sleep assessment.

Proper preprocessing proved critical. The authors emphasize that HRV estimation requires careful outlier removal and correction of ectopic beats using linear interpolation. Without this step, classification accuracy degrades significantly.

The finding that a relatively simple random forest classifier matched or exceeded a deep learning model has practical implications: simpler models are easier to deploy, require less computational power, and are more readily interpretable by clinicians.

Limits

The model classifies five sleep stages (W, N1, N2, N3, REM) but N1 staging remains challenging even for human scorers using full polysomnography, and HRV-only approaches are unlikely to match multi-channel PSG for fine-grained staging. The external validation set was small (n=43). Performance on pathological sleep (sleep apnea, periodic limb movements, narcolepsy) was not separately reported.

Bottom Line

A random forest classifier using heart rate variability features and temporal context can automate sleep staging with approximately 79% accuracy. While not a replacement for clinical polysomnography, the approach demonstrates the feasibility of scalable, ECG-based sleep assessment.

Source

Suvradeep Chakraborty, Manish Goyal, Paritosh Goyal, Priyadarshini Mishra. “Artificial intelligence-based automated sleep staging using heart rate variability: Assessment of performance and clinical prospects.” National Medical Journal of India, 2026 Jul-Aug;39(4):224-230. DOI: 10.25259/NMJI_397_2024. PMID: 42325027.

Scroll to Top