Foundations to Frontier
Tests
E. Deep Learning › E9 Object Detection Architectures

CenterNet, FCOS (anchor-free detection)

Anchor-free detectors drop anchor boxes. FCOS (Tian et al., 2019) treats every feature-map location inside an object as a positive and regresses its distances to the four box edges, with a centre-ness score that suppresses poor boxes near edges and FPN levels assigned by object size. CenterNet (Zhou et al., 2019) represents each object by the peak of a heatmap at its centre plus a regressed size, reading detections as local maxima without NMS. Both matched or beat anchor-based detectors with fewer hyperparameters. This page covers both designs, centre-ness, centre sampling and heatmap decoding. In the exercises you implement the targets, centre-ness and peak finding, then reproduce FCOS's ambiguity analysis: 27% of positive locations lie inside two or more objects on one map, but only 9% across FPN levels.

Level 0: Foundation

★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.

No more preset boxes

Anchor-based detectors need a hand-tuned list of box sizes and shapes. Anchor-free detectors skip it.

  • FCOS lets every point inside an object predict how far it is to the object’s four edges.
  • CenterNet marks each object only by its centre point, which glows on a heatmap, together with the object’s width and height.

Fewer settings to tune, and often simpler and faster.

Detection lab
216 anchors; 0 positive (IoU ≥ 0.5); best IoU with the ground truth 0.46 — no positive anchor, so the best one is also assigned (highlighted)
Why engineers care

Anchor-free heads are used in many modern detectors (YOLOX, YOLOv8, FCOS-based models) and in 3-D detection for driving (CenterPoint), because they handle unusual object shapes without retuning anchors.

📝 Quick check (Level 0)
0/3 answered
  1. 1. FCOS points predict…
  2. 2. CenterNet represents an object by…
  3. 3. Anchor-free detectors remove…

Level 1: Beginner

★★☆☆☆ Basic⏱ 20 minSecondary-school mathematics: arithmetic and elementary algebra.

By hand

  • FCOS targets: for a location (x, y) inside box (x₀, y₀, x₁, y₁):
    • l = x − x₀, t = y − y₀, r = x₁ − x and b = y₁ − y;
    • for (30, 20) in (10, 10, 50, 40) they are (20, 10, 20, 20).
  • Centre-ness: √(min(l, r)/max(l, r) · min(t, b)/max(t, b)). It is 1 at the centre; with l = 5, r = 35 and t = b = 15 it is √(5/35) ≈ 0.378. At test time it multiplies the class score.
  • Level assignment: level k regresses only targets with max(l, t, r, b) in its range: 0–64 for P3, 64–128 for P4, 128–256 for P5, 256–512 for P6 and above 512 for P7.
  • Ambiguity: a location inside two boxes is assigned to the smaller one.
  • CenterNet:
    • output stride 4, so a 512 image gives a 128 × 128 map;
    • per location, C heatmap channels plus 2 size and 2 offset values: 128²·84 outputs for 80 classes;
    • ground truth is a Gaussian around each centre;
    • decoding keeps 3 × 3 local maxima above a threshold.
📝 Quick check (Level 1)
0/3 answered
  1. 1. Centre-ness at the exact centre:
  2. 2. FCOS level for max target 100:
  3. 3. CenterNet's output stride:

Level 2: Intermediate

★★★☆☆ Intermediate⏱ 25 minUndergraduate students and practising engineers.

Anchor-free detection in code

Exercise 1.

  • The FCOS targets and centre-ness matched hand values.
  • Peak finding recovered exactly the two object centres from a heatmap of two Gaussians.

Practice.

  • torchvision’s fcos_resnet50_fpn implements FCOS.
  • FCOS details:
    • the head is shared across levels, with a learned scale per level;
    • centre sampling (positives only near the centre) and GIoU box loss are common improvements;
    • the focal loss is used for classification.
  • CenterNet:
    • backbones range from ResNet-18 (fast) to Hourglass-104 (accurate);
    • it extends naturally to 3-D boxes, pose keypoints and tracking (CenterTrack, CenterPoint for lidar).
  • Without NMS, CenterNet’s 3 × 3 max-pool decoding is simple and fast. Overlapping objects with the same centre cell are rare at stride 4.
model = torchvision.models.detection.fcos_resnet50_fpn(weights="DEFAULT")
# CenterNet decoding: keep = heat == F.max_pool2d(heat, 3, 1, 1); peaks = heat * keep
🐍 Exercise 1: targets, centre-ness and peaks
Implement FCOS targets and centre-ness, a CenterNet Gaussian heatmap, and peak decoding.
📝 Quick check (Level 2)
0/3 answered
  1. 1. torchvision's FCOS:
  2. 2. CenterNet's decoding replaces NMS with…
  3. 3. CenterPoint applies CenterNet to…

Level 3: Advanced

★★★★☆ Advanced⏱ 25 minGraduate level, with full derivations and proofs.

Theory

Why drop anchors.

  • Anchors add hyperparameters (sizes, ratios, IoU thresholds) that must match the data.
  • Most anchors are negatives, so the imbalance grows.
  • IoU matching is expensive.

Anchor-free detectors predict boxes directly from points, which works for any shape.

FCOS’s two problems and fixes.

  • Ambiguity: a location inside overlapping objects must pick one target. FPN assignment by regression range puts objects of different sizes on different levels, which removes most ambiguity (exercise 2).
  • Low-quality boxes far from the centre: points near an object’s edge see little of it and regress poorly. Centre-ness learns to predict how central a point is and down-weights such boxes at test time; centre sampling avoids training on them.

CenterNet’s view. Detection becomes keypoint estimation: a heatmap peak per object, plus size and offset regression at the peak. Duplicates are rare, because there is one peak per object, so NMS is unnecessary. It reported 28.1% COCO AP at 142 frames per second, 37.4% at 52, and 45.1% with multi-scale testing.

📝 Quick check (Level 3)
0/3 answered
  1. 1. FCOS handles ambiguity mainly by…
  2. 2. Centre-ness down-weights…
  3. 3. CenterNet treats detection as…

Level 4: Expert

★★★★★ Expert⏱ 30 minResearchers: original papers and open problems.

How ambiguous are anchor-free positives?

History.

  • H. Law and J. Deng (2018) proposed CornerNet, which detects box corners as keypoints.
  • Z. Tian, C. Shen, H. Chen and T. He (2019) introduced FCOS at ICCV.
  • X. Zhou, D. Wang and P. Krähenbühl (2019) proposed CenterNet (“Objects as Points”).
  • T. Yin, X. Zhou and P. Krähenbühl (2021) introduced CenterPoint for lidar.

Exercise 2. This is a calculation, not a training run. It uses 60 synthetic 512 × 512 scenes with 6 overlapping objects each. For FCOS’s positive locations we measure the share that lie inside two or more objects:

  • on a single stride-8 map;
  • across P3–P7 with FCOS’s regression-size ranges;
  • each with and without centre sampling (radius 1.5 strides).
positive locations ambiguous, single map ambiguous, FPN with size ranges
all locations inside a box 0.267 0.089
centre sampling 0.015 0.027
  • Without FPN, about a quarter of positives are ambiguous, close to the FCOS paper’s 23.2% on COCO.
  • Size-based level assignment cuts this to 9% (paper: 7.1%). As the authors argued, overlapping objects usually differ greatly in size and so land on different levels.
  • Centre sampling removes most of the rest. On FPN its coarse levels have wide radii (1.5 × 128 pixels), which leaves slightly more overlap than on the fine single map.
🐍 Exercise 2 (research): how ambiguous are anchor-free positives?
Measure the share of FCOS positive locations inside two or more objects, with and without FPN size ranges and centre sampling.

Anchor-free detection in AI, robotics and aerospace

  • Lidar 3-D detection: CenterPoint-style heads detect cars and pedestrians from point clouds in autonomous driving.
  • Unusual shapes: anchor-free heads handle elongated objects (ships, runways, power lines) without designing anchors.
  • Keypoints: the same heatmap idea finds landmarks for pose estimation in robot manipulation.

References

  1. Z. Tian, C. Shen, H. Chen, T. He (2019). “FCOS: fully convolutional one-stage object detection.” Proc. ICCV.
  2. X. Zhou, D. Wang, P. Krähenbühl (2019). “Objects as points.” arXiv:1904.07850.
  3. H. Law, J. Deng (2018). “CornerNet: detecting objects as paired keypoints.” Proc. ECCV.
  4. T. Yin, X. Zhou, P. Krähenbühl (2021). “Center-based 3D object detection and tracking.” Proc. CVPR.