Junior — Middle
How does Non-Maximum Suppression (NMS) work and what is it used for?
sobes.tech AI
Answer from AI
Non-Maximum Suppression (NMS) is an algorithm used in object detection tasks to remove redundant overlapping predictions. When a model detects multiple boxes that significantly overlap and refer to the same object, NMS keeps only the one with the highest confidence score, removing the others.
Working principle:
- Sort all predicted boxes by decreasing probability.
- Select the box with the highest probability and add it to the final set.
- Remove from the list all boxes that significantly overlap with the selected one (based on the IoU — Intersection over Union metric — exceeding a specified threshold).
- Repeat steps 2-3 until all boxes are processed.
This helps reduce false positives and achieve more accurate detection results.