Python implementation of AccuSleep
Project description
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
- (recommended) create a new virtual environment (using venv, conda, etc.) with python >=3.11,<3.14
- (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/
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.12.0: Make plots more interactive
- 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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file accusleepy-0.12.0.tar.gz.
File metadata
- Download URL: accusleepy-0.12.0.tar.gz
- Upload date:
- Size: 1.8 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5a4672ae97e6cd2962dacfd438f510e575bd5d4c498f0cc7d6187391cddc7c36
|
|
| MD5 |
7661f7e2d19278f8c0fb502cf0560aaf
|
|
| BLAKE2b-256 |
0b3916e4838574c62ab26407d43b16cdec20f50b59a6d4599d51ebf9cfd1ddce
|
Provenance
The following attestation bundles were made for accusleepy-0.12.0.tar.gz:
Publisher:
release.yml on zekebarger/AccuSleePy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
accusleepy-0.12.0.tar.gz -
Subject digest:
5a4672ae97e6cd2962dacfd438f510e575bd5d4c498f0cc7d6187391cddc7c36 - Sigstore transparency entry: 948552969
- Sigstore integration time:
-
Permalink:
zekebarger/AccuSleePy@d1d975440fcb59ec2e58e460f0f31d92a4e5868f -
Branch / Tag:
refs/tags/v0.12.0 - Owner: https://github.com/zekebarger
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@d1d975440fcb59ec2e58e460f0f31d92a4e5868f -
Trigger Event:
release
-
Statement type:
File details
Details for the file accusleepy-0.12.0-py3-none-any.whl.
File metadata
- Download URL: accusleepy-0.12.0-py3-none-any.whl
- Upload date:
- Size: 1.9 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b57783cce995a4e59e3a2131c36413a85724f169d67da41b2263d527ff3a6327
|
|
| MD5 |
ac8e0a7a35e685786ed3c3dc8324baee
|
|
| BLAKE2b-256 |
939c5d3f4769304f699f3937f1d4f3ac66a49c71284cb9ba8c5bf472f9c70a72
|
Provenance
The following attestation bundles were made for accusleepy-0.12.0-py3-none-any.whl:
Publisher:
release.yml on zekebarger/AccuSleePy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
accusleepy-0.12.0-py3-none-any.whl -
Subject digest:
b57783cce995a4e59e3a2131c36413a85724f169d67da41b2263d527ff3a6327 - Sigstore transparency entry: 948553029
- Sigstore integration time:
-
Permalink:
zekebarger/AccuSleePy@d1d975440fcb59ec2e58e460f0f31d92a4e5868f -
Branch / Tag:
refs/tags/v0.12.0 - Owner: https://github.com/zekebarger
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@d1d975440fcb59ec2e58e460f0f31d92a4e5868f -
Trigger Event:
release
-
Statement type: