Fig. 1: Model diagram of our algorithm.
From: A deep learning software tool for automated sleep staging in rats via single channel EEG

The model accepts a sequence of 9 10 s epochs to predict the class of the center 10 s epoch (epoch i, as denoted in the figure). Example raw traces are shown from our dataset to exhibit the inherent difficulty of sleep staging from a single-channel EEG. The model learns to classify the center epoch despite sometimes ambiguous patterns, a key strength of our approach. Each 10 s epoch in the sequence is independently encoded and then forwarded to a Long Short-Term Memory (LSTM) neural network to share information between neighboring 10 s epochs. The 64-dimensional LSTM output vector is linearly projected down to three dimensions and mapped to a probability distribution over 3 values (corresponding to 3 vigilant states; REM/paradoxical sleep, ‘P‘, NREM/slow-wave sleep, ‘S‘, and wake, ‘W‘) by the Softmax function.