Open programmeriop opened 1 year ago
You can check the hyp file you are using for training. If you are training your model on a custom dataset, you should be using the "hyp.scratch.custom.yaml" . Go into it and change fl_gamma to 1.5 from zero (which is the default gamma value for focal loss). Then you can optimize it accordingly with you specific case.
@yilmaz0734 , Thanks for the reply. I learned that YOLOV7 is using 3 loss: localization loss (Lbox), confidence loss (Lobj), and classification loss (Lcls). In order to see the performance/improvement on the imbalanced data, do I need to replace those with focal loss? (for example, setting those parameters to zero) or just keep those intact and try to set the focal loss=1.5?
One thing to note is that focal loss was not proposed to address data class imbalance, but rather to address foreground-background class imbalance that arises during training. To address the data class imbalance issue in your dataset, it may be better to use techniques such as over-sampling or under-sampling.
You can check the hyp file you are using for training. If you are training your model on a custom dataset, you should be using the "hyp.scratch.custom.yaml" . Go into it and change fl_gamma to 1.5 from zero (which is the default gamma value for focal loss). Then you can optimize it accordingly with you specific case.
I try to hange fl_gamma to 1.5 from zero, but get worse result.
Hi, I'm working on a multiple-class detection with imbalanced training data, in fact, the distribution of images in each class is different. I checked that the focal loss function is defined in yolov7, but I don't see anything in the documentation on how to use class balance loss, if you have a reference or method, could you please let me know?