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
273 stars 137 forks source link

Path plots #309

Closed IsabelleSajonia closed 7 months ago

IsabelleSajonia commented 7 months ago

Hello. I'm currently making path plots and I had another question about how missing points are dealt with.

The nose point in my video is sometimes not visible (certain poses where the head is down or out of frame). I skipped outlier correction as that was causing issues with tracking before. I previously used quadratic interpolation for body parts, but I've found that with some frames that puts points in the wrong location. However, when I skip these and simba puts missing points in the corner of the screen (0,0) it looks like they are tracked in the path plots? I'm not sure that's the case but it would make sense for what I'm seeing from the plot (see attached). How can I make a cleaner plot and what could this be from? FR3_training_final_frame

Also- I'm not sure if this is possible but it would be a cool feature if you could make path plots of a final frame without going through the machine training (I think there's an option in the main menu but it makes a whole video). Thanks!

sronilsson commented 7 months ago

Hi @IsabelleSajonia!

Yes, about the different interpolation methods. I mentioned it in an earlier issue, and there is a graph representation of the different interpolation methods HERE.

In brief, say your data is [1, 2, m, m, m, m, 7, 4] where m is missing data, you might want to try a linear interpolation which would give you [1,2, 3, 4, 5, 6, 7, 4], or a nearest interpolation which gives you [1, 2, 2, 2, 7, 7, 4].

Some other thought:

1) Instead of using the nose, could you use a different body-part that is visible and is accurately tracked?

2) I've seen a lot of users not label or track the nose or other body-parts in DLC or SLEAP lately, even though the experimenter knows where in the image where the nose is. The nose might be obscured by a headstage, or some bedding material, or the mouse sniffs the floor at a tilt. But if you ask the experimenter where the nose they would know with certainty where it is, but still they skip to label it. If you know where in the image the nose is, even though it is obscured, I think you should label and track that position. You can read about it in the DLC or SLEAP documentation I think thats what they also suggest.

3) Also, in new future videos - make sure the animal can't be outside of the recording environment.

Finally: Yes I will insert a fix - for now - if you don't have to train a model, you can manually move the CSV files from the project_folder/csv/outlier_corrected_movement_location folder to the project_folder/csv/machine_results folder and the path plot function will find them.

IsabelleSajonia commented 7 months ago

For most frames I know where the nose is and should be able to add that label in. The tail points are not always visible to me since it blends in with the color of our operant chamber walls. I'll consider not labeling as many tail points.

Thank you!

sronilsson commented 7 months ago

yes, tails I've always had trouble with...

Yes I'm thinging of scenarious like this:

image

I would put a label where the nose is, even though head is covering it and I cant see it directly.

IsabelleSajonia commented 7 months ago

I'll give that a try thanks again!