为什么我们使用 mAP 分数来评估深度学习中的对象检测器?

Why we use mAp score for evaluate object detectors in deep learning?

在这个 Tensorflow detection model zoo 中,他们提到了不同检测架构的 COCO mAP 分数。他们还表示,mAp 分数越高,准确性越高。不明白的是这是怎么计算的?它的最高分数是多少?为什么这个 mAP 分数因数据集而异?

要理解 MAP(平均精度),我会先从 AP(平均精度)开始。

Suppose we are searching for images of a flower and we provide our image retrieval system a sample picture of a rose (query), we do get back a bunch of ranked images (from most likely to least likely). Usually not all of them are correct. So we compute the precision at every correctly returned image, and then take an average.


示例:

If our returned result is 1, 0, 0, 1, 1, 1 where 1 is an image of a flower, while 0 not, then the precision at every correct point is:

Precision at each correct image = 1/1, 0, 0, 2/4, 3/5, 4/6
Summation of these precisions = 83/30
Average Precision = (Precision summation)/(total correct images) = 83/120

旁注:

本节详细解释了每个正确图像的精度计算,以防您仍然对上述分数感到困惑。

出于说明目的,让 1, 0, 0, 1, 1, 1 存储在一个数组中,因此 results[0] = 1results[1] = 0

totalCorrectImages = 0, totalImagesSeen = 0, pointPrecision = 0

pointPrecision的公式是totalCorrectImages / totalImagesSeen

results[0], totalCorrectImages = 1, totalImagesSeen = 1 因此 pointPrecision = 1

因为results[1] != 1,我们忽略了它但是totalImagesSeen = 2 && totalCorrectImages = 1

因为 results[2] != 1totalImagesSeen = 3 && totalCorrectImages = 1

results[3], totalCorrectImages = 2, totalImagesSeen = 4 因此 pointPrecision = 2/4

results[4], totalCorrectImages = 3, totalImagesSeen = 5 因此 pointPrecision = 3/5

results[5], totalCorrectImages = 4, totalImagesSeen = 6 因此 pointPrecision = 4/6


A simple way to interpret is to produce a combination of zeros and ones which will give the required AP. For example, an AP of 0.5 could have results like 0, 1, 0, 1, 0, 1, ... where every second image is correct, while an AP of 0.333 has 0, 0, 1, 0, 0, 1, 0, 0, 1, ... where every third image is correct.

For an AP of 0.1, every 10th image will be correct, and that is definitely a bad retrieval system. On the other hand, for an AP above 0.5, we will encounter more correct images than wrong in the top results which is definitely a good sign.

MAP只是AP的扩展。您只需对一定数量的查询取所有 AP 分数的平均值。上述对 AP 分数的解释也适用于 MAP。 MAP范围从0到100,越高越好。

Wikipedia

上的 AP 公式

Wikipedia

上的 MAP 公式

致谢 blog

编辑我:

同样的概念也适用于对象检测。在这种情况下,您将计算每个 class 的 AP。这是由给定 class 的精确召回曲线下的面积给出的。从这一点,你找到他们的平均值来获得 mAP。

更多详细信息,请参阅2012 Pascal VOC Dev Kit. The related paper can be found here的3.4.1和4.4节。