MAI study materials
MAI study resources

Edge Vision Defect Detection Under Cost Asymmetry

MAI · Put your knowledge to work in context.

All case studies

Edge Vision Defect Detection Under Cost Asymmetry

A manufacturer wants visual defect detection on six assembly lines. Each line produces one part every 1.8 seconds and has four cameras. The defect rate is 1.2%; a missed defect that reaches a customer costs about $25,000, while a false reject costs $6 in scrap and labor. A pilot model reaches 0.91 recall at 0.78 precision on held-out images. Cloud inference takes 600 ms round trip; the line PLC can tolerate 200 ms. The plant network drops for 10-30 minutes about twice a week. A new supplier changed the surface finish last month, and the model's recall on the new parts fell to 0.74. IT wants a central GPU cluster; operations wants no stoppages. The pilot used images from two lines collected over eight weeks.

1. Recommend a deployment architecture. Compare edge and cloud against the latency, availability, and operating constraints.

Read the worked answer

Cloud-only inference is not viable for the line control loop. A 600 ms round trip exceeds the 200 ms PLC tolerance, and the network already drops for 10-30 minutes twice a week. If inference is unavailable, the line must not silently pass parts.

The practical architecture is plant-local or line-local edge inference with cloud support. Put a GPU-equipped industrial PC at the line or plant cell, run the model locally, and return a decision within the cycle budget. Use the cloud for training, model registry, experiment tracking, fleet monitoring, and dashboards, not for the real-time decision. Design a fail-safe: if the edge node or camera fails, route parts to manual inspection or stop the line according to a defined quality rule; never default to pass. Buffer images locally for retraining and audit.

IT's central-cluster preference may reduce hardware management, but it does not solve the network dependency unless the plant has a reliable low-latency local network and a documented failover. A hybrid design gives central governance with local autonomy. The pilot's two-line, eight-week dataset is too narrow to justify plant-wide rollout without line-specific validation.

2. Given the cost asymmetry, how should the operating threshold be set? Show the reasoning and note the operational constraint.

Read the worked answer

The cost ratio is about 25,000 to 6, roughly 4,167 to 1. At a 1.2% defect rate, missing one defect costs as much as thousands of false rejects. A threshold chosen to maximize precision or overall accuracy would be wrong.

Use expected cost per 10,000 parts. At 1.2% prevalence there are 120 defective parts. At 0.91 recall, about 109 are caught and about 11 are missed. At 0.78 precision, the 109 true positives imply about 31 false positives. Cost is approximately 11 x $25,000 = $275,000 for misses plus 31 x $6 = $186 for false rejects. The misses dominate completely. The threshold should be lowered to increase recall until the marginal cost of additional false rejects approaches the marginal benefit of avoided misses, which will occur at a very low threshold. The binding constraint is likely operational: the line and inspectors can only handle so many false rejects, and low-confidence parts can be routed to a second inspection rather than scrapped.

The threshold should be set per line and per material. The new supplier's 0.74 recall means the global threshold is invalid for those parts. Recompute on new-surface validation data, and if recall cannot be restored, require 100% manual inspection for that material.

3. Design a rollout and drift plan for six lines and a changing supplier base.

Read the worked answer

Roll out in stages. First, run shadow mode on each line while operators inspect normally, collecting at least several weeks of line-specific images and comparing model decisions with ground truth. Include the new supplier's surface finish and any planned material changes. Acceptance criteria should be line-specific: for example, recall at the chosen threshold on a challenge set that includes rare defect types, false-reject rate within the line's handling capacity, p95 decision latency under the PLC budget, and a tested fail-safe.

Deploy one line at a time with a rollback plan and a human review queue for low-confidence parts. Monitor input drift using image statistics and camera diagnostics, prediction distribution, false-reject rate, and escaped defects. Establish an onboarding gate for new suppliers: collect a minimum sample, test the existing model, and either fine-tune or add a material-specific model before production. Retrain on a schedule and on triggers such as a recall drop below the line target or a new defect mode. Keep a frozen challenge set that includes historical and new surfaces so improvements are not measured only on the latest data.