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

// MANUFACTURING

Coffee Bean Defect Inspection

Coffee Bean Defect Inspection. What it takes to run it.

Stones, quakers and foreign material masked on the roast belt, the outline's centre carried to the line's own reject station.

Start with your footageBook a demo →All of manufacturing →

// 01 · The question

“Is that dark speck a stone the reject station needs to hit, or a shadow between two beans?”

// 02 · Why it is hard

A pale stone stands out against a dark roast and a dark stone vanishes into one, so the same class needs both ends of that range on this roast level alone. A quaker is the harder case: it is a bean, the same shape and size as its neighbours, told apart only by colour and surface, and the belt's own motion blur does neither contrast any favours.

// 03 · What the labels have to be

Instance segmentation

Decided before the first frame

A reject station working off a box's centre can land on a bean and miss the stone beside it, or clear three good beans for one pebble, because a box around a stone half hidden by its neighbours covers plenty of bean along with it. A mask's outline gives the true centre of the stone alone, which is the one position the reject station can act on without guessing.

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

A stone among the beans

masked on the belt's own camera after the cooling tray, its outline's centre carried by a webhook to the line's own reject station

A quaker, an underdeveloped bean

masked and classed apart from a sound bean by colour and surface rather than shape, since the two share an outline

A twig, a husk fragment or a trace of metal

one foreign-material class, masked wherever it sits in the stream rather than named for every form it takes

A bean the model cannot place

a pale stone or a shadowed quaker held for a person before anything is scored, rather than passed or rejected on weak evidence

// 03b · What it checks

  1. 01

    The mask's outline centre, carried by a webhook to the line's own reject station, rather than a box's coarser centre that can sit over the wrong bean.

  2. 02

    The written rule for each class before labeling: how small a stone still counts, whether a stone half under a bean is outlined to its visible edge, what a labeler does with a bean that only looks like a stone.

  3. 03

    The current reject rate against the line's own thresholds, re-tuned first when a new origin lot moves the rate, before anyone considers the model at fault.

  4. 04

    The override rate at review, not the raw doubted count, since a wider stream of doubted frames after a new lot is a threshold question and a rising correction rate in one direction is the retrain question.

// 03c · What the line provides

  • The camera already mounted over the belt at its height, after the cooling tray; no new camera, no new hardware.
  • Frames from this belt, under this line's own light and at its own speed, not beans arranged on a bench under a lamp.
  • The classes written down before labeling starts, in the roaster's own words, so two labelers are not building two datasets under one class name.
  • Someone to clear the review queue and confirm or correct the beans the model holds, the way a taster already judges a cup today.

// 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.

How the loop fits together →

// 05 · What breaks it after launch

Prior shift

The defect rate changed

→Prior shift →

A new origin lot arrives from a stonier harvest and the reject rate climbs while the bean stream itself looks exactly as it did the week before. The model is still finding every stone correctly; what moved is how many there are to find. The first sign is the review queue flooding and the line lead's instinct that the model broke, not a drop in any one detection's confidence.

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

Full write-up ↓Every case study →

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 the model fire the reject station itself?

No. It masks the stone, quaker or foreign object and carries the outline's centre to the line's own reject station over a webhook, with a severity and a cooldown set before the rule goes live. The station is the line's own equipment; the model only gives it a position worth acting on.

How does it tell a quaker from a good bean?

By colour and surface, not shape, since a quaker roasts pale and shares its neighbour's outline exactly. The frames come from this roast line across its roast levels, and a bean the model cannot place is held for a person rather than scored either way.

What happens when a new origin lot changes the stone rate?

The model keeps finding stones correctly; what moved is how many there are. The review queue floods before any detection looks wrong, and the first move is re-tuning the thresholds against the new rate, not retraining the model.

Why a mask instead of a box?

Because the reject station needs a position, not a presence. A box's centre can fall on a bean beside the stone it is meant to clear; a mask's outline gives the stone's own centre, which is the position the station can actually use.

Read next

Coffee bean inspection on the roasted bean belt, the full walk-through →Surface defect detection: disposition as a severity call, for any part →What a new origin lot does to thresholds tuned for the old rate →
Start with your footageBook a demo →

// 07 · Also in manufacturing

Surface Defect Detection→Weld Quality Inspection→Assembly Verification & Error Proofing→Package & Label Inspection→Date & Lot Code Inspection→Predictive Maintenance→Multi-Sensor Monitoring→Tablet Defect Inspection→Syringe Barrel Defect Detection→Foreign Material Detection→Glass Defect Detection→Semiconductor Wafer Inspection→Strip Surface Defect Inspection→Ceramic Defect Detection→Wood Defect Detection→Body-in-White Inspection→Contact Lens Defect Inspection→Parts Count Verification→All forty-one→
Surface Defect DetectionWeld Quality InspectionAssembly Verification & Error ProofingPackage & Label InspectionDate & Lot Code InspectionPredictive MaintenanceMulti-Sensor MonitoringTablet Defect InspectionSyringe Barrel Defect DetectionForeign Material DetectionGlass Defect DetectionSemiconductor Wafer InspectionStrip Surface Defect InspectionCeramic Defect DetectionWood Defect DetectionBody-in-White InspectionContact Lens Defect InspectionParts Count VerificationAll forty-one →

Send us a week of this footage. We’ll show you what comes back.

Start with your footageBook a demo →
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