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

Industries · 6 min read

Optical character verification checks the print against the work order instead of reading it from scratch

The expected lot and expiry come from the order, a detector finds the print on every pack, and the pack is held when they disagree. A new layout is a relabel.

Summary

This post separates optical character verification from reading, using a carton line where the lot code and expiry on every pack are compared against the string the work order expects. It covers finding the printed region with a detector, the two errors a comparison can make, holding the pack when the comparison fails, and relabeling when the label layout changes. It is for packaging and quality engineers on coded lines.

Stephen Biswas · Engineer · Sep 26, 2026

Cartons passing a scanner on a packaging line, generated scene with detections from our model

The changeover on the carton line finished at 6:50 am, and the first carton of the new order came off the printer with the old order's lot code on it. The printer had not been reset. The lot on the carton was a real lot, printed cleanly, in the right font, in the right place, and a person reading it would have seen nothing wrong unless she happened to have the work order in her other hand. By the time the line lead did, at 7:30 am, several hundred cartons of order B carried the lot of order A.

Reading the code was never the problem. The printer prints what it was told, and what it was told was wrong. The question a camera has to answer at the outfeed is whether the print matches what the order says it should, which is a different and easier question than what the print says.

Verification compares the print with an expected string, and reading is a different job

Optical character recognition takes a region of pixels and produces text with no prior idea of what the text should be. Optical character verification starts from the other end: the work order says this pack should carry this lot and this expiry, and the camera's job is to confirm that the pack does. The expected string is known before the frame is taken, and on the carton line at 6:50 am it was the one thing nobody looked at.

That changes what the model has to be good at. A reader has to be right about every character in a font it may not have seen. A verifier has to say match or mismatch between a printed region and a known string, and it can be built to be suspicious in exactly one direction. On the carton line the expected string comes from the order system, and it should never be typed at the line, because a line operator who types the expected lot from memory has reintroduced the problem the camera was fitted to remove.

A detector finds the printed region on every pack, even when it wanders

The lot and expiry on a carton are printed by a coder that fires as the carton passes, and the print lands in slightly different places as cartons shift on the belt and the guide rails wear. A crop at fixed coordinates catches most of them and misses the ones that came through askew. So the first model on the line 2 carton camera is a detector: it puts a box on the printed region wherever it landed, and the comparison runs on the crop inside the box.

The package and label inspection use case has the same structure, a region and a rule, and line speed as the hard part. The detector has to find the region on a motion-blurred frame in the time between cartons. Lexi proposes the boxes from a single class, "lot and expiry print", and a person checks them on frames from the line camera at line speed. A box drawn on a carton photographed at rest is a box for a line that does not exist.

The coder's ribbon runs out partway through a shift, and the last hundred cartons before it does are each a little fainter than the one before.

The comparison is set to tolerate a faint print and reject a wrong one

There are two ways for a verifier to be wrong, and they cost different things. A missed mismatch lets a carton with the wrong lot ship, which is the recall the plant will have to explain. A false reject stops a good carton, which costs the line a few seconds and, if it happens often, costs the plant the operator's trust in the camera.

On the manufacturing lines we run, the comparison is set so that a faint but correct print passes and any print that disagrees with the expected string in a single character fails. A print too faint to compare at all is a review, and the review goes to a person with the crop and the expected string side by side. The 99%+ accuracy maintained in production that our manufacturing work reports comes from lines where the review queue is small and the mismatch rate is honest.

My own view is that a verifier should never be tuned to reduce false rejects by loosening the match. The false rejects are usually a faint ribbon or a wandering print, and both have fixes at the coder. Loosening the match to hide them is how the wrong lot ships cleanly.

A failed comparison holds the pack rather than guessing

A carton whose print does not match is held. A carton whose print cannot be read well enough to compare is held. Neither is passed on the theory that the coder is probably right, because the morning at 6:50 am is what the coder being probably right looks like.

The hold is an alert: a rule written as a sentence, with a severity and a cooldown, approved before it goes live. A lot mismatch on the carton line is critical and goes to a webhook the line controller reads and to the line lead's phone, with the frame, the crop and the expected string. An unreadable print is routine and goes to the same lead's morning list. With a runner beside the recorder the hold is raised on the line, where the reject gate is.

A new label layout is a relabel from the line's own frames

The marketing team moves the lot and expiry from the end flap to the side panel, and on the day of the changeover every carton is correct and the detector has never seen a print where it now is. The drift catalog calls this a spec change, and the packaging version of it is a redesign on a marketing schedule nobody told the model about.

The fix is short because the changeover date is known. Frames of the new layout from the line camera, a window of them labeled and folded in before the run, and the detector has the new position. Versions keep what they were trained on, so the old layout still verifies for the plant that runs both.

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

The changeover at 6:50 am still happens, and the printer still has to be reset by a person. What changes is that the first carton with the wrong lot is the last one, held at the gate with the order's expected string printed beside it on the line lead's phone.

See it on your own footage.

Start with your footage

More in Industries

Industries · 6 min read

AI crop analysis in the greenhouse, catching tomato disease before it spreads down the row

Lesions boxed by disease with a healthy class, a question of the footage about how far a patch spread since last week, and a model that turns with the season.

Rob Hickey · Sep 26, 2026

Industries · 6 min read

Ceramic defect detection for hairline cracks a fixed-rule camera cannot learn

Edge chips, hairline cracks and pinholes on the tile line after the kiln, masks where the area sets the grade, and the new glaze as the day to relabel.

Esdras Ntuyenabo · Sep 26, 2026

Industries · 6 min read

Chocolate box inspection with a camera over the tray line

Each piece boxed by type, a plain check against the box template, damage as its own class, and the new spring assortment as the day the labels go stale.

Stephen Biswas · Sep 26, 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