百科.dev
全部条目AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
O

Object-Detection-Metrics

> DevOps
开源

用于评估物体检测算法的最常用指标。

5.1K stars0 点赞0 次浏览
访问官网GitHub

工具介绍

用于评估物体检测算法的最常用指标。

## Citation If you use this code for your research, please consider citing: ``` @Article{electronics10030279, AUTHOR = {Padilla, Rafael and Passos, Wesley L. and Dias, Thadeu L. B. and Netto, Sergio L. and da Silva, Eduardo A. B.}, TITLE = {A Comparative Analysis of Object Detection Metrics with a Companion Open-Source Toolkit}, JOURNAL = {Electronics}, VOLUME = {10}, YEAR = {2021}, NUMBER = {3}, ARTICLE-NUMBER = {279}, URL = {https://www.mdpi.com/2079-9292/10/3/279}, ISSN = {2079-9292}, DOI = {10.3390/electronics10030279} } ``` Download the paper [here](https://www.mdpi.com/2079-9292/10/3/279/pdf) or [here](https://github.com/rafaelpadilla/review_object_detection_metrics/blob/main/published_paper.pdf). ``` @INPROCEEDINGS {padillaCITE2020, author = {R. {Padilla} and S. L. {Netto} and E. A. B. {da Silva}}, title = {A Survey on Performance Metrics for Object-Detection Algorithms}, booktitle = {2020 International Conference on Systems, Signals and Image Processing (IWSSIP)}, year = {2020}, pages = {237-242},} ``` Download the paper [here](https://github.com/rafaelpadilla/Object-Detection-Metrics/raw/master/paper_survey_on_performance_metrics_for_object_detection_algorithms.pdf) ----------------- Attention! A new version of this tool is available [here](https://github.com/rafaelpadilla/review_object_detection_metrics) ======= The new version includes **all COCO metrics**, supports **other file formats**, provides a **User Interface (UI)** to guide the evaluation process, and presents the **STT-AP metric** to evaluate object detection in videos. ----------------- # Metrics for object detection The motivation of this project is the lack of consensus used by different works and implementations concerning the **evaluation metrics of the object detection problem**. Although on-line competitions use their own metrics to evaluate the task of object detection, just some of them offer reference code snippets to calculate the accuracy of the detected objects. Researchers who want to evaluate their work using different datasets than those offered by the competitions, need to implement their own version of the metrics. Sometimes a wrong or different implementation can create different and biased results. Ideally, in order to have trustworthy benchmarking among different approaches, it is necessary to have a flexible implementation that can be used by everyone regardless the dataset used. **This project provides easy-to-use functions implementing the same metrics used by the the most popular competitions of object detection**. Our implementation does not require modifications of your detection model to complicated input formats, avoiding conversions to XML or JSON files. We simplified the input data (ground truth bounding boxes and detected bounding boxes) and gathered in a single project the main metrics used by the academia and challenges. Our implementation was carefully compared against the official implementations and our results are exactly the same. In the topics below you can find an overview of the most popular metrics used in different competitions and works, as well as samples showing how to use our code. ## Table of contents - [Motivation](#metrics-for-object-detection) - [Different competitions, different metrics](#different-competitions-different-metrics) - [Important definitions](#important-definitions) - [Metrics](#metrics) - [Precision x Recall curve](#precision-x-recall-curve) - [Average Precision](#average-precision) - [11-point interpolation](#11-point-interpolation) - [Interpolating all points](#interpolating-all-points) - [**How to use this project**](#how-to-use-this-project) - [References](#references) ## Different competitions, different metrics * **[PASCAL VOC Challenge](http://host.robots.ox.ac.uk/pascal/VOC/)** offers a Matlab script in order to evaluate the quality of the detected objects. Participants of the competition can use the provided Matlab script to measure the accuracy of their detections before submitting their results. The official documentation explaining their criteria for object detection metrics can be accessed [here](http://host.robots.ox.ac.uk/pascal/VOC/voc2012/htmldoc/devkit_doc.html#SECTION00050000000000000000). The current metrics used by the current PASCAL VOC object detection challenge are the **Precision x Recall curve** and **Average Precision**. The PASCAL VOC Matlab evaluation code reads the ground truth bounding boxes from XML files, requiring changes in the code if you want to apply it to other datasets or to your specific cases. Even though projects such as [Faster-RCNN](https://github.com/rbgirshick/py-faster-rcnn) implement PASCAL VOC evaluation metrics, it is also necessary to convert the detected bounding boxes into their specific format. [Tensorflow](https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/evaluation_protocols.md) framework also has their PASCAL VOC metrics implementation. * **[COCO Detection Challenge](https://competitions.codalab.org/competitions/5181)** uses different metrics to evaluate the accuracy of object detection of different algorithms. [Here](http://cocodataset.org/#detection-eval) you can find a documentation explaining the 12 metrics used for characterizing the performance of an object detector on COCO. This competition offers Python and Matlab codes so users can verify their scores before submitting the results. It is also necessary to convert the results to a [format](http://cocodataset.org/#format-results) required by the competition. * **[Google Open Images Dataset V4 Competition](https://storage.googleapis.com/openimages/web/challenge.html)** also uses mean Average Precision (mAP) over the 500 classes to evaluate the object detection task. * **[ImageNet Object Localization Challenge](https://www.kaggle.com/c/imagenet-object-detection-challenge)** defines an error for each image considering the class and the overlapping region between ground truth and detected boxes. The total error is computed as the average of all min errors among all test dataset images. [Here](https://www.kaggle.com/c/imagenet-object-localization-challenge#evaluation) are more details about their evaluation method. ## Important definitions ### Intersection Over Union (IOU) Intersection Over Union (IOU) is a measure based on Jaccard Index that evaluates the overlap between two bounding boxes. It requires a ground truth bounding box and a predicted bounding box . By applying the IOU we can tell if a detection is valid (True Positive) or not (False Positive). IOU is given by the overlapping area between the predicted bounding box and the ground truth bounding box divided by the area of union between them:  

