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

Do non-classified frames affects the training model? #270

Open BarakMalul opened 1 year ago

BarakMalul commented 1 year ago

Hi, when inserting date which is not fully classified(for exampled 10 minutes out of 20 of the video are classified) - does the empty parts of video effects on the bad side on the classifier results when I training the model based on this data?

another question - when I insert annotations to SimBA the output file conatins in the behaviors columns not enough frames with "1"s in each behaviour, despite in the annotations file there are a lot of them. what could be the reason? Thank you!

sronilsson commented 1 year ago

Hi @BarakMalul!

For the first question: If you annotate say the first half of the video, and do not annotate (not look at) the second half of the video, then watch out SimBA will assume that the second half of the video contains no behavior of interest (second half will be all 0). Check out advanced labelling for a different behavior of the annotator that might be more suitable.

For the second question, is there an error msg associated with this, can you past it here?

BarakMalul commented 1 year ago

Does the non classified annotation will cause significantly worse reault of the classifier? Should I consider trim the videos to the annotated parts?

And I got no error, but I get '0' in times that I classified.

sronilsson commented 1 year ago

yes trimming is a good idea, if your video contains long sequences you do not want to annotate.

I wrote a little bit about this here, let me know if makes sense: https://github.com/sgoldenlab/simba/blob/master/docs/FAQ.md#8-my-videos-are-very-long-and-can-be-a-pain-to-annotate-in-the-simba-annotation-gui-can-i-skip-annotating-some-frames-and-still-build-an-accurate-classification-model-based-on-annotatednot-annotated-frames

BarakMalul commented 1 year ago

I'll check it out! About thw second issue- Is there any factor that can lead to the '0' that appear despite behaviors which annotated?

sronilsson commented 1 year ago

Let's make sure I understand: do you check the behavior, and click save the file, then you open the file in a spreadsheet viewer (e.g., MS Excel), and you see 0 for that frame in the relevant column?

BarakMalul commented 1 year ago

Because the manual labeling in the annotaions is not per frame but per time so the problem is that for example despite I encoded behavior like Fighting for 2 seconds under start and point I can't see any '1' when I'm looking at the file that created when I appended the boris file

sronilsson commented 1 year ago

Got it, did you see any warning msgs when you appended your BORIS annotations?

The first thing that comes to mind is say you recorded Fighting to start at 00:05:03 and end at 00:05:05, SimBA will look at the FPS of your video to match the time stamps to frame numbers. However, if the FPS of your video is not the same as the video analysed in pose-estimation there will be a mismatch.

But you should see warning if that happens.

BarakMalul commented 1 year ago

Sorry for the late response. In the meantime, I have trimmed the videos, and the results are now great! I would love to know how to analyze new videos (I couldn't find the information in the tutorials). What steps should I take to extract frames only from a new video in order to use it in the 'Validate Model On Single Video" part?

sronilsson commented 1 year ago

Hi @BarakMalul - I think the relevant documentation is in the link below, but let me know if there is something specific missing or unclear.

https://github.com/sgoldenlab/simba/blob/master/docs/Scenario2.md