Two mistakes traded places. The detector’s score stayed at 16.83%.
An object detector draws boxes around things it thinks it sees. In our three invented pictures it drew a box where a reviewer had found no instance of the target object. We left out that picture and raised the box limit. The score still read 16.83%. Where did the benefit of losing that false alarm go?
At the same time, we let the scorer count a second box from each picture it kept. That brought a different false alarm into the calculation. To see how the two mistakes traded places, follow the boxes through the three pictures.
We kept all the detector’s predictions fixed and tried four ways of counting them. We could include all three reviewed pictures or just the two with a marked target. For each set of pictures we tried two limits. The scorer could count the detector’s most confident box for the target category in each picture, or it could count the top two.
One good box and three false alarms
Picture one had a marked object. The detector found it. Picture two had a second marked object, which the detector missed, and two boxes in the wrong places. The third picture contained none of the objects we were looking for, yet the detector drew one box. It gave each of its four boxes a different confidence score. The one correct box ranked last.
Follow the boxes behind the matching scores
Start with all three pictures and the one-box limit. Picture one contributed the correct box. Picture two contributed its higher-confidence mistake. Picture three contributed its one false alarm. Now keep just the first two pictures and raise the limit to two boxes. Picture three’s false alarm is gone, but picture two can now contribute both its mistakes.
Average precision (AP) gives credit for finding real objects and for ranking correct predictions ahead of false alarms. In both runs, two mistakes ranked ahead of the correct box. The detector found one of the two objects, or 50% recall. At the point where the correct box appeared, one of three counted boxes was right. COCO samples precision at 101 recall levels. In these runs, 51 levels up to and including 50% recall received one-third, and the 50 levels above it received zero. The average rounded to 16.83% AP either way. Those matching scores sit in opposite corners of the table. The other cells show the remaining two combinations.
| Images scored | One detection per image | Two detections per image |
|---|---|---|
| All three reviewed images | 16.83% | 12.62% |
| Only the two images with a target label | 25.25% | 16.83% |
For each combination we asked pycocotools 2.0.10 for its bounding-box AP at that particular limit, reading it directly from the evaluator’s precision array. The calculation included all object sizes and used COCO’s default overlap thresholds from 0.50 through 0.95 and 101 recall levels. The overlap thresholds determine how closely a predicted box must match the marked object. COCO scoring by detection limit
Check which predictions actually counted
Save the image IDs, the category being scored, the box limit and the IDs of the counted boxes in confidence order. Keep the reference boxes, the scoring settings, and which predictions matched, counted as mistakes or were ignored. If two prediction files were produced separately, trace the boxes back to the original predictions before comparing them. When images with a confirmed absence belong in the test, keep their IDs on the list. Asking for only the images labeled with the target would leave those out. Comparing the IDs of the boxes that counted is what reveals the traded false alarms here. COCO image selection