EasyDeepLearn

Explain focal loss and why it's used in dense detection.

hard

Answer

  • FL(pt)\mathrm{FL}(p_{t}) = -α    (1    pt){\alpha}\; \cdot \;(1\; - \;p_{t})^γ    log(pt){\gamma}\; \cdot \;\operatorname{log}(p_{t}), where ptp_{t} is the model's probability for the true class.
  • The (1pt)(1 - p_{t})^γ term (γ ~ 2) down-weights well-classified examples, keeping the loss focused on hard examples.
  • Fixes the extreme class imbalance in one-stage detectors (RetinaNet) where 100k background anchors dominate a few foreground ones.
  • Also useful for imbalanced classification.
Check yourself — multiple choice
  • Focal loss = plain BCE
  • FL down-weights easy examples via (1pt)(1 - p_{t})^γ → focuses gradient on hard cases; fixes extreme detection imbalance
  • Adds noise to labels
  • Only for regression

Focal loss: (1pt)(1 - p_{t})^γ down-weights easy examples → attention on hard ones (RetinaNet).

#losses#detection#computer-vision

Practise Deep Learning

214 interview questions in this topic.

Related questions