AICurious Logo

What is: Varifocal Loss?

SourceVarifocalNet: An IoU-aware Dense Object Detector
Year2000
Data SourceCC BY-SA - https://paperswithcode.com

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(p,q)=q(qlog(p)+(1q)log(1p)) if q>0VFL\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(p,q)=αpγlog(1p)VFL\left(p, q\right) = −\alpha{p^{\gamma}}\log\left(1-p\right)

where pp is the predicted IACS and qq is the target IoU score.

For a positive training example, qq 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 qq for all classes is 00.