Object detectors like YOLO or Faster R-CNN don't output one box per object — they output dozens of overlapping candidate boxes, each with a confidence score. Non-maximum suppression (NMS) is the step that turns that pile of proposals into one clean box per object.
The overlap between two boxes A and B is measured with Intersection-over-Union:
IoU(A, B) = area(A ∩ B) / area(A ∪ B)
Greedy NMS then runs:
1. Drop every box with score < confidence threshold
2. Sort remaining boxes by score, descending
3. Take the highest-scoring box → keep it
4. Remove every remaining box whose IoU with it
exceeds the IoU threshold (it's "the same object")
5. Repeat from 3 with what's left
This 2D view drops the spatial picture entirely. Every candidate box is a column, ordered left-to-right by confidence rank; the heatmap grid above the columns is the full pairwise IoU matrix — cell (i, j) is exactly IoU(box_i, box_j), brighter = more overlap. Running NMS draws an arc from every kept column to each column it suppresses, so the algorithm's decisions become a literal graph instead of a scene you have to infer overlaps from by eye.
- Confidence threshold — columns below it turn grey and drop out of the matrix/arcs entirely, exactly as they're dropped from the candidate list before NMS starts.
- IoU threshold — visualised directly as a horizontal cutoff on the matrix's colour scale: any cell brighter than the threshold is a pair NMS treats as "the same object."
- Bar height still encodes confidence; arcs appear in the same greedy order the algorithm processes columns, one step at a time.
Same trade-off as ever: too low an IoU threshold merges genuinely separate nearby objects into one detection; too high a confidence threshold can drop real objects the model was only moderately sure about. The matrix makes the mechanism explicit — an arc exists if and only if the corresponding matrix cell exceeds the current IoU threshold and the box has not already been removed.