MANUFACTURING
Chocolate Box Inspection
Chocolate Box Inspection. What it takes to run it.
Every piece boxed and named from the top-down camera, checked against the insert's own template by row and position before the lid goes on.
// 01 · The question
“Is every piece in its cup, named right and undamaged, before the lid goes on?”
// 02 · Why it is hard
A milk caramel and a milk praline in the same cup shape, under the same light, differ by a swirl on top, and those two classes want more frames and a person who already packs this assortment checking every box. Naming bites later: one labeler writing "praline" and another writing "hazelnut praline" gives the template two classes where the line has one, and every tray fails. The line's own name for a piece that has escaped its cup and sits between two others is a traveller, and travellers cause most of the doubtful frames.
// 03 · What the labels have to be
Bounding box
Decided before the first frame
The question is which piece sits in which cup and whether it is sound, not its extent, so a box carries the answer: its position says which cup, and a class read from the crop inside it says the piece type and whether that piece is damaged. Nothing here is measured by area, so a mask would add labelling cost without changing a single verdict.
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
Every piece in its cup
boxed from the top-down camera at a fixed height and named by type as the tray crosses the line
The piece out of place
the detections sorted into rows and read left to right, each position compared against the insert's own template and a mismatch reported by the cup it sits in
Damage as its own class
cracked, bloomed, misshapen or missing its decoration, read from the same box as the piece type rather than scored separately
The traveller, or a tray the model doubts
a piece that has escaped its cup and sits between two others, or a count too close to call, held for a person rather than scored either way
// 03b · What it checks
- 01
The template's own rows and positions against what the camera found, so a mismatch is reported by cup rather than failing the whole tray on one number.
- 02
The count first on a short tray: an empty cup read from the template at the gap, a missed detection read from a doubted box in that same region, so the two are never confused.
- 03
Damage read from the piece's own box, held alongside a swapped piece rather than scored on a separate pass.
- 04
A doubted tray held for a person with the frame and the box attached, the way the packer at the end of the belt decides today.
// 03c · What the line provides
- The camera already over the tray line, fixed height, with the tray always in the same place.
- The insert's own template, written down as rows and positions the way the box's own lid already shows it.
- A few dozen labeled frames per piece type on this camera; the lookalikes want more, and a person who already packs this assortment to check them.
- Someone to settle each piece's name once, so the template and the model never carry two classes for one piece.
// 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 seasonal assortment swaps two pieces for new ones and the insert's template changes with it. The camera sees a piece it has never seen and either boxes it as the nearest lookalike or boxes nothing, so every tray fails the template check for the first run until the new pieces are labeled.
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 replace the packer at the end of the line?
No. It is the check that runs on every tray before the lid goes on, where a glance only catches what the eye happens to land on by the end of a shift. The packer still gets the held trays, with the frame and the box attached, and decides the ones the camera doubts.
What happens when the assortment changes for a new season?
The template update is the easy half. The new pieces need labeled frames before the run starts, and every tray fails the template check for the first hour until they are added, which is the tell that somebody skipped the relabel.
How does it tell a missing piece from one the model just missed?
By checking the count against the template before scoring anything. A tray short by one is read against the cup the template expects at the gap; if the model was unsure about that region, the tray is held for a person rather than marked as a missing piece on a guess.
What about two pieces that look almost identical?
Answered with more labeled frames, not a different method. A milk caramel and a milk praline in the same cup shape need a person who already knows the swirl that tells them apart checking every box the model draws on those two classes, until the boundary is the one the plant actually uses.
// 07 · Also in manufacturing