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

Industries · 7 min read

Tablet defect inspection that says which defect, so the engineer knows which press setting to check

Every tablet boxed, each crop classed as capping, lamination, chip or crack, and the class says which press setting to check. A new defect is its first labels.

Summary

This post puts a camera over a compression line and splits the inspection into finding every tablet and then classifying each crop, so that the class names the defect and the defect names the press setting to check. It concludes that a new defect type is a labeling change rather than a new detector, and that the taxonomy has to be written in the process engineer's terms before anyone labels. It is for pharmaceutical process and quality engineers.

Sheikh Srijon · GTM Lead · Sep 25, 2026

Bottling line with bottles queued under a fill head, generated scene with detections from our model

The tablet press on line 3 turns out tablets by the thousand an hour, and the reject gate at the end of it knows one thing: this tablet is wrong. It does not know why. The process engineer collects the rejects at the end of the shift in a tray and sorts them by hand under the bench light. A tablet with its top separated is a different fault on the press from a tablet with a chip out of its edge, and the tray is the only way to find out which fault the shift had.

A camera over the line can do the sorting on every tablet, and the sorting is the point, because the sort is what tells the engineer which knob to turn.

Find every tablet first, and ask nothing else of that model

The first model finds tablets. Every tablet on the belt gets a box, and the model is tuned to miss none, which means it will occasionally box a fragment or a shadow, and that is the right trade, since a tablet that never gets a box never gets classified. The class is "tablet" and nothing else, from frames off the line camera at its mount, with the belt moving and the dust that a compression line has.

That model is the stable one. It does not change when a new defect appears, because a tablet still looks like a tablet. You type the one class once, Lexi proposes a box on every tablet in every frame, and a person checks the proposals, mostly for the tablets touching one another, since two tablets in one box is one tablet the second stage never sees.

Then classify the crop, and the class is the diagnosis

The second stage takes each box as a crop and assigns it a class. Good is one class. The rest are the defects the engineer already names, and each one points at a cause on the press. Capping, where the top of the tablet lifts off, points at compression force or worn tooling. Lamination, where the body separates into layers, points at the binder or the material. A chip out of the edge points at ejection or handling. A crack through the body points at compression or a rapid decompression. Contamination, a foreign speck on or in the tablet, points at the raw material or the room.

That is why the taxonomy is written in the engineer's terms before anyone labels, with a reference crop for each class. The classes are kept apart from one another, since a class that overlaps another is a class two labelers will call differently, and a class that does not map to a cause is a class the engineer cannot act on. The surface defect detection use case says the same for any part: disposition is a severity call and the label has to carry what the decision needs, which here is the cause.

A labeled set of crops, with a person checking each label, comes back at up to 99.9% accuracy, and on tablets the checking is mostly capping against lamination, which look alike on a crop and mean different things on the press.

A VLM can name the defect before the classifier exists

On the first day of a new product there are no labeled crops. A VLM asked a plain question of each crop, is this tablet capped, laminated, chipped, cracked, contaminated or good, gives an answer with the crop behind it, and that answer is a proposal a person can confirm or correct in a second. It is slower per crop than a trained classifier and it is the fastest way to a first labeled set.

The honest limits are that it is an answer per crop rather than a measurement, that it downscales what it sees, and that it can name a defect that is not there. So every answer is treated as a proposal for a person, and a crop the VLM calls anything other than good goes to the reject gate and to the review queue with the frame. Once a few hundred crops per class have been confirmed, a trained classifier takes over the line and the VLM goes back to being the tool for the next new product.

The result per tablet is a rule written as a sentence, with a severity and a cooldown, approved before it goes live. Any tablet on line 3 classed as capped, routine, to the line's log. A capping count climbing across the shift, high, to the process engineer in Slack with the crops attached. The engineer sees twenty capped crops from the last hour rather than a reject count, and goes to the press knowing what to check.

In our manufacturing work the inspection models hold 99%+ accuracy maintained in production, and on a tablet line that figure describes the two stages together, measured against the engineer's own sort of the reject tray.

The unsure crop goes to a person and the verdict is a label

Some crops are plainly good and some plainly capped. Between them are the crops the classifier is unsure of, and those go to a person with the frame rather than being forced to a class. The default is conservative: a crop the classifier cannot place goes to the reject gate and to review, because a bad tablet passed is worse than a good one held.

LexData takes both stages through their whole life. You type what to look for, Lexi puts a box on every tablet in every frame, and a person checks each label before anything trains on it. The model then watches the line camera, 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. On a tablet line the doubted crops are the capping-or-lamination cases, and the engineer's verdicts on those are what the next version learns.

One aside from the line. The engineer still sorts the reject tray at the end of the shift, and says the tray is what the classifier's counts get checked against. It is quicker than it was because the crops on the screen say which tablets to look at first.

A new defect type is its first labeled examples, and the finder does not change

A new formulation arrives in March and with it a defect the line has never seen: a mottled surface where the colour is uneven. The finder still boxes every tablet. The classifier, which has never seen mottling, calls it contamination or good, and the engineer's overrides climb on the first shift. The drift catalog calls this a spec change: the pixels are identical and the taxonomy every label was drawn against is now incomplete.

The fix is a new class, not a new detector. The engineer names it, a few dozen crops are labeled as mottled, the classifier is retrained with the new class, and the finder is untouched. That is the whole reason for the two stages: a taxonomy change is a labeling afternoon rather than a rebuild.

My own view is that the taxonomy should be treated as a document the process engineer owns, with a change log, and that a class should never be added by whoever is labeling that week. A class added without the engineer's name for it is a class that points at no press setting, and a sort that does not point at a setting is the reject tray with extra steps. How the labels get checked before training is in the labeling doc.

See it on your own footage.

Start with your footage

More in Industries

Industries · 7 min read

Counting the screws in a kit with object detection over the bench

A camera over the kitting bench counts every screw and bottle one box at a time. Exact for kits, a band for cases, and a half-hidden item is a written rule.

Rajiya Sultana · Sep 25, 2026

Industries · 7 min read

Automated water meter reading with a camera in the vault

Ten digit classes in a fixed row turn a truck roll into a frame. A rolling digit and condensation on the glass are the frames that come back to a person.

Stephen Biswas · Sep 25, 2026

Industries · 7 min read

Body-in-white inspection with a station camera on unpainted steel

Dents on a bare body shell hide in the reflections. Masks give the extent, a second pass decides reportable, and a tightened tolerance is a spec change.

Finn Ellingwood · Sep 25, 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