A subscription to JoVE is required to view this content. Sign in or start your free trial.
We present a software package with a graphic user interface for researchers without coding experience to score sleep stages in mice with a simple download and operation.
Sleep stage scoring in rodents is the process of identifying the three stages: nonrapid eye movement sleep (NREM), rapid eye movement sleep (REM), and wake. Sleep stage scoring is crucial for studying sleep stage-specific measures and effects.
Sleep patterns in rodents differ from those in humans, characterized by shorter episodes of NREM and REM interspaced by waking, and traditional manual sleep stage scoring by human experts is time-consuming. To address this issue, previous studies have used machine learning-based approaches to develop algorithms to automatically categorize sleep stages, but high-performing models with great generalizability are often not publicly available/cost-free nor user-friendly for non-trained sleep researchers.
Therefore, we developed a machine learning-based LightGBM algorithm trained with a large dataset. To make the model available to sleep researchers without coding experience, a software tool named IntelliSleepScorer (v1.2- newest version) was developed based on the model, which features an easy-to-use graphic user interface. In this manuscript, we present step-by-step instructions for using the software to demonstrate a convenient and effective automatic sleep stage scoring tool in mice for sleep researchers.
Sleep stage scoring in rodents is the procedure to identify the three stages: non-rapid eye movement sleep (NREM), rapid eye movement sleep (REM), and wake2. In rodents, NREM is characterized by reduced muscle activity, slow and regular breathing, decreased heart rate, and low-frequency oscillations of the brain waves. REM in rodents, similar to humans, shows muscle atonia, EEG activation, and rapid eye movements, although the occurrence of vivid dreaming is less clear in rodents compared to humans2,3. The "wake" state in rodents is marked by desynchronized brain activity with high-frequency, low-amplitude waves, increased muscle tone, and active behavior, such as grooming and exploration4. These three stages can be identified by inspecting electroencephalogram (EEG) and electromyogram (EMG) signals5.
The automatic sleep stage scoring models in rodents are in great need. First, manual sleep stage scoring by human experts is labor-intensive and time-consuming. Secondly, sleep patterns in rodents differ from those in humans and have more fragmented episodes of NREM and REM interspaced by waking, around 10 min, in contrast to 60-120 min in humans6. Therefore, identifying these brief periods during manual scoring is challenging. There have been many attempts since the 60s to develop an automatic scoring system of rodent sleep data7. Although many automated rodent sleep scoring methods exist, their performances vary8,9,10,11,12,13,14,15,16,17,18. Importantly, most high-performing models with high generalizability are not publicly available (some need special requests from developers) or are not cost-free for sleep researchers.
Therefore, to fill the current technology gap, we developed a machine learning-based model using a large dataset of 5776 h of EEG and EMG signals from 519 recordings across 124 mice with the LightGBM algorithm1. The lightGBM uses a gradient-boosting approach to construct decision trees19. In Wang et al., 2023, the LightGBM model (consisting of over 8000 decision trees) achieved an overall accuracy of 95.2% and a Cohen's kappa of 0.91, which outperformed two widely used baseline models such as the logistic regression model (accuracy = 93.3%) and the random forest model (accuracy = 94.3%, kappa = 0.89). The overall performance of the model also displayed a similar performance to that of human experts. Most importantly, the model has been proved to have generalizability and not overfitted to the original training data1: 1) It performed well (accuracy > 89%) on two other publicly available independent datasets, from Miladinovic and colleagues11, with different sampling frequencies and epoch lengths; 2) The performance of the model is not impacted by the light/dark cycle of mice; 3) A modified LightGBM model performed well on data containing only one EEG and one EMG electrode with kappa β₯ 0.89; 4) Both wildtype and mutant mice were used for the testing and the performances of the model were both accurate. This suggests the model can score sleep stages for mice with different genetic backgrounds.
In order to make this model accessible to sleep researchers who may not have coding expertise, we developed IntelliSleepScorer, a user-friendly software tool with a visually intuitive interface. The software can fully automate the sleep-scoring procedure in mice. It produces interactive visualizations of the signals, hypnogram, and Shapley Additive exPlanations (SHAP) values from an European data format (EDF)/EDF+ file input. The SHAP value approach, based on cooperative game theory, enhances the interpretability of machine learning models20. The model offers both global and epoch-level SHAP values, revealing how different feature values contribute to the scoring decision of the model overall and for each epoch. This advanced program significantly reduces the time and effort required for sleep stage scoring in mice while ensuring that downstream analysis can rely on highly accurate results. In this manuscript, we present step-by-step usage of IntelliSleepScorer (v1.2) with several updates upon version 1.0, including an option to run SHAP analysis separately from sleep pattern prediction, an user adjustable epoch length for sleep stage scoring, and a sleep stage manual correction feature integrated within the GUI.
This study used data collected from in vivo experiments in mice. No human experiments were involved in the study. All the experiments with animals were approved by the Institutional Animal Care and Use Committee at the Broad Institute. All experiments were performed in accordance with relevant guidelines and regulations. The ARRIVE guidelines are not applicable to this study because the focus of this study is to develop machine learning models rather than comparing different treatment groups.
1. Data preparation
NOTE: Data compatibility: the recorded data can have any sampling rate higher than 40 Hz. There is no need to bandpass filter the signal because the software bandpass filters the EEG and EMG signals at the first step. The LightGBM models were developed and tested using data from mice. No evidence regarding the performance of the LightGBM models in other types of lab animals is available. The recording electrodes need to be placed at the frontal and the parietal cortex, or either place if only one EEG channel is recorded.
2. Downloading IntelliSleepScorer for Windows, Mac, and Linux users
3. Workflow and Program launch and operation
4. Navigating the scored results
5. Interpretation of the scored sleep stages hypnogram
NOTE: There are 4 rows in the hypnogram (Figure 2). The top row is the predicted results. The bottom 3 rows are raw data of 2 EEG and 1 EMG channels, respectively. On the top row, orange suggests the Wake stage, blue suggests the NREM stage, and red suggests the REM stage in each epoch.
6. Manual correction of the predicted sleep stages on GUI (Optional)
NOTE: if no anomaly is observed or extremely high accuracy is not required for REM stage prediction, manual verification is not needed.
There are three plots (only the top plot if SHAP values were not run) generated in the GUI after sleep stage scoring: the top plot presents EEG and EMG channels with a hypnogram of sleep stage prediction. The middle plot presents epoch SHAP values. The bottom plot presents Global SHAP values (Figure 1).
There are 4 types of data presented in the sleep stage prediction hypnogram plot (Figure 2). The top row is the predicted results. Th...
This paper presents how to use the IntelliSleepScorer (v1.2) graphic user interface to automatically score the sleep stages of mice and how to leverage SHAP values/plots to better understand the sleep stage scores generated by the model.
An important consideration when using the software is data compatibility. The in-house data used in this study was limited to electrodes placed in the frontal and parietal regions. In the independent dataset from Miladinovic and colleagues11<...
The authors declare no conflict of interest.
We thank Kerena Yan and Jingwen Hu for manually scoring sleep stages and Eunah and Soonwiik for the recordings.
Name | Company | Catalog Number | Comments |
Canonical Unbuntu 18.04 | Canonical | https://releases.ubuntu.com/18.04/ | Supporting Operating System for the software IntelliSleep Scorer: Windows, Mac, or Linux |
Intel Core i7-8550U CPU @ 1.80 GHz 1.99 GHz; RAM: 24 GBΒ | Intel Corp | https://www.intel.com/content/www/us/en/products/details/processors/core-ultra.html | Hardware requirment for the software: Both Inte Core listed here have been used to process the data. It takes around 10 min to process 12 h of recording sampled at 1000 Hz for both hardwares. Any similar or superior hardware would yield comparable or better performance.Β Β |
Intel Core i7-10610U CPU @1.80 GHz 2.30 GHz; RAM: 16 GB | Intel Corp | https://www.intel.com/content/www/us/en/products/details/processors/core-ultra.html | Hardware requirment for the software: Both Inte Core listed here have been used to process the data. It takes around 10 min to process 12 h of recording sampled at 1000 Hz for both hardwares. Any similar or superior hardware would yield comparable or better performance.Β Β |
LightGBM | Microsoft | https://lightgbm.readthedocs.io/en/latest/index.html | Machine learning-based algorithm that was used to train the software.Β |
MacBook Pro | Apple | https://www.apple.com/in/macbook-pro/ | Supporting Operating System for the software IntelliSleep Scorer: Windows, Mac, or Linux |
Windows | Microsoft | https://www.microsoft.com/en-in/windows/?r=1 | Supporting Operating System for the software IntelliSleep Scorer: Windows, Mac, or Linux |
Request permission to reuse the text or figures of this JoVE article
Request PermissionThis article has been published
Video Coming Soon
Copyright Β© 2025 MyJoVE Corporation. All rights reserved