How a Vineyard Robot Counts Grape Bunches Along a Row

Follow grape detections from two-dimensional boxes to a row count, and inspect what a public vineyard dataset can establish about harvest estimates.

A small rover carries a camera beneath a trellis with hanging grapes.
A camera moving beside a vine can see the same bunch several times and miss another behind a leaf.

A robot passes the same bunch of grapes in six consecutive frames. If the six boxes all look right, how many bunches has it seen? An AI model can identify visible clusters in an image. A row count also needs a way to associate those detections while the camera moves. A harvest estimate needs another measurement again: the weight of the fruit.

What did the vineyard researchers test?

Santos and colleagues trained neural networks to detect wine-grape bunches and separate their outlines from surrounding leaves and neighboring fruit. In a test subset with individual outlines for 408 bunches in 27 images, the best reported instance-segmentation F1 score reached 0.91. The authors also tested using three-dimensional associations to track bunches along filmed rows. The segmentation score and the row-tracking task describe different results. Santos and colleagues, grape detection and tracking (PDF)

A robotic device in a vineyard, likely engaged in agricultural activities.
A grape bunch behind a leaf contributes no visible outline in that view.

A robot can approach a bunch from more than one angle. Following the outline across frames helps avoid counting it twice. A bunch that stays behind a leaf throughout the pass remains absent from the visual record. To test how many bunches were missed, inspect marked vines independently and match them to the recorded row.

How demanding is an ordinary vineyard frame?

Yenra counted the bounding-box annotations in Embrapa’s published image split. The 242 training frames contain 3,581 labeled bunches. The 58 test frames contain 850. We tried a simple reference prediction that never sees a picture: always guess the training median of 14 bunches. Its mean absolute error on the test set was 4.79 bunches per frame. Guessing the median for each frame’s cultivar reduced the error to 3.76. Embrapa grape image annotations and split files

Test-frame bunch counts vary within every cultivar. The training medians range from 11 for Cabernet Sauvignon and Syrah to 20 for Sauvignon Blanc.
Yenra counted the labeled boxes in each test frame. Each dot represents one photograph. The triangles and dashed line use only training data. Embrapa WGISD annotations, Santos and colleagues.

These are Yenra’s two baselines for the count task. They use only the training annotations and the cultivar code in the filename. Neither baseline locates fruit. A detector that also provides a map of where each bunch is visible answers a question these guesses cannot. The public split contains the same cultivar categories on both sides, so this comparison leaves performance on an unfamiliar cultivar open.

Download the 58-frame bunch-count comparison (CSV). Each row gives the test frame, cultivar code, labeled count, two training-median estimates and their absolute errors.

A vineyard with rows of grapevines laden with purple grapes.
Count distinct bunches before converting a survey into a mass estimate.

Which units are still missing?

To move from a camera pass to a harvest estimate, preserve the row length, the number of unique visible bunches and a field sample relating bunch count to mass. A yield claim requires a later comparison with weighed fruit from the same area. That check can reveal a systematic underestimate on the shaded side of a row even when the frame-level counts look good.

A vineyard with rows of grapevines and a small device in the foreground.
A repeated view of one cluster can improve recognition while adding zero new clusters.

The same distinction between a repeated view and a new individual matters at an orchard trap. From an AI Moth Count to an Orchard Scouting Decision

Try it with the evidence

Try one published test frame

Source notes. Embrapa WGISD bounding boxes. Test frame CDY_2015 has 24 labeled visible bunches. The pooled training median is 14. The training median for its cultivar code CDY is 13. Across all 58 test frames the corresponding mean absolute errors were 4.79 and 3.76 bunches.

Prompt. Compute both absolute errors for this frame. Which baseline wins here and which wins across all frames? Name two additional records needed to turn the image count into a harvest estimate.

Check your reading

For CDY_2015 the pooled error is 10 bunches and the cultivar error is 11. The pooled baseline wins this frame. The cultivar baseline has the lower average error across the split. Unique-bunch tracking across frames and a count-to-mass reference are needed, followed by comparison with weighed fruit from the surveyed rows.

Illustrated field notes

Observing the vine and fruit
An automated disease identification system is being used in a vineyard to detect any signs of disease or pests.
An image can document a visible symptom while leaving its cause unresolved.
An electric vehicle is parked on the road in front of a building with columns and pillars.
Keep an independently reviewed observation with a flagged vine.
A bunch of ripe grapes hanging from a vine in an outdoor setting.
Ripeness requires an observation beyond the number of visible bunches.
A drone is hovering over a rocky terrain in an outdoor setting, possibly used for surveying or mapping purposes.
Sunlit and shaded sides of a row can look different to the same camera.
A serene vineyard at dusk, with rows of grapevines and a tractor parked in the foreground.
Thermal contrast depends on exposure and observation time.
A greenhouse or indoor plant nursery with rows of young grapevine plants growing in black pots on shelves.
Keep the date of an early-season count when comparing it with a later harvest.
A vineyard with well-maintained grapevines and a large white building in the background.
A measurement at vine height can reveal fruit hidden from above.
A machine sorts and selects grapes in an industrial setting.
Visual sorting and weighed marketable yield are separate outcomes.
Moving through a vineyard
Two autonomous robots navigate through a picturesque vineyard at sunset.
A completed route gives the coverage behind a survey count.
A vineyard with rows of healthy grapevines and a small device used for monitoring or maintenance.
Evaluate plant detections where the background is cluttered as well as clear.
An aerial view of a vineyard with rows of grapevines and a tractor in the center.
Map the survey route before using counts to compare vineyard blocks.
A person operating a tractor in a vineyard during sunset.
Report gaps in route coverage along with the distance traveled.
Checking management outcomes
An agricultural machine is shown in a rural area, possibly used for irrigation or harvesting.
Moisture evidence should identify the row, depth and time of observation.
A vineyard with rows of grapevines and a machine in the foreground.
Record what was actually measured before inferring a nutrient problem.
A visually striking representation of historical data integration, evoking a sense of timelessness and interconnectedness.
Retain the cultivar and season represented in a historical training set.
A woman sits in a vineyard at sunset, surrounded by grapevines, and appears to be taking notes on her tablet.
Link a recommendation to the frame and row that prompted it.
A futuristic car dashboard with a blue holographic display in front of a vineyard.
A claim about resource savings needs an actual comparison over time.