TL;DR
This paper introduces a deep learning model using 50-layer residual networks to automatically classify sleep stages directly from raw polysomnographic (PSG) waveforms. Their best model achieved an accuracy of 84.1% and a Cohen's kappa of 0.746, outperforming previous methods that relied on raw data. This work suggests that complex data transformations and manual feature engineering might not be necessary for effective sleep staging with deep learning.
What Problem Does This Paper Address?
Sleep staging, the process of categorizing sleep into different stages (wakefulness, REM, N1, N2, N3), is crucial for diagnosing sleep disorders. Traditionally, this is done manually by sleep technicians analyzing polysomnograms (PSGs), which include signals like EEG, EOG, and EMG. This manual process is subjective and prone to inter-scorer variability. While machine learning, particularly deep learning, has shown promise in automating this task, many existing approaches involve complex pre-processing steps like spectral analysis or manual feature extraction. This paper aims to simplify the process by demonstrating that a deep residual network can achieve high performance directly from raw PSG signals, eliminating the need for these intermediate steps.
Methods
The core of this work is a deep residual network architecture, inspired by models that have achieved state-of-the-art results in image classification. Specifically, they employ a 50-layer network with bottleneck residual blocks. These blocks use "pre-activation" configurations (batch normalization, ReLU, convolution) and "projection shortcuts" to facilitate gradient flow and enable training of very deep networks.
The raw PSG signals (EEG, EOG, EMG) are first pre-processed:
- Resampling: All channels are upsampled to 200 Hz.
- Filtering: Zero-phase Butterworth filters are applied according to AASM recommendations.
- Normalization: Signals are soft-normalized using their 5th and 95th quantiles to handle varying dynamic ranges.
- Segmentation: Each signal is segmented into 30-second epochs, resulting in a tensor input of shape (N, C, 1, T), where N is batch size, C is the number of signals (5 in this case: central EEG, left/right EOG, left/right EMG), and T is the number of timesteps per epoch.
The network architecture includes an initial convolutional layer, followed by four blocks of bottleneck residual blocks. Each block contains multiple residual units. A max-pooling layer is used at the beginning of each block to reduce temporal resolution. After the residual blocks, a final batch normalization, ReLU, and mean pooling layer reduce the tensor to a fixed-size representation, which is then fed into a fully connected layer with a softmax activation to output probabilities for the five sleep stages.
For training, they explored three configurations:
- Baseline: Standard cross-entropy loss.
- Weighted: Cost function weighted by the inverse frequency of the correct class to address class imbalance.
- Balanced: Achieved by oversampling minority classes (N1, N3, REM) and undersampling the majority class (N2) in the training data.
Optimization was performed using the Adam optimizer with weight decay and a learning rate schedule.
Datasets
The study utilized data from the Wisconsin Sleep Cohort (WSC), a database containing 2310 recordings. This dataset was split into training (80%), validation (10%), and testing (10%) subgroups. The paper provides demographic and PSG variable statistics for these subgroups in Table I.
Key Insights and Ideas
- Raw Data is Sufficient: The most significant insight is that complex pre-processing like spectral analysis or manual feature extraction might be unnecessary for achieving high performance in sleep staging with deep learning. Raw PSG waveforms, when fed into a sufficiently deep residual network, can capture the necessary temporal dynamics.
- Residual Networks Excel: The use of deep residual networks is key. Their architecture, particularly the identity mappings and bottleneck blocks, allows for the training of very deep models (50 layers in this case) without suffering from vanishing gradients, enabling the capture of intricate patterns in the data.
- Class Imbalance Matters (but not always as expected): While the dataset is imbalanced (favoring N2 sleep), the baseline model performed comparably to weighted and balanced configurations on validation data. This suggests that the deep network might be robust enough to learn from imbalanced data without explicit re-weighting or resampling, though further investigation is warranted.
- N1 and N3 are Challenging: The model, like human scorers, struggled most with classifying N1 and N3 stages. This is attributed to the inherent ambiguity and transitional nature of these stages, as well as potential inter-scorer variability in their definition.
Key Results
- Best Performance: The best performing model (baseline configuration) achieved an accuracy of 84.1% and a Cohen's kappa of 0.746 on the test subgroup.
- Improvement over Prior Work: This performance is noted as an improvement over previous reported results from other groups using only raw PSG data.
- Generalization: The model demonstrated good generalization, with only a slight drop in accuracy and kappa when evaluated on the independent test subgroup compared to the validation subgroup.
- Stage-Specific Performance: Table III shows stage-specific metrics. The model achieved high precision and recall for Wake (W) and N2 stages, but lower sensitivity for N1 and N3, consistent with clinical observations.
Limitations and Future Work
- Limited Data for Independent Cohorts: The authors acknowledge that further testing on independent cohorts is needed to verify the clinical applicability of the method.
- Hyperparameter Tuning: Minimal hyperparameter tuning was performed, suggesting that optimizing network specifications could lead to further performance gains.
- Kernel Sizes: The small kernel sizes in the residual blocks might limit their ability to capture very long-term physiological dynamics.
- Future Directions:
- Adding Recurrent Networks: Incorporating recurrent neural networks (like LSTMs) could help model temporal dynamics between epochs more effectively.
- More Data: Increasing the size and diversity of the training dataset is suggested to improve performance.
- Investigating Network Specifications: Further exploration of network architecture and parameters is recommended.
Summary updated