啥也不说,直接把精简总结贴最前面,懂的回顾一下帮忙看看总结的对不对,不懂的继续往下翻看细节解释。如有纰漏,欢迎各位大佬指正。

总结

输入

  • 个真值框GTs,
    个检测结果Dets(bbox+scores)。

预处理:分配+排序

  • 根据 IOU 阈值确定 TP, FP(其实FP在计算时没有用);一个GT若有多个Dets,选择其中一个为 TP ,其余为 FP ;
  • 根据置信度score从高到低对所有Dets进行排序;为每个Det进行标记:若其为TP标为1,否则标为0,可得到表 T;T的长度为
    ,即Dets的数量。

计算 Precision 和 Recall

  • 从头开始遍历 T,当前步数为

    ,则
    ;
  • 其中,
    为当前步时 TP 的个数,
    为真值框个数;
  • PR图:Recall为横轴,Precision为纵轴。

计算 mAP

  • PASCAL VOC

    • 11点插值法:Recall值为离散的11个点[0, 0.1, ..., 1];对每一个点,在 PR图上向右找最大的Precision值,找到11个对应的Precision值,加和求平均即为AP。
    • all点插值法:Recall值为[0, 1]区间内的所有点;对每个点,在 PR图上向右找最大的Precision值,找到无穷个对应的Precision值,对其求定积分即为AP,即近似为PR曲线下的面积。
  • COCO
    • 101点插值法:COCO使用101点插值法进行计算。

Metrics

在下面的主题中,有一些用于目标检测的最受欢迎度量的介绍。

Precision x Recall curve

Precision x Recall曲线是评估目标检测器性能的好方法,因为通过为每个目标类别绘制一条曲线来改变置信度。如果特定类别的目标检测器的精度随查全率的提高而保持较高,则认为该检测器良好,这意味着,如果您改变置信度阈值,则查准率和查全率仍然很高。识别优质目标检测器的另一种方法是寻找一种只能识别相关物体(0个误报=高精度)的检测器,找到所有ground truth目标(0个误报=高召回率)。

不良的目标检测器需要增加检测到的物体的数量(增加的误报=较低的精度)才能检索所有ground truth目标(高召回率)。因此,Precision x Recall曲线通常以高精度值开始,随召回率的增加而减小。您可以在下一个主题(平均精度)中看到Prevision x Recall曲线的示例。

Average Precision

比较目标检测器性能的另一种方法是计算Precision x Recall曲线的曲线下面积(AUC)。由于AP曲线通常是上下弯曲的锯齿形曲线,因此比较同一图中的不同曲线(不同的检测器)通常不是一件容易的事-因为这些曲线往往会频繁地相互交叉。这就是为什么数字精度平均精度(AP)也可以帮助我们比较不同检测器的原因。实际上,AP是在0到1之间的所有召回值上平均的精度。

从2010年开始,通过PASCAL VOC挑战计算AP的方法已经改变。目前,由PASCAL VOC挑战执行的插值使用所有数据点,而不是如其论文所述仅插值11个等距点。

  • 11-point interpolation

11点插值法尝试通过在一组11个等间隔的召回级别[0, 0.1, 0.2, ... , 1]上求平均精度来总结Precision x Recall曲线的形状:

with:

where

is the measured precision at recall
.

Instead of using the precision observed at each point, the AP is obtained by interpolating the precision only at the 11 levels

taking the maximum precision whose recall value is greater than
.
  • Interpolating all points

不仅可以在等距的11个点进行插值,还可以通过以下方式对所有点进行插值:

with:

where

is the measured precision at recall
.

In this case, instead of using the precision observed at only few points, the AP is now obtained by interpolating the precision at each level,

taking the

maximum precision whose recall value is greater or equal than

. This way we calculate the estimated area under the curve.

为了理解起来更清楚,下面提供了一个比较两种插值方法的示例。

例子

An example helps us understand better the concept of the interpolated average precision. Consider the detections below:

There are 7 images with 15 ground truth objects represented by the green bounding boxes and 24 detected objects represented by the red bounding boxes. Each detected object has a confidence level and is identified by a letter (A,B,...,Y).

The following table shows the bounding boxes with their corresponding confidences. The last column identifies the detections as TP or FP. In this example a TP is considered if IOU >= 30%, otherwise it is a FP. By looking at the images above we can roughly tell if the detections are TP or FP.

In some images there are more than one detection overlapping a ground truth (Images 2, 3, 4, 5, 6 and 7). For those cases the first detection is considered TP while the others are FP. This rule is applied by the PASCAL VOC 2012 metric: "e.g. 5 detections (TP) of a single object is counted as 1 correct detection and 4 false detections”.

The Precision x Recall curve is plotted by calculating the precision and recall values of the accumulated TP or FP detections. For this, first we need to order the detections by their confidences, then we calculate the precision and recall for each accumulated detection as shown in the table below:

Plotting the precision and recall values we have the following Precision x Recall curve:

As mentioned before, there are two different ways to measure the interpolted average precision: 11-point interpolation and interpolating all points. Below we make a comparisson between them:

Calculating the 11-point interpolation

The idea of the 11-point interpolated average precision is to average the precisions at a set of 11 recall levels (0,0.1,...,1). The interpolated precision values are obtained by taking the maximum precision whose recall value is greater than its current recall value as follows:

By applying the 11-point interpolation, we have:

Calculating the interpolation performed in all points

