Convolutional Neural Network Based Sleep Stage Classification with Class Imbalance

Qi Xu, Dongdong Zhou, Jian Wang, Jiangrong Shen, Lauri Kettunen, Fengyu Cong

Introduction

Sleep stage classification is a critical component of clinical sleep medicine, providing insights into various neurological and physiological disorders. Traditionally, specialists manually score overnight polysomnography (PSG) data into five distinct stages: Wake (W), Rapid Eye Movement (REM), and Non-REM stages (N1, N2, N3). However, manual scoring is labor-intensive and prone to inter-rater variability. While deep learning models offer a promising automated alternative, they face a significant hurdle: Class Imbalance (CIP).

In typical sleep datasets, stages like W and N2 dominate, often accounting for over 60% of the recording. Conversely, the N1 transition stage is a "minority class," frequently representing less than 5% of the total data. Standard neural networks, acting as "lazy" optimizers, tend to prioritize the majority classes to achieve high overall accuracy, often at the expense of failing to identify critical minority stages like N1. This paper addresses this imbalance by proposing a novel data augmentation (DA) strategy using Gaussian white noise.

Methodology

Noise-Driven Data Augmentation

To mitigate the effects of class imbalance without over-fitting or disrupting the underlying physiological structure of the sleep cycle, the authors developed two distinct augmentation strategies focused on the minority N1 stage.

1. Signal-Driven Data Augmentation

In this approach, Gaussian white noise is added directly to the raw EEG signal before any transformation. By varying the Signal-to-Noise Ratio (SNR) at intensities of 10dB, 5dB, and 1dB, the researchers create synthetic variations of the N1 stage. This process introduces additional frequency components into the resulting time-frequency representation, forcing the model to learn more robust and invariant features of the transition stage.

Visualizing signal-driven noise augmentation on EEG spectrograms at different intensities.

2. Image-Driven Data Augmentation

Alternatively, the raw EEG signal is first converted into a time-frequency image using the Short-Time Fourier Transform (STFT). Gaussian noise with specific variances (0.05, 0.1, or 0.2) is then applied directly to the pixels of the spectrogram. This method functions similarly to traditional computer vision augmentation, perturbing the visual features the CNN uses for classification.

Visualizing image-driven noise augmentation applied directly to the STFT spectrogram pixels.

CNN Architecture: The Multi-Convolution (MC) Block

The classification model utilizes a specialized Multi-Convolution (MC) Block inspired by the Inception architecture. Unlike standard serial layers, the MC Block employs three different filter sizes (1×1, 3×3, and 7×7) in parallel. This allows the network to capture features at multiple temporal and spectral scales simultaneously—essential for sleep stages that may be defined by both fine-grained oscillations and broader patterns. To further prevent overfitting and reduce the parameter count, the architecture replaces traditional fully connected layers with Global Average Pooling (GAP).

Experimental Results

The proposed methodology was validated across three diverse public datasets: Sleep-EDF-V1, Sleep-EDF (Expanded), and the Cleveland Children’s Sleep and Health Study (CCSHS).

Performance Metrics

The study focused on two primary metrics: overall accuracy (ACC) and the recall of the N1 stage (RE_N1).

  • N1 Recall Improvement: On the Sleep-EDF-V1 dataset, the baseline N1 recall of 38.9% was boosted to 42.7% using signal-driven noise at 5 dB.
  • Overall Accuracy: On the large-scale CCSHS dataset (515 subjects), the signal-driven approach at 1 dB achieved an overall accuracy of 87.5%, outperforming traditional methods like Hidden Markov Models (HMMs) and Random Forests.
  • Cohen’s Kappa ($K$): The authors identified a "sweet spot" for augmentation—typically a combination of 1 dB signal noise and 0.1 variance image noise—which maximized Cohen’s Kappa, ensuring the improvements were statistically significant and not due to random chance.

Discussion and Conclusion

The results demonstrate that noise-driven data augmentation is an effective tool for balancing sleep datasets. By specifically augmenting the minority N1 class, the researchers preserved the "physiological mechanism" of the sleep cycle better than simple oversampling techniques.

However, the study also revealed that there is no "one size fits all" noise level; optimal intensities varied by dataset (e.g., 10 dB for Sleep-EDF vs. 1 dB for CCSHS), likely due to differences in recording hardware or patient demographics. Future research may explore more sophisticated generative models, such as Generative Adversarial Networks (GANs), to create even more realistic synthetic sleep epochs and further refine the balance between data-level and algorithm-level (e.g., weighted loss functions) strategies.

In conclusion, integrating Gaussian noise into the training pipeline provides a robust way to "level the playing field" for deep learning models in sleep medicine, leading to more accurate and reliable diagnostic tools.

Summary updated

BibTeX
@inproceedings{xu2022convolutional,
  author = {Qi Xu and Dongdong Zhou and Jian Wang and Jiangrong Shen and Lauri Kettunen and Fengyu Cong},
  title = {{Convolutional Neural Network Based Sleep Stage Classification with Class Imbalance}},
  booktitle = {IJCNN},
  year = {2022},
  doi = {10.1109/ijcnn55064.2022.9892741},
}
Figure