Week 3 YOLO: why not directly apply threshold to all score, but a max is required?

In yolo_filter_boxes function, we first get the class with highest score for each of the bounding box and then apply a threshold to only remain the ones that have a higher score then the threshold.

I’m wondering why do not we directly apply the threshold to all the scores?
There is a possibility that a certain bounding box have very high score for two of the classes which both have scores higher than the threshold, but one of them will be removed because of the first step.

Hi yc2984,

It seems to me you can do both. Either start with the highest score per bounding box and then apply a threshold, or start with a threshold and then get the highest score.

Thanks for your reply, but I’m still not clear about the scenario I described above: When a certain bounding box have very high score for two of the classes whose scores are both higher than the threshold, why cannot they both be kept? Is it because each bounding box is only meant to detect one class? I don’t think so, otherwise you would always have the same amount of bounding box as the number of classes.

Hi yc2984,

Thank you for your clarification. This issue was discussed here.

1 Like

Hi Reinoud:
Thanks for pointing me to that answer, it helps clear part of my doubt. But I guess my question now is on the yolo_filter_boxes function, where we use tf.math.argmax for each box to select the class that has the highest score, and only keep that class. Is that also the case for “actual implementation”? Thanks so much.

Hi yc2984,

As I indicated in the discussion I linked to in my previous post, an actual implementation of yolo predicts all bounding boxes across all classes. I also pointed to a good overview of current systems with links to important articles that describe approaches taken:

I hope this answers your question.