KatInterview

Offline Evaluation Framework for a Video Safety Classifier

Machine LearningModel answer
MediumModel answerMachine Learningclassificationprecision-recallfairness

Last updated

Design an end-to-end offline evaluation pipeline for a binary content classifier, covering metrics, label collection, calibration, threshold choice, and fairness slicing.

Setting the Scene

A trust and safety team has trained a model that scores uploaded videos on the likelihood of containing harmful content. Before rolling it out, they want a rigorous offline evaluation. You have been asked to design that evaluation from scratch.

Your Task

Walk through the complete offline evaluation framework you would build. Your answer should address all of the following:

Metrics

  • Why is accuracy alone insufficient here? Which metrics are more informative, and why?
  • How do you correctly compute precision when your test set does not reflect production prevalence?

Ground-truth collection

  • How do you sample videos for labeling in a way that avoids bias and still gives you enough positives to measure recall reliably?
  • What labeling quality controls matter, and how do you measure them?

Class imbalance

  • How does extreme label skew (assume around 0.1% of videos are harmful) affect metric interpretation?
  • If you used negative downsampling during training, what correction is needed before deploying the model?

Calibration

  • How do you verify that model scores are well-calibrated, and why does calibration matter for everything downstream?

Threshold selection

  • How do you derive an operating threshold from business costs? Walk through a concrete numerical example.
  • How do review-queue capacity constraints interact with cost-based threshold selection?

Fairness and slice analysis

  • Which slices would you prioritize, and which per-slice metrics reveal over-enforcement versus under-protection?
  • What do you do when fairness criteria conflict with each other?

A strong answer is structured like a pipeline, treats each step as a dependency for the next, is concrete with numbers and formulas where they add clarity, and is honest about limitations and trade-offs.

Hints

Hint 1

At 0.1% prevalence, even a low false positive rate produces far more false positives than true positives — work through the math to show why ROC-AUC and accuracy are misleading in this regime, and which curve is more informative instead.

Hint 2

Ground-truth collection is often the weakest link. Think about what biases appear if you only label videos that were reported or previously actioned, and how stratified sampling with importance weights fixes that.

Hint 3

Threshold selection and calibration are linked: cost-based threshold math only works if a score of 0.3 really means 30% probability of harm. Sketch the formula that converts costs into a threshold, then think about what additional hard constraints — reviewer capacity, minimum precision floors — sit on top of it.