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

  • make sure you have python >=3.11,<3.14
  • (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.12.0-0.12.1: 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 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.12.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.12.1-py3-none-any.whl (1.9 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: accusleepy-0.12.1.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.12.1.tar.gz
Algorithm Hash digest
SHA256 69b1a761727e90b9c9badf2b5a2b80cedbedffde140168a3ef473cb46852b933
MD5 cecca0c335f31affb96e88251b83959a
BLAKE2b-256 45e293b86498ef37bb35a6adcdcaa8f5c79451eeab5d94a5a0740e765cad9933

See more details on using hashes here.

Provenance

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

File metadata

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

File hashes

Hashes for accusleepy-0.12.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d521a6a072b987717cdb7fd9c19b3efcca8ac460de88c22cd959d298cf0152be
MD5 d32366b07781cbcc0343b638c51c0a9f
BLAKE2b-256 22e99941eeb61e34df8bc4e33b1140ebea5466104e4fed041c2a182e4f71c16f

See more details on using hashes here.

Provenance

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