By interpolating all points, the Average Precision (AP) can be interpreted as an approximated AUC of the Precision x Recall curve. The intention is to reduce the impact of the wiggles in the curve. By applying the equations presented before, we can obtain the areas as it will be demostrated here. We could also visually have the interpolated precision points by looking at the recalls starting from the highest (0.4666) to 0 (looking at the plot from right to left) and, as we decrease the recall, we collect the precision values that are the highest as shown in the image below:

Looking at the plot above, we can divide the AUC into 4 areas (A1, A2, A3 and A4):

Calculating the total area, we have the AP:

with:

The results between the two different interpolation methods are a little different: 24.56% and 26.84% by the every point interpolation and the 11-point interpolation respectively.

参考

https://github.com/rafaelpadilla/Object-Detection-Metrics​github.comhttps://github.com/amusi/Deep-Learning-Interview-Book/blob/master/docs/%E8%AE%A1%E7%AE%97%E6%9C%BA%E8%A7%86%E8%A7%89.md#map​github.com

ap 目标检测算法map_目标检测mAP怎么计算相关推荐

  1. ap 目标检测算法map_目标检测算法的评估指标:mAP定义及计算方式

    前面依次介绍了: 本节介绍目标检测算法的评估指标:mAP定义及计算方式 mAP:mean Average Precision,平均精度均值,即AP(Average Precision)的平均值,它是目 ...

  2. ap 目标检测算法map_目标检测的指标AP与mAP

    最近在处理实验数据的时候,想到了之前学习的分类混淆矩阵当时没有完全弄懂,刚好借着这个机会给深入的学习一下,做好相应的笔记 一.检测指标 在目标检测任务中,通过不同的IoU阈值来进行检测器的整体的性能评 ...

  3. 基于用户行为建模和异常检测算法的内部威胁检测

    Insider Threat Detection Based on User Behavior Modeling and Anomaly Detection Algorithms 内部威胁是授权用户的 ...

  4. Metis异常检测算法率值检测和量值检测源码刨析

    Metis异常检测算法率值检测和量值检测源码刨析 1. 测试代码 2. 率值检测 2.1 rate_predict方法(detect.py) 2.2 predict方法(statistic.py) 2 ...

  5. 目标检测算法 2020_One-stage目标检测算法综述

    yolo-v1: YOLO 就是使用回归这种做法的典型算法. 首先将图片 Resize 到固定尺寸,然后通过一套卷积神经网络,最后接上 FC 直接输出结果,这就他们整个网络的基本结构. 更具体地做法, ...

  6. 基于yolov5框架实现人流统计(目标检测算法、目标追踪算法以及越界识别功能)+手机获取统计人数

    主要实现的AI算法有:目标检测.目标追踪 主要实现AI算法功能:越界识别功能(主要是获取统计人流量) 平台:基于Aidlux平台 基础库安装: (1)lap安装: 先sudo apt-get upda ...

  7. 目标检测算法——小目标检测

    一.定义 1.以物体检测领域的通用数据集COCO物体定义为例,小目标是指小于32×32个像素点(中物体是指32*32-96*96,大物体是指大于96*96). 2.在实际应用场景中,通常更倾向于使用相 ...

  8. 行为检测算法:跌倒检测

    1 前言 首选用背景差分法和形态学算法提取目标骨架,骨架提取经历九步:图像灰度化,背景差分法提取目标轮廓,使用CLAHE算法增强对比度,高斯滤波,Solel算子进行边缘检测,小波去噪,最大类间误差法二 ...

  9. 基于线条特征的机场检测算法——LSD直线检测算法、平行线组提取和聚类

    遥感图像的机场检测是图像处理在军事以及航空领域一个重要的应用,现有一些机场提取方法利用显著性特征获取机场区域的方法容易使得机场提取不够完整,而且会混入过多的虚警区域,原因在于图像的显著性特征并能用来表 ...

最新文章

  1. Mysql从5.0升级到 5.1.73
  2. boost::intrusive::set用法的测试程序
  3. H5新增的标签和属性
  4. fragment在activity中的静态和动态用法_使用Matlab修改压缩Gif动态图片制作微信表情...
  5. IBM 前面板显示信息提示
  6. 2018CCPC网络赛
  7. JQueryDOM之属性操作
  8. ios字典存bool_iOS 开发之字典写入文件
  9. 空间权重矩阵构建(Stata代码)
  10. base循环解码工具
  11. 修改网卡地址 突破一些与MAC绑定服务的限制 突破封锁 应对病毒 等
  12. 程序员老了之后练太极最合适了
  13. 苹果4计算机错误怎么办,苹果刷机失败卡在恢复模式怎么办?
  14. 搜索结果排列html模板,搜索结果页优化-城市模板
  15. Hyde And Hebbe
  16. 《信息物理融合系统(CPS)设计、建模与仿真——基于 Ptolemy II 平台》——1.9 案例研究...
  17. 《嫌疑人X的献身》——两个天才之间的思想火花
  18. 安徽省铜陵市谷歌卫星地图下载
  19. 路西法及堕落天使相关资料
  20. 【ULR #2】Picks loves segment tree IX

热门文章

  1. 英特尔“硬盘内存一体化”首款产品正式发布,读写速度超千倍,存储密度扩充十倍...
  2. Day5 - 前端高频面试题之计算机网络相关
  3. 自动化创建tornado项目
  4. Clojure学习之比线性箭头操作
  5. mysqli_fetch_row,mysqli_fetch_array,mysqli_fetch_assoc区别
  6. Codeforces 40 E. Number Table
  7. 使用java理解程序逻辑(16)
  8. [HDU] 3491 Thieves
  9. python 实例化方法_Python中__new__()方法的使用和实例化
  10. 微课|中学生可以这样学Python(例11.3):tkinter通信录管理系统3