Skip to main content

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.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 AccuSleePy primary interface

Manual scoring interface AccuSleePy 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

accusleepy-0.11.2.tar.gz (1.8 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

accusleepy-0.11.2-py3-none-any.whl (1.9 MB view details)

Uploaded Python 3

File details

Details for the file accusleepy-0.11.2.tar.gz.

File metadata

  • Download URL: accusleepy-0.11.2.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

Hashes for accusleepy-0.11.2.tar.gz
Algorithm Hash digest
SHA256 ef601830b4e284053a26a77aafcd627cad126b95b4943525a1a284e3fd81b2d4
MD5 ec73179383ea061553493bad9452e464
BLAKE2b-256 4757eb7802fc2bd5bd34ff90c1850443dec5f3b757e2c75bb12dc59d2ab66346

See more details on using hashes here.

Provenance

The following attestation bundles were made for accusleepy-0.11.2.tar.gz:

Publisher: release.yml on zekebarger/AccuSleePy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file accusleepy-0.11.2-py3-none-any.whl.

File metadata

  • Download URL: accusleepy-0.11.2-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

Hashes for accusleepy-0.11.2-py3-none-any.whl
Algorithm Hash digest
SHA256 869f3e5015359509241c3d7088f58826b0ae0c16b297284ec7448e437cbfe91a
MD5 1cfa73019a9bd32471b3d7200ef7eabb
BLAKE2b-256 0ac117acd76788a6c84051d656a9892ecee6b230d9eb0248b50c59a301e3c435

See more details on using hashes here.

Provenance

The following attestation bundles were made for accusleepy-0.11.2-py3-none-any.whl:

Publisher: release.yml on zekebarger/AccuSleePy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page