zzdeeprollover

Detect rollovers in zebrafish larvae


Keywords
Animal, Behavior, Tracking, Zebrafish, Deep, Learning, Rolling
License
AGPL-3.0
Install
pip install zzdeeprollover==0.0.9

Documentation

ZZDeepRollover

This code enables the detection of rollovers performed by zebrafish larvae tracked by the open-source software ZebraZoom. This code is still in "beta mode". For more information visit zebrazoom.org or email us at info@zebrazoom.org

Road Map:

Preparing the rollovers detection model
Testing the rollovers detection model
Training the rollovers detection model
Using the rollovers detection model

Preparing the rollovers detection model:

The detection of rollovers is based on deep learning. You must first install pytorch on your machine. It may be better to first create an anaconda environment for this purpose.

You then need to place the output result folders of ZebraZoom inside the folder "ZZoutput" of this repository.

In order to train the rollovers detection model, you must also manually classify the frames of some of the tracked videos in order to be able to create a training set. Look inside the folder "manualClassificationExamples" for examples of how to create such manual classifications. You then need to place those manual classifications inside the corresponding output result folders of ZebraZoom.

Testing the rollovers detection model:

In order to test the accuracy of the rollovers detection model, you can use the script leaveOneOutVideoTest.py, you will need to adjust some variables at the beginning of that script. The variable "videos" is an array that must contain the name of videos for which a manual classification of frames exist and has been placed inside the corresponding output result folder (inside the folder ZZoutput of this repository).

The script leaveOneOutVideoTest.py will loop through all the videos learning the model on all but one video and testing on the video left out.

Training the rollovers detection model:

Once the model has been tested using the steps described in the previous section, you can now learn the final model on all the videos for which a manual classification of frames exist using the script trainModel.py (you will need to adjust a few variables in that script).

Using the rollovers detection model:

As mentionned above, you can then use the script useModel.py to apply the rollovers detection model on a video.