The runtime trust layer between the vision model and the actuator
A 97% lab model can hit a 14% false-reject rate in production, not because the model got worse but because glare, cold dies, and shift changes walked the inputs out of the distribution it was validated on. The Inspection Trust Gate checks every image against the model's validated envelope, applies deterministic gates the model cannot override, holds anything out-of-envelope for human review, and writes a per-part audit lineage record. Agents advise, code decides.
0
Drifted good parts auto-scrapped by the gate
Naive baseline false-rejects 95.5 to 100% (MVTec metal_nut held-out split)
93/93
Defective parts under drift still caught or escalated
Never auto-passed (same held-out split)
1.00
Envelope AUROC on a held-out drift family
Never tuned against it, so the check is not circular (MVTec metal_nut held-out split)
This is a runnable demo. The PLC actuator and MES sink are simulated adapters that log what they would do, the part images are real MVTec AD metal_nut photographs, and the drift is honest image corruption applied to real good photos.
The failure mode that stalls edge inspection deployments is an input failure, not a model failure.
The canonical case from our research is a 200-ton progressive die press running 40 strokes per minute: a vision model that hit 97% accuracy in validation collapses to a 14% false-reject rate in production. The model did not get worse. Overhead bay-light glare varies per stroke angle, lubricant pools differently on warm and cold dies, and the first 50 parts of a shift arrive before thermal equilibrium. The inputs left the distribution the model was validated on, and no model, at any accuracy, is trustworthy there.
The industry pattern says the model was never the project. Out-of-box AOI systems false-reject 5 to 15% of good parts, while well-tuned systems get under 2%: a calibration and data problem, not a model architecture problem. Integration is 60% of a deployment's timeline and model training 15%, and 84% of system integration projects fail or partially fail.
Regulation raises the stakes. The EU AI Act's high-risk obligations, which cover safety-critical quality decisions under Annex III, are fully applicable from August 2, 2026, with maximum fines of 35 million euros or 7% of global turnover for the most serious, prohibited-practice violations. A reject actuator that fires on an unvalidated model verdict, with no record of why, is exactly what that regime is designed to expose.
The fix is not a better model. Even a perfect model is only valid on inputs inside its validated envelope. What the line needs is a runtime layer that knows that envelope, refuses to actuate outside it, and can prove, part by part, what it decided and why.
A deterministic gate decides what actuates, not a model and not an LLM.
Every part runs the same pipeline:
image → physical + texture features → envelope check (OOD) → defect verdict → deterministic gate → actuate / hold → audit record
An EnvelopeDetector computes Mahalanobis distance in physical-signal space (exposure, contrast, dynamic range, focus, high-frequency detail, thermal colour cast, saturation, glare fraction), fit on 220 train-good images. It answers one question: is this image inside the capture conditions the model was validated on? Out-of-envelope means no model output is trusted.
Plain code, outside any LLM, that the model cannot override: calibrated confidence thresholds fitted from the demo's own data (auto-pass below 0.948, auto-reject above 1.30) and a hard 750 ms stroke-window latency budget. Each part routes to AUTO_PASS, AUTO_REJECT, or HOLD, which sends it to a human escalation queue.
Every decision writes a JSONL record: part id, station, model id and version, dataset hash, defect confidence, OOD score, physical signals, the gate rules that fired, latency against budget, actuation and MES logs, and the risk tag high-risk:quality-gate (EU AI Act Annex III, eff. 2026-08-02). One click exports the shift.
The demo's DefectDetector is a kNN distance to train-good parts in texture space (PatchCore-lite), standing in for your NVIDIA Metropolis, Cognex, or custom model behind a fixed interface. It is a real working stand-in (AUROC 0.845 on clean good versus defect), reported honestly, and the product claim never rests on it. The durable value is the layer around it: drift-gating, provenance, and governed actuation hold at any model accuracy, so the layer survives every model upgrade.
When parts pile up in the HOLD queue, an agentic Drift Triage pair explains why: a diagnosis agent reads the ranked physical-signal deviations of the held parts and proposes a root-cause hypothesis with a recommended action, and a critic agent verifies that hypothesis against the numeric evidence, downgrading it to manual investigation if the cited signal is not actually the dominant deviation. The agents are built on Pydantic AI and are provider-swappable; with no API key configured, triage falls back to a deterministic template so the whole demo runs offline. Either way, the agents only advise. The gate has already decided.
A scripted shift on station Line 3, replayed over real MVTec AD metal_nut held-out test parts. Every image below is a screenshot of the running app.
Before the drift, clean good parts auto-pass with time to spare: the shipped audit log shows part test-good-288 at 37.7 ms and test-good-289 at 24.4 ms against the 750 ms stroke-window budget, each with a full lineage record. The dashboard shows the live decision pipeline per part, with each stage's measured wall-clock and the evidence behind its output.
Then the scripted marker fires: SHIFT CHANGE 06:00, cold dies, bay lights on. Twelve held-out good parts arrive corrupted with glare, defocus, and thermal cast (honest image corruption applied to real good photos, labeled as such in the app). The envelope monitor goes red. The gate holds every one of them for human review instead of letting the actuator fire on a verdict the model was never validated to give.
The comparison panel runs the identical parts through the naive no-envelope baseline and the Trust Gate. The baseline false-rejects the drifted good parts; the gate auto-scraps 0 and holds them, driving the false-reject KPI from 57.1% to 0% in this scripted shift. A projection panel extrapolates the measured naive false-reject rate to a full shift (40 strokes per minute over 8 hours is 19,200 parts) at $2.42 per part, a sourced order-of-magnitude scrap cost (cookie-manufacturer case: $94K annual savings from an 8.7% scrap-waste reduction). The dollar figure is always a labeled projection, never a measured saving.
Drift-gating would be worthless if defects hid under it. A real gross structural defect (MVTec class flip, part test-flip-264) auto-rejects, and the simulated actuator logs REJECT actuated in 25 ms against the 750 ms budget. The geometry drill-in states that nothing was localised on this part: the reject rests on texture confidence alone, and the zone rule fell back to its centre default. Showing that text is deliberate. The demo displays the rule abstaining rather than pretending. Across the whole held-out split, defective parts injected during drift are still caught or escalated, 93 of 93, never auto-passed.
Click any part and the audit drawer shows its full lineage record: model id metalnut-defect-knn version v7, dataset hash ae95b5b533c8, OOD score, physical signals, the rules that fired, latency against budget, the actuation and MES logs, and the risk tag high-risk:quality-gate (EU AI Act Annex III, eff. 2026-08-02). Export Audit downloads the shift as inspection_audit.jsonl; audit completeness is 100% of decided parts on the held-out split. Run Drift Triage and the diagnosis agent proposes a root cause for the held parts while the critic agent verifies it against the numeric evidence before it earns a verified badge.
All measurements come from the demo's benchmark script on the MVTec AD metal_nut official held-out test split (220 train-good fit images; 22 good and 93 defective test parts), comparing the naive no-envelope baseline against the Trust Gate on the same images. The baseline false-rejects 95.5 to 100% of drifted good parts per drift family (average 98.9%); the gate auto-scraps 0.0% and holds 100% of them. The envelope detector scores AUROC 1.00 on a held-out drift family (underexposure) it was never tuned against. The corruptions are full-strength, so the baseline's collapse is near-total by construction: the honest claim is the direction, a clean-validated model collapses once inputs leave the envelope, not the exact percentage. These are demo measurements on a research benchmark, never open-world guarantees.
The same comparison the demo runs live, on the same parts.
| Dimension | Naive AOI (no envelope check) | Inspection Trust Gate |
|---|---|---|
| Out-of-envelope inputs | Model verdict trusted anyway | No model output trusted; part HELD for review |
| Drifted good parts (glare, defocus, thermal cast) | 95.5 to 100% false-rejected per drift family | 0 auto-scrapped; 100% held (MVTec metal_nut held-out split) |
| Who fires the actuator | The model's verdict, directly | A deterministic gate the model cannot override |
| Latency accountability | None | Hard 750 ms stroke-window budget, measured per part |
| Audit trail | None | Per-part JSONL lineage record, exportable per shift |
| When the line drifts | Scrap piles up until someone notices | Escalation queue plus advisory Drift Triage (diagnosis agent, critic agent) |
Usually because the inputs drifted, not because the model got worse. Bay-light glare, cold dies, and the first parts of a shift before thermal equilibrium move images outside the distribution the model was validated on, and no model is trustworthy on inputs outside its validated envelope. A 97% lab model hitting a 14% production false-reject rate on a stamping press is the canonical example. The durable fix is a gate that detects out-of-envelope inputs and holds those parts for review instead of actuating.
No. The Inspection Trust Gate wraps your model behind a fixed interface; in the demo the defect detector is a deliberate stand-in for an NVIDIA Metropolis, Cognex, or custom engine. The product is the layer around the model: the envelope check, the deterministic gate, the escalation queue, and the audit lineage. That layer keeps earning its keep through every model upgrade, because the failure it prevents is an input failure, not a model failure.
The gate is plain code with a hard latency budget: the reject decision must land inside the 750 ms stroke window of a press running 40 strokes per minute. In the demo's shipped audit log, decisions land in tens of milliseconds, for example 24.4 ms and 37.7 ms against the 750 ms budget, and the dashboard reports the live p99. These are demo measurements, not a production guarantee, but the budget is enforced per part.
Safety-critical quality decisions fall under the Act's high-risk obligations (Annex III), fully applicable from August 2, 2026, with maximum fines of 35 million euros or 7% of global turnover for the most serious, prohibited-practice violations. The demo writes a per-part lineage record: model id and version, dataset hash, OOD score, the rules that fired, latency against budget, actuation log, and the risk tag, exportable as JSONL. That record is designed to be filable evidence for a high-risk conformity file; it is not a certification.
No. Actuation is decided by a deterministic gate: fitted confidence thresholds and a latency budget in plain code that no model output and no LLM can override. The agentic part, Drift Triage, is a diagnosis agent plus a critic agent that explain why the line drifted; they advise and never actuate. With no API key configured, triage degrades to a deterministic fallback and the whole demo runs offline.
That is the independence check we ran: the envelope detector scored AUROC 1.00 on a held-out drift family (underexposure) it was never tuned against, measured on the MVTec metal_nut held-out split. It is fit on 220 known-good images in physical-signal space, so it flags capture drift that moves those signals, not just the drift families we built. The corruptions are full-strength, so the separation is stark by construction; the honest claim is the direction, not the exact percentage.
A runnable demo that proves the mechanism. The EtherNet/IP to Allen-Bradley ControlLogix reject actuator and the MES sink are simulated adapters that log what they would do, and the camera is a recorded stream of real MVTec AD metal_nut photographs; the drift is honest image corruption applied to real good photos. The envelope check, the deterministic gate, the escalation queue, and the audit export are real and run exactly as shown, and every headline number is measured on the MVTec metal_nut held-out test split.
The research behind this demo — the architecture, the verification design, and the enterprise blueprint.
The trust layer between the model and the actuator is the hard part. We build it.
If your team is wrestling with false rejects after every shift change, or with what the EU AI Act's high-risk obligations mean for a line that decides at 40 strokes per minute, we would genuinely like to hear how you are thinking about it. The problem is industry-wide and the answers will be too.