Loss Functions

# Varifocal Loss

Introduced by Zhang et al. in VarifocalNet: An IoU-aware Dense Object Detector

Varifocal Loss is a loss function for training a dense object detector to predict the IACS, inspired by 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$.

#### Papers

Paper Code Results Date Stars