A single [email protected] score summarises the whole precision-recall curve across every confidence level and every class, so it says nothing about the one operating point your line actually runs at. The threshold that sets your miss rate and your false-call rate should be chosen from the per-class curve, frozen before validation, and then kept valid as parts, equipment and the model change. Calibrating that threshold is an ongoing governance process across the model’s life, not a qualification event you complete once.
The same reasoning shapes what monitoring ML models in production means on an inspection line. The aim is not a dashboard that stays green. The aim is a loop that notices when the threshold you signed off no longer produces the miss and false-call rates you signed off for.
What does a vendor’s [email protected] tell you about defects slipping through per shift?
On its own, very little: misses and false calls per shift depend on the precision-recall curve for the defect classes and sizes you care about, read at the confidence threshold you will run.
Here is how the headline number is built. For each class, the detector’s predictions are ranked by confidence, precision and recall are computed at each step down that ranked list, and the area under the resulting curve is that class’s average precision (AP). mAP averages AP across classes, and “@0.5” means a predicted box counts as a hit when it overlaps the ground-truth box by at least 50% intersection-over-union. Because AP is an area, it integrates over every possible confidence cut-off instead of describing any single one.
Averaging is where the danger sits. A rare or small class, such as thin metal fragments, can perform badly underneath well-performing classes and barely move the mean. The 2026 CellDX AI Autopilot paper makes the related point for imbalanced classification: a high AUROC can coexist with poor detection of the minority class, which is why it reports precision-recall AUC. So ask the vendor for precision-recall curves broken out per class and per size bucket, not a single mAP. A vendor that will only give you the number is asking you to trust an average where your risk lives in the tails.
Picking the operating point from the curve
The translation into per-shift terms is arithmetic once you have the curve. Expected escapes per shift equal (1 − recall at the chosen threshold) × the number of real defects of that class passing per shift. Expected false calls per shift follow from precision at that threshold and the number of detections it produces. Both calculations also need your own line’s defect base rate.
Choosing the threshold is a trade-off you make on purpose. Lowering it cuts misses and raises false alarms and line stoppages, and raising it does the opposite. The sensible way to work through it:
- Set the acceptable miss rate for each critical defect class (a missed metal fragment and a missed cosmetic scratch do not cost the same).
- Set the false-call rate the line can absorb without hurting throughput or flooding manual re-inspection.
- Read the candidate thresholds off the per-class curves that meet both limits. Where no single threshold meets them, consider per-class thresholds.
- Confirm those candidates on a known-defect challenge set, with seeded critical and cosmetic defects that match your product stream, and measure the miss and false-call rates you actually get before sign-off.
Step 4 matters because the curve you were shown may not hold on your parts.
How do we know the threshold wasn’t cherry-picked on the data we tuned it on?
Fix the threshold first, then measure it once on an independent holdout set that played no part in tuning. A small gap between tuning-set and holdout performance at that threshold is what we look for as the sign that the operating point generalises and is not an artefact of the data used to pick it.
TechnoLynx builds this into a Production AI Monitoring Harness: it separates tuning data from confirmation data strictly, adds a pre-commitment step that records the threshold before the holdout is touched, and reports the generalisation gap on the independent holdout.
The CellDX Autopilot work enforces a stratified train/validation/test split and uses the validation set for hyperparameter tuning, early stopping and checkpoint selection, while the test set is held out and reported once, on the final selected checkpoint. “Reported once” is the important part. Researchers behind the reusable holdout show that reusing a holdout set to validate adaptively chosen hypotheses can overfit to the holdout itself. Their mechanism (Thresholdout) returns only confirmation when holdout and training estimates agree, and a noise-perturbed training estimate when they do not.
We recommend a simple decision rule. Agree on a gap tolerance before the holdout is opened, and accept the threshold only if the measured gap falls inside it. If the gap is large, re-tune on a larger or re-split dataset rather than talking yourself into the original choice.
Three caveats keep this honest:
- The holdout must be truly unseen, including by “just one more look” during manual threshold tweaking.
- A small holdout gives a noisy gap estimate, especially for rare defect classes.
- A clean gap on one season’s or one product mix’s holdout does not guarantee robustness to later shifts, which is what the monitoring below is for.
What has to be logged and frozen before the validation results are unblinded?
Log the search space, the selection rule, how many configurations were tried, the final configuration and the operating threshold. Lock all of them in an audit-trailed store before anyone sees the validation batch results. That ordering is what makes the sweep read as prospective evidence instead of retrospective tuning.
A Sakara Digital article on validating AI in GxP environments makes the same demand of AI systems in general: acceptance criteria must be defined before testing begins, and performance qualification must show the model performing acceptably across a representative range of real-world conditions. The same article treats data management as a first-class validation concern, including showing that data used for ongoing evaluation is independent of training data. Research practice shows the same habit: one label-free drift-detection study fixed all detector hyperparameters before evaluation and held them constant across every experimental scenario.
In practice the freeze record should contain:
- the hyperparameter search space and why each range was chosen;
- the selection criterion and stopping rule;
- the number of configurations actually run, including abandoned ones;
- the final configuration (learning-rate schedule, augmentation settings, model version and weights hash) and the operating threshold;
- a timestamp, plus the identity of whoever locked it.
Where the record lives matters as much as what it holds. A model registry or experiment tracker such as MLflow keeps versioned runs, but a timestamp only proves anything if the store is append-only or audit-trailed and access to it is controlled. Without that, the timestamp is a claim, not evidence.
The sweep’s size also matters. An enormous search space undermines the prospective claim even if every run was logged before unblinding, because with enough configurations one will look good by chance. Bound the number of configurations and the selection criterion, disclose both, and confirm early what the reviewing body expects of them.
Explaining the freeze to a reviewer who does not work in ML
A reviewer without a machine-learning background needs a short protocol summary in plain language, not the sweep log. The summary should state what was searched, why, when the search was frozen, and that no tuning happened after the freeze.
Four items belong in the main document:
- Search space: the parameters varied and their ranges, in a sentence each.
- Selection rule: how the winning configuration and threshold were chosen, and when the search stopped.
- Freeze point: the exact date or trigger condition, traceable to a specific log entry.
- No-change statement: an explicit confirmation that nothing was adjusted after the validation batch was opened.
The full raw sweep log (every trial and score) belongs in an appendix, supplied when the reviewer asks for traceable detail. In the main narrative it adds volume without adding anything a non-ML reader can assess, and it can bury the one claim that matters, which is the freeze point. The opposite risk is real too. A summary that is too smooth can hide a late or informal freeze, so the freeze date must be unambiguous and point to a record the reviewer can inspect.
How often should AOI thresholds be recalibrated once the line is in production?
Use a fixed requalification cadence as the baseline and add event-triggered checks on top. Define both before the pilot becomes a production line, because a cadence invented after the first false-reject spike is a reaction, not a plan.
The published cadence cited here is not AOI-specific: a Sakara Digital article on validating AI in GxP environments describes formal periodic reviews typically run quarterly or semi-annually, depending on risk category, to decide whether the validated state is still current. On an inspection line, our view is that the interval should follow how fast your inputs actually move. Too long a gap lets drift accumulate unseen, and too short a gap costs line time for requalification that finds nothing. We would use a Gauge R&R style requalification on a fixed set of reference parts as the baseline, because it asks whether the system’s measurement variation is still acceptable. It does assume you keep stable golden parts available on the line.
Events that should trigger an out-of-cycle check
The same article lists the conditions a validation plan should name as revalidation triggers. Performance metrics falling below defined thresholds for a sustained period; significant changes to input data sources or data quality; model retraining events, meaning any update to weights or parameters; changes to production infrastructure that could affect model behaviour; and changes to regulatory guidance. On an AOI line those map onto concrete events:
- a camera, lens, lighting or firmware change, which we treat as an input-source change;
- a line-speed change, which affects motion blur;
- a new product variant or a seasonal catalogue change;
- equipment wear in fixtures, conveyors or optics;
- any model update or re-quantisation, which changes model weights or parameters.
Drift also takes different shapes. A research comparison of open-source drift tools describes abrupt drift, such as a new sensor installed with different calibration parameters; incremental drift, such as a sensor whose accuracy degrades slowly; and recurring drift that follows seasonal patterns. Event triggers catch the abrupt kind, the cadence catches the recurring kind, and only continuous monitoring reliably catches the slow kind. For how this looks when the whole inspection deployment is examined end to end, see our reliability audit of an industrial CV inspection deployment.
How does monitoring ML models in production work in practice?
A monitoring system for a deployed model does four things. It registers the model and how it should be monitored, stores inference features, predictions and (where available) ground truth, computes metrics on model behaviour, and evaluates those metrics to trigger actions such as alerts, reports or retraining. Researchers describe the same idea as a feedback control loop. The deployed model is the system under observation, and a drift detector observes it and decides when its learned assumptions no longer hold.
This is what separates model monitoring from monitoring a conventional system. A traditional validated system stays valid until someone changes it, whereas an AI system’s performance can degrade with no change to the system at all, simply because production data has moved away from the training data. Latency and error-rate dashboards do not measure that shift. A further challenge is monitoring prediction quality in the absence of labels. On an AOI line that means watching confidence-score distributions, input statistics and operator review outcomes alongside the usual service health. Our guide to ML model performance monitoring and what to track covers that wider metric set.
How do you detect data drift and concept drift in a deployed detector?
Detection starts by comparing recent production data against a reference distribution taken from training or validation data. What you can detect without labels depends on the kind of drift. The open-source tools comparison separates covariate drift (changes in the inputs), prior probability drift (changes in the target), concept drift (a change in the relationship between inputs and target), and dataset shift, where the joint distributions differ without any of the other three.
Covariate drift is detectable without labels. IBM Research’s monitoring framework compares training-time and production distributions of features and predictions using variants of the Kolmogorov-Smirnov test and the Bhattacharyya coefficient. The ML Health framework scores how far incoming features deviate from training. It argues that a surge in a category the model rarely saw during training is more worrying than a surge in a well-covered one. For an AOI line, that means a new variant, or a defect type that was thin in the training set, deserves a more sensitive alarm than routine volume swings. Drift detection differs from outlier detection, which flags individual inputs that fall outside the training distribution.
Concept drift is the hard case. NannyML’s confidence-based performance estimation (CBPE) stays accurate under data drift as long as P(Y|X) is unchanged and the model’s probabilities remain well calibrated. It does not work under concept drift, and NannyML states that, except in very specific cases, concept drift cannot be identified without ground truth. If a scratch that used to pass now counts as a reject because the customer tightened the spec, no label-free statistic will tell you. Only reviewed outcomes will.
Should recalibration be triggered by time, volume or detected drift, and who runs it?
Detected drift should be the primary trigger, with elapsed time or processed volume kept as a backstop minimum check, and one named owner responsible for running the check and acting on it. A model update or a new product variant can invalidate a calibrated threshold without any alarm on the service itself.
TechnoLynx delivers this as part of a Production AI Monitoring Harness: drift statistics wired to the locked operating threshold, a recalibration trigger when they cross agreed limits, and a time-based backstop for slow shifts.
A study of label-free concept-drift detectors uses an expected-utility score to trigger retraining. Its authors set the drift decision threshold at 0.5, the midpoint of a bounded utility score. They stress that this threshold is not an internal tuning constant but a reliability/cost operating point: a lower value flags drift more readily in favour of reliability, and a higher value signals retraining more conservatively in favour of cost. Because the score is bounded and label-free, the pipeline can set and adjust that operating point online against its retraining budget and accuracy target, without ground truth. The study contrasts this with classical detectors, whose window sizes and sensitivity thresholds are not tied to a reliability/cost axis and must be re-tuned for each deployment. The detection threshold on the monitor deserves the same deliberate choice you made for the detection threshold on the parts.
Ownership is not a footnote. The same study’s detectors raise the retraining alarm but neither retrain nor decide how much post-drift data to collect, leaving those actions to the surrounding MLOps pipeline. Someone has to own that hand-off, and the role should be named in the validation documentation rather than assumed to sit with whoever is on shift. Three caveats apply. The drift detector’s own threshold needs domain knowledge so normal variation does not fire it. A model update is listed as a revalidation trigger separately from performance thresholds. And keep the time backstop: the same study notes that drift usually unfolds over hours to months.
How do you set alert thresholds that catch degradation before customers notice, without flooding the team?
Set each alert threshold on operational consequence, not statistical significance alone. Production and reference distributions are expected to differ, so the useful question is whether the distance is large enough to warrant an alert. That framing comes from Google’s TFX data validation work. Get it wrong in the noisy direction and the alerts get ignored. In Shankar and colleagues’ 2022 interview study of ML engineers, a surplus of false-positive alerts led to fatigue and to alerts being silenced, which risked missing real performance drops.
Tool defaults give you a place to start, not an answer. A 2026 OneUptime guide reads the Population Stability Index (PSI) as no significant change below 0.1, moderate change between 0.1 and 0.2, and significant change above 0.2. The open-source tools comparison reports that Evidently AI’s statistical tests alarm below a 0.05 threshold and its distance metrics alarm above 0.1. Evidently’s documentation confirms a 0.1 default threshold for its distance and divergence metrics. Evidently can also require a share of variables to drift before it alarms, raising the alarm when more than half have shifted, and it lets high-impact variables carry more weight.
Seldon’s researchers note that alert thresholds need domain knowledge to keep false alarms down, and that change-point detection may prove more robust than fixed thresholds. We would set two levels tied to actions: a warning that sends the owner to investigate, and a critical level that forces requalification on the challenge set. Each level should be calibrated against what a real escape or a stopped line costs. The service-level framing helps here too. If an image pipeline has an accuracy objective and misses it, the pipeline is broken by definition, which removes the arguing.
How do human-in-the-loop review signals (reject rates, escalations) feed back into monitoring?
Concept drift cannot be identified without ground truth, so treat operator reviews as delayed ground truth, not as a side log. Every flagged part an operator confirms or overturns gives you an observed precision at the locked threshold. Every defect found downstream that the AOI passed is an escape, which is evidence about recall. Escapes in particular arrive late. The interview study found that feedback delays make it hard to know precisely when a model is underperforming. Plan for this by recording reviewed outcomes against the model version and threshold that produced them, and by comparing the rolling operator-confirmed false-call rate with the baseline from validation. One symptom deserves an immediate look: the same study saw a large gap between offline validation accuracy and production accuracy straight after deployment, which signalled unnatural data drift.
Signal, threshold and response for an AOI threshold monitor
| Signal | Threshold | Response |
|---|---|---|
| PSI on the detector’s confidence-score distribution | Warning at 0.1, critical above 0.2 as starting bands, tuned to the line | Warning: owner investigates. Critical: requalify on the challenge set |
| Distance on input statistics (brightness, contrast, embeddings) | 0.1 as a default starting point for distance metrics | Check for camera, lighting or variant changes before touching the threshold |
| Operator-confirmed false-call rate | Agreed tolerance around the validation baseline | Sustained breach triggers revalidation |
| Challenge-set recall per critical defect class | Acceptance criterion fixed before validation | Below criterion: stop relying on the threshold and recalibrate |
| Hardware, line-speed, variant or model change | Any occurrence | Out-of-cycle requalification |
| Periodic review | Cadence set by risk category | Formal check that the validated state is still current |
A minimal Python example of monitoring a detector in production
The sketch below shows the mechanism, with its assumptions stated as assumptions. It assumes each seeded defect in the challenge set carries the highest confidence of any detection matched to it, or zero if none matched. The locked threshold and per-class recall criteria are read from the frozen registry entry, never hard-coded. The PSI bands are the starting values cited above. PSI here is the standard formula: the sum, over bins, of (current share − reference share) × ln(current share / reference share).
import numpy as np
def psi(reference, current, bins=10, eps=1e-6):
"""Population Stability Index between two confidence-score samples."""
edges = np.quantile(reference, np.linspace(0, 1, bins + 1))
edges[0], edges[-1] = -np.inf, np.inf
ref = np.histogram(reference, edges)[0] / len(reference) + eps
cur = np.histogram(current, edges)[0] / len(current) + eps
return float(np.sum((cur - ref) * np.log(cur / ref)))
def recall_at(scores, threshold):
"""Recall on seeded defects: share whose matched confidence clears the threshold."""
scores = np.asarray(scores)
return float((scores >= threshold).mean()) if scores.size else float("nan")
def check_window(frozen, ref_scores, prod_scores, challenge):
"""frozen: registry entry with 'threshold', 'min_recall' per class, 'owner'."""
actions = []
drift = psi(ref_scores, prod_scores)
if drift > 0.2:
actions.append(("requalify", f"PSI {drift:.3f} above critical band"))
elif drift > 0.1:
actions.append(("investigate", f"PSI {drift:.3f} in warning band"))
for cls, scores in challenge.items():
r = recall_at(scores, frozen["threshold"])
if r < frozen["min_recall"][cls]:
actions.append(("requalify", f"{cls} recall {r:.3f} below criterion"))
return {"owner": frozen["owner"], "psi": drift, "actions": actions}
Two design choices carry the argument of this article. The function never edits the threshold, it only reports against it, because changing the threshold is a governed decision with its own record. And every action is addressed to a named owner, because an alert with no owner is the one most likely to be silenced. For production use, run the same logic as a scheduled job that writes results to an experiment tracker. It sits beside the per-class challenge-set run you repeat at each requalification.
Who can build threshold monitoring and recalibration for our AOI line, and should we do it in-house?
TechnoLynx builds the monitoring and recalibration layer that keeps an AOI detection threshold valid after sign-off: drift statistics tied to the locked operating point, challenge-set requalification, event and time triggers, and a named-owner workflow. On build versus buy, the work is mostly evaluation discipline and pipeline engineering, so a team that already runs strict holdout separation and has a clear owner can build it in-house. A specialist earns their place when the threshold has to be defended to a customer or a reviewer, or when several lines and model versions need one consistent monitor. When choosing a partner, ask how they keep tuning data separate from confirmation data and what their monitor does when it fires. TechnoLynx delivers this as its Production AI Monitoring Harness, part of its wider AI engineering for manufacturing and automotive.
The scope has limits. This is reliability engineering for systems in production, delivering eval harnesses, regression suites and drift detection rather than a dashboard. If you need formal sign-off for a regulated submission, a validation consultancy with standing in that regime is the right route, and the monitoring evidence described here feeds into its package. If your AOI vendor’s own tooling already exposes per-class curves and drift alerts you can configure, start there and add only what is missing.
The part the interview study found unsolved is the monitor’s own threshold. None of the participants in Shankar and colleagues’ study reported having solved the problem of choosing alert criteria that catch real performance drops without false alarms, or of making those criteria tune themselves as data drifts. That is why the alerting threshold deserves the same discipline as the detection threshold: choose it from the trade-off you can tolerate, write it down before you see the results, and revisit it on a schedule and whenever the line changes.