The Short Answer
Never judge training data or LLM evaluation quality by a vague headline percentage. Match the metric to the geometry and label structure: use IoU + Instance F1 for bounding boxes and segmentation masks, OKS / pixel tolerance for keypoints, IDF1 / ID-switch count for video tracking, Cohen’s Kappa for two-reviewer categorical tasks, and Krippendorff’s Alpha for multi-reviewer, sparse, or ordinal AI response evaluation rubrics.
When a vendor quotes a flat accuracy number without defining the unit of measurement, threshold, and chance correction, your engineering team has no way to predict downstream model behavior.
Why “99% Accuracy” Means Nothing Without a Metric Definition
In production ML pipelines, two datasets can both claim high accuracy while producing completely different model metrics:
- Frame-level vs. object-level denominator: An image with 19 empty frames and 1 frame containing 10 missed objects looks “95% accurate” at the frame level—yet fails completely on recall.
- Class imbalance illusion: On a safety or defect dataset where 96% of samples are normal, labeling every sample “normal” achieves 96% raw accuracy and 0% defect recall.
- Geometry vs. classification confusion: A bounding box can carry the right class ID while sitting 15 pixels too loose around a pedestrian, dragging down
mAP@0.50:0.95during training.
A real QA contract separates localization precision, detection completeness (missing/extra instances), and class or rubric agreement.
Choosing the Right QA Metric by AI Modality
| Modality / Task | Primary QA Metric(s) | Typical Production Gate | Primary Failure Mode Caught |
|---|---|---|---|
| 2D Bounding Boxes | Mean IoU + Matched Instance F1 (IoU >= 0.75–0.90) | F1 >= 0.96, mIoU >= 0.88 | Loose boxes, missed small objects, wrong class IDs |
| Semantic / Instance Segmentation | Boundary IoU (B-IoU) + Mask Dice / IoU | Mask IoU >= 0.90, B-IoU >= 0.80 | Edge bleed, jagged polygons, merged adjacent instances |
| Keypoints / Pose | OKS (Object Keypoint Similarity) + Visibility Flag Match | OKS >= 0.90, visibility match >= 95% | Swapped left/right joints, wrong v=0/1/2 flags |
| Video Object Tracking | IDF1 + ID-Switch Rate + MOTA | Zero unresolved ID swaps per clip | Broken trajectories after occlusion or re-entry |
| 3D LiDAR Cuboids | 3D BEV IoU + Yaw Error (degrees) | 3D IoU >= 0.70–0.80, yaw <= 5° | Flipped heading direction, ground-plane z-drift |
| Text / NER Classification | Exact Span F1 + Cohen’s Kappa (κ) | κ >= 0.80, span F1 >= 0.92 | Partial entity spans, inconsistent boundary punctuation |
| LLM Preference / Rubric Evals | Krippendorff’s Alpha (α, nominal or ordinal) | α >= 0.75–0.80 (ordinal/binary) | Subjective rubric drift, ambiguous tie-breaking |
Computer Vision QA: Separating Localization From Completeness
A common mistake in vision QA is averaging IoU only across matched boxes while ignoring missed objects (false negatives) or hallucinated boxes (false positives). Always compute two numbers against a reviewed gold set:
- Localization Quality (
Mean IoUof matched pairs): Measures how tightly annotators hug object boundaries. - Detection Completeness (
Precision,Recall, andF1at a strict IoU cutoff): Penalizes every missed object, duplicate box, and class swap.
Watch Out for Small-Object IoU Sensitivity
IoU is unforgiving on small objects. A 20 × 20 px traffic sign shifted by just 2 pixels on two sides drops from 1.00 to roughly 0.68 IoU, whereas a 400 × 400 px truck shifted by 2 pixels still scores 0.98.
For mixed-scale scenes (such as aerial imagery, CCTV, or 3D perception datasets), stratify your QA thresholds by object area:
- Large objects (
> 96 × 96 px): StrictIoU >= 0.90 - Medium objects (
32 × 32to96 × 96 px):IoU >= 0.85 - Small objects (
< 32 × 32 px):IoU >= 0.75or<= 2 pxboundary tolerance
Text, NLP & LLM Evaluation QA: Cohen’s Kappa vs. Krippendorff’s Alpha
When teams move from computer vision to text annotation or AI response evaluation, raw agreement breaks down quickly because human judgment involves class skew and ordinal scales.
Cohen’s Kappa (κ) — Best for Two Reviewers, Categorical Labels
Cohen’s Kappa measures agreement beyond chance between two annotators rating the same set of items:
kappa = (p_observed - p_expected_by_chance) / (1 - p_expected_by_chance)
κ < 0.40: Guidelines are broken or underspecified; pause labeling immediately.κ = 0.60 – 0.79: Usable for rough exploration, but ambiguous edge cases still need written examples.κ >= 0.80: Production-ready consistency for binary/categorical classification and groundedness checks.
Krippendorff’s Alpha (α) — The Gold Standard for Production Ops
Real annotation pods rarely have the exact same two people label 100% of items. Usually, 5 to 15 reviewers annotate subsets, with a 10–20% overlapping audit slice. Krippendorff’s Alpha handles:
- Any number of reviewers
- Missing/sparse overlap matrices (not every reviewer scores every item)
- Nominal labels (categories), ordinal rubrics (e.g., 1–4 severity), and interval scores (where a 1 vs. 2 disagreement is penalized less than a 1 vs. 4 disagreement)
Practical Python QA Verification Script
You can integrate this lightweight verification check into your CI/CD data pipeline or calibration review to compute both 2D box IoU / F1 and chance-corrected Cohen’s Kappa:
from collections import Counter
from typing import List, Tuple
Box = Tuple[int, float, float, float, float] # (class_id, x1, y1, x2, y2)
def compute_iou(a: Box, b: Box) -> float:
ix1, iy1 = max(a[1], b[1]), max(a[2], b[2])
ix2, iy2 = min(a[3], b[3]), min(a[4], b[4])
inter = max(0.0, ix2 - ix1) * max(0.0, iy2 - iy1)
area_a = max(0.0, a[3] - a[1]) * max(0.0, a[4] - a[2])
area_b = max(0.0, b[3] - b[1]) * max(0.0, b[4] - b[2])
union = area_a + area_b - inter
return inter / union if union > 0 else 0.0
def evaluate_box_qa(pred: List[Box], gold: List[Box], iou_thresh: float = 0.85) -> dict:
matched_gold = set()
ious = []
tp = 0
for p in pred:
best_iou, best_idx = 0.0, -1
for idx, g in enumerate(gold):
if idx in matched_gold or p[0] != g[0]:
continue
score = compute_iou(p, g)
if score > best_iou:
best_iou, best_idx = score, idx
if best_iou >= iou_thresh and best_idx >= 0:
matched_gold.add(best_idx)
ious.append(best_iou)
tp += 1
fp = len(pred) - tp
fn = len(gold) - tp
precision = tp / (tp + fp) if (tp + fp) else 1.0
recall = tp / (tp + fn) if (tp + fn) else 1.0
f1 = (2 * precision * recall / (precision + recall)) if (precision + recall) else 0.0
return {
"matched_tp": tp,
"false_positives": fp,
"missed_fn": fn,
"f1": round(f1, 4),
"mean_iou": round(sum(ious) / len(ious), 4) if ious else 0.0,
}
def cohens_kappa(rater_a: List[str], rater_b: List[str]) -> float:
assert len(rater_a) == len(rater_b) and len(rater_a) > 0
n = len(rater_a)
p_obs = sum(1 for a, b in zip(rater_a, rater_b) if a == b) / n
counts_a, counts_b = Counter(rater_a), Counter(rater_b)
labels = set(counts_a) | set(counts_b)
p_exp = sum((counts_a[k] / n) * (counts_b[k] / n) for k in labels)
return 1.0 if p_exp == 1.0 else round((p_obs - p_exp) / (1.0 - p_exp), 4)
Operationalizing QA: The 3-Gate Calibration Loop
Metrics only improve your model when they are wired into release gates:
- Gate 1 — Calibration Pilot (50–150 items): Two or more reviewers independently label the exact same edge-case-heavy slice. Compute
mIoU/F1orκ/α. Every disagreement becomes a new visual or textual example inside your annotation guidelines. - Gate 2 — Rolling Gold-Set Injection (5–10% of production): Mix pre-verified gold items blindly into live batches inside CVAT, Roboflow, Encord, or Label Studio so drift is detected per annotator and per class in real time.
- Gate 3 — Pre-Export Schema & Class Audit: Before handoff, run automated scripts to check zero-area boxes, out-of-bounds coordinates, invalid visibility flags, missing rationales, and unexpected class-distribution shifts (paired with our full computer vision QA checklist).
When Low Agreement Signals a Guideline Bug (Not a Bad Annotator)
If three careful reviewers all disagree on the same 15% of items, firing annotators will not fix your dataset. Low inter-annotator agreement is usually a specification bug:
- Two classes overlap semantically (e.g.,
"van"vs."truck", or"minor hallucination"vs."incomplete answer"). - Occlusion rules aren’t quantified (e.g., “label if more than 30% visible”).
- An ordinal LLM rubric uses vague 1–5 scales instead of decomposed yes/no criteria.
Fixing the guideline before scaling saves weeks of relabeling and directly boosts downstream model convergence.
Need a Calibration QA Audit on Your Dataset or Eval Rubric?
AI and ML Network builds written edge-case guidelines, runs calibration pilot batches, and delivers QA-audited computer vision, 3D LiDAR, and LLM evaluation datasets directly inside your preferred workspace. Start your project with a sample batch or schedule a scoping call to define your exact acceptance metrics.