Huber loss (smooth L1): for residual
r=y−f(x), quadratic for small errors and linear for large ones, piecewise defined as
Lδ(r)={21r2,δ(∣r∣−21δ),∣r∣≤δ∣r∣>δ — continuous and differentiable at
∣r∣=δ, with constant gradient (no explosion) on large outliers while keeping L2's fast convergence on typical samples; in object detection it appears as Smooth L1. Focal Loss:
FL(pt)=−αt(1−pt)γlogpt where
pt is the predicted probability of the true class,
γ∈[0,5] is the modulating factor (typically 2) and
αt the class weight — as
pt→1 (easy samples) the factor
(1−pt)γ→0 and the loss is sharply down-weighted; as
pt is small (hard samples) the weight is near 1 and the loss is kept. Proposed by RetinaNet to solve “easy negatives drowning the gradient”.