← Lessons

quiz vs the machine

Gold1360

Machine Learning

The Non Max Suppression Deep

Pruning overlapping detections to keep one box per object.

5 min read · core · beat Gold to climb

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.

Check yourself

Answer to earn rating on the learn ladder.

1. What does standard non max suppression do to a box that overlaps a kept box too much?

2. How does soft non max suppression help crowded scenes?