THE NON-MAXIMUM SUPPRESSION

One response per thing. A ridge of high-gradient pixels is thinned to a single-pixel line; a cloud of overlapping detection boxes is reduced to one box per object. The rule is the same both times: keep the local maximum, delete what it dominates.

source J. Canny, “A Computational Approach to Edge Detection,” IEEE TPAMI, PAMI-8(6):679–698, 1986 · earlier: A. Rosenfeld & M. Thurston, 1971. doi:10.1109/TPAMI.1986.4767851 amber Rendered, not quoted.

Blue Team · builds & defends
3

THE MODEL

Edge NMS. At each pixel look along the gradient normal (the two neighbours across the edge). Keep the pixel only if its magnitude is ≥ both of them (strict on one side to break flat plateaus). A 3-pixel-wide ridge collapses to the single crest column.

Detection NMS. Sort boxes by score. Take the top box, delete every remaining box whose IoU with it exceeds a threshold, repeat on what survives. Greedy, exact, order-dependent.

IoU = |A∩B| / |A∪B| — intersection over union, in [0,1]; 1 for identical boxes, 0 for disjoint ones.

5

THE LINEAGE

One detection per object is the shared idea. The thinning stage here is exactly the step inside the-canny-edge-detector between gradient and hysteresis. The box-dedup here is the tail every object detector runs — sliding-window, R-CNN, YOLO all end in this same greedy suppression.

Neighbour sphere: the-intersection-over-union supplies the overlap metric this engine thresholds on.

7

THE WITNESS

Live re-check of the engine's invariants. Green confirms edge-NMS thinned to one pixel, detection-NMS kept the far box, and the tamper is caught. It flips red the instant window 6 corrupts the rule.

witness idle
The Machine
4

DATA IN in ↓

A constructed gradient-magnitude ridge (3 columns wide, all gradients horizontal) and a set of three scored boxes: A 0.90, B 0.80 overlapping A, C 0.70 far away.

0

THE PANEL lit

Edge NMS thins the ridge; detection NMS dedupes the boxes. Both run live from the pure functions above — no baked numbers.

engine booting…
8

DATA OUT out ↓

Ridge thinned 3→1 pixel wide. Boxes kept in score order: — the winner and the distinct far object, the redundant overlap struck.

Red Team · attacks & breaks
1

THE ADVERSARY

wall

Greedy NMS has no notion of "a real object." Two genuinely separate objects that happen to sit close get merged: the second is deleted for overlapping the first. Crowds, stacked pedestrians, kissing bounding boxes — the recall you lose here is structural, not a bug. Soft-NMS and learned NMS exist precisely because this greedy delete is too blunt.

2

THE GRAVEYARD

"Suppress every box with a lower score than a kept box."
→ Only suppress lower boxes that overlap (IoU > t). Score alone would erase every other object in the frame.

"NMS keeps the box with the biggest area / most central box."
→ It keeps the highest score; geometry only enters through the overlap test.

"Threshold choice is free."
→ Too high → duplicates survive; too low → neighbours merge. It trades precision against recall directly.

6

THE TAMPER

Replace the overlap test with pure score dominance: after keeping a box, delete all lower-scoring boxes regardless of position. The far object C is wrongly erased — and the Witness (7) catches it live.