-
-
Notifications
You must be signed in to change notification settings - Fork 16.3k
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
Yolov5 hyperparameter tuning #13085
Comments
@AbhishekPSI7042 hi there, Thank you for reaching out and providing detailed information about your training setup and results. It looks like you're achieving good performance on most classes, but the
Here is an example command to train with some of these suggestions: python train.py --epochs 300 --img 640 --batch 32 --data dev_data.yaml --weights yolov5m.pt --cache --patience 10 For more detailed tips and best practices, please refer to our Tips for Best Training Results guide. I hope these suggestions help improve your number plate detection accuracy. If you have any further questions or need additional assistance, feel free to ask! |
Hii @glenn-jocher, In my case, I need a small model because I have to run it with DeepStream on Jetson, where I can't compromise on FPS. That's why I'm using the YOLOv5n model with an image size of 360. Do I need to have more images for validation? In the training dataset, we have around 7,100 images, but in the validation dataset, I have approximately 2,100 images. |
Hi @AbhishekPSI7042, Thank you for your question and for providing details about your use case. Running YOLOv5n on Jetson with DeepStream is a great choice for maintaining high FPS. Here are some suggestions to help you optimize your model performance:
Here is an example command to train with some of these suggestions: python train.py --epochs 300 --img 480 --batch 32 --data dev_data.yaml --weights yolov5n.pt --cache --patience 10 For more detailed tips and best practices, please refer to our Tips for Best Training Results guide. If you encounter any issues or have further questions, feel free to ask. The YOLO community and the Ultralytics team are here to help! 😊 |
Hii @glenn-jocher, I have trained model with image size 480 and epochs 300 but model accuracy didn't increased. Now what things do I need to do to increase the accuracy of numberplate. I training model on google colab pro. Will this hyperparameter tuning work? lr0: 0.001 # initial learning rate (SGD=1E-2, Adam=1E-3) anchors: 3 # anchors per output layer (0 to ignore)fl_gamma: 0.5 # focal loss gamma (efficientDet default gamma=1.5) |
Hi @AbhishekPSI7042, Thank you for your detailed follow-up. It's great to see you're experimenting with different settings to improve your model's performance. Let's address your concerns and explore further steps to enhance the accuracy of your number plate detection. Hyperparameter TuningHyperparameter tuning can indeed have a significant impact on model performance. The hyperparameters you've listed are a good starting point. Here are a few suggestions to fine-tune them:
Example Command with Adjusted HyperparametersHere's an example command incorporating some of these suggestions: python train.py --epochs 300 --img 480 --batch 32 --data dev_data.yaml --weights yolov5n.pt --cache --patience 10 --hyp hyp.yaml And your lr0: 0.0005
lrf: 0.01
momentum: 0.937
weight_decay: 0.0005
warmup_epochs: 5.0
warmup_momentum: 0.9
warmup_bias_lr: 0.2
box: 0.1
cls: 0.5
cls_pw: 1.0
obj: 1.5
obj_pw: 1.0
iou_t: 0.15
anchor_t: 3.0
fl_gamma: 0.5
hsv_h: 0.015
hsv_s: 0.7
hsv_v: 0.4
degrees: 0.0
translate: 0.3
scale: 0.6
shear: 0.0
perspective: 0.0
flipud: 0.0
fliplr: 0.5
mosaic: 1.0
mixup: 0.0
copy_paste: 0.0 Additional Tips
For more detailed tips and best practices, please refer to our Tips for Best Training Results guide. If you encounter any issues or have further questions, feel free to ask. The YOLO community and the Ultralytics team are here to help! 😊 Best of luck with your training! |
👋 Hello there! We wanted to give you a friendly reminder that this issue has not had any recent activity and may be closed soon, but don't worry - you can always reopen it if needed. If you still have any questions or concerns, please feel free to let us know how we can help. For additional resources and information, please see the links below:
Feel free to inform us of any other issues you discover or feature requests that come to mind in the future. Pull Requests (PRs) are also always welcomed! Thank you for your contributions to YOLO 🚀 and Vision AI ⭐ |
Search before asking
Question
Hi,
I'm training a YOLOv5n model for vehicle detection, and we have five classes. In training, I have 7519 images, including background images, and in validation, 2130 images. However, I'm unable to achieve accuracy in number plate detection. How can I improve the accuracy of number plate detection? Please help me to improve the accuracy of numberplate
!python train.py --epochs 150 --img 360 --batch 32 --data dev_data.yaml --weights yolov5n.pt --cache --patience 10
Accuracy achieved:-
Class Images Instances P R mAP50 mAP50-95: 100%|██████████| 34/34 [00:23<00:00, 1.44it/s] all 2130 3710 0.99 0.984 0.995 0.859 Vehicle 2130 1158 0.985 0.985 0.995 0.922 NumberPlate 2130 1594 0.985 0.981 0.994 0.655 Heavy Vehicle 2130 650 1 0.984 0.995 0.921 TwoWheeler 2130 295 0.993 0.969 0.995 0.871 ThreeWheeler 2130 13 0.985 1 0.995 0.927
Additional
No response
The text was updated successfully, but these errors were encountered: