KatInterview

Matching Error Costs to Metrics for Three Image Moderation Models

Machine LearningModel answer
MediumModel answerMachine Learningprecision-recallf1-scoreclass-imbalance

Last 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:

  1. 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.
  2. Model B triggers an automatic account suspension whenever it flags an image. Wrongly suspending a legitimate user causes public backlash and lost customers.
  3. 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

  1. 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.
  2. Describe the trade-offs of tuning Model B to maximize recall rather than precision.
  3. 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.