Computer Vision Lab Models FCOS ResNet-50 FPN

FCOS ResNet-50 FPN

Anchor-free per-pixel detector with centre-ness

Knowledge card: an anchor-free detector that treats detection as per-pixel prediction as in segmentation; it removes tuning of anchor sizes and ratios and reduces hyperparameters.

Object detectionKnowledge card

ArchitectureAnchor-free per-pixel detector with centre-ness
TaskObject detection
Training dataCOCO 2017
the number of parameters32,269,600
FrameworkPyTorch (torchvision)
File size≈124 MB
LicenceBSD-3-Clause (torchvision code); weights trained on COCO 2017
Where it runsKnowledge card only
Official sourcepytorch.org
Official weightsdownload.pytorch.org

Published metrics (from the official source, not measured by this site)

MetricValueEvaluation dataSource
box mAP39.2COCO val2017Source

Architecture diagram

Architecture diagram FCOS ResNet-50 FPNFPNInput imageResNet-50 backbonestages conv2–conv5C3stride 8P3lateral 1×1 + top-down ×2, 3×3C4stride 16P4lateral 1×1 + top-down ×2, 3×3C5stride 32P5lateral 1×1 + top-down ×2, 3×3P6extra levelP7extra levelClassification branch (shared)4 × Conv 3×3 (GN, ReLU)Class mapH × W × CRegression branch (shared)4 × Conv 3×3 (GN, ReLU)Distances (l, t, r, b)H × W × 4, exp(·)Center-nessH × W × 1score = √(cls × centerness)then NMS
FCOS by Tian et al. (2019): an anchor-free one-stage detector; every location on the feature map predicts the class and the distances (l, t, r, b) to the box sides, and a «centerness» output lowers the scores of locations far from the object centre.
  • Input / output
  • Convolutional layer
  • Composite block
  • Memory / intermediate features
  • Output head
  • Operation (add, multiply, merge)

Detailed model explanation

Idea and intuition

FCOS (Fully Convolutional One-Stage) abandons anchors entirely and treats detection as semantic segmentation is treated: every pixel of the feature map that falls inside a ground-truth box counts as a positive example, and it directly predicts the four distances from its location to the box edges. The anchor-specific hyperparameters (sizes, ratios and IoU thresholds for assignment) disappear.

Components

  • A backbone with FPN (P3–P7); each object is assigned to a level according to the largest distance \max(l,t,r,b) to reduce ambiguity when boxes overlap.
  • A classification branch with focal loss.
  • A regression branch that predicts (l,t,r,b).
  • A «centerness» branch estimates how close the pixel is to the object centre, and is multiplied by the classification score to suppress poor boxes produced by pixels far from the centre.

Mathematical formulation

l^*=x-x_0,\; t^*=y-y_0,\; r^*=x_1-x,\; b^*=y_1-y
\mathrm{centerness}^* = \sqrt{\frac{\min(l^*,r^*)}{\max(l^*,r^*)}\cdot\frac{\min(t^*,b^*)}{\max(t^*,b^*)}}

The regression loss is computed with IoU loss between the predicted and ground-truth box, and the centerness loss with binary cross-entropy.

Performance

The torchvision release FCOS ResNet-50 FPN: about 32.3 million parameters and box mAP = 39.2 on COCO val2017.

Strengths and limitations

  • Strength: fewer hyperparameters and a simpler design, and lighter training memory because IoU is not computed against thousands of anchors.
  • Strength: the per-pixel formulation makes it easy to extend to other dense tasks.
  • Limitation: still needs NMS after prediction.
  • Limitation: sensitivity to how overlapping objects are assigned to levels.

Uses

General detection, the basis for later anchor-free detectors.

Runtime requirements

—

How to load

Not loaded in the lab (knowledge card).

References

  1. Z. Tian, C. Shen, H. Chen, T. He (2019).FCOS: Fully Convolutional One-Stage Object Detection. arXiv:1904.01355 (ICCV 2019). doi:10.48550/arXiv.1904.01355
  2. T.-Y. Lin, P. Dollár, R. Girshick, K. He, B. Hariharan, S. Belongie (2016).Feature Pyramid Networks for Object Detection. arXiv:1612.03144 (CVPR 2017). doi:10.48550/arXiv.1612.03144
  3. T.-Y. Lin, P. Goyal, R. Girshick, K. He, P. Dollár (2017).Focal Loss for Dense Object Detection. arXiv:1708.02002 (ICCV 2017). doi:10.48550/arXiv.1708.02002

Related algorithms