Skip to content
tezvyn:
Menu

Precision vs recall in object detection.

Source: interviewEasyHow cards are made

Summary

precision and recall trade-offs.

Key points

precision is fraction of detections that are correct, recall is fraction of true objects found; prioritize recall for safety-critical detection, precision when false alarms are costly.

What's really being asked

The interviewer wants crisp definitions, awareness that they trade off, and judgment about which matters in a given application.

The full answer

Precision is the fraction of the model's positive detections that are actually correct: true positives divided by true positives plus false positives. It answers, when the model says there is an object, how often is it right. Recall is the fraction of real objects the model successfully finds: true positives divided by true positives plus false negatives. It answers, of all the objects that exist, how many did we catch. In detection these depend on the confidence threshold and on the IoU criterion for counting a box as correct. Lowering the threshold catches more true objects, raising recall but adding false positives that lower precision; raising it does the opposite. You choose based on the cost of each error type. When a miss is dangerous, you favor recall; when a false alarm is expensive or erodes trust, you favor precision. Average precision and the precision-recall curve summarize the whole trade-off.

The mistakes people make

Swapping the definitions. Claiming you can maximize both freely with no trade-off. Forgetting the threshold and IoU dependence in detection specifically.

What usually comes next

F1 score, mAP across IoU thresholds, how to pick an operating point, and behavior on imbalanced data.

A concrete example

For a self-driving car's pedestrian detector you prioritize recall: missing a real pedestrian is catastrophic, so you accept some false alarms and brake conservatively. For a consumer photo app that auto-tags faces, you prioritize precision: a wrong tag is annoying and visible, so it is better to skip uncertain detections than to label incorrectly.

Interview question

For a self-driving car's pedestrian detector, which metric should usually be prioritized and why?

  • a.Recall, because failing to detect a real pedestrian is dangerousCorrect
  • b.Precision, because false alarms waste compute
  • c.Precision, because every detection must be perfectly accurate
  • d.Neither, since both are equally important in all cases
Why?

Missing a pedestrian can be fatal, so high recall matters even at the cost of some false alarms. Prioritizing precision would risk dangerous misses, and the two genuinely trade off.

Just read this? Test yourself on what you have been reading.

Read the original → en.wikipedia.org

Put your scrolling time to good use

Learn one idea, try a quiz and save useful cards for revision. Tezvyn makes it easy to learn and stay current in your tech field, a few minutes at a time.

The iPhone app is on the way

We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.

Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.

Get it on Google PlayiPhone app coming soon

We are hiring for this. Every open role lists the topics its interview covers, so you can prepare for the real thing rather than guessing.

See open roles