Industries · 7 min read
How to detect metal defects with computer vision, one model across brushed and polished parts
Scratch, dent, crack and pit on a stamping line, the light that shows each, a decision layer that knows the cosmetic face, a new alloy labeled in advance.
Summary
This post takes a stamping line that runs brushed panels in the morning and polished ones after eleven and builds one model for scratches, dents, cracks and pits across both, with the lighting set per finish and a decision layer that knows a cosmetic face from a hidden one. It concludes that a new alloy or finish is the equipment change to label before the changeover rather than after. It is for quality engineers on stamping and finishing lines.
Esdras Ntuyenabo · Engineer · Sep 24, 2026

Stamping line, steel panels on a conveyor passing the inspection station, generated scene with detections from our model
The stamping line runs brushed stainless panels from 6 am and switches to the polished batch at eleven. The inspector at the end of the line tilts each panel under a lamp through the same arc every time. A scratch on brushed steel shows at one angle and a dent on polished steel shows at another, and a scratch that runs along the grain shows at neither until the panel is almost flat to the light.
A camera cannot tilt the panel. What it can do is look at every panel, under light chosen for the finish, and find the same four things the inspector is looking for.
The defects are the same four shapes on every finish
Scratch, dent, crack and pit. Those are the classes on the line, and they are the same classes whether the panel is brushed, polished or painted, because the defect comes from the die, the handling or the coil, and none of those care about the finish. What changes between finishes is the background the defect sits on. A scratch on brushed steel is a line that crosses the grain. The same scratch on polished steel is a line through a reflection of the room.
So the question is whether to train one model or one per finish. My view, and the opposite is a defensible position, is one model on both finishes, with the finish itself as a tag on every frame. A model that has seen a scratch on both backgrounds has learned the scratch. A model that has only seen brushed panels has learned brushed steel with a line on it, and the polished batch at 11 am is a new world to it.
Stampers call the small raised dent left by a fleck of debris on the die a pimple, and a pimple is a dent in the taxonomy even though it goes the other way.
The light is part of the model, and each finish wants its own
The inspector's lamp is at a low angle for a reason: a scratch is a groove, and a groove throws a shadow under raking light. A dent on a polished surface is found differently, as a distortion in the reflection of a diffuse source, which is why the 11 am batch is checked under the big dome lamp at the end of the line rather than the spot.
The camera station copies that. Raking light from one side for the brushed run, a diffuse dome for the polished run, switched with the batch. The frames from each state are kept separate in the training set, so the model never sees a brushed panel under dome light it will not meet in production. Changing the light after the model is trained is the same as changing the camera, and the model has to be told.
Object detection finds the flaw, and the decision layer knows which face it is on
The model puts a box on every scratch, dent, crack and pit, and for scratches and cracks an outline, because the disposition depends on length. That is where the model stops. Whether the panel ships is decided by a layer above it that knows the part: which face is the cosmetic one the customer sees, which is the hidden one behind a trim, and what length of scratch is acceptable on each.
The surface defect detection use case describes that layer: disposition is a severity call, severity is size and location on the part, and only the outline carries the length. On the lines we run the zone map per part is drawn once, from the customer's drawing, and the rule reads the box's position against it before it decides. A scratch the same length on the hidden face and the cosmetic face produces a pass and a rework from one detection.
The rule is written as a sentence, with a severity and a cooldown, approved by the quality engineer before it goes live. A crack anywhere on a panel is critical and stops the conveyor at the station. A scratch on the cosmetic face over the limit is a rework, and it goes to the operator's screen and the line lead's Slack with the frame.
The frames the model doubts go to the inspector at the lamp
A reflection of the overhead light on a polished panel looks like a scratch. A grain line on brushed steel that is a little deeper than its neighbours looks like a scratch. A pit at the edge of the panel may be a pit or may be the edge. These are the frames the model is unsure of, and they go to the inspector with the box drawn and the outline's length beside it, so the inspector tilts that one panel under the lamp and gives a verdict.
The verdict is a label. It is also the signal. When the inspector is overriding the model on the polished batch and agreeing with it on the brushed one, the polished frames are where the next version needs to learn, and the queue has already collected them.
You type the four classes once, Lexi proposes the boxes and outlines on frames from both runs, and the inspector checks them against the customer's acceptance criteria before anything trains. On a line like this the inspector's check is where the difference between a pimple and a pit gets written into the model.
A new alloy or finish is the equipment change to label before changeover
The failure that arrives on a known date is the new material. Procurement moves to a different coil supplier, or the customer asks for a satin finish, and the panels on the line in March look different from every panel the model has seen. Detections collapse on the new batch and hold on the old, and the boundary is the material rather than a camera or a day. The drift catalog calls this the equipment changed, and its advice is the useful kind: the changeover date is known months ahead, so label the new material from a trial run before the line switches rather than after.
LexData takes the stamping model through its whole life. You type what to look for, Lexi puts a box on every frame, and a person checks each label before anything trains on it. The model then watches the station camera the line already has, in the cloud, on your servers, or on a runner beside the recorder. Frames it is unsure of come back to a person, the corrections retrain it, and the new version replaces the old one with no downtime. That is how 99%+ accuracy is maintained in production on the manufacturing lines behind our numbers, across a coil change and a finish change.
The inspector keeps the lamp
The station does not retire the inspector. It changes what reaches the lamp: the panels the model doubted, a handful on the 6 am shift, instead of every panel for a few seconds each. The inspector's verdict on those panels is what keeps the model's idea of a scratch the same as the customer's, and it is the reason the model on the polished batch at eleven is still right in April, when the satin batch arrives.
See it on your own footage.
Start with your footageMore in Industries

Industries · 6 min read
AI visual inspection as the nondestructive testing step a camera can take over
Visual testing is the first NDT gate, its acceptance criteria are already written, and a camera can apply them to every weld instead of one in twenty.
Rob Hickey · Sep 24, 2026

Industries · 6 min read
Appearance inspection systems that judge scratches, chips and burrs the same way on every shift
The station, the light and the written standard matter more than the model. The outlines carry the limit, and a tightened tolerance makes every label wrong.
Rajiya Sultana · Sep 24, 2026

Industries · 7 min read
Automated pallet accounting from the camera over the staging zone
A polygon on the frame, every pallet tracked so it is counted once, entries and exits as the ledger, and a wash-down that nudges the camera as the failure.
Andreas Ohrvall · Sep 24, 2026