RetinaNet

The paper shows that a dense one-stage detector can match two-stage detector accuracy when foreground-background imbalance is handled by focal loss.

Metadata

FieldValue
PaperFocal Loss for Dense Object Detection
AuthorsTsung-Yi Lin, Priya Goyal, Ross Girshick, Kaiming He, Piotr Dollár
Year2017
VenueICCV 2017
arXiv1708.02002
Statusseed note started

One-Line Takeaway

RetinaNet combines a feature pyramid, dense anchor heads, and focal loss so one-stage detection is not overwhelmed by easy background examples.

Question

Two-stage detectors reduce class imbalance by evaluating a sparse set of proposals:

Dense one-stage detectors evaluate many locations and anchors:

Most candidates are background. RetinaNet asks:

Is class imbalance the main reason one-stage detectors trail two-stage detectors, and can the loss fix it?

Architecture Contract

ComponentInputOutputRole
backbone CNNimagefeature hierarchyvisual representation
FPNbackbone featurespyramid features multi-scale dense features
classification subneteach pyramid levelclass logits per anchordense object classification
box subneteach pyramid levelbox offsets per anchordense localization
focal lossclass logits and labelsreweighted classification lossfocus training on hard examples

The architecture can be written as:

where is pyramid level, is spatial location, and is anchor index.

FPN Backbone

RetinaNet uses Feature Pyramid Networks:

Each level receives two subnetworks:

The heads are shared across pyramid levels, which makes the detector a repeated dense prediction module over scale.

Focal Loss

For binary classification, cross entropy is:

where:

Focal loss adds a modulating factor:

When an example is already easy, is large and:

So easy negatives contribute less, and hard examples dominate training.

Dense Detector Interpretation

RetinaNet is architecturally simple:

The paper’s important point is that architecture and objective are coupled. A dense one-stage architecture creates many easy background examples; focal loss makes that architecture trainable.

Comparison

AxisSSDRetinaNet
Detector typeone-stage dense detectorone-stage dense detector
Scale handlingmultiple feature mapsFPN pyramid
Classification issuehard negative miningfocal loss
Main architectural blockdefault boxes over feature mapsFPN plus shared subnet heads
Historical rolepractical single-shot detectioncloses one-stage/two-stage accuracy gap

What To Watch

  • The main novelty is focal loss, but the detector architecture is still part of the contribution.
  • FPN, anchors, and focal loss interact; avoid attributing all gains to only one component.
  • and are loss hyperparameters that affect optimization.
  • Dense detection accuracy depends on assignment rules and anchor design.
  • RetinaNet is not proposal-free in the sense of avoiding anchors; it is proposal-free in the two-stage RPN/RoI sense.