目标检测评估指标(ap,map,PR曲线)

目标检测评估指标


1.对于目标检任务,分为单类别和多类别

单类别 AP:(average pression)

多类别 mAP:(mean average precision)

2.计算AP

已知:图片上有N个groundtruth,M个预测的bounding box,以及每个预测目标的confidence

  • step1: 先将bounding box 按照 confidence排序

  • step2:对每个bounding box遍历,若与任意groundtruth的IOU大于阈值,则该bounding box 视为 TP,反之为FP

  • step3: 对每个bounding box遍历,会得到recall和pre,其中recall = TP/(TP+FN) = TP/(N)precession = TP/(TP+FP)其中 TP+FN = N(N为总GT个数),最后得到M个recall,M个precession

  • step4: 计算PR曲线下面积
    若绘制PR曲线,横轴为Recall,纵轴为Precession

BB  | confidence | GT
----------------------
BB1 |  0.9       | 1
----------------------
BB2 |  0.9       | 1
----------------------
BB1 |  0.8       | 1
----------------------
BB3 |  0.7       | 0
----------------------
BB4 |  0.7       | 0
----------------------
BB5 |  0.7       | 1
----------------------
BB6 |  0.7       | 0
----------------------
BB7 |  0.7       | 0
----------------------
BB8 |  0.7       | 1
----------------------
BB9 |  0.7       | 1
----------------------

共有7个GT,TP为(BB1,BB2,BB5,BB8,BB9)

rank=1  precision=1.00(1/1) and recall=0.14(1/1+6)
----------
rank=2  precision=1.00(2/2) and recall=0.29(2/2+5)
----------
rank=3  precision=0.66(2/2+1) and recall=0.29(2/2+5)
----------
rank=4  precision=0.50(2/2+1)and recall=0.29(2/2+5)
----------
rank=5  precision=0.40(2/2+3)and recall=0.29(2/2+5)
----------
rank=6  precision=0.50(3/3+3) and recall=0.43(3/3+4)
----------
rank=7  precision=0.43(3/3+4) and recall=0.43(3/3+4)
----------
rank=8  precision=0.38(3/3+5) and recall=0.43(3/3+4)
----------
rank=9  precision=0.44(4/4+5) and recall=0.57(4/4+3)
----------
rank=10 precision=0.50(5/5+5)and recall=0.71(5/5+2)
----------

3.计算mAP

  • 分布计算每个类别的AP,再求平均

4.AP_*

AP50,AP60,AP70……等等指的是取detector的IoU阈值大于0.5,大于0.6,大于0.7……

默认AP是指不同阈值下的AP的平均值

A P s : a r e a < 3 2 2 AP_s: area <32^2 APs:area<322

A P m : 3 2 2 < a r e a < 9 6 2 AP_m: 32^2 < area < 96^2 APm:322<area<962

A P s : a r e a > 9 6 2 AP_s: area >96^2 APs:area>962

你可能感兴趣的:(目标检测)