Rat sleep staging holds up when the drug changes: trained on saline alone, F1 falls less than 1% under psilocybin and MDL100907
Synopsis
On more than 1.1 million annotated rat EEG/EMG segments, a robustness-oriented deep learning pipeline reaches 94.3% F1 for four-class sleep staging, 7.3 and 6.4 points above SlumberNet's 87.0% and random forest's 87.9%. Most automated stagers were evaluated on random splits that preserve the training distribution, and degrade when subjects or drug conditions shift. The pipeline combines a global context vector, supervised contrastive learning and a dual-branch classifier to learn representations insensitive to subject and treatment; trained on saline recordings only and tested on unseen animals, every metric drops by less than 1%.
Interpretation
Four-class staging (wake, NREM, REM, artifact) reaches 94.3% F1 on rat data spanning several drug conditions, with little variation across held-out animals. Earlier automated stagers were mostly evaluated on random splits that preserve the training distribution, leaving structured shifts from new subjects or drug conditions largely untested. Subject-held-out 5-fold cross-validation over 13 Long-Evans rats and more than 1.1 million annotated 4-second segments gives 94.4% accuracy, 94.3% F1 and 0.993 ROC-AUC, with fold standard deviations below 1%.
Trained only on saline recordings, the model barely degrades under psychedelic drug conditions, indicating representations that transfer across treatments. The full-dataset baseline above uses training data from all treatment conditions combined. With the same subject-held-out folds but training restricted to saline recordings, evaluation on held-out animals under each drug condition shows less than 1% degradation across all metrics; by condition, F1 is 0.932 under psilocybin, 0.946 under MDL100907 and 0.939 for the combination.
Most of the gain comes from a memory vector that carries global information across the recording sequence and from a contrastive loss that organizes the embedding space by sleep stage. Removing the global context vector costs 2.3% F1, a 25.3% error reduction, and removing supervised contrastive learning costs 0.6% F1, an 8.2% error reduction. Ablations show all-zeros initialization of the global context vector beats manual-feature and learned initialization, while domain adaptation through gradient reversal layers adds negligible benefit and is absent from the default model.
The model approaches full-data performance from a small amount of annotation, lowering the labeling burden for new drug experiments. Full-dataset training yields 0.943 F1, where earlier practice required extensive per-segment manual scoring to support such performance. One hour of annotated training data gives 0.832 F1, rising to 0.921 at 8 hours, 0.919 at 12 hours and 0.918 at 24 hours; 8 to 12 hours is about 1% of the full dataset and only 2.4% F1 below full training.
Perspective
The results come from a single laboratory's adult male Long-Evans rats, with four-channel EEG/EMG recordings and four-class scoring, under psilocybin, MDL100907, their combination and saline control. The cross-condition transfer claim is limited to compounds sharing a serotonergic mechanism; whether GABAergic, dopaminergic or glutamatergic agents behave the same is left as an open question. The contextual classifier handles sequences of about 34 minutes at most, short of a full sleep cycle. The full dataset is withheld because it belongs to ongoing studies; representative samples, annotations and metadata are available, and code and trained weights are public.
The residual degradation of less than 1% under saline-only training is partly attributable to the smaller training set rather than to an inability to handle drug distribution shift, an interpretation supported by comparison with a size-matched random subsample. Performance is lowest under psilocybin, consistent with its REM-suppressant action and altered theta-band dynamics. Linear probes show subject identity and treatment condition remain slightly decodable above chance, so nuisance factors are largely but not entirely suppressed. The authors also note that per-subject amplitude normalization can introduce systematic bias when a drug substantially changes stage proportions, and that mixture z-scoring could complement the preprocessing. Per-window saliency maps localize the moments the model relied on but do not isolate epoch-to-epoch information flow.
