sgoldenlab / simba

SimBA (Simple Behavioral Analysis), a pipeline and GUI for developing supervised behavioral classifiers
https://simba-uw-tf-dev.readthedocs.io/
GNU General Public License v3.0
287 stars 140 forks source link

SimBA for SPRGT #90

Closed Shehrrykid closed 3 years ago

Shehrrykid commented 3 years ago

I apologise if this is the wrong page to post this, i'm fairly new to GitHub. I was wondering if SimBA could be used to annotate and create behaviour classifiers for the rodent single pellet reaching task? Here is my setup: I have top down videos (and corresponding DeepLabCut csv's) of rat forelimbs reaching and grasping a sugar pellet (also annotated) on a spoon and then retrieving it. These videos are only around 28 seconds and contain 700 frames. I would like to create a classifier that would identify pronation, supination and lingering of the forelimb on the spoon as well as an overall classifier for detecting outcome (successful pellet reach or unsuccessful). I have already tried using SimBA but fear I may have used behavioural annotation incorrectly, marking frames individually rather than a frame range which would contain temporal data. My question is, would this software actually work for this purpose and would it be able to take a chunk of frames marked as "successful pellet retrieval" and make an efficient classifier? Thank you in advance!

https://user-images.githubusercontent.com/65357758/108206742-b6841880-711e-11eb-92ad-7b14165dcb1f.mp4

sgoldenlab commented 3 years ago

Hello @Shehrrykid! The video won't play or download for some reason, if you share a gdrive link I could take a look -goldenneurolab@gmail.com

Some thoughts, I'm not sure how pronation, supination and lingering looks like but generally, if you can identify a behavior by eye, and the behavior has a meaningful duration (e.g., the animal performed 3 bouts of supination for a total duration of 1.5) then you can use SimBA to get to that.

I mention "meaningful duration" because of your second question - about successful reaching. Successful reaching doesn't really fill this criterion - SimBA will give you how many frames/ seconds/bouts successful reaching happened in - it is possible that the "bouts" of successful reaching that simba classifies is meaningful for you though.

Each individual frame, annotated or not, does contain temporal data, up to 500ms - for each frame SimBA calculates these values - https://github.com/sgoldenlab/simba/blob/master/misc/features_user_defined_pose_config.csv

I mention this as if you annotate a single frame as "successful reaching", what is unique about that frame compared to 3 frames downstream which is not "successful reaching" - probably nothing or very little - and this will confuse the classifier. I'd try to annotate a whole segment as successful reaching and see if that works.

I'd also set some very clear definitions of what successful reaching is before annotating - e.g., the forelimbs have to remain this position after making this motion or something similar - without that it be difficult for the annotator to label frames correctly and for the computer to separate the behaviors from the background.

Shehrrykid commented 3 years ago

Thanks for your quick reply!

I have sent you an email :)

Shehrrykid commented 3 years ago

Hi guys,

I was just wondering, per your last email: I as the annotator i can only tell if an animal is successful in reaching when they have retrieved the pellet and it has moved out of the field of view. This is because sometimes they can drop it as they pull their paw out and this is classed as a failure. That being said, does this mean I should label all the frames AFTER the paw is no longer in view as successful of failure? If thats the case the only frames contained in that classifier would be unannotated empty frames showing the spoon. Does SimBA somehow look at those frames in relation the the rest of the video? Or would it be best to label all frames containing the paw and pellet as success or fail instead? As in if frames 200-400 contain the paw reaching and grasping the pellet successfully then they should all be labelled as successful? Thank you Ilyaas