π§7 things you should know about the Focal Loss:
π It was introduced in the RetinaNet paper to address the foreground-background class imbalance encountered during training of dense detectors (one-stage detectors)
...
π Itβs derived from the cross-entropy loss such that it down-weights the loss assigned to well-classiο¬ed examples. It's used in the classification head.
π Itβs used in many one-stage object detection models: EfficientDet, FCOS, VFNet, and many other models
π It can also be used in two-stage object detection models: e.g. Sparse R-CNN
π It crashes losses associated to easy examples: for a confidence score of 0.9, the focal loss is 100 times smaller than the cross-entropy loss (see figure here above)