Best loss function for multi-class classification when the dataset is imbalance?

被刻印的时光 ゝ 提交于 2021-01-24 07:40:09

问题


I'm currently using the Cross Entropy Loss function but with the imbalance data-set the performance is not great.

Is there better lost function?


回答1:


It's a very broad subject, but IMHO, you should try focal loss: It was introduced by Tsung-Yi Lin, Priya Goyal, Ross Girshick, Kaiming He and Piotr Dollar to handle imbalance prediction in object detection. Since introduced it was also used in the context of segmentation.
The idea of the focal loss is to reduce both loss and gradient for correct (or almost correct) prediction while emphasizing the gradient of errors.

As you can see in the graph:

Blue curve is the regular cross entropy loss: it has on the one hand non-negligible loss and gradient even for well classified examples, and on the other hand it has weaker gradient for the erroneously classified examples.
In contrast, focal loss (all other curves) has smaller loss and weaker gradient for the well classified examples and stronger gradients for the erroneously classified examples.



来源:https://stackoverflow.com/questions/52160979/best-loss-function-for-multi-class-classification-when-the-dataset-is-imbalance

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!