Skip to content
LexDataLexData
PlatformIndustriesCustomers
DocsThe Field GuideBlogWhy models drift
AboutCareersSecurityContact
Log inStart now
← All posts

Industries · 6 min read

Defect detection on the line, why the tolerance decides whether you draw a box or a mask

Two scratches on a stamped panel, one under the tolerance and one over, look the same inside a box. The geometry follows the disposition rule.

Summary

This post uses two scratches on a stamped steel panel, one just under the tolerance and one just over, to explain why a bounding box cannot separate them and a mask can. It covers what the mask costs in labeling, how the tolerance is written into the labeling standard before the first label, and what a tightened tolerance does to every label the plant already owns. It is for quality engineers and whoever is about to choose an annotation type.

Sheikh Srijon · GTM Lead · Sep 23, 2026

Stamping line with steel panels on the conveyor past the inspection station, press and sheet boxed, generated scene with detections from our model

Two panels come off the stamping line a minute apart on a Wednesday afternoon. Each has a scratch across the same region of the face, running the same direction, from the same burr on the same die. The first scratch is a shade under the length the customer's drawing tolerates on that face. The second is a shade over. The first panel ships. The second goes to rework. A camera at the inspection station sees both, and a model has to tell them apart.

Which annotation the labels are drawn with decides whether it can.

A bounding box cannot tell the two scratches apart

A bounding box is a rectangle around the defect, and for a lot of questions on the Wednesday line it is exactly enough. Is there a scratch, where on the panel, how many. For those questions a box is cheap to draw, fast to review and easy to train on, and no plant should pay for more geometry than its decision needs.

The disposition on the stamped panel is a different question. A scratch that is a shade under and a scratch that is a shade over produce boxes of almost the same size. A diagonal scratch produces a box far larger than the scratch inside it, because a rectangle around a diagonal line is mostly clean steel. The box carries the scratch's rough extent and none of its length, and the length is the tolerance. Train a model on boxes and it learns to find scratches well and to grade them badly.

A mask carries the length and costs more to draw

A mask traces the scratch itself, pixel by pixel, and its length along the panel is a measurement. The surface defect detection use case puts it plainly: disposition is a severity call, severity is size and location on the part, and only a mask carries the length. The same scratch on the hidden flange is a different decision from the same scratch on the visible face, and the mask's position on the panel gives the rule that too.

What it costs is time. A mask takes several times longer to draw than a box and longer again to review, because a reviewer has to check where the trace ends rather than whether a rectangle contains the thing. My view is that the geometry should be decided by the disposition rule and never by what the labeling tool defaults to. If the rule is a length, label the length. If the rule is presence, label presence and keep the money.

In LexAnnotate you type "scratch", Lexi proposes the geometry on every frame, and a person checks each label before anything trains on it. The labeling with Lexi guide makes the same choice explicit: boxes answer where and how many, and masks are for questions where the exact shape is the answer.

On many lines the written tolerance in millimetres is backed by a card of reference scratches at the inspection station, and the card is what the inspector actually holds up to the panel.

The tolerance goes into the labeling standard first

The mask is only useful if everyone draws it the same way. Where does a scratch start when it fades into the grain, does a scratch with a gap count as one or two, is the length measured along the curve or end to end. Those are the questions the inspector already answers by habit, and the labeling standard writes the habit down before anyone labels a frame, in the same words the drawing uses.

Two labelers who outline the same scratch differently teach the model the disagreement.

So the standard is written first, the first few hundred labels are reviewed against it by the quality engineer who owns the tolerance, and the words in it are the words the alert will use later. On the manufacturing lines we run, 99%+ accuracy maintained in production is measured against that standard rather than against a labeler's eye.

A tightened tolerance makes every existing label wrong

In the spring the customer tightens the scratch tolerance on the visible face. The panels on Wednesday look exactly as they did in the winter, the die is the same, the scratches are the same length. The first panel, which shipped in February, is now rework. The model has a winter of masks that say otherwise, and it is confident about every one of them.

The drift catalog files this under the spec changed: the pixels are identical and the mapping from image to correct answer moved. There is no input signal, because nothing looks unfamiliar. The masks themselves survive, since a mask records the scratch and the scratch has not changed, but the disposition attached to each one is now wrong, and the model that learned to pass the first scratch has to learn to fail it.

That is the case for keeping the tolerance out of the geometry and in the rule. A mask that records length can be re-judged against a new limit without redrawing anything. A dataset where the label was simply pass or fail has to be relabeled from the frames.

The reviewer's override is the first signal the rulebook moved

Nobody tells the model the tolerance changed. What happens instead is that the inspector at the station starts overriding it, sending to rework panels the model passed, in a consistent direction, on the same face. That override rate is the signal, and it appears before any accuracy figure moves, because the accuracy figure is computed against the old labels.

LexData takes the panel model through its whole life. You type what to look for, Lexi puts a mask on every frame, and a person checks each label before anything trains on it. The model then watches the inspection station, 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.

The corrections from the first week of the new tolerance are the ones that matter most, and the inspector who makes them is doing the same job with the reference card as before. The card just has a new line on it.

See it on your own footage.

Start with your footage

More in Industries

Industries · 8 min read

Computer vision for construction site safety, a warning before the worker and the excavator meet

A pole camera boxes people and machines, draws a danger zone that moves with the excavator, and sends the frame when someone walks into it.

Ayman Quadir · Sep 23, 2026

Industries · 7 min read

Computer vision in agriculture, from the sprayer boom to the packing line

Weeds against beet rows at dawn, lesions on a leaf, bruises on a packhouse belt, and labels that go stale as the season turns.

Ayman Quadir · Sep 23, 2026

Industries · 6 min read

Computer vision applications on a factory floor, four jobs for the cameras already there

Defect detection, assembly verification, safety and inventory on one plant's cameras, with cosmetic against functional written into the labeling schema.

Ayman Quadir · Sep 23, 2026

LexData
LexData

Product

  • Platform
  • Industries
  • Use cases

Resources

  • Docs
  • The Field Guide
  • Blog
  • Why models drift

Industries

  • Energy & utilities
  • Oil & gas
  • Agriculture
  • Manufacturing
  • Insurance
  • Retail
  • Robotics

Company

  • About
  • Customers
  • Careers
  • Contact

Trust

  • Security
  • Privacy
  • Terms

Stay updated

What we learn running vision models in production.

See everything.
Miss nothing.

Stay updated

What we learn running vision models in production.

Terms of use & Privacy policy

© 2026 LexData Labs · All rights reserved