09/18/2026
NMS and IoU: How Detectors Clean Up Duplicate Boxes (and What It Can't Tell You)
An object detector can draw several boxes around the same car, and if we count every box, we count proposals as though they were separate objects. In this cybercab photograph, a local YOLO11n run produced 22 car candidates above a score of 0.25, and these are our model results on a photograph unrelated to Tesla's onboard software. Non-maximum suppression, or NMS, reduces those competing proposals, where each candidate has a confidence score.
First, NMS keeps the box with the highest remaining score, then measures how much each other box overlaps it using intersection over union, or IoU: the area shared by both boxes divided by the area covered by either box, counting the shared region once. An IoU near 1 means nearly identical coverage, and near 0 means little overlap. The highest scoring box scores about 0.90001, another scores about 0.897 with an IoU of about 0.987, and with an overlap threshold of 0.5, since 0.987 exceeds it, the lower scoring candidate is removed and the selected box stays. A different candidate scores about 0.538 with an IoU of only 0.038, so it stays available. Repeating this process leaves 3 retained candidates from the original 22, and their coordinates have not moved, because NMS selected existing boxes.
But those 3 survivors are not a verified count of 3 real cars. A high score does not guarantee a correctly placed box, and 2 real objects can overlap enough that 1 candidate is wrongly suppressed. Keep the two thresholds separate: the score threshold decides which candidates enter, and the overlap threshold decides which competing boxes are removed. NMS reduces duplication using scores and geometry. It does not establish what is actually present.