Neurophysiology — Sleep Medicine
Generalisable, reproducible automatic sleep-stage classification from polysomnography, working toward foundation models for sleep medicine.

Polysomnography is the gold standard for diagnosing sleep disorders, but staging the recordings by hand is slow, tedious, and surprisingly inconsistent: two experts scoring the same night often disagree, and every sleep centre uses its own sensor setup. Automating the staging promises faster, more reliable, and fairer diagnosis. Where we would like to go is broader still, toward foundation models for sleep medicine that hold up across clinics, sensors, and populations.
Major achievements
We began with stateless models, which score each thirty-second epoch without reference to what came before, comparing hand-crafted against learned feature extractors across databases from different sleep centres. One finding has shaped everything since: the model that performed best within a single database was not the one that generalised best across setups. A convolutional network won on home ground, while a random forest over hand-designed features transferred most reliably between centres with different sensor montages — peak in-domain accuracy is simply not the same property as robust deployment. The ceiling deserves stating plainly too: the best model reached a Cohen’s kappa of 0.67 to 0.72 against the reference scoring, short of the 0.76 typically observed between two human experts, so staging at this level complements the scorer rather than replacing them. A companion study carried the comparison to stateful models that propagate temporal context across the night, on the reasoning that sleep stages are defined partly by what precedes them.
The work has since moved from task-specific models toward reusable encoders. A set-then-sequence
transformer was pretrained contrastively on roughly 13,000 nights drawn from ten public cohorts,
then frozen while lightweight heads were trained on a held-out cohort for two different clinical
tasks. The frozen encoder reached 76.2% balanced accuracy for sleep staging from brain-activity
channels alone and remained competitive at detecting sleep apnoea, and a channel analysis showed
that respiratory signals are indispensable for apnoea yet contribute little to staging. That is
concrete evidence that a single pretrained encoder can serve several tasks and montages, with
the honest qualification that how much it helps depends on which sensors a clinic actually
records. All of it is released through the open-source sleepless library, with preset
configurations that reproduce the published results, so the cross-clinic comparisons can be
rerun rather than taken on trust.
Evaluation uses public polysomnography databases, including Sleep-EDF (ST and SC), MASS SS3, and the Sleep Heart Health Study.
Supervised theses

Towards Scalable Foundation Models for Sleep EEG and Polysomnography
Sleep is diagnosed from all-night recordings, but models are usually built one task and one sensor setup at a time. This thesis built a reusable foundation model for sleep, pretrained on about 13,000 nights.

Automatic Sleep-Phase Analysis via Stateful Methods
Sleep stages unfold over time, so a good scorer should use temporal context. This thesis studied stateful models for automatic sleep-phase analysis, and how well they carry across clinics and populations.

Generalizable Automatic Classification of Sleep Stages
Scoring a night of sleep by hand is slow and two experts often disagree. This thesis studied automatic sleep-stage classification with a focus on holding up across different clinics.