AlexeyAB / darknet

YOLOv4 / Scaled-YOLOv4 / YOLO - Neural Networks for Object Detection (Windows and Linux version of Darknet )
http://pjreddie.com/darknet/
Other
21.7k stars 7.96k forks source link

How to find False Positive instances #7474

Open newjoy2018 opened 3 years ago

newjoy2018 commented 3 years ago

@AlexeyAB I have trained my YOLOv4 model, and calculate mAP like following. But some categories have very low ap, like ap = 43.50%(TP = 31, FP = 14), melon ap = 62.50%(TP = 4, FP = 0) so my question is , How can I find these False Positive instances so that I can know where is the problem. Is there any command that they can be directly output. Thanks in advance.

class_id = 0, name = apple, ap = 89.89% (TP = 421, FP = 20) class_id = 1, name = orange, ap = 98.46% (TP = 479, FP = 13) class_id = 2, name = banana, ap = 100.00% (TP = 3, FP = 0) class_id = 3, name = pear, ap = 100.00% (TP = 125, FP = 0) class_id = 4, name = strawberry, ap = 99.22% (TP = 133, FP = 0) class_id = 5, name = lemon, ap = 43.50% (TP = 31, FP = 14) class_id = 6, name = melon, ap = 62.50% (TP = 4, FP = 0)

for conf_thresh = 0.50, precision = 0.96, recall = 0.90, F1-score = 0.93 for conf_thresh = 0.50, TP = 1196, FP = 47, FN = 132, average IoU = 80.69 %

IoU threshold = 50 %, used Area-Under-Curve for each unique Recall mean average precision (mAP@0.50) = 0.847951, or 84.80 %

readicculus commented 3 years ago

I don't think anything built into darknet for this but can use this flag, ex. -out results.json to save the detections then preprocess against your truth labels to find the false positives. Someone may know if this is possible to do currently in this darknet, if not I think it would be a useful feature to be able to output FN/FP/TP to json. I may look into this and make a PR this week if it doesn't exist.

matt-sharp commented 3 years ago

I also think this would be a useful feature and have requested already: https://github.com/AlexeyAB/darknet/issues/7388