Skip to main content

DataJoint Element for Continuous Behavior Tracking via DeepLabCut

Project description

DataJoint Element - DeepLabCut

This repository features a DataJoint schema for pose estimation via DeepLabCut. The pipeline presented here is not a complete pipeline by itself, but rather a modular design of tables and dependencies specific to the behavior tracking workflow. This modular pipeline element can be flexibly attached downstream to any particular design of experiment session, thus assembling a fully functional behavior pipeline (see the example workflow-deeplabcut).

This Element currently supports single-animal, single-camera 2D models, and does not yet support multi-animal or multi-camera models. This Element does not offer any features for labeling training data. Users should to use native DeepLabCut tools for intitializing a project and labeling training data.

Element architecture

element-deeplabcut diagram

As the diagram depicts, the DeepLabCut element starts immediately downstream from a Session table, which is modeled in our workflow pipeline. The following tables are further downstream across two schemas:

  • train schema: Tables related to model training.
    • VideoSet: The set of files corresponding to a training dataset.
    • TrainingParamSet: A collection of model training parameters, represented by an index.
    • TrainingTask: A set of tasks specifying model training methods.
    • ModelTraining: A record of training iterations launched by TrainingTask.
  • model schema: Tables related to DeepLabCut models and pose estimation.
    • VideoRecording: Video(s) from one recording session, for pose estimation.
    • BodyPart: Unique body parts (a.k.a. joints) and descriptions thereof.
    • Model: A central table for storing unique models.
    • ModelEvaluation: Evaluation results for each model.
    • PoseEstimationTask: A series of pose estimation tasks to be completed. Pairings of video recordings with models to be use for pose estimation.
    • PoseEstimation: Results of pose estimation using a given model.

Installation

  • Install element-deeplabcut

    pip install element-deeplabcut
    
  • Upgrade element-deeplabcut previously installed with pip

    pip install --upgrade element-deeplabcut
    
  • Install element-interface

    • element-interface is a dependency of element-deeplabcut, however it is not contained within requirements.txt.
    pip install "element-interface @ git+https://github.com/datajoint/element-interface"
    

Usage

Element activation

To activate the element-deeplabcut, one needs to provide:

  1. Schema names
    • optionally, a schema name for the train module.
    • a schema name for the model module.
  2. Upstream tables
    • Session: A set of keys identifying a recording session (see Element-Session).
    • Device: A reference table linked VideoRecording to specify camera information.
  3. Utility functions
    • get_dlc_root_data_dir() to provide a root directory for a given machine,
    • optionally, get_dlc_processed_data_dir() to provide an output directory.

For more detail, check the docstring of the element-deeplabcut:

    help(train.activate)
    help(model.activate)

Example usage

  • See our workflow for an example usage of this DeepLabCut Element.
  • See our YouTube tutorial for a walkthrough of the schemas and functions:

YouTube tutorial

Citation

  • If your work uses DataJoint and DataJoint Elements, please cite the respective Research Resource Identifiers (RRIDs) and manuscripts.

  • DataJoint for Python or MATLAB

    • Yatsenko D, Reimer J, Ecker AS, Walker EY, Sinz F, Berens P, Hoenselaar A, Cotton RJ, Siapas AS, Tolias AS. DataJoint: managing big scientific data using MATLAB or Python. bioRxiv. 2015 Jan 1:031658. doi: https://doi.org/10.1101/031658

    • DataJoint (RRID:SCR_014543) - DataJoint for <Select Python or MATLAB> (version <Enter version number>)

  • DataJoint Elements

    • Yatsenko D, Nguyen T, Shen S, Gunalan K, Turner CA, Guzman R, Sasaki M, Sitonic D, Reimer J, Walker EY, Tolias AS. DataJoint Elements: Data Workflows for Neurophysiology. bioRxiv. 2021 Jan 1. doi: https://doi.org/10.1101/2021.03.30.437358

    • DataJoint Elements (RRID:SCR_021894) - Element DeepLabCut (version <Enter version number>)

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

element-deeplabcut-0.1.1.tar.gz (17.4 kB view details)

Uploaded Source

Built Distribution

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

element_deeplabcut-0.1.1-py3-none-any.whl (17.8 kB view details)

Uploaded Python 3

File details

Details for the file element-deeplabcut-0.1.1.tar.gz.

File metadata

  • Download URL: element-deeplabcut-0.1.1.tar.gz
  • Upload date:
  • Size: 17.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.5

File hashes

Hashes for element-deeplabcut-0.1.1.tar.gz
Algorithm Hash digest
SHA256 a8af52b8793dcd36e91071c008d9de6aeb96d1fcc77445ecd9dc2355c1b5bb33
MD5 4d1e9347f067c2a0c848d5ec1d6ce2dd
BLAKE2b-256 83ce7407948fb98ff73f1aa2885668609f92f361dfd05204a1e290adc72b4229

See more details on using hashes here.

File details

Details for the file element_deeplabcut-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for element_deeplabcut-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ff5845df15da1b221c9212dec498517d955437cbabeb61f07391e395982024dd
MD5 d9951888a1b2974b8f6496223cfc3c70
BLAKE2b-256 e29df284e4cf771c36b3114699d9a3517e583728fcc99e62b48e007c7913a9aa

See more details on using hashes here.

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