如何计算Pascal VOC主板检测任务的平均精度( mAP )?
上面写着-在第11页:
平均精度(AP)对于VOC2007挑战,采用插值平均精度(Salton和Mcgill 1986)对分类和检测进行了评价。对于给定的任务和类,精度/召回曲线是根据方法的排序输出计算出来的。回忆被定义为在给定等级之上的所有正面例子的比例。精度是这个级别以上的所有例子的比例,这些例子都来自于正级。AP概括了查全率/召回曲线的形状,定义为一组由11个等间距的召回级别组成的平均精度( 0,0.1,.,1:
AP = 1/11 ∑ r∈{0,0.1,...,1} pinterp(r))每个召回级别r的精度都是通过对相应的召回超过r:pinterp(r) = max p(r˜)的方法测量的最大精度进行插值,其中p(r˜)是在˜r上测量的精度。
关于地图
这是否意味着:
IoU > {0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1},我们计算True positive = Number_of_detection with IoU > {0, 0.1,..., 1}的真值/假正值/负值,如所说的这里,然后计算:Precision = True positive / (True positive + False positive) Recall = True positive / (True positive + False negative)Precision = True positive / (True positive + False positive) Recall = True positive / (True positive + False negative),其中True positive = Number_of_detection with IoU > 0.5说是这里Precision = Intersect / Detected_box,Recall = Intersect / Object,如这里?

Precision在Recall = {0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1}点,即AP = 1/11 ∑ recall∈{0,0.1,...,1} Precision(Recall)点的11个值的平均值AP (平均精度)(一般来说,对于每一点,例如0.3,我们得到了召回<= 0.3的精度最大值,而不是此时Recall=0.3的精度值)
air。所以AP是一个积分(曲线下面积)
但是当我们对所有图像上的所有对象类计算AP时,我们得到了所有图像数据集的平均精度( mAP )。
发布于 2017-11-29 21:42:49
回答你的问题:
解释如下:为了计算对象检测上下文中的平均平均精度(mAP),必须计算每个类的平均精度(AP),然后计算所有类的平均值。这里的关键是计算每个类的AP,通常用于计算精度(P)和召回(R),您必须定义什么是:真阳性(TP)、假阳性(FP)、真阴性(TN)和假阴性(FN)。Pascal VOC挑战的目标检测设置如下:
现在每个预测的BB对于给定的类都有一个置信度值。因此,评分法对各可能等级k=1的预测进行排序,并计算P= TP / (TP + FP)和R= TP / (TP + FN)。所以现在你有一个(P,R),对于每个等级,这些P和R是“原始”的精确召回曲线。为了计算R的插值P曲线,选择具有相应R‘>= R的最大P。
根据voc devkit doc,有两种不同的方法对P曲线点进行采样.对于2010年前的VOC挑战,我们选择了R‘>= R的最大P值,R属于0,0.1,…,1(11分)。然后,AP是每个召回阈值的平均精度。对于2010年和以后的VOC挑战,我们仍然为任何R‘>= R选择最大P,而R属于所有唯一的召回值(包括0和1)。然后AP是P曲线下的面积大小.注意,在没有超过某些阈值的P值的情况下,精度值为0。
例如,考虑给定“飞机”类的方法的以下输出:
BB | confidence | GT
----------------------
BB1 | 0.9 | 1
----------------------
BB2 | 0.9 | 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
----------------------另外,它没有检测到两幅图像中的包围盒,所以我们得到了FN = 2。上一表是用置信值排序的GT =1均值是TP,GT =0FP。所以TP=5 ( BB1,BB2,BB5,BB8和BB9),FP=5。对于rank=3来说,由于BB1已经被检测到了,所以精度下降了,所以即使对象确实存在,也可以算作FP。。
rank=1 precision=1.00 and recall=0.14
----------
rank=2 precision=1.00 and recall=0.29
----------
rank=3 precision=0.66 and recall=0.29
----------
rank=4 precision=0.50 and recall=0.29
----------
rank=5 precision=0.40 and recall=0.29
----------
rank=6 precision=0.50 and recall=0.43
----------
rank=7 precision=0.43 and recall=0.43
----------
rank=8 precision=0.38 and recall=0.43
----------
rank=9 precision=0.44 and recall=0.57
----------
rank=10 precision=0.50 and recall=0.71
----------给出了前面的结果:如果采用voc2010之前的方法,则插值精度值为1、1、1、0.5、0.5、0.5、0.5、0.5、0、0、0。然后AP = 5.5 / 11 = 0.5为“飞机”级。否则,如果我们使用自voc2010以来的方法,对于七种独特的回忆,即0、0.14、0.29、0.43、0.57、0.71,插值精度值为1、1、1、0.5、0.5、0.5、0,1.对于“飞机”类,AP = (0.14-0)*1 + (0.29-0.14)*1 + (0.43-0.29)*0.5 + (0.57-0.43)*0.5 + (0.71-0.57)*0.5 + (1-0.71)*0 = 0.5。
对每个类重复,然后得到(mAP)。
发布于 2018-06-22 06:29:07
在我的Github上有一个简单易用的代码,有一个很好的详细解释。
当然会对你们有帮助的。
https://datascience.stackexchange.com/questions/25119
复制相似问题