← All case studies Case study 1 · Computer vision for agriculture

Counting coffee cherries in dense foliage with edge AI

How a low-cost camera and a vision AI pipeline turn photos of coffee branches into berry counts, ripeness maps and yield estimates, with AI-assisted labeling that cuts the manual annotation work.

Industry
Agriculture · coffee estates
Use case
Yield estimation and harvest planning
Led by
Dr. Raghu M. Rao, HeadBands.ai advisor
Deployment
Edge devices and cloud
0.87weighted F1 score for detecting and classifying berries by ripeness
4ripeness stages classified: raw, semiripe, ripe and overripe
0training needed to generate first-pass labels with a vision-language model
~8¢estimated AI cost to auto-label one photo with 10 clusters

Scores are from a test set of 45 images. The cost estimate uses Gemini 3.6 Flash list prices for about 27,000 tokens per image.

The challenge

High-yield plants are the hardest to count

Coffee estates need reliable berry counts to forecast yield, schedule harvesting across the estate and support commodities trading. Today those counts are mostly manual, slow and subjective. Productive plants grow dense, overlapping clusters that defeat standard detection.

  • Severe occlusionLeaves and branches hide many cherries from the camera.
  • Harsh, uneven lightDeep shadows and overexposed patches confuse standard detection algorithms.
  • Green-on-green camouflageUnripe green cherries blend into the surrounding foliage.
  • Costly labelingTraining a model needs thousands of hand-labeled berries, which is slow and expensive.
The solution

A four-stage vision pipeline

Each stage narrows the problem for the next one, so lightweight models can run on low-cost devices in the field.

01 · Capture

Photograph one branch at a time

Low-cost devices capture images of individual branches. GPS coordinates are extracted and images are standardized to 1024×1024.

02 · Detect

Find the clusters that matter

A YOLO26x model finds in-focus foreground clusters. Overlapping boxes are merged so berries aren't split and double counted.

03 · Classify

Segment and grade every berry

YOLO26x-Seg detects, outlines and classifies each berry by ripeness. The pixel-level outlines let people see what the model counted.

04 · Estimate

Turn counts into yield maps

Counts feed a yield model and are plotted on satellite maps, sized by plant yield and colored by dominant ripeness stage.

A coffee branch photo beside the same photo with detected clusters boxed and each berry colored by ripeness
Model output on a field photo: 60 berries detected (31 raw, 6 semiripe, 23 ripe, 0 overripe). Image: Visimatics LLC.
What's next

From pilot to production

  • All agricultural commoditiesThis solution can be applied to all agricultural commodities to predict yield, not just coffee.
  • Autonomous harvestingGuidance systems for harvesting robots, addressing farm labor shortages.
  • Commodities tradingQuantitative mid-season yield forecasts to replace subjective estimates.
  • Security and scaleA data security reference design, scalable cloud storage and compute, and data lifecycle policies.

Have images, documents or sensor data to put to work?

We help mid-market companies apply computer vision and AI to real operational problems, one use case at a time.

Talk to us