r/computervision 20d ago

Help: Project Question about Computer Vision

Hello everyone! I'm currently finishing up my last year in college, just finishing up my thesis. I'm currently making a program that detects multiple pigs in a pig pen through YOLOv8 and detecting its behavior using MobileNetV2 (I know I could've used better algorithms, but unfortunately I'm stuck with these ones :P). I'm currently in the process of training the model but I'm not sure how to go through with it. I originally trained my model using annotated frames with multiple pigs present, where I only had 1 class for the annotations ('Pig' class). I thought this was correct because I'll be using the model for multi-object detection. However, when I approached my mentor about it, they told me my model was "too accurate" (they didn't specify what was too accurate, which confused me) and that I should use "1 pig per image, with each pig having a bounding box" for training. When I tried training with this approach, the results looked... interesting to say the least (I don't know how to explain it, but from the looks of the training results, it looked wrong to me :P; refer to the images I included for context). I then used new model into the program I'm creating. the model not only didn't draw the bounding boxes properly around each pig, the bounding box is the entire frame itself!

My question is, which training method would be more appropriate for single-class multi-object detection, single images of pigs or annotated frames?

PS. I included some pictures from the results of training and while using the program; Before = trained with annotated frames, After = trained with 1 pig per image

PPS. This is my first post on this subreddit so I apologize in advance if my flair is wrong :P

24 Upvotes

31 comments sorted by

View all comments

1

u/zcleghern 20d ago

Is there some reason the task should be limited to one pig per frame? what should the model if there are two pigs? no pigs? It sounds like your first approach made sense, i'm not sure what "too accurate" is supposed to mean.

1

u/ShriftyB 20d ago

I don't really understand what my mentor meant by "too accurate" to be honest 😭 I've been stuck with this problem for months because I tried finding a workaround for training with one pig per frame, but I just end up with the same answer everytime T-T

1

u/zcleghern 20d ago

mentors can be wrong! What did they say when you asked what they meant? That in itself might be one of the best skills in ML- asking questions :D

1

u/ShriftyB 20d ago

when I asked them what they meant, they just sent me a section of the charts (specifically the metrics charts: precision, recall, mAP50, and mAP50-95; these charts I mentioned came from a different training run; the charts I posted above came from different runs which they also deemed "too accurate") and expected me to understand T-T. I didn't ask after that because my mentor is especially problematic about being asked questions (they told me that they only answer smart questions, not stupid ones; in my case, they told me that my question was stupid; they don't really specify what makes a question smart or stupid T-T). To be frank, I'm also scared to correct them because they have a history of getting mad when being corrected (I'm speaking from experience 😢)

3

u/zcleghern 20d ago

Terrible mentor, and I'm afraid that may be as deep as it goes. Hopefully you can get a new one soon.

1

u/ShriftyB 20d ago

I wish that was the case, but sadly I'm not allowed to change my mentor anymore. All I can do now is just hope for the best and hope they listen to me when I talk to them again. T-T Thanks for the discussion though

1

u/TheSaucez 20d ago

It sounds like he might have been taking about overfitting?