Skip to content
AI360Xpert
Computer Vision
Visual explainer

Non-Maximum Suppression (NMS)

How object detectors filter overlapping boxes to keep only the best predictions.

Multiple Object Proposals
Multiple Object Proposals

When an object detector processes an image, it often generates many overlapping bounding boxes around the same object. This happens because multiple anchor boxes or grid cells might fire simultaneously for a single object.

Select Highest Score
Select Highest Score

To fix this, NMS first selects the bounding box with the highest confidence score. This box is temporarily considered the "true" detection for the object.

Compute IoU
Compute IoU

Next, it calculates the Intersection over Union (IoU) between this selected box and all other overlapping boxes. IoU measures how much the boxes overlap geometrically.

Suppress High Overlap
Suppress High Overlap

Any box that overlaps with the selected box more than a predefined threshold (e.g., IoU > 0.5) is suppressed (discarded). The process repeats for the remaining boxes until no unsuppressed boxes overlap significantly.