原文:http://blog.csdn.net/jningwei/article/details/78955536

深度学习: mAP (Mean Average Precision)

版权声明:转载请注明出处 http://blog.csdn.net/JNingWei/article/details/78955536

mAP 概念

P

precision,即 准确率 。

R

recall,即 召回率 。

PR曲线

即 以 precision 和 recall 作为 横纵轴坐标 的二维曲线。

一般来说,precision 和 recall 是 鱼与熊掌 的关系。下图即是 PR曲线: 

AP值

Average Precision,即 平均精确度 。

如何衡量一个模型的性能,单纯用 precision 和 recall 都不科学。于是人们想到,哎嘛为何不把 PR曲线下的面积 当做衡量尺度呢?于是就有了 AP值 这一概念。这里的 average,等于是对 precision 进行 取平均 。

mAP值

Mean Average Precision,即 平均AP值 。

是对多个验证集个体 求 平均AP值 。如下图: 

mAP 计算

公式

Code

def compute_ap(gt_boxes, gt_class_ids,pred_boxes, pred_class_ids, pred_scores,iou_threshold=0.5):"""Compute Average Precision at a set IoU threshold (default 0.5).Returns:mAP: Mean Average Precisionprecisions: List of precisions at different class score thresholds.recalls: List of recall values at different class score thresholds.overlaps: [pred_boxes, gt_boxes] IoU overlaps."""# Trim zero padding and sort predictions by score from high to lowgt_boxes = trim_zeros(gt_boxes)pred_boxes = trim_zeros(pred_boxes)pred_scores = pred_scores[:pred_boxes.shape[0]]indices = np.argsort(pred_scores)[::-1]pred_boxes = pred_boxes[indices]pred_class_ids = pred_class_ids[indices]pred_scores = pred_scores[indices]# Compute IoU overlaps [pred_boxes, gt_boxes]overlaps = compute_overlaps(pred_boxes, gt_boxes)# Loop through ground truth boxes and find matching predictionsmatch_count = 0pred_match = np.zeros([pred_boxes.shape[0]])gt_match = np.zeros([gt_boxes.shape[0]])for i in range(len(pred_boxes)):# Find best matching ground truth boxsorted_ixs = np.argsort(overlaps[i])[::-1]for j in sorted_ixs:# If ground truth box is already matched, go to next oneif gt_match[j] == 1:continue# If we reach IoU smaller than the threshold, end the loopiou = overlaps[i, j]if iou < iou_threshold:break# Do we have a match?if pred_class_ids[i] == gt_class_ids[j]:match_count += 1gt_match[j] = 1pred_match[i] = 1break# Compute precision and recall at each prediction box stepprecisions = np.cumsum(pred_match) / (np.arange(len(pred_match)) + 1)recalls = np.cumsum(pred_match).astype(np.float32) / len(gt_match)# Pad with start and end values to simplify the mathprecisions = np.concatenate([[0], precisions, [0]])recalls = np.concatenate([[0], recalls, [1]])# Ensure precision values decrease but don't increase. This way, the# precision value at each recall threshold is the maximum it can be# for all following recall thresholds, as specified by the VOC paper.for i in range(len(precisions) - 2, -1, -1):precisions[i] = np.maximum(precisions[i], precisions[i + 1])# Compute mean AP over recall rangeindices = np.where(recalls[:-1] != recalls[1:])[0] + 1mAP = np.sum((recalls[indices] - recalls[indices - 1]) *precisions[indices])return mAP, precisions, recalls, overlaps

深度学习: mAP (Mean Average Precision)相关推荐

  1. 交并比 (IoU), mAP (mean Average Precision), 非极大值抑制 (NMS, Soft NMS, Softer NMS, IoU-Net)

    目录 目标检测的评价指标 交并比 (Intersection of Union, IoU) mAP (mean Average Precision) 其他指标 非极大值抑制 (Non-Maximum ...

  2. MAP(Mean Average Precision)

    from: http://blog.sina.com.cn/s/blog_662234020100pozd.html MAP(Mean Average Precision) MAP(Mean Aver ...

  3. MAP(Mean Average Precision):

     MAP(Mean Average Precision): 单个主题的平均准确率是每篇相关文档检索出后的准确率的平均值.主集合的平均准确率(MAP)是每个主题的平均准确率的平均值.MAP 是反映系 ...

  4. mAP(mean Average Precision)应用(转)

    原文章地址来自于知乎:https://www.zhihu.com/question/41540197 1. precision 和 recall 的计算(没什么好说的,图片示例相当棒): 图1 图中上 ...

  5. 深度学习笔记——秒懂评价指标precision和recall(附例子)

    Precision:查准率,识别正确的/所有识别出来的. 这个指标反应了你的可信度,比如让儿子把药拿过来,他一定不能错,他可以不把家里全部的药都拿过来,但是他要保证拿过来必须是降压药.也就是拿药的pr ...

  6. yolo-v2 v3实现笔记 mAP:mean average precision 平均精度均值

    mAP计算参考这里:目标检测的评估指标mAP的那些事儿 相关概念:机器学习中 True Positives(真正例TP).False Positives(假正例FP).True Negatives(真 ...

  7. map平均准确率_MAP(Mean Average Precision)

    MAP(Mean Average Precision):单个主题的平均准确率是每篇相关文档检索出后的准确率的平均值.主集合的平均准确率(MAP)是每个主题的平均准确率的平均值. MAP 是反映系统在全 ...

  8. 深度学习中Map的概念

    mAP定义及相关概念 P precision,即 准确率 . 解释:10张图片,每张都有狗.猫,识别到里面有狗也有猫,两者皆有,准确率就高 R recall,即 召回率 . 解释:10张图片,每张都有 ...

  9. 深度学习在目标视觉检测中的应用进展与展望

    作者:张慧,王坤峰,王飞跃 来源:王飞跃科学网博客 摘要:目标视觉检测是计算机视觉领域的一个重要问题,在视频监控.自主驾驶.人机交互等方面具有重要的研究意义和应用价值.近年来,深度学习在图像分类研究中 ...

最新文章

  1. linux删除新建的磁盘分区,Fixmbr,删除磁盘分区,新建磁盘分区,等待正式Ubuntu...
  2. 在Flutter中更快地加载您的图像资源
  3. 嵌入式Linux操作系统学习规划 (转)
  4. BugkuCTF-WEB题bp
  5. Android开发笔记(一百)折叠式列表
  6. C++ 调节PCM音量
  7. [zencart数据采集]第二课 火车头采集简单系统配置
  8. mysql 查询一年中每个月份的数据量
  9. java期中 考试_java期中考试题
  10. 《线性代数应该这样学》学习笔记
  11. matlab设计匹配滤波器,[转载]利用MATLAB实现匹配滤波器的仿真验证
  12. 华为云数据容灾服务,如何守护企业数据安全
  13. 在电信和联通的围攻下,大象中国移动显示出脚步蹒跚迹象
  14. Android开发--更换字体
  15. Maya布料解算入门
  16. 5G+AIoT趋势下,智慧社区的发展机遇与趋势
  17. 微信小程序实现页面加入背景图片以及调节透明度
  18. 数据科学家技能树(中文翻译版)
  19. golang入门笔记——kitex
  20. 单片机并行口控制蜂鸣器播放音乐

热门文章

  1. html掷骰子小游戏,网页实现掷骰子小游戏
  2. 青蛙捉昆虫的html游戏,幼儿园小班体育游戏教案《小青蛙捉害虫》
  3. python键盘输入代码,python监控键盘输入实例代码
  4. 什么命令看服务器系统,查看linux系统版本可以使用什么命令_网站服务器运行维护...
  5. java调用百度推送详解,关于百度推送,请教一下大家
  6. 服务器支持最大连接数,Horizon 连接服务器最大连接数和配置
  7. C语言怎么读取串口的数据为,如何通过串口来读写数据,请教达人
  8. ubuntu 远程访问mysql_Ubuntu下远程访问MySQL数据库
  9. Spring Boot 获取 Bean 的 3 种方式!还有谁不会?
  10. 工欲善其事必先利其器,一款开源编码辅助工具~