The image below illustrates the IOU between a ground truth bounding box (in green) and a detected bounding box (in red).

### True Positive, False Positive, False Negative and True Negative Some basic concepts used by the metrics: * **True Positive (TP)**: A correct detection. Detection with IOU ≥ _threshold_ * **False Positive (FP)**: A wrong detection. Detection with IOU < _threshold_ * **False Negative (FN)**: A ground truth not detected * **True Negative (TN)**: Does not apply. It would represent a corrected misdetection. In the object detection task there are many possible bounding boxes that should not be detected within an image. Thus, TN would be all possible bounding boxes that were corrrectly not detected (so many possible boxes within an image). That's why it is not used by the metrics. _threshold_: depending on the metric, it is usually set to 50%, 75% or 95%. ### Precision Precision is the ability of a model to identify **only** the relevant objects. It is the percentage of correct positive predictions and is given by:

### Recall Recall is the ability of a model to find all the relevant cases (all ground truth bounding boxes). It is the percentage of true positive detected among all relevant ground truths and is given by:

## Metrics In the topics below there are some comments on the most popular metrics used for object detection. ### Precision x Recall curve The Precision x Recall curve is a good way to evaluate the performance of an object detector as the confidence is changed by plotting a curve for each object class. An object detector of a particular class is considered good if its precision stays high as recall increases, which means that if you vary the confidence threshold, the precision and recall will still be high. Another way to identify a good object detector is to look for a detector that can identify only relevant objects (0 False Positives = high precision), finding all ground truth objects (0 False Negatives = high recall). A poor object detector needs to increase the number of detected objects (increasing False Positives = lower precision) in order to retrieve all ground truth objects (high recall). That's why the Precision x Recall curve usually starts with high precision values, decreasing as recall increases. You can see an example of the Prevision x Recall curve in the next topic (Average Precision). This kind of curve is used by the PASCAL VOC 2012 challenge and is available in our implementation. ### Average Precision Another way to compare the performance of object detectors is to calculate the area under the curve (AUC) of the Precision x Recall curve. As AP curves are often zigzag curves going up and down, comparing different curves (different detectors) in the same plot usually is not an easy task - because the curves tend to cross each other much frequently. That's why Average Precision (AP), a numerical metric, can also help us compare different detectors. In practice AP is the precision averaged across all recall values between 0 and 1. From 2010 on, the method of computing AP by the PASCAL VOC challenge has changed. Currently, **the interpolation performed by PASCAL VOC challenge uses all data points, rather than interpolating only 11 equally spaced points as stated in their [paper](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.157.5766&rep=rep1&type=pdf)**. As we want to reproduce their default implementation, our default code (as seen further) follows their most recent application (interpolating all data points). However, we also offer the 11-point interpolation approach. #### 11-point interpolation The 11-point interpolation tries to summarize the shape of the Precision x Recall curve by averaging the precision at a set of eleven equally spaced recall levels [0, 0.1, 0.2, ... , 1]:

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 Instead of interpolating only in the 11 equally spaced points, you could interpolate through all points in such way that:

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. To

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Pythonaverage-precisionbounding-boxesmean-average-precisionmetrics

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类DevOps
定价开源

> 相关工具

D
Docker
容器化平台,标准化应用交付
G
GitHub Actions
GitHub 原生 CI/CD 工作流
N
Nginx
高性能 Web 服务器与反向代理