Varifocal Loss
Varifocal Loss
**Varifocal Loss** is a loss function for training a dense object detector to predict the IACS, inspired by [focal loss](https://paperswithcode.com/method/focal-loss). Unlike the focal loss that deals with positives and negatives equally, Varifocal Loss treats them asymmetrically.

$$ VFL\left(p, q\right) = −q\left(q\log\left(p\right) + \left(1 − q\right)\log\left(1 − p\right)\right) \text{ if } q > 0 $$

$$ VFL\left(p, q\right) = −\alpha{p^{\gamma}}\log\left(1-p\right) $$

where $p$ is the predicted IACS and $q$ is the target IoU score.

For a positive training example, $q$ is set as the IoU between the generated bounding box and the ground-truth one
(gt IoU), whereas for a negative training example, the training target $q$ for all classes is $0$.
VarifocalNet: An IoU-aware Dense Object Detector
https://paperswithcode.com/paper/varifocalnet-an-iou-aware-dense-object
VarifocalNet: An IoU-aware Dense Object Detector