I am not really understanding the non-max supression (NMS) algorithm. Let's say my model produces 20 bounding boxes (bbs) for my picture which have 7 cats (7 objects with the same class). Can it be possible that after performing NMS on 20 bbs; the output can be 10 bbs?

Also, I want to ask when I test the model with the test dataset, what does each point in the Precision Recall graph belong to? Does it belong to a picture or something?

Thank you for reading my stupid questions : D.


1 Answer 1


Usually bounding-boxes are associated to a score or confidence. So, you loop over them considering the highest scoring first. You then set a threshold on the IoU (intersection over union) that is used to remove a bbox if the overlap is larger than the threshold. You repeat this until each bbox is tested.

Indeed, it can happen that these are still more than the actual number of objects in the image. In fact, one disadvantage of NMS is that it is difficult to tune.

Moreover, by changing the minimum confidence to accept a prediction (this is done before NMS) you can trade precision for the recall, and vice-versa. By varying this confidence you can build a precision-recall curve by considering all your test-set. If there are multiple classes you average on them to get the mean average precision (mAP).

  • $\begingroup$ @hachane If you find my answer helpful you may want to upvote and mark it as answered! :) $\endgroup$ Commented Apr 29 at 10:25
  • $\begingroup$ I am a new member here so I don't have enough reputation to give you an upvote :). Sorry and thank you again!! $\endgroup$
    – hachane
    Commented Apr 30 at 12:51
  • $\begingroup$ @hachane don't mind, I forgot that! $\endgroup$ Commented May 2 at 16:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .