Skip to main content
Granular IT logo - AI & IoT Engineering in Kenya
Overhead YOLO computer vision camera counting dough pieces in bakery prover pans
Field Note 05 • Edge AI Computer VisionIndustrial Bakery & Food Production • Nairobi Industrial Area • 6 min field note

Training Custom YOLO Models on Real Images to Count Soft Dough Lines Accurately

Why off-the-shelf object detection fails on pale, shape-shifting, flour-dusted dough—and how we trained a custom YOLO model to count thousands of pieces an hour in real time.

Overhead YOLO computer vision camera counting dough pieces in bakery prover pans
Verified Field Outcomes
Clean boundary separation even when soft dough pieces touch or swell in prover pans
Real-time 30 FPS edge inference across changing flour dust and warm steam contrast
Live batch verification before ovens without slowing down operators
01 / Why Standard Vision Models Fail on Dough

Soft Shapes, Flour Dust & Touching Boundaries

Pointing an off-the-shelf object detection model at a moving bakery dough line is a humbling experience. Unlike rigid cardboard cartons or printed beverage cans, unbaked dough pieces are pale, soft, and constantly changing shape as they proof.

Within hours on a real bakery shift, fine flour dust and warm steam shift the visual contrast across the conveyor belt. Even trickier, two pieces of dough frequently swell and touch slightly inside prover pans—causing generic models or optical beams to count two pieces as one.

02 / Our Gigiri Lab Training Pipeline

Finding the Sweet Spot Between Edge FPS & Boundary Precision

To make the camera see the dough line reliably across every shift, we built a dedicated training and benchmarking pipeline from real production footage:

Model Benchmarking

Nano/Small vs. Deeper YOLO Variants

Tested multiple YOLO architectures to balance fast 30 FPS edge inference against tight bounding-box separation on adjacent pans.

Ground-Truth Dataset

Hundreds of Real Shift Captures

Captured and hand-labeled frames across morning glare, night-shift LED lighting, heavy flour dusting, and steam plumes.

Boundary Training

Teaching Touching-Edge Separation

Specifically annotated overlapping and touching dough seams so each individual piece receives its own high-confidence centroid before crossing the virtual gate.

Virtual Prover Gate

5-Batch Pan Verification

Grouped individual dough centroids inside each prover pan container to flag under-filled pans immediately alongside total hourly piece counts.

03 / Floor Results

Thousands of Pieces Per Hour, Verified Live

Once deployed above the prover line with diffused overhead LED illumination, the custom-trained model locked onto every pan cleanly—turning one of the hardest visual counting problems in food manufacturing into a live shift metric.

  • Immune to Flour & Steam Drift: Training on real dirty-lens and steam conditions eliminated mid-shift accuracy drops.
  • Under-Filled Pan Detection: Supervisors see immediately if 4-piece pans pass through a 5-piece batch run.
  • Connected to Yield Reporting: Pre-oven dough counts reconcile directly against finished packaged loaves at dispatch.
Field Note Architecture Spec
Vision Architecture
Custom-Trained YOLO Object Detection
Lighting Rig
Diffused Overhead Linear LED Bar
Frame Rate & Latency
30 FPS Real-Time Edge Inference
Engineering Lead
Gigiri AI & Vision Lab, Nairobi
Custom YOLO Edge ModelOverhead PoE VisionDataset Labeling30 FPS Inference

Want This Engineered at Your Site?

Speak directly with our Nairobi engineering team in Gigiri & Kilimani to scope a practical deployment.

Discuss With Our EngineersNext: Field Note 06: Python Proxy + ANPR Weighbridge