ultralytics / yolov5

YOLOv5 🚀 in PyTorch > ONNX > CoreML > TFLite
https://docs.ultralytics.com
GNU Affero General Public License v3.0
50.6k stars 16.32k forks source link

how to reduce false postives in yolov5 #13389

Open yAlqubati opened 4 days ago

yAlqubati commented 4 days ago

Search before asking

Question

Hello everyone,

I'm currently training YOLOv5s to detect three objects: phone, cigarette, and vape. My original dataset contained 9,000 images, with 3,000 images for each class. After training the model for 100 epochs, I've noticed a high number of false positives.

To address this, I've added 3,000 negative images (images that don't contain any of the target objects) to the dataset. I've also experimented with adjusting the conf_thres and iou_thres settings a bit. I plan to train the model for more epochs in the future.

Are there any additional strategies or techniques you recommend to further reduce the number of false positives? Any insights would be greatly appreciated!

thanks in advance.

Additional

training info pochs 100, --img-size 640, --batch-size 16, --optimizer SGD --cache ram --hyp /content/yolov5/data/hyps/hyp.scratch-low.yaml

the content of hyp.scratch-low.yaml file is set to default

UltralyticsAssistant commented 4 days ago

👋 Hello @yAlqubati, thank you for your interest in YOLOv5 🚀! It's great to hear you're working on training a model for detecting phones, cigarettes, and vapes. Reducing false positives can indeed be challenging, and it seems like you're already taking some good steps.

To further improve your results, consider these strategies:

If this is a 🐛 Bug Report, please provide a minimum reproducible example to help us debug it.

An Ultralytics engineer will also assist you soon, and their insights could provide additional valuable guidance! 😊