Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to interpret the precision and recall vs epoch curve? #4812

Closed
YukunXia opened this issue Sep 15, 2021 · 7 comments
Closed

How to interpret the precision and recall vs epoch curve? #4812

YukunXia opened this issue Sep 15, 2021 · 7 comments
Labels
question Further information is requested Stale

Comments

@YukunXia
Copy link
Contributor

❔Question

If I understand correctly, the default train.py will call the test function to calculate the metrics, and the default conf_thred is 0.001. The final precision and recall I had were both pretty high: 0.984 and 0.883. I feel confused that such a small conf_thred could lead to a precision close to 1. I checked the P_curve.png, and at confidence close to 0, the precision decreased to 0, which makes sense to me, but seems to be contradictory to the 0.984 precision.

Additional context

My training curves:

image

P curve:

image

R curve:

image

PR curve:

image

@YukunXia YukunXia added the question Further information is requested label Sep 15, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Sep 15, 2021

👋 Hello @YukunXia, thank you for your interest in YOLOv5 🚀! Please visit our ⭐️ Tutorials to get started, where you can find quickstart guides for simple tasks like Custom Data Training all the way to advanced concepts like Hyperparameter Evolution.

If this is a 🐛 Bug Report, please provide screenshots and minimum viable code to reproduce your issue, otherwise we can not help you.

If this is a custom training ❓ Question, please provide as much information as possible, including dataset images, training logs, screenshots, and a public link to online W&B logging if available.

For business inquiries or professional support requests please visit https://ultralytics.com or email Glenn Jocher at glenn.jocher@ultralytics.com.

Requirements

Python>=3.6.0 with all requirements.txt installed including PyTorch>=1.7. To get started:

$ git clone https://github.com/ultralytics/yolov5
$ cd yolov5
$ pip install -r requirements.txt

Environments

YOLOv5 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):

Status

CI CPU testing

If this badge is green, all YOLOv5 GitHub Actions Continuous Integration (CI) tests are currently passing. CI tests verify correct operation of YOLOv5 training (train.py), validation (val.py), inference (detect.py) and export (export.py) on MacOS, Windows, and Ubuntu every 24 hours and on every commit.

@glenn-jocher
Copy link
Member

glenn-jocher commented Sep 15, 2021

@YukunXia P and R are reported at maximum F1 confidence, not at 0.001, which would not make any sense as then R would be near 1 and P would be near zero. See F1_curve.png for this value.

@YukunXia
Copy link
Contributor Author

Thank you! F1 curve says "all classes 0.93 at 0.505", so the conf_thred for precision and recall is actually 0.505.

@glenn-jocher
Copy link
Member

@YukunXia yes

@github-actions
Copy link
Contributor

github-actions bot commented Oct 16, 2021

👋 Hello, this issue has been automatically marked as stale because it has not had recent activity. Please note it will be closed if no further activity occurs.

Access additional YOLOv5 🚀 resources:

Access additional Ultralytics ⚡ resources:

Feel free to inform us of any other issues you discover or feature requests that come to mind in the future. Pull Requests (PRs) are also always welcomed!

Thank you for your contributions to YOLOv5 🚀 and Vision AI ⭐!

@jet-c-21
Copy link

@glenn-jocher what kind of confidence represented on the horizontal axis? Is it IOU thresh or Class thresh?

How can set confidence threshold when I am doing inference?

@glenn-jocher
Copy link
Member

@jet-c-21 The confidence on the horizontal axis of the precision-recall curves and F1 curves is the objectness score threshold, not the IoU or class score threshold. You can set the confidence threshold during inference with the --conf argument. Check out the YOLOv5 documentation for more details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested Stale
Projects
None yet
Development

No branches or pull requests

3 participants