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.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.1-0.9.3: Bugfixes, code cleanup, additional config settings
  • 0.7.0: More settings can be configured in the UI
  • 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.5.0: Performance improvements
  • 0.4.5: Added support for python 3.13, removed 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.1.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.1-py3-none-any.whl (1.9 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: accusleepy-0.11.1.tar.gz
  • Upload date:
  • Size: 1.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for accusleepy-0.11.1.tar.gz
Algorithm Hash digest
SHA256 2c8127ba6d87f79ccaeef82440ff03223dcd426da1b646105b99d62b476e0f1c
MD5 fc4ed583ccb76647af4dfe774c771bd8
BLAKE2b-256 1357ed89e8e39d8e5a0495f69e18a830d678ff10c5e78d03f9c77f5ca0fb7c0c

See more details on using hashes here.

Provenance

The following attestation bundles were made for accusleepy-0.11.1.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.1-py3-none-any.whl.

File metadata

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

File hashes

Hashes for accusleepy-0.11.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0f3c37f2360eb725350dcbbf8452b00fd83dc094964436cfe28fba4988745b00
MD5 01f57b04a9eb671082ab60b72cdd74f2
BLAKE2b-256 ef1eb0f6222bfa8c76fa7e2409973e13b08092a4c38b11e056e329939980a333

See more details on using hashes here.

Provenance

The following attestation bundles were made for accusleepy-0.11.1-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