Camera AI on the conveyor: spotting whole kernels in milled grain
An anonymised case: a feasibility test on customer photos shows that AI can tell whole kernels from husks and fragments — and how Dokiny turns that into hourly, shift and daily quality reports.
Whole kernels are the early sign that a mill is drifting
After the roller mill, milled barley should no longer contain whole kernels. If it does, the roll gap is too wide, the rolls are worn or something is disturbing the process — and kernels that were never broken open are used less well by the animal that eats the feed. The producer in this case had already tried to measure the quality with optical sieve analysis, without reaching the goal.
The question we agreed to answer together was a narrow one: can AI reliably see whole kernels in a photo of milled grain? The customer supplied sample photos, we tested, and only then would anyone decide on a proof of concept.
Continuous instead of spot checks
Automatic inspection of the milled grain right after each roller mill.
Early warning
A signal as soon as whole kernels increase, so the roll gap can be adjusted before quality tips.
Seamless evidence
Grain quality documented per hour, shift and day — with evidence images.
Seventeen photos, four of them never shown to the model
The customer provided 17 smartphone photos of samples on a white surface. Five show the grain as it should look. Twelve were deliberately mixed with whole barley, whole wheat or both, and in those the customer marked every whole kernel — 309 markings in total, which served both as training target and as the yardstick for the test.
We trained a compact object-detection model, of the kind that later runs on a small computer next to the line, on 13 photos. One photo from each sample group was held back completely. The result is judged only on those four, so it shows how the model behaves on samples it has never seen.
of the AI's detections really were whole kernels (24 of 25)
false alarms on the photo of optimal grain — not a single kernel reported
samples rated correctly as good or faulty
of the marked whole kernels were found (24 of 40) — a lower bound, see below
The last number deserves the honest reading. Most of the kernels the model missed sit in two photos taken at an angle and from further away, where kernels appear about half as large as in the training images. Whole wheat — red-brown, smooth and plump — stands out clearly. Whole barley is the harder task: it still carries its husk and resembles the empty husks around it, so the difference lies in shape and shadow.
Both points are addressed by the setup rather than by a bigger model: a fixed camera at a constant distance, light that brings out the shape of the kernels, and more images from real production including borderline cases. And for process monitoring, not every single kernel has to be found. What matters is a stable figure that rises reliably when the mill is not working cleanly.
A camera per roller mill, analysis on site, results in Dokiny
The AI counts the whole kernels in each image and relates them to the inspected area. That gives one simple figure per roller mill, the whole-kernel index: detected whole kernels per 100 cm² of inspected grain surface. Thresholds for warning and alarm are set by the customer, and because every measuring point belongs to one mill, each alert says immediately which mill needs adjusting.
Industrial camera, global shutter
Around 5 megapixels over a 30 cm field of view gives roughly 8 pixels per millimetre — as detailed as the test photos.
LED flash
Very short exposure, so kernels on the moving belt do not blur.
AI computer on site
Saves bandwidth and keeps working when the network drops; data is delivered afterwards.
Only the belt is in view
The cameras see grain, not people. Data stays in the customer's own, separated tenant.
What a shift looks like when the index is watched
Dokiny bundles all measuring points, figures, evidence images, reports and alarms in one module, usable in the browser at the control station, on a PC and on a tablet. Each level gets its own report: a live view for the control room, an hourly summary for the shift lead, a PDF at the end of each shift and each day, and a weekly or monthly trend per mill as an early hint of wear for maintenance planning.
In this example the index starts climbing at 15:00. At 16:00 Dokiny issues a warning, at 18:00 the alarm threshold is crossed and the shift lead receives an SMS with an evidence image. After the roll gap is readjusted at 20:10, the value is back in range from 21:00. Without continuous monitoring, the rise would have been noticed at the next spot check — or not at all.
Invest only once feasibility is proven
Phase 0 · Feasibility
done — shown on the customer's images
Phase 1 · Proof of Concept
photo box and real samples, six weeks
Phase 2 · Pilot
cameras on the conveyor, after site survey
Phase 3 · Operation
all roller mills, ongoing reports
The proof of concept answers, with real production samples, how good detection is under fixed conditions — before the customer invests in camera hardware. Samples are photographed in a simple photo box and uploaded from a phone or tablet; shift and daily reports already run in Dokiny; and a site survey of the roller mills and the conveyor section supplies what the pilot needs. Success criteria are fixed at kick-off, for example: at least 85 % of whole kernels in the reference samples detected, at most one false detection per optimal sample on average, and the traffic-light rating matching the customer's own for at least 90 % of samples.
Where the limits are
The same pattern fits other inspection tasks
Nothing in this setup is specific to barley. A camera at the line or a photo box, analysis on site, one key figure per line and an alarm with an evidence image: the same building blocks cover defects, foreign objects and completeness checks. The model is trained on your images; the dashboard, reports, alarms, users and roles are already there.