Introduction
Automatic sleep scoring—the classification of sleep stages (Wake, N1, N2, N3, REM) from bio-signals like EEG—is a cornerstone for diagnosing sleep disorders at scale. Despite the success of deep learning in this domain, models often suffer from a significant "generalization gap." A model trained on one patient cohort frequently underperforms when deployed in a different clinic due to variations in age, medication, and recording equipment.
Current solutions typically involve transfer learning or few-shot adaptation, requiring manual labeling of new data—a bottleneck in clinical workflows. This research proposes S2MAML (Self-Supervised Model Agnostic Meta-Learning), a framework designed for zero-shot generalization, allowing a single model to be deployed "as-is" across entirely unseen cohorts.
The S2MAML Framework
S2MAML integrates two powerful paradigms: Model Agnostic Meta-Learning (MAML) and Self-Supervised Learning (SSL). While standard MAML "learns how to learn" by training on a variety of tasks, it can still overfit to subject-specific idiosyncratic patterns.
S2MAML addresses this by utilizing a self-supervised task in the meta-learning "inner loop." Specifically, it employs PhaseSwap: a task where the model must detect if the frequency phases of two signal samples have been swapped. This forces the model to learn robust, general-purpose features of bio-signals rather than memorizing training-set specifics.
The underlying architecture is DeepSleepNet-Lite, a streamlined convolutional neural network optimized for processing raw bio-signals.
Experimental Setup and Datasets
The framework was evaluated across five diverse, publicly available sleep datasets:
- Sleep Cassette (SC) & Sleep Telemetry (ST): Historical recordings from the Expanded Sleep-EDF database.
- ISRUC: PSG recordings from a Portuguese sleep medicine center.
- UCD (University College Dublin): Data from suspected sleep apnea patients.
- CAP (Cyclic Alternating Pattern): Recordings from subjects with various sleep disorders.
The primary metric used is the Macro F1 (MF1) score, which provides a balanced evaluation across the inherently imbalanced sleep stages.
Key Results and Discussion
S2MAML demonstrates superior zero-shot performance compared to standard supervised learning (SL) and vanilla MAML. In an "All vs. All" evaluation—training on all datasets and testing on unseen subjects—S2MAML achieved an average MF1 of 75.8%, outperforming SL (64.5%) and MAML (73.3%).
Insights on Generalization
- SSL as a Regularizer: The inclusion of PhaseSwap in the inner loop acts as a powerful guard against overfitting. By replacing supervised tasks in the inner loop, the model focuses on "universal" features useful for the outer supervised sleep scoring task.
- Inter-Cohort Robustness: While standard models often handle new subjects from the same dataset reasonably well, they struggle with different datasets. S2MAML specifically narrows this inter-cohort gap, making it more suitable for real-world clinical deployment.
- Hyperparameter Stability: S2MAML proved more stable than standard MAML, showing less sensitivity to the inner-loop learning rate ($\lambda_{in}$), which simplifies the training process.
Limitations and Future Directions
While S2MAML sets a new bar for zero-shot generalization, some challenges remain. The model showed slightly lower performance on the older Sleep Telemetry (ST) dataset in certain tests, likely due to unique electrode placements. Additionally, while PhaseSwap is efficient, exploring more complex SSL tasks like Contrastive Predictive Coding could further enhance feature robustness, albeit at a higher computational cost. Future work will focus on optimizing the bilevel training process to reduce the computational overhead of meta-learning.
Summary updated