Somnotate: An accurate, robust, and flexible sleep stage classifier for the experimentalist
Brodersen P., Alfonsa H., Krone L., Duque CB., Fisk A., Flaherty S., Guillaumin M., Huang Y-G., Kahn M., McKillop L., Milinski L., Taylor L., Thomas C., Yamagata T., Foster R., Vyazovskiy V., Akerman C.
Manual sleep stage annotation is a time-consuming but often essential step in the analysis of sleep data. To address this bottleneck we need automated approaches that exhibit high levels of performance, are robust under different experimental conditions, are accessible, and meet the specific needs of sleep scientists. Here we develop an unbiased framework for assessing automated performance against a consensus derived from multiple experienced researchers. We then construct a new sleep stage classifier that combines automated feature extraction using linear discriminant analysis, with inference based on vigilance state-dependent contextual information using a hidden Markov model. This produces annotation accuracies that exceed expert performance on rodent electrophysiological data. We demonstrate that the classifier is robust to errors in the training data, compatible with different recording configurations, and maintains high performance during experimental interventions including sleep deprivation and optogenetic manipulations. Finally, the classifier quantifies and reports its certainty, which can be leveraged to identify ambiguous epochs for further examination. Ambiguous epochs are shown to include unsuccessful transitions between vigilance states, which may offer new insight into the mechanisms underlying sleep-wake dynamics. We call our classifier ‘Somnotate’ and make an implementation available to the neuroscience community.