Intra- and Inter-epoch Temporal Context Network (IITNet) Using Sub-epoch Features for Automatic Sleep Scoring on Raw Single-channel EEG

Hogeon Seo, Seunghyeok Back, Seongju Lee, Deokhwan Park, Tae Kim, Kyoobin LeearXiv 2019 · DOI

TL;DR

IITNet is an end-to-end deep learning model that automates sleep scoring using just a single channel of raw EEG data. By mimicking human experts to analyze both micro-events within a 30-second window (intra-epoch) and historical trends across windows (inter-epoch), it achieves state-of-the-art accuracy. Crucially, the authors show that looking back at just two minutes of historical data is the sweet spot for high-accuracy, real-time sleep tracking.

What Problem Does This Paper Address?

Sleep staging—categorizing sleep into states like Wake, REM, and various Non-REM stages—is vital for diagnosing sleep disorders. Traditionally, this is done manually by clinicians reviewing overnight polysomnography (PSG) data in 30-second blocks called "epochs." This manual process is incredibly tedious, labor-intensive, and subjective.

While automated machine learning solutions exist, they suffer from several drawbacks:

  1. Heavy Preprocessing: Many models require converting raw signals into time-frequency spectrograms first.
  2. Handcrafted Features: Older methods rely on engineered features that don't translate well across different hospital environments or equipment.
  3. Multi-Channel Dependency: Many top-performing models require multiple sensors (EEG, EOG, EMG), making them impractical for lightweight, home-use wearables.

IITNet addresses these gaps by processing raw, single-channel EEG data in a single, end-to-end step, successfully capturing both short-term localized events and long-term sleep stage transition rules.

Methods

IITNet stands for Intra- and Inter-epoch Temporal Context Network. It uses a Convolutional Recurrent Neural Network (CRNN) architecture designed to replicate how human experts score sleep:

  • Intra-epoch Feature Learning (The CNN): The model utilizes a modified 1-dimensional ResNet-50. It breaks down a single 30-second epoch into smaller, overlapping "sub-epochs." The deep residual layers extract feature vectors from these sub-epochs, capturing localized micro-events like sleep spindles or K-complexes without requiring any manual feature engineering or Fourier transforms.
  • Inter-epoch Context Learning (The RNN): These sub-epoch features are fed chronologically into a two-layer Bidirectional LSTM (BiLSTM). The BiLSTM learns the temporal context—how sleep features flow into one another over time.
  • Context Window ($L$): The network evaluates a sequence of $L$ epochs (the target epoch plus the preceding $L-1$ epochs). This past-looking approach makes the model highly viable for real-time applications, as it doesn't rely on future data to predict the current sleep stage.

Datasets

The model was validated across three prominent, distinct public datasets to prove its versatility:

  • SleepEDF (2013 version): 20 healthy subjects, utilizing the single-channel Fpz-Cz EEG.
  • MASS (Montreal Archive of Sleep Studies): Subset SS3 (62 subjects), utilizing the F4-EOG (left) channel.
  • SHHS (Sleep Heart Health Study): A massive cohort dataset, utilizing 5,791 records from the C4-A1 EEG channel.

Key Insights and Ideas

  • The "Two-Minute" Sweet Spot: The authors experimented with sequence lengths ($L$) from 1 to 10 epochs. Performance spiked dramatically when moving from 1 epoch to 4 epochs (2 minutes of data), particularly for tricky transition stages like N1 and REM. However, adding context beyond 4 epochs yielded diminishing returns. This implies that overnight context isn't necessary for accurate deep learning models; a two-minute rolling window is sufficient.
  • Architecture Depth Matters by Dataset Scale: Replacing shallow CNNs with a deep ResNet-50 significantly boosted performance on the massive SHHS dataset. However, on smaller datasets like MASS, the deep architecture occasionally underperformed slightly compared to shallower baselines, likely due to overfitting on limited data. This underscores the importance of matching network depth to dataset scale in biomedical applications.
  • Implicit Handling of Class Imbalance: Sleep datasets are notoriously imbalanced (e.g., the N1 stage often makes up less than 10% of a night's sleep). IITNet achieved strong macro F1-scores without relying on standard mitigation techniques like class-balanced sampling or synthetic data generation.

Key Results

IITNet achieved performance on par with state-of-the-art models while using simpler, single-channel raw inputs:

  • Peak Performance:
  • SleepEDF ($L=10$): 83.9% accuracy, 77.6% Macro F1 (MF1), 0.78 Cohen's kappa ($\kappa$).
  • MASS ($L=9$): 86.5% accuracy, 80.7% MF1, 0.80 $\kappa$.
  • SHHS ($L=10$): 86.7% accuracy, 79.8% MF1, 0.81 $\kappa$.
  • 4-Epoch Efficiency ($L=4$): Using just a 2-minute window, the model achieved nearly identical accuracy: 83.6% for SleepEDF, 86.2% for MASS, and 86.3% for SHHS.
  • Targeted Stage Improvements: Compared to looking at a single epoch ($L=1$), utilizing the 4-epoch window boosted the F1-scores for the notoriously difficult N1, N2, and REM stages by 16.1%, 1.50%, and 6.42% percentage points, respectively.

Limitations and Future Work

  • Rigid Sampling Rates: The model's architecture is tied to the sampling frequency it was trained on. To evaluate signals with different sampling rates, data must be manually up- or down-sampled beforehand.
  • Room to Grow on N1 Detection: Although context learning helped, the F1 score for the N1 stage remains lower than other stages due to its transient nature and mixed-frequency characteristics.
  • Future Directions: The authors plan to introduce a "frequency-aware" module to better isolate the 4–7.99 Hz alpha/theta bands characteristic of the N1 stage. They also aim to expand IITNet into a sequence-to-sequence multi-channel ensemble model for clinical settings.

Summary updated

BibTeX
@misc{seo2019intra,
  author = {Hogeon Seo and Seunghyeok Back and Seongju Lee and Deokhwan Park and Tae Kim and Kyoobin Lee},
  title = {{Intra- and Inter-epoch Temporal Context Network (IITNet) Using Sub-epoch Features for Automatic Sleep Scoring on Raw Single-channel EEG}},
  year = {2019},
  eprint = {1902.06562},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1902.06562},
}
Figure