当前位置:网站首页>"Deep learning" evaluation index of target detection
"Deep learning" evaluation index of target detection
2022-08-09 16:48:00 【弗洛丽朱】
【深度学习】目标检测之评价指标mAP
评价指标
时隔一年,Started learning again.Hahaha not much nonsense,Let's start with some of the content I've put together recently.The knowledge points to be sorted out today are several evaluation indicators commonly used in the field of target detection,准确率Precision,召回率Recall,交并比IoU,平均精度AP,多个类别APthe average ofmAP等等.
混淆矩阵
目标检测模型通常会输出很多个检测框,我们是通过统计并计算每个检测框是否能检测到目标的各种占比来衡量模型的检测效果,因此,我们会把检测框分成如下四种情况,判断的依据主要是通过计算交并比(IoU,这个下面会讲到).
- TP (True Positive) ,真的正样本 = 正样本 被分类为 正样本;
- TN (True Negative) ,真的负样本 = 负样本 被分类为 负样本;
- FP (False Positive) ,假的正样本 = 负样本 被分类为 正样本;
- FN (False Negative) ,假的负样本 = 正样本 被分类为 负样本(通常为漏检);
According to the detection situation of the detection frame,我们写成一个4x4的矩阵形式(称为混淆矩阵):
| 分类情况 | 预测为正类 | 预测为负类 |
|---|---|---|
| 真实正样本 | TP | FN |
| 真实负样本 | FP | TN |
for an image,The predicted situation and the real sample situation are as follows(记住这个,Later calculations will not be confusing)

Precision 精确率(精度)
Precision:指的是在模型预测的结果中,其中正确的有多少个.看上面的图,预测结果有TP+FP.
P r e c i s i o n = T P T P + F P Precision = \frac{TP}{TP+FP} Precision=TP+FPTP
Recall 召回率
Recall:指的是在所有的真实目标中,其中正确的有多少个.看上面的图,真实目标有TP+FN.
R e c a l l = T P T P + F N Recall= \frac{TP}{TP+FN} Recall=TP+FNTP
IoU 交并比
IoU:It refers to the ratio of the intersection and union of the detection frame and the rectangular frame marked by the sample.
平均精度 AP
AP(Average Precision)指的是Precision-Recall曲线下的面积.
Start with a single category(猫)开始计算,假设一共有3张图片,绿色框是GT(7个),红色框是预测框(7个)with confidence.现在假设IOU=50%,The following table is obtained in order of confidence


After getting the statistics,根据confidence取不同的阈值,可以计算Precision和Recall


This way we can calculate the type of cat based on the tableAP值了
猫 A P = ∑ i = 1 R a n k ( R e c a l l i − R e c a l l i − 1 ) × P r e c i s i o n i 猫AP=\sum_{i=1}^{Rank}(Recall_i - Recall_{i-1})\times Precision_i 猫AP=i=1∑Rank(Recalli−Recalli−1)×Precisioni
即:猫AP=(0.14-0)x1.0 + (0.28-0.14)x1.0 + (0.42-0.28)x1.0 + (0.57-0.42)x1.0 + (0.71-0.57)x0.71=0.6694
mAP
mAP (means Average Precision) 即各类别的AP值的均值
m A P = ∑ j c l a s s _ n u m b e r C l a s s _ A P j mAP = \sum_{j}^{class\_number} Class\_AP_j mAP=j∑class_numberClass_APj
总结
完结.谢谢,觉得有帮助的可以点个赞~
边栏推荐
猜你喜欢
随机推荐
【Leetcode】433. 最小基因变化
【论文阅读】LIME:Low-light Image Enhancement via Illumination Map Estimation(笔记最全篇)
flex布局总结
实现一个支持请求失败后重试的JS方法
【深度学习】全面理解支持向量机SVM(七)
什么是跨境电商测评?
仪表盘
抱抱脸(hugging face)教程-中文翻译-创建一个自定义架构
单例模式-五种方式 不要被克隆
抱抱脸(hugging face)教程-中文翻译-文本分类
【论文阅读】Deep Learning for Image Super-resolution: A Survey(DL超分辨率最新综述)
防关联浏览器对亚马逊测评有多重要?
AsyncTask 串行还是并行
微信小程序禁止页面左右滑动
【研究生工作周报】(第七周)
抱抱脸(hugging face)教程-中文翻译-模型概要
微信小程序自定义日期选择器(带标题的)
WebGL:BabylonJS入门——初探:数据展示
js总结,基础篇
路由的懒加载与接口的封装









