Too many boxes
A detector emits many overlapping boxes around each object, each with a confidence score. Non max suppression is the cleanup step that keeps the best box and removes its near duplicates.
The greedy procedure
Within each class the algorithm:
- Sorts boxes by confidence, highest first.
- Takes the top box and marks it as kept.
- Removes any remaining box whose intersection over union with the kept box exceeds a threshold.
- Repeats on the survivors.
The IoU threshold sets how aggressively overlaps are pruned.
The crowd problem
Standard suppression deletes a box entirely once it overlaps a kept one. In crowded scenes two real objects overlap, so a true box can be wrongly removed.
A softer variant
Soft non max suppression instead lowers the score of overlapping boxes rather than deleting them. A heavily overlapping box loses more confidence but can still survive if it was strong, improving recall in crowds.
Key idea
Non max suppression greedily keeps the highest scoring box and drops near duplicates above an IoU threshold, while soft suppression decays scores instead of deleting to keep more boxes in crowded scenes.