MAP(Mean Average Precision)

from: http://blog.sina.com.cn/s/blog_662234020100pozd.html

MAP(Mean Average Precision)


MAP(Mean AveragePrecision):单个主题的平均准确率是每篇相关文档检索出后的准确率的平均值。主集合的平均准确率(MAP)是每个主题的平均准确率的平均值。MAP 是反映系统在全部相关文档上性能的单值指标。系统检索出来的相关文档越靠前(rank越高),MAP就可能越高。如果系统没有返回相关文档,则准确率默认为0。
例如:假设有两个主题,主题1有4个相关网页,主题2有5个相关网页。某系统对于主题1检索出4个相关网页,其rank分别为1, 2, 4,7;对于主题2检索出3个相关网页,其rank分别为1,3,5。对于主题1,平均准确率为(1/1+2/2+3/4+4/7)/4=0.83。对于主题2,平均准确率为(1/1+2/3+3/5+0+0)/3=0.7555。则MAP=(0.83+0.7555)/2=0.79。”

MRR是把标准答案在被评价系统给出结果中的排序取倒数作为它的准确度,再对所有的问题取平均。

Wiki

Precision and recall are single-value metrics based on the wholelist of documents returned by the system. For systems that return aranked sequence of documents, it is desirable to also consider theorder in which the returned documents are presented. Averageprecision emphasizes ranking relevant documents higher. It is theaverage of precisions computed at the point of each of the relevantdocuments in the ranked sequence:

 \operatorname{AveP} = \frac{\sum_{r=1}^N (P(r) \times \mathrm{rel}(r))}{\mbox{number of relevant documents}} \!


where r is the rank, N the number retrieved,rel() a binary function on the relevance of a given rank,andP(r) precision at a given cut-off rank:

 \mbox{P(r)} = \frac{|\{\mbox{relevant retrieved documents of rank r or less}\}|}{r}

This metric is also sometimes referred to geometrically as thearea under the Precision-Recall curve.

Note that the denominator (number of relevant documents) is thenumber of relevant documents in the entire collection, so that themetric reflects performance over all relevant documents, regardlessof a retrieval cutoff. See:.

^Turpin, Andrew; Scholer, Falk (2006). "User performanceversus precision measures for simple search tasks". Proceedingsof the 29th Annual international ACM SIGIR Conference onResearch and Development in information Retrieval_r(Seattle,Washington, USA, August 06-11, 2006) (New York, NY: ACM):11–18.doi:10.1145/1148170.1148176

mAPmean Average Precision)即平均精度均值,是目标检测(也用于实例分割、关键点等)最常用的主评测指标之一,它衡量模型在不同阈值、不同召回水平下的整体检测质量,是对“找对多少(Recall,召回)”与“找得有多准(Precision,精度)”的综合积分[^1]。 在目标检测任务中,要理解 mAP 需先了解 AP(平均精确度)。衡量一个模型的平均精确度通常有两个指标:精确率(P,precision)和召回率(R,recall),这两个概念最初运用在信息检索领域。例如总共需要 100 条信息,检索出来 80 条,其中 60 条是需要的,20 条是不需要的,那么精确率为 60/80 = 75%,召回率为 60/100 = 60%。在目标检测领域,有了重新的定义,引入了 IOU(交并比),即两个框相交的面积比上两框总面积,True、False 的分类标准是 IOU,Positive、Negative 的分类标准是置信度。通常希望 P 值与 R 值都越高越好,但实际上这通常很难发生。将 P - R 值绘成曲线,得到 PR 曲线,PR 曲线围成的面积记作平均精确度,即 AP 值。而 mAP 中的“m”是 mean(平均值),是指在多个验证集上求 AP 的平均值,它反映的是模型的准确度[^3]。 计算 mAP 时,先求每个类的 AP,再进行求均值操作。可以通过画出 Precision - Recall 图(纵轴 Precision ,横轴 Recall ) ,对应的面积即为 AP [^2]。 mAP 的应用场景广泛,主要应用于目标检测、实例分割、关键点检测等领域,用于评估模型的性能,帮助研究人员和开发者了解模型在不同类别和不同召回水平下的检测能力,从而对模型进行改进和优化。 ```python # 以下是一个简单的伪代码示例,用于说明 mAP 计算的大致流程 # 实际 mAP 计算会更复杂,需要处理真实的检测结果和标注信息 # 假设已经有了每个类别的 precision 和 recall 列表 def calculate_ap(precision, recall): # 这里简单模拟计算 AP,实际需要更复杂的积分计算 ap = sum(precision) / len(precision) return ap # 假设有多个类别的 precision 和 recall 列表 class_precisions = [[0.8, 0.7, 0.6], [0.9, 0.8, 0.7]] class_recalls = [[0.6, 0.7, 0.8], [0.7, 0.8, 0.9]] aps = [] for i in range(len(class_precisions)): ap = calculate_ap(class_precisions[i], class_recalls[i]) aps.append(ap) mAP = sum(aps) / len(aps) print("mAP:", mAP) ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值