Matching Error Costs to Metrics for Three Image Moderation Models
Machine LearningModel answerLast updated
Pick precision, recall, or F1 for three moderation models with different error costs, then reason about recall-oriented tuning and how thresholds move the operating point on a PR curve.
Scenario
You are comparing three automated classifiers that detect policy-violating images. Your labeled evaluation set contains roughly 10,000 images. About 100 are true violations (the positive class) and the remaining ~9,990 are benign, so prevalence is about 1%.
Each classifier plays a different role in the moderation pipeline:
- Model A is a first-pass screen. Anything it flags goes to a human reviewer. Letting a real violation through is very costly, while an extra review is cheap.
- Model B triggers an automatic account suspension whenever it flags an image. Wrongly suspending a legitimate user causes public backlash and lost customers.
- Model C feeds a dashboard that tracks the health of each model release. The team wants a single score, and neither kind of mistake is clearly more costly than the other.
Your task
- For each model (A, B, C), choose the best primary metric among precision, recall, and F1, and justify the choice in terms of error costs.
- Describe the trade-offs of tuning Model B to maximize recall rather than precision.
- Given the heavy class imbalance, explain what happens on the precision-recall curve when you raise the decision threshold.
Be prepared to discuss any secondary constraints you would add, and to say why plain accuracy is a poor choice here.
Hints
Hint 1
Write down which error (false positive or false negative) is expensive for each model, then pick the metric that penalizes that error. Remember that none of precision, recall, or F1 uses true negatives.
Hint 2
A single metric can be gamed: flagging everything gives perfect recall, and flagging one sure thing gives perfect precision. Think about what guardrail each model needs.
Hint 3
With about 100 negatives per positive, a tiny false positive rate produces many false positives in absolute terms. Compute precision for a concrete case, and remember that raising the threshold slides you along the PR curve rather than changing it.
Model answer
Medium Try it yourself first — then compare your approach, complexity and edge cases.
What a strong answer shows
- Metrics are tied to the cost of each error type, not just recited as definitions.
- The threshold is understood as the lever that trades precision against recall.
- The effect of imbalance on metrics is understood.
A small data note: 100 + 9,990 = 10,090, not 10,000. Prevalence is still about 1%, so nothing changes. Mentioning it briefly is fine.
Definitions
- Precision = TP / (TP + FP): of everything flagged, the share that were real violations.
- Recall = TP / (TP + FN): of all real violations, the share we caught.
- F1 = 2PR / (P + R): the harmonic mean, pulled down by whichever of the two is weaker.
None of these use true negatives. With 9,990 negatives that is a feature. Accuracy is misleading because a model that flags nothing scores about 99%.
Part 1: Metric per model
| Model | Role | Costly error | Primary metric | Guardrail |
|---|---|---|---|---|
| A | Screen before human review | FN | Recall | Flag volume must fit reviewer capacity |
| B | Automatic suspension | FP | Precision | A recall floor so it stays useful |
| C | Release-health dashboard | Roughly equal | F1 | Also log P and R separately |
Model A. A missed violation is gone for good, while a false alarm costs seconds of reviewer time. Maximize recall, but phrase the objective as "maximize recall subject to flagged volume fitting reviewer capacity." Without that constraint, flagging everything gives 100% recall and is meaningless.
Model B. Each false positive hurts an innocent user. Optimize precision, typically stated as "maximize recall at precision of at least 99%." Pure precision can be gamed by a model that acts on a single obvious case, so a recall floor is needed. F0.5, which weights precision more than recall, is a reasonable single-number alternative.
Model C. Costs are balanced and a single number is wanted, so F1 fits. Hold the threshold fixed across releases so scores are comparable over time.
Part 2: Tuning Model B for recall
Higher recall means a lower threshold, so more borderline images are flagged. Because negatives outnumber positives about 100 to 1, a small increase in false positive rate is a large number of wrongful flags.
Illustration:
- At 70% recall with 1 FP: precision = 70/71 ≈ 98.6%.
- Push recall to 95% and let the FPR reach only 0.5%, about 50 FPs: precision = 95/145 ≈ 65.5%.
- You catch about 25 more violators but wrongly suspend roughly 49 more users.
Trade-off: more harmful content is caught, but in an irreversible-action system model uncertainty is converted straight into user harm, with churn and PR risk.
Better design: a cascade. B acts automatically only at very high confidence; the uncertain middle band goes to Model A's human-review path. This recovers recall without automatically punishing anyone. Also consider making suspensions appealable or reversible.
Part 3: Raising the threshold
The PR curve is a property of the model's score ranking. Changing the threshold moves the operating point along the curve; it does not change the curve.
With recall on the x-axis, raising the threshold:
- Lowers recall or leaves it unchanged, since fewer items are flagged and TP can only fall.
- Usually raises precision, because the survivors are the most confident predictions. This is not guaranteed monotonic: if the next item removed is a TP, precision dips, giving the familiar sawtooth.
- Moves the point left and generally up.
Imbalance effects:
- With about 100 positives, each lost TP costs one point of recall, so the curve is jagged and noisy. Report confidence intervals or gather more positives.
- Precision is very sensitive to FP count. At 90 TPs, a 1% FPR means about 100 FPs, capping precision near 47%.
- The no-skill baseline on a PR plot is the prevalence (about 0.01), not 0.5.
Common mistakes
- Reporting accuracy.
- Picking recall for A with no volume constraint, or precision for B with no recall floor.
- Claiming precision always rises with the threshold.
- Saying the threshold "changes the curve."
- Forgetting that F1 depends on both the threshold and prevalence.
Likely follow-ups
Prevalence rises to 20%. The metric choices stay the same because they come from error costs, not class balance. Precision at a given threshold rises markedly and the PR baseline becomes 0.2, so numbers are not comparable across prevalences; re-baseline and re-tune. Check whether 20% reflects real traffic or a resampled test set, since the latter makes precision look better than it will be in production.
Model A at 99% recall and 5% precision. That means about 99 TPs and roughly 1,980 flagged images, of which about 1,881 are false. Reviewers see about 20% of traffic instead of all of it, an ~80% workload cut, while missing only one violation. For a cheap-review screen that is the intended behavior. Next, raise precision at fixed 99% recall to shrink the queue further.
Why AUROC can mislead here. AUROC is prevalence-insensitive, and its FPR denominator is 9,990, so hundreds of FPs still look like a small FPR. A model with AUROC 0.98 can have 1% FPR at useful recall, which is about 100 FPs against 100 positives and precision near 50%. AUROC also credits regions of the curve no one would deploy in. Prefer AUPRC (baseline about 0.01) or operating-point metrics such as recall at precision of at least 99% for B and precision at recall of at least 99% for A.