Closed noahweber1-debug closed 1 year ago
@noahweber1-debug hi, as we redesigned the loss part in v8 and the loss values are different from v5 so we also need to re-balanced the losses by redesigned the gains. :)
@Laughing-q I used yolov8m-seg.yaml to train a model on my own dataset which has 4 classes. And all training parameters are default parameters except nc=4.
the result of mask looks good. But the conf of boxes is very low. Do you have any suggestions to improve the conf of boxes?Or what training parameters should I modify?
Should I modify the loss gain to re-balanced the losses?
@ziyaxuanyi
Should I modify the loss gain to re-balanced the losses?
mostly you don't need to modify the loss gain.
Do you have any suggestions to improve the conf of boxes?Or what training parameters should I modify?
this depends on many factors, I recommend you to read the tips in v5 which also applies to v8 models and segmentation. :)
@Laughing-q thank for your answer.
👋 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 ⭐
@Laughing-q what would you suggest in case my segmentation masks are either convex polygons (rectangle) or concave polygons in the ground truth. I am facing overfitting and I was thinking maybe changing the loss parameters can help there?
@glenn-jocher can you please help in this regard?
@Ashutosh1995 Adjusting loss parameters might help, but it's also essential to consider other strategies to combat overfitting. You could try implementing data augmentation, adjusting the learning rate, or increasing dropout rates. Experimenting with these methods could provide more stability during training without solely relying on modifying loss gains.
@glenn-jocher I'm doing a medical project and for me recall is the most important metric. Setting the parameters like this is a good option?
| box | 10 | box loss gain | cls | 1.0 | cls loss gain (scale with pixels) | dfl | 1.0 | dfl loss gain
Hi @gusmendess,
It's great to hear about your medical project! Prioritizing recall is crucial in such applications. Adjusting the loss gains can indeed help, but it's essential to balance them carefully. Your proposed settings:
Parameter | Value | Description |
---|---|---|
box | 10 | Box loss gain |
cls | 1.0 | Classification loss gain |
dfl | 1.0 | Distribution focal loss gain |
These settings increase the emphasis on the box loss, which might help in improving recall by making the model more sensitive to detecting objects. However, it's also important to monitor the precision to ensure that the increase in recall doesn't lead to too many false positives.
Additionally, consider the following tips to further enhance recall:
Experimenting with these parameters and strategies should help you find the optimal balance for your specific dataset and requirements. If you encounter any issues or need further assistance, feel free to share more details or a reproducible example.
Best of luck with your project! 🚀
For more detailed guidance, you can refer to our training tips.
Search before asking
Question
There are 3 hyperparameters that ought to be set:
| box | 7.5 | box loss gain
| cls | 0.5 | cls loss gain (scale with pixels)
| dfl | 1.5 | dfl loss gain
I understand conceptually what these losses are but what I dont understand is:
Additional
No response