pytorchyolov5

The training results of YOLOv5 are marked incorrectly


I am a beginner in YOLOv5, and I am training a custom model.
I used Roboflow to create a dataset, which includes a Training Set with 2,000 images, a Validation Set with 183 images, and a Testing Set with 115 images.
The results I get from training are not satisfactory, as seen in the image below, the position of the cueball is always significantly off. I don't know why this is happening and I am wondering if there are any ways to improve this.

result1 result1 \

result2 result2

This is the command I use during training.
python train.py --img 416 --batch 32 --epochs 500 --data data.yaml --weights yolov5l.pt --cache

I have tried using other YOLOv5 models, but the results are still the same. I have also continuously added data to my dataset, but there has been no improvement in the results. I would like to ask if anyone knows whether I should continue training or if there are other methods to improve the results?

The following are some indicator data about the dataset. Although I have 5 classes, I only used two of them, cue and cueball, during training. Class Balance enter image description here enter image description here enter image description here enter image description here


Solution

  • The position of the cue ball is actually pretty spot on. If you notice the bounding box for the actual cue has a high confidence (0.76) for result 1 and 0.82 for result 2. And the rest are detections with low confidence. Judging from those two images, i guess that your recall is very high, but your precision is a bit low. You can apply a higher threshold (basically saying to filter out the ouputs under a certain confidence). You can set a default threshold of 0.5, and see if it works for your use case or not, then decrease it or increase it depending on what you want.