Accuracy lies when the rare case is the one that matters

Precision, recall, prevalence and the workload behind an alert

A worked confusion matrix shows how recall, false-positive rate and prevalence determine alert quality and operator workload.

Suppose 100 of 10,000 equipment images contain a fault. A model that always says “normal” achieves 99% accuracy and catches none of the faults.

The arithmetic is right. “The model is useful” is the unsupported conclusion.

Keep the four counts

Another classifier produces:

| Actual state | Alerted | Did not alert | Total | |---|---:|---:|---:| | Fault | 80 TP | 20 FN | 100 | | Normal | 198 FP | 9,702 TN | 9,900 |

TP means a detected fault; FN a missed fault; FP a false alert; TN a normal image correctly left alone.

Precision asks what fraction of alerts were real. Recall asks what fraction of real faults were found. FPR asks what fraction of normal examples generated alerts.

Calculate usefulness, not just correctness

The model sends 278 alerts, only 80 genuine:

  • Precision = 80/278 ≈ 28.8%.
  • Recall = 80/100 = 80%.
  • FPR = 198/9,900 = 2%.
  • Accuracy = (80+9,702)/10,000 = 97.82%.
  • Ranking only by accuracy would prefer the always-normal model.

    Rarity changes the alert mix

    Consider a different population of 10,000 images with only ten faults. For illustration, hold recall at 80% and FPR at 2%. Expect about eight true alerts and 200 false alerts: precision is roughly 3.8%.

    This is conditional arithmetic, not a claim that error rates stay fixed after a distribution change. It shows why a deliberately balanced evaluation set may not predict production alert quality.

    Thresholds are a policy choice

    On a fixed dataset, lowering a score threshold cannot decrease recall, but precision need not change monotonically at every step. It is too strong to claim that every recall increase must reduce precision.

    The right operating point depends on error costs and review capacity. A team able to inspect 100 alerts cannot approve 278 simply because recall looks good. Decision thresholds and expected cost works through that choice.

    F1 combines precision and recall into a harmonic mean. It is useful as a summary, but it does not encode every cost or tell you whether the workload is feasible.

    Report the evidence underneath the percentage

    Keep the four counts, observation period and unit of measurement. Eight of ten faults and 8,000 of 10,000 both give 80% recall but offer different evidence.

    For video, frames and independent events are not interchangeable. Hundreds of frames of one fault do not create hundreds of independent faults. Data splitting needs the same care.

    Check yourself

    Fifty alerts contain 40 real faults; 100 real faults occurred overall. Precision is 80%, recall 40%. The alerts are relatively trustworthy while most faults are missed.

    Compare against a trivial baseline, report counts and workload, and choose a decision rule that fits the task.

    Tagged: ai, evaluation, metrics, machine-learning

    Area: AI

    Related notes

    עברית