ultralytics / yolov3

YOLOv3 in PyTorch > ONNX > CoreML > TFLite
https://docs.ultralytics.com
GNU Affero General Public License v3.0
10.18k stars 3.44k forks source link

The code can detect object with correct classification and good bbox, but scores are pretty low. What is the reason? #823

Closed yoga-0125 closed 4 years ago

yoga-0125 commented 4 years ago

Classification is correct (eg. Pedestrian) and bbox coordinate is also fine. But score is very low (eg. 0.1, 0.18......). Any suggestions in training process? Any hyp parameters result in this problem?

glenn-jocher commented 4 years ago

Hello, thank you for your interest in our work! This issue seems to lack the minimum requirements for a proper response, or is insufficiently detailed for us to help you. Please note that most technical problems are due to:

If none of these apply to you, we suggest you close this issue and raise a new one using the Bug Report template, providing screenshots and minimum viable code to reproduce your issue. Thank you!

yoga-0125 commented 4 years ago

Hi, I use exactly the same code as the updated ultralytics/yolov3 version to train KITTI data.

The attached 3 photos shows that it has low scores for pedestrian even if there is only few people. Please help me if you have any idea where to adjust in the code, thank you very much!

000862 000789 000208

glenn-jocher commented 4 years ago

@yoga-0125 can you show the results.png file produced during training? Sometimes low confidences are simply because you have not trained long enough.

yoga-0125 commented 4 years ago

attached results

glenn-jocher commented 4 years ago

Ah ok. Two problems.

  1. You need to train for more epochs, say --epochs 300
  2. You have changed the LR scheduler for some reason, I see a drop at epoch 22. You should return to the default scheduler which drops at 0.8 and 0.9 of --epochs.

Basically you should return to the repo defaults, as you've caused the problems yourself with your changes.

yoga-0125 commented 4 years ago

Sure, thanks a lot for suggestions. In addition, when using conf_thres at 0.1, P & R are 0.8 & 0.45. Then I change conf_thres from 0.1 to 0.01, P is reduced from 0.8 to 0.7, but R almost no change. Any suggestion?

glenn-jocher commented 4 years ago

@yoga-0125 I recommend you use the very latest repo (git pull), and that you use the default settings. In regards to your P-R question, I believe I've already addressed this in your other issue https://github.com/ultralytics/yolov3/issues/822#issuecomment-580999941

yoga-0125 commented 4 years ago

I tried reducing conf_thres from 0.1 to 0.001, then P is reduced from 0.8 to 0.4, and R does not improve significantly. So I set con_thres back to 0.01.

wemindful commented 4 years ago

I want to know, how do I adjust the hyperparameters in this case? results300

FranciscoReveriano commented 4 years ago

This looks very good. What exactly are you trying to do?

wemindful commented 4 years ago

这看起来很好。您到底想做什么?

I think the accuracy is too low

github-actions[bot] commented 4 years ago

This issue is stale because it has been open 30 days with no activity. Remove Stale label or comment or this will be closed in 5 days.

goldwater668 commented 4 years ago

@glenn-jocher I use my own data set. For a category, only 700 pieces of training data are used. In the test, the default conf thres = 0.01, IOU thres = 0.6, and the accuracy rate is 81%. The recall rate was 77%, and the accuracy was 83% when conf thres = 0.2 and IOU thres = 0.6. The recall rate is 75%. Why does the accuracy rate rise and the recall rate drop instead of falling together? What is the way to improve the recall rate? image

glenn-jocher commented 11 months ago

@goldwater668 the accuracy and recall rates can have complex interactions. To improve the recall rate, you can try the following techniques:

  1. Increase the amount of training data for the affected category.
  2. Augment the existing training data to provide the model with more varied examples.
  3. Experiment with different confidence and IOU thresholds to find the optimum balance between precision and recall.

Additionally, consider adjusting the anchor box sizes and aspect ratios to better match the characteristics of the objects in your dataset. This may help improve detection performance, particularly for small or densely packed objects.

I hope these suggestions help. Good luck with your training!