Industries · 6 min read
Expiration date detection on a curved bottle neck at the packing station
The code found as a box on the neck, read as a string, checked against the plant's own format, and the case held on a mismatch. A new coder is a spec change.
Summary
This post follows a bottle to the packing station where a camera finds the laser-etched date code on the curved neck, reads it, and checks the reading against the plant's own date format before the case is closed. It concludes that the format check catches more misreads than any model change, that a mismatch holds the case, and that a new coder or a new format is a spec change to relabel. It is for bottling and packaging quality teams.
Esdras Ntuyenabo · Engineer · Sep 26, 2026

Bottles queued under the fill head on a bottling line, generated scene with detections from our model
At the packing station on line 1 the bottles arrive in lanes of six, and an operator pulls one from every case, turns it to the light, and reads the date code the laser etched onto the neck a few minutes earlier. She is checking that the coder is still printing and that it is printing this month's date. The last time it was not, the coder had reset overnight to its default and etched a date from the year it was installed onto a full shift of bottles. She checks one bottle in every case. The other bottles in the case are assumed.
A camera at the packing station reads the neck of every bottle in every lane, and the parts of that job that decide whether the plant trusts it are the ones that happen after the characters have been read.
The code is found as a box on the neck before anything reads it
The neck is curved, the code is small, and it lands at a slightly different height and rotation on each bottle depending on how the bottle sat in the star wheel under the laser. A crop at fixed coordinates catches the well-behaved bottles and misses the ones that turned. So the first model is a detector that puts a box on the code wherever it is, and everything downstream works on the crop inside that box.
The package and label inspection use case has this shape, a region and a rule, and the detector is trained on frames from the packing station camera at line speed, with the glare stripe from the overhead lamp where it actually falls. You type "date code" once, Lexi proposes the box on every bottle, and a person checks them. The checker's time goes on the bottles that turned furthest, where the last characters foreshorten around the curve.
The crop is read through LexInsight, and the reading is a string
The reading is a question. LexInsight is asked what the code on this bottle says and answers with the characters and the frame behind them. On a clean etch under a good lamp that is the easy part. On a bottle whose neck caught the lamp's reflection across the middle of the code it is the part that produces a plausible wrong answer, a three read as an eight, which is why the reading on its own is never the verdict.
Laser codes on clear PET are etched frost rather than printed ink, and they read differently from the same code on an amber bottle. The plant that runs both has two sets of frames in the set.
The plant's own format is the check that turns a string into a date
Every plant has a format. Six digits as day, month and year, or a Julian day and a shift letter, or a best-before written the way the customer's market expects. A string that does not fit the format is a misread or a coder fault, and either one is a hold. A string that fits the format but parses to a date in the past, or one further ahead than the product's shelf life allows, is the same.
This check is where most of the wrong readings are caught. My own view is that the format rule is worth more to a coded line than any improvement to the reader. The reader will always misread a glare-struck eight now and then. A rule that holds the year cannot be the year the coder was installed catches every one of those misreads without a single new label.
A mismatch holds the case rather than guessing
The expected date for the shift comes from the production order, and the reading is compared with it. A match and the case closes. A mismatch, or a reading the format rejects, and the case is held. The bottle is never passed on the theory that the coder is probably fine, since a coder that reset overnight is exactly what probably fine looks like at 6 am.
An alert is a rule written as a sentence, with a severity and a cooldown, approved before it goes live. A date code on line 1 that disagrees with the order is critical, and goes to a webhook the line controller reads and to the line lead's phone, with the frame and the crop. A code too faint to read is routine and goes to the same lead's list, because a faint code is a laser that needs attention before it stops. With a runner beside the recorder the hold is raised at the station, where the case is.
Curvature, glare and a worn coder are the frames that come back for review
A bottle that turned far in the star wheel, a neck that caught the lamp, a laser whose lens has fogged so the frost is lighter than the frames the model learned from: these are the bottles the model doubts, and they should say so. The frame goes to the operator at the packing station with the box and the reading, she confirms or corrects it, and her call is recorded against the frame.
LexData takes the date code model through its whole life. You type what to look for, Lexi puts a box on the code on every bottle on every frame, and a person checks each label before anything trains on it. The model then watches the packing station 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 99%+ accuracy maintained in production that our manufacturing work reports is held by those corrections, which on a coded line come from the operator who used to pull one bottle a case.
A new coder or a new format is a spec change the frames cannot show
The plant replaces the laser with a newer one that etches a slightly different font in a slightly different place, or a customer market asks for the date written month 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. The drift catalog calls this a spec change, and its first evidence on a coded line is the review queue filling with correct bottles and the operator overriding every one.
The changeover date is known, so the fix comes before the run. Frames from the new coder on line 1, a window of them labeled, the format rule rewritten, and the model retrained. The old coder's frames stay in the version for the line that still has one. The wider manufacturing picture is built from stations like this one, where the camera reads what a person used to read one bottle in six.
See it on your own footage.
Start with your footageMore 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