Why most works on Cityscapes don't use weighted cross-entropy?

Viewed 55

Weight Cross-Entroy (WCE) helps to handle an imbalanced dataset, and Cityscapes is quite imbalanced as seen below:

enter image description here

If we check the best benchmarks on this dataset, most of the works use bare CE as a loss function. I don't get it if there are any special causes that would lead WCE to a worse result for semantic segmentation tasks on the mIoU evaluation.

I'm especially asking because I'm working in an even higher unbalanced dataset (multi-minority classes on the ratio of 1:1000 to the majority classes) and got very surprised when bare CE outperformed WCE on the mIoU metric.

I found so far that WCE can yield many false positives from minority classes, but beyond that, would there be more reasons for it?

1 Answers

Read Tsung-Yi Lin, Priya Goyal, Ross Girshick, Kaiming He and Piotr Dollár Focal Loss for Dense Object Detection (ICCV 2017). They discuss in length the shortcoming of CE loss when classes are unbalanced and argue (quite compellingly) that WCE simply does not address this limitation of CE.

CE loss never goes to zero: it always has non-zero gradients even if the prediction is perfect. CE strives to increase the margin between the different classes. As a result, when there is an imbalance between classes, CE will put an equal effort into being "more certain" about the dominant class as well as making fewer mistakes on the minority class. Putting weights on the CE will not make a fundamental change to this behavior.
In contrast, what you actually want from a loss function, in this case, is to ignore samples that you already predict correctly, and make an effort to correct wrong predictions. This is usually achieved via hard-negative mining of Focal loss.

Related