You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In detection models, some classes can look very similar, which often leads to overlapping bounding boxes for the same object. In these cases, precision and recall don't give us the full picture, because what we really need to know is how often the model assigns the correct class, i.e., the top-1 accuracy for each class.
Would it be possible to add the following to validation?
Top-1 accuracy for highly overlapping boxes: An option to calculate top-1 accuracy when predicted boxes overlap above a configurable IoU threshold, where the top-1 prediction is the box with the highest confidence score. It should also be possible to specify which classes this runs for.
Per-class metrics at multiple confidence thresholds: A breakdown of precision, recall, and F1 score for each class across a range of confidence thresholds.
These additions would make it much easier to evaluate how well the model distinguishes between similar-looking classes and to choose the right confidence thresholds for deployment for each class.
Hello @christuchez , thank you for the interesting and detailed request.
You are right that it's not possible to do what you are asking for. This is why I took a look at the YOLO api and realized that a few things are missing in libreyolo...
Run validation with this new flag: agnostic_nms=True which will run the nms on the bounding boxes ignoring the classes. You can use classes= to limit it to certain classes.
Then you can read results.confusion_matrix.class_accuracy() to get per class, how often a found object gets the right class, which is the top-1 accuracy.
For the per class precision, recall and F1 at multiple confidence thresholds use the new results.box.p_curve, r_curve and f1_curve in results.box.px.
Thank you for the issue, I hope that this satisfies your request. I know that I didn't implement exactly what you asked for but I'm trying to keep it compatible with the YOLO api standard.
Activity
Merge pull request #931 from LibreYOLO/928-confusion-matrix-curves-ag…
EHxuban11 commentedon Oct 3, 2026
Hello @christuchez , thank you for the interesting and detailed request.
You are right that it's not possible to do what you are asking for. This is why I took a look at the YOLO api and realized that a few things are missing in libreyolo...
I've worked on this PR which is now merged: #931
With it, you can get what you want in two steps:
For the per class precision, recall and F1 at multiple confidence thresholds use the new results.box.p_curve, r_curve and f1_curve in results.box.px.
Thank you for the issue, I hope that this satisfies your request. I know that I didn't implement exactly what you asked for but I'm trying to keep it compatible with the YOLO api standard.
Add agnostic_nms, validation confusion matrix and per-class confidenc…