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.
★☆☆☆☆ 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. FCOS points predict…
2. CenterNet represents an object by…
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. Centre-ness at the exact centre:
2. FCOS level for max target 100:
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. torchvision's FCOS:
2. CenterNet's decoding replaces NMS with…
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. FCOS handles ambiguity mainly by…
2. Centre-ness down-weights…
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
Z. Tian, C. Shen, H. Chen, T. He (2019). “FCOS: fully convolutional one-stage object detection.” Proc. ICCV.
X. Zhou, D. Wang, P. Krähenbühl (2019). “Objects as points.” arXiv:1904.07850.
H. Law, J. Deng (2018). “CornerNet: detecting objects as paired keypoints.” Proc. ECCV.
T. Yin, X. Zhou, P. Krähenbühl (2021). “Center-based 3D object detection and tracking.” Proc. CVPR.
Size-based FPN assignment cut ambiguous positives from 27% to 9%.
Practice
Show:
Level 0
Problem 1Level 0
Number of distances an FCOS location regresses?
l, t, r, b: 4.
Problem 2Level 0
Centre-ness at the centre of a box?
1.
Problem 3Level 0
CenterNet’s output stride?
4.
Level 1
Problem 4Level 1
Centre-ness with l = 5, r = 35, t = b = 15, three decimals?
√(5/35) ≈ 0.378.
Problem 5Level 1
FCOS target l for location (30, 20) in box (10, 10, 50, 40)?
30 − 10 = 20.
Problem 6Level 1
FCOS level (k) for a location whose largest target is 200?
128–256 → P5.
Problem 7Level 1
CenterNet outputs for a 512 image, stride 4, 80 classes (heatmaps + 2 size + 2 offset)?
128²·84 = 1376256.
Level 2
Problem 8Level 2
Ambiguous share on a single map in exercise 2?
0.267.
Problem 9Level 2
Ambiguous share with FPN size ranges?
0.089.
Problem 10Level 2
Ambiguous share on a single map with centre sampling?
0.015.
Problem 11Level 2
Centre-ness with l = 1, r = 9, t = b = 4, three decimals?
√(1/9) ≈ 0.333.
Problem 12Level 2
Gaussian heatmap value 2 pixels from the centre with σ = 2, three decimals?
e^(−0.5) ≈ 0.607.
Problem 13Level 2
Centre-sampling radius in pixels on P7 (stride 128) at 1.5 strides?
1.5·128 = 192.
Level 3
Problem 14Level 3
Show that centre-ness lies in [0, 1] and equals 1 only at the centre.
Each ratio min(·)/max(·) lies in (0, 1] for a location strictly inside the box and equals 1 only when the two distances are equal. The product of two such ratios lies in (0, 1], and so does its square root, equal to 1 only when l = r and t = b, at the centre. As a location approaches an edge, one distance tends to 0 and centre-ness to 0. ∎
Problem 15Level 3
Explain why assigning FPN levels by regression range reduces ambiguity.
A location is a positive on level k only if its largest distance to the box edges falls in that level’s range, so a box’s positives concentrate on the level matching its size. Two overlapping objects of very different sizes therefore claim their shared locations on different levels, and neither is ambiguous on its own level. Only overlapping objects of similar size still compete, the remaining 9% in exercise 2. ∎
Problem 16Level 3
Explain why CenterNet can skip NMS.
Each object is supervised to produce one heatmap peak at its centre, with a Gaussian fall-off around it. Decoding keeps only locations that are maxima in their 3 × 3 neighbourhood, so the surrounding high values of the same object are not reported. Duplicates arise only if two peaks form for one object, which training discourages. ∎
Problem 17Level 3
Advise whether to use an anchor-free head for detecting pipelines in aerial images.
Yes. Pipelines are long and thin, so anchors would need extreme ratios and still match poorly, while FCOS-style or CenterNet-style heads predict any shape. Use FPN with suitable regression ranges, centre sampling and a GIoU box loss, or consider oriented boxes or segmentation for diagonal pipelines. Validate on images with crossing or parallel pipelines, where ambiguity is high. ∎
Level 4
Problem 18Level 4
Ambiguous share with FPN and centre sampling in exercise 2?
0.027.
Problem 19Level 4
CenterNet’s fastest reported speed, in frames per second?
142.
Problem 20Level 4
Ambiguous share without FPN reported in the FCOS paper, in percent (one decimal)?
23.2.
Coding practice
🐍 Code 1 (Level 1): centre-ness
√ of the product of min/max ratios.
🐍 Code 2 (Level 0): FCOS targets
Distances to the four edges.
🐍 Code 3 (Level 1): level by range
Which pyramid level regresses this distance?
🐍 Code 4 (Level 0): CenterNet outputs
(img/stride)²·(C + 4).
🐍 Code 5 (Level 0): Gaussian value
exp(−d²/(2σ²)).
Topic test
A timed test drawn at random from this topic's question bank. Each attempt gets new questions. For a longer test across the whole chapter, see the chapter test, or mix topics in the question bag.
CenterNet, FCOS (anchor-free detection): topic test
10 questions, drawn at random from a bank of 21. Every attempt is different.
⏱ Time limit: 15 minutes. The test submits itself when time runs out.
Levels covered: 0, 1, 2, 3, 4. No hints or solutions until you submit.