DeepSleepNet: A Model for Automatic Sleep Stage Scoring Based on Raw Single-Channel EEG

Akara Supratak, Hao Dong, Chao Wu, Yike GuoIEEE Transactions on Neural Systems and Rehabilitation Engineering 2017 · DOI

Abstract

This paper proposes a deep learning model, named DeepSleepNet, for automatic sleep stage scoring based on raw single-channel EEG. Most existing methods rely on hand-engineered features, which require prior knowledge of sleep analysis. Only a few of them encode temporal information, such as transition rules, which is important for identifying sleep stages. In the proposed model, we utilize convolutional neural networks (CNNs) to extract time-invariant features and bidirectional-long short-term memory (Bi-LSTM) to learn transition rules among sleep stages automatically from EEG epochs. We implement a two-step training algorithm to train our model efficiently. Evaluated on two public datasets (MASS and Sleep-EDF), our model achieved similar or better overall accuracy and macro F1-score compared with state-of-the-art methods. This demonstrates that DeepSleepNet can automatically learn features for sleep stage scoring from different raw single-channel EEGs without utilizing any hand-engineered features.

Introduction

Sleep stage scoring—the process of categorizing 30-second "epochs" of sleep into stages like REM, Wake, or Deep Sleep (N3)—is the backbone of sleep medicine. Traditionally, this is a grueling manual task where experts review hours of polysomnography (PSG) data. While automated systems exist, they face two major hurdles: the reliance on human-defined mathematical features (feature engineering) and the failure to account for temporal context (transition rules). DeepSleepNet addresses these by automating feature extraction and sequential modeling using a deep learning framework.

Methodology

DeepSleepNet uses a two-part architecture to mimic the way a human expert analyzes a sleep study:

  • Representation Learning: The model uses two parallel CNN branches with different filter sizes. A small-filter branch captures fine-grained temporal information, while a large-filter branch captures frequency-domain information. This effectively automates the signal processing trade-offs usually handled by engineers.
  • Sequence Residual Learning: The features from the CNNs are fed into Bi-LSTM layers. These layers learn the transition rules by looking at both past and future epochs. A residual shortcut connection links the CNN output directly to the final classification, ensuring the model maintains the unique characteristics of the current epoch while considering the broader sequence.
The DeepSleepNet architecture, featuring parallel CNN branches for representation learning and Bi-LSTMs for sequence residual learning.

To handle class imbalance (e.g., the prevalence of N2 over N1), a two-step training algorithm is employed. First, the CNNs are pre-trained on a balanced, oversampled dataset. Then, the entire model is fine-tuned on the original sequential data using distinct learning rates for the CNN and RNN components.

Datasets

The model was validated on two prominent public datasets:

  • MASS (Montreal Archive of Sleep Studies): 62 healthy subjects, using the F4-EOG (Left) channel.
  • Sleep-EDF: 20 subjects, using the Fpz-Cz and Pz-Oz channels.

These datasets vary in sampling rates and scoring standards (AASM vs. R&K), providing a rigorous test of the model's generalization capabilities.

Results and Discussion

DeepSleepNet achieved performance comparable to or better than state-of-the-art methods that use hand-engineered features. On the MASS dataset, it reached 86.2% overall accuracy and an 81.7 macro F1-score. On the Sleep-EDF dataset, it achieved 82.0% accuracy and a 76.9 macro F1-score.

Comparison between a hypnogram manually scored by a sleep expert and one automatically scored by DeepSleepNet.

Qualitatively, the model's hypnograms closely match expert scoring. The Bi-LSTMs successfully internalized transition rules; for example, maintaining an "N2" classification during ambiguous periods if preceded by clear N2 markers. The residual connections were critical in preventing temporal smoothing from washing out distinct features of individual 30-second windows.

Conclusion

DeepSleepNet demonstrates that a single-channel EEG model can achieve high accuracy without manual feature engineering. By combining CNNs for representation and Bi-LSTMs for sequence modeling, the system generalizes across different electrode locations and datasets. Future work may extend this model to wearable devices for remote, long-term sleep monitoring outside of clinical settings.

Summary updated

BibTeX
@article{supratak2017deepsleepnet,
  author = {Akara Supratak and Hao Dong and Chao Wu and Yike Guo},
  title = {{DeepSleepNet: A Model for Automatic Sleep Stage Scoring Based on Raw Single-Channel EEG}},
  journal = {IEEE Transactions on Neural Systems and Rehabilitation Engineering},
  year = {2017},
  doi = {10.1109/tnsre.2017.2721116},
}
Figure