AccuSleePy
Description
AccuSleePy is set of graphical user interfaces for scoring rodent sleep using EEG and EMG recordings. It offers the following improvements over the MATLAB version (AccuSleep):
- Up to 10 brain states can be configured through the user interface
- Classification models can be trained through the user interface
- Model files contain useful metadata (brain state configuration, epoch length, number of epochs)
- Models optimized for real-time scoring can be trained
- Confidence scores can be saved and visualized
- Lists of recordings can be imported and exported for repeatable batch processing
- Undo/redo functionality in the manual scoring interface
If you use AccuSleep in your research, please cite our publication:
Barger, Z., Frye, C. G., Liu, D., Dan, Y., & Bouchard, K. E. (2019). Robust, automated sleep scoring by a compact neural network with distributional shift correction. PLOS ONE, 14(12), 1–18.
The data and models associated with AccuSleep are available at https://osf.io/py5eb/
Please contact zekebarger (at) gmail (dot) com with any questions or comments about the software.
Installation
- make sure you have python 3.11, 3.12, 3.12, or 3.14 (but not 3.14.1)
- (recommended) create a new virtual environment (using venv, conda, etc.)
- (optional) if you have a CUDA device and want to speed up model training, install PyTorch
pip install accusleepy- (optional) download a classification model from https://osf.io/py5eb/ under /python_format/models/
There have been issues reported with installing pytorch on M1 Macs. Please contact us if you have trouble with this.
Usage
python -m accusleepy will open the primary interface.
Your settings are saved to a platform-specific location
(e.g., ~/Library/Application Support/accusleepy/config.json on macOS)
Guide to the primary interface
Guide to the manual scoring interface
Developer guide
If you want to contribute to the project or modify the code for your own use, please consult the developer guide.
Changelog
- 0.13.0: Add support for python 3.14, use cross-platform visual style
- 0.12.0-0.12.2: Bugfixes, more plot interactivity
- 0.11.2: Simplify GUI editing
- 0.11.1: Add integration tests
- 0.11.0: Store config file in a user directory
- 0.10.0-0.10.1: Improved zoom behavior, updated dependencies
- 0.7.0-0.9.3: Bugfixes, code cleanup, additional config settings
- 0.6.0: Confidence scores can now be displayed and saved. Retraining your models is recommended since the new calibration feature will make the confidence scores more accurate.
- 0.4.5: Add support for python 3.13, remove support for python 3.10.
- 0.1.0-0.4.4: Early development versions
Screenshots
Primary interface
Manual scoring interface
Acknowledgements
We would like to thank Franz Weber for creating an early version of the manual labeling interface. The code that creates spectrograms comes from the Prerau lab with only minor modifications. Jim Bohnslav's deepethogram served as an incredibly useful reference when reimplementing this project in python. The model calibration code added in version 0.6.0 comes from Geoff Pleiss' temperature scaling repo.
Metadata
Release files for accusleepy 0.13.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| accusleepy-0.13.0.tar.gz | 1.8 MB | With provenance | Details for accusleepy-0.13.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| accusleepy-0.13.0-py3-none-any.whl | Python 3 | none | any | Details for accusleepy-0.13.0-py3-none-any.whl |
Total release size: 3.7 MB
Release files / accusleepy-0.13.0.tar.gz
| Download URL | accusleepy-0.13.0.tar.gz |
|---|---|
| Size | 1.8 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e86d8261729e5db138514bb1f7b07c0e515158e2398a88f88997fb4d4a4777dd
|
|
BLAKE2b-256 checksum How to use checksums |
9d0a14b67ac9532c7b341a6bb4bc897bf1fd1303ecbbcbcae27c2b9a7d08119b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 18, 2026.
Transparency logRelease files / accusleepy-0.13.0-py3-none-any.whl
| Download URL | accusleepy-0.13.0-py3-none-any.whl |
|---|---|
| Size | 1.9 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6b061a9c45bf2e412a05c0f1b6f8f3e06f08537a3af25d2209002a6e00cd95da
|
|
BLAKE2b-256 checksum How to use checksums |
e42b2d2a305c30c85878146f7f2b89bcbb9bc6a943043104f4f842906f91b406
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 18, 2026.
Transparency logSecurity for accusleepy 0.13.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for accusleepy-0.13.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 18, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.