Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to reduce false postives in yolov5 #13389

Open
1 task done
yAlqubati opened this issue Oct 28, 2024 · 2 comments
Open
1 task done

how to reduce false postives in yolov5 #13389

yAlqubati opened this issue Oct 28, 2024 · 2 comments
Labels
detect Object Detection issues, PR's question Further information is requested

Comments

@yAlqubati
Copy link

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

@yAlqubati yAlqubati added the question Further information is requested label Oct 28, 2024
@UltralyticsAssistant UltralyticsAssistant added the detect Object Detection issues, PR's label Oct 28, 2024
@UltralyticsAssistant
Copy link
Member

👋 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:

  • Data Augmentation: Augment your training data with transformations like rotation, scaling, and flipping to help your model generalize better.
  • Advanced Hyperparameter Tuning: Experiment with different learning rates, momentum values, and other hyperparameters. You might want to check out techniques like learning rate scheduling or adaptive optimizers.
  • Increase Training Epochs: Since you've mentioned planning to train for more epochs, be sure to monitor for overfitting as well as improvements.
  • Anchor Box Adjustment: Ensure that your anchor boxes are appropriate for the object sizes in your dataset. You might use k-means clustering to find optimal anchor box settings.
  • Class Balance: Ensure that your dataset is balanced. It seems you have balanced classes, but verifying this won't hurt.

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! 😊

@pderrenger
Copy link
Member

@yAlqubati to further reduce false positives, ensure your dataset is well-labeled and diverse, and consider using data augmentation techniques like Mosaic or Copy-Paste. Additionally, you might want to experiment with different models like YOLOv5m or YOLOv5l for potentially better performance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
detect Object Detection issues, PR's question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants