当前位置:网站首页>"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
总结
完结.谢谢,觉得有帮助的可以点个赞~
边栏推荐
猜你喜欢

ASP.Net Core实战——使用Swagger

More than pytorch from zero to build neural network to realize classification (training data sets)

抱抱脸(hugging face)教程-中文翻译-模型概要

At the beginning of the C language order 】 【 o least common multiple of three methods
![[Elementary C language] Detailed explanation of branch statements](/img/5c/9ae0fc48e021d1285badf295dda4be.png)
[Elementary C language] Detailed explanation of branch statements

浏览器中的302你真的知道吗

.Net Core动态注入

【深度学习】模型选择、欠/过拟合和感受野(三)

【深度学习】SVM解决线性不可分情况(八)

Qt control - QTextEdit usage record
随机推荐
【深度学习】梳理范数与正则化(二)
关于初级程序员职场如何提升技能的几点建议?
The difference between show and exec in Qt dialog
桥接模式下虚拟机连接不上网络的解决方法(WIFI)
Sequelize配置中的timezone测试
【研究生工作周报】(第十周)
自定义指令,实现默认头像和用户上传头像的切换
Basic principles and common methods of digital image processing
【研究生工作周报】
smote 采样
ASP.Net Core实战——使用Swagger
【研究生工作周报】(第九周)
【深度学习】归一化(十一)
抱抱脸(hugging face)教程-中文翻译-QA问答(Question Answering)
研究生工作周报(第六周)
抱抱脸(hugging face)教程-中文翻译-翻译任务(translating)
YOLOV2详解
抱抱脸(hugging face)教程-中文翻译-文本分类
记一次解决Mysql:Incorrect string value: ‘\xF0\x9F\x8D\x83\xF0\x9F...‘ for column 插入emoji表情报错问题
[Deep Learning] Original Problem and Dual Problem (6)