Case Study: Visual Defect Detection on a Production Line
"Cameras photograph every part on the line. Flag defects — but you have thousands of good parts and almost no labelled bad ones, and the line runs at 60 parts a minute" is the interview prompt behind every industrial visual-inspection system: electronics assembly lines checking solder joints, automotive plants checking stampings and welds, pharma lines checking blister packs and vials. The buyer is a manufacturer whose current alternative is a human inspector standing at the line, whose attention degrades within the first hour of a shift and who costs real wages for a job that never stops; the failure modes on both sides of that human are expensive — a defect that reaches a customer (an escape) can mean a warranty claim, a recall, or a safety incident, while a good part wrongly thrown away (scrap) burns material and rework labour for nothing. Vendors like Landing AI have built a public product positioning — "small data," a few hundred images per part instead of the tens of thousands a general-purpose vision model needs — directly around the structural fact that sits at the centre of this case: you will never have a representative labelled sample of what "defective" looks like, because defects are rare by definition and the ways a part can go wrong are open-ended.
This subject is the block's detection-not-generation case and its edge case, and both facts are worth stating up front because they invert almost everything the rest of this series has assumed. generative-adversarial-networks-and-face-generation, text-to-image-diffusion-models and every business case built on them so far — virtual try-on, generative fill, product photography, super-resolution, synthetic data — all ask a generator to produce pixels a human or a downstream model will accept. Here, nothing is generated in production at all; the model's only job is to say how far a real, camera-captured part sits from what "normal" looks like, and pixel-level realism is not merely a secondary metric, it is not a metric at all. The generative vocabulary this case study still needs — GAN training dynamics, the failure-mode ladder, reconstruction versus feature-based approaches — earns its place because one of the two viable modelling families for this problem is generative (the GAN learns the manifold of normal parts and reconstruction error against that manifold is the anomaly signal), while the field's current pragmatic favourite is not generative at all.
This subject follows the same seven-step case-study framework case-study-fraud-detection uses, and reuses that subject's decision-policy framing almost directly — asymmetric costs, an operating-point table, a threshold derived from an expected-cost inequality — because "escape cost vastly exceeds false-reject cost, but false rejects are not free" is structurally the same shape as "fraud loss vastly exceeds false-decline cost, but false declines are not free." It leans on generative-adversarial-networks-and-face-generation for GAN vocabulary and on case-study-synthetic-data-generation-for-computer-vision for synthetic-defect generation rather than re-deriving either. Aim to deliver the full answer in about 40 minutes, then use the follow-up questions to pressure-test it.