Non-maximum suppression in detection
detector post-processing.
detectors emit many overlapping boxes per object; NMS keeps the highest-scoring box and removes others above an IoU threshold.
forgetting NMS is per-class or misstating why duplicates arise.
WHAT THIS TESTS The interviewer wants you to connect a detector's dense, redundant outputs to the cleanup step that produces final, non-duplicated detections. Duplicates arise because detectors evaluate many anchors or grid locations, so a single object triggers several highly overlapping high-confidence boxes, and without cleanup the output would report one object many times.
A GOOD ANSWER COVERS The algorithm: collect all predicted boxes with their confidence scores, typically grouped per class. Sort by descending confidence. Take the top box, add it to the kept set, and compute IoU between it and all remaining boxes; discard any whose IoU exceeds a threshold such as 0.5 because they likely cover the same object. Repeat with the next highest remaining box until none are left. The result is one representative box per object. Variants include Soft-NMS, which decays scores instead of hard-removing, helping crowded scenes.
COMMON WRONG ANSWERS Saying NMS removes low-confidence boxes generally, when it specifically removes overlapping duplicates of a kept box. Or applying it across all classes jointly, which can wrongly suppress different overlapping objects. Or inverting the threshold logic.
LIKELY FOLLOW-UPS How does the IoU threshold trade off missed versus duplicate detections. What problem does Soft-NMS solve in crowded scenes. How is NMS handled in DETR-style detectors that avoid it. How does class-wise NMS differ from class-agnostic.
ONE CONCRETE EXAMPLE A detector outputs five overlapping boxes around one car with scores 0.95, 0.93, 0.90, 0.60, and 0.55. NMS sorts them, keeps the 0.95 box, then computes IoU between it and the rest; since all four overlap it heavily, above the threshold, they are discarded as duplicates, yielding a single clean car detection. If a nearby second car produced a box with low overlap, that box would survive because its IoU with the kept box is below the threshold, which is why NMS is run per class and tuned so it removes duplicates without suppressing genuinely distinct neighboring objects.
Read the original → datature.io
Get five bites like this every day.
Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.