DeepLabCut 1,2,3, SLEAP 4, and OpenPose 5 have revolutionized the way behavioral scientists analyze data. These algorithm utilizes recent advances in computer vision and deep learning to automatically estimate 3D-poses. Interpreting the positions of an animal can be useful in studying behavior; however, it does not encompass the whole dynamic range of naturalistic behaviors.
B-SOiD identifies behaviors using a unique pipeline where unsupervised learning meets supervised classification. The unsupervised behavioral segmentation relies on non-linear dimensionality reduction 6,7,9,10, whereas the supervised classification is standard scikit-learn 8.
Behavioral segmentation of open field in DeepLabCut, or B-SOiD ("B-side"), as the name suggested, was first designed as a pipeline using pose estimation file from DeepLabCut as input. Now, it has extended to handle DeepLabCut (.h5, .csv), SLEAP (.h5), and OpenPose (.json) files.
Step 1: Install Anaconda/Python3
Git clone the web URL (example below) or download ZIP.
Change your current working directory to the location where you want the cloned directory to be made.
git clone https://github.com/YttriLab/B-SOID.git
Step 1: Setup, open an anaconda/python3 instance and install dependencies with the requirements file
cd /path/to/B-SOID/
For MacOS users
conda env create -n bsoid_v2 -f requirements.yaml (macOS)
or for Windows users
conda env create -n bsoid_v2 -f requirements_win.yaml (windows)
conda activate bsoid_v2
You should now see (bsoid_v2) $yourusername@yourmachine ~ %
streamlit run bsoid_app.py
We have provided our 6 body part DeepLabCut model. We also included two example 5 minute clips (labeled_clip1, labeled_clip2) as proxy for how well we trained our model. The raw video (raw_clip1, raw_clip2) and the corresponding h5/pickle/csv files are included as well.
Pull requests are welcome. For recommended changes that you would like to see, open an issue. Join our slack group for more instantaneous feedback.
There are many exciting avenues to explore based on this work. Please do not hesitate to contact us for collaborations.
This software package provided without warranty of any kind and is licensed under the GNU General Public License v3.0. If you use our algorithm and/or model/data, please cite us! Preprint/peer-review will be announced in the following section.
September 2019: First B-SOiD preprint on bioRxiv
March 2020: Updated version of our preprint on bioRxiv