Accurate identification of sleep stages is essential for understanding sleep physiology and its role in neurological and behavioral research. Manual scoring of polysomnographic data, while reliable, is time-intensive and prone to variability. This study presents a novel Python-based algorithm for automated vigilance state scoring using single-channel electroencephalogram (EEG) recordings from rats and mice. The algorithm employs artifact processing, multi-band frequency analysis, and Gaussian mixture model (GMM)-based clustering to classify wakefulness, non-rapid, and rapid eye movement sleep (NREM and REM sleep, respectively). Combining narrow and broad frequency bands across the delta, theta, and sigma ranges, it uses a majority voting system to enhance accuracy, with tailored preprocessing and voting criteria improving REM detection. Validation on datasets from 10 rats and 10 mice under standard conditions showed sleep–wake state detection accuracies of 92% and 93%, respectively, closely matching manual scoring and comparable to existing methods. REM sleep detection accuracies of 89% (mice) and 91% (rats) align with previously reported (85–90%). Processing a full day of EEG data within several minutes, the algorithm is advantageous for large-scale and longitudinal studies. Its open-source design, flexibility, and scalability make it a robust, efficient tool for automated rodent sleep scoring, advancing research in standard experimental conditions, including aging and sleep deprivation.
Read full abstract