MANUFACTURING
Date Code OCR Verification
Date Code OCR Verification. What it takes to run it.
The date code boxed on a bottle's curved neck, read by LexInsight and checked against the plant's own format and the shift order.
// 01 · The question
“Which bottle left the packing station carrying a date code that does not match today's order?”
// 02 · Why it is hard
A reading on its own is never the verdict. A laser etch under the wrong angle, or a reflection crossing the middle of the code, produces a plausible wrong character, a three read as an eight, rather than an obvious failure, and the two mistakes a plant makes from that are not equal: a correct bottle held for a second look costs an operator a glance, a coder that reset overnight and etched last year's date onto a full shift costs a recall.
// 03 · What the labels have to be
Bounding box
Decided before the first frame
The neck is curved and the code lands at a different height and rotation on every bottle depending on how it sat in the star wheel under the laser, so the first job is a box on the code wherever it is, not a crop at fixed coordinates that only catches the well-behaved bottles. Everything downstream, the reading and the format check, works on the crop inside that box, which is why the geometry this question needs is the same simple box a dozen other packing-line questions use, not a mask or a point.
This is the decision that is expensive to reverse. The geometry has to match what the answer contains, and finding out it does not means labelling the set a second time.
// 03a · What it finds
The date code's own box
on the bottle's neck, wherever it landed depending on how the bottle turned in the star wheel under the laser
The characters inside that box
read as a string by LexInsight off the same crop the box drew, not assumed from a fixed position
A reading the plant's format rejects
the day's own coder fault, a string that does not fit six digits as day, month and year or whatever the plant's own format is
A bottle the model doubts
glare across the code, or a neck turned further than the model has seen, held for the operator before it is scored either way
// 03b · What it checks
- 01
The reading against the plant's own date format before a string becomes a date, since this is where most of the wrong readings are caught.
- 02
The format-checked date against the shift's own production order; a match closes the case, a mismatch or a format-rejected string holds it.
- 03
The hold rule's own severity and cooldown, approved before it goes live, so a critical mismatch on the active line reaches the line controller rather than sitting in a dashboard nobody is watching.
- 04
The format rule itself against a new coder or a new market's date order, since a changeover makes every bottle wrong the same way rather than some of them.
// 03c · What the line provides
- The camera already over the packing station, seeing the neck at line speed; no new camera, no new hardware.
- Frames from this line's own coder and bottle material, since a frosted laser etch on clear PET reads differently from the same code on amber glass.
- The plant's own date format and the shift's production order, in the operator's hands, not assumed from a template.
- Someone to confirm or correct the bottles the model holds, the same operator who used to pull one bottle from every case.
// 04 · How we run it
Three parts of one loop, on this job.
LexAnnotate
Defect Annotation
Pixel-level defect annotation for surface scratches, cracks, dents, weld faults, and assembly misalignments. Multi-sensor alignment for multi-camera inspection systems.
LexInsight
Line Performance
Ask which shift or which line is producing the most of one defect class, and get an answer with the frames behind it, graded against the plant's own written standard.
LexAlert
Quality Alerts
Monitor defect detection accuracy across changing production conditions. Detect when lighting shifts, new materials, or equipment aging degrades model performance. Auto-retrain to maintain 99%+ accuracy.
// 05 · What breaks it after launch
A new laser etches a slightly different font in a slightly different place, or a customer market asks for the date written month first instead of day first. On the day of the change every bottle is correct and the detector, the reader and the format rule are each looking for something that is no longer there, which is why the first sign of this drift is the review queue filling with bottles the operator keeps overriding rather than any drop in a count.
It is not the only one that can get this use case, it is the one that usually gets it first. All ten conditions.
// 06 · In manufacturing
Defect Detection at Scale
The Challenge
Vision models performed well in pilots but lost accuracy as factory conditions shifted.
Our Execution
Built pixel-level annotated datasets and multi-sensor alignment for reliable defect detection.
The Result
Maintained 99%+ defect detection accuracy across changing production environments. Reduced unplanned downtime.
99%+
Accuracy maintained in production
// 06a · Questions we get asked
Does this just find the date code, or does it read what the code says?
It reads it. LexInsight is asked what the code on this bottle says and answers with the characters and the frame behind them, then checks that reading against the plant's own format before anything is scored. That is the difference from a page that only finds where a field landed for a person to read.
What happens when glare or a turned bottle makes the code hard to read?
The frame is held for the operator rather than guessed. A bevel or a reflection under the wrong angle can produce a plausible wrong character, and those are exactly the frames that come back for a person to confirm or correct before they train the next version.
Can it tell a coder fault from a camera misread?
The format check is what separates them. A reading that does not fit the plant's own date format, or that parses to a date the coder could not have meant, is caught by the format rule before it is ever blamed on the model, which is why the format rule catches more wrong readings than any change to the reader.
What happens when the plant changes coders or a market asks for a different date order?
Every bottle is correct and the model is looking for something that no longer exists, so the fix comes ahead of the changeover: frames from the new coder, a window of them labeled, the format rule rewritten for the new order. The old coder's frames stay in the version for any line that still runs one.
Read next
Expiration date detection on a curved bottle neck, the full walk-through →The same packing line, finding where the date, lot and part fields are rather than reading what they say →The nutrition panel, allergen statement and net weight, boxed as regions on the same kind of label →What a new coder or a new date order does to a format rule tuned on the old one →// 07 · Also in manufacturing