High-throughput phenotyping tools for blueberry count, weight, and size estimation based on modified YOLOv5s

Xingjian Li, Sushan Ru, Zixuan He, James D. Spiers, Lirong XiangFruit 2025 · DOI

Abstract

The increasing popularity of blueberry has led to expanded blueberry production in many parts of the world. Berry size and average berry weight are key factors in determining the price and marketability of blueberries and therefore are important traits for breeders and researchers to evaluate. Manual measurement of berry size and average berry weight is labor-intensive and prone to human error. This study developed an automated algorithm and smartphone application for accurate blueberry count and size estimation. Two different computer vision pipelines based on traditional methods and deep neural networks were implemented to detect and segment individual blueberries from Red-Green-Blue (RGB) images. The first pipeline used traditional algorithms such as Hough Transform, Watershed, and filtering. The second pipeline deployed YOLOv5 models with additional modifications using the Ghost module and bi-Feature Pyramid Network (biFPN). A total of 198 images of blueberries, together with manually measured berry count and average berry weight, were used to train and test the model performance. The YOLOv5-based model miscounted four berries in 4,604 total berries across the 198 images. The mean average precision was 92.3%, averaged across an intersection-over-union threshold between 0.50−0.95. The model-derived average berry size was highly correlated with measured average berry weight ($R^2 > 0.93$), which translated to a mean absolute error of around 0.14 g (8.3%). An Android application was also developed in this study to allow easier access to implemented models for berry size and weight phenotyping.

Introduction

In blueberry breeding and research, berry size and weight are critical phenotypic traits that directly influence market value and consumer preference. However, the current standard for data collection represents a significant bottleneck. Researchers typically rely on manual counting and weighing of thousands of berries or utilize specialized, expensive laboratory equipment such as the FruitFirm® 1000. These methods are not only slow and labor-intensive but also susceptible to human error and difficult to scale for high-throughput breeding programs.

Overview of traditional blueberry phenotyping workflows, including manual harvesting (a), field weighing (b), lab weighing (c), and manual size/firmness measurements (d, e).

Methodology

This study aimed to automate the phenotyping process using a smartphone-based approach. The researchers compared two primary computer vision strategies:

Traditional Computer Vision

A pipeline was established using the Hough Transform (HT) for circular object detection, followed by Watershed segmentation to separate touching berries. A circularity filter was applied to minimize false positives from non-berry objects.

Modified YOLOv5s Architecture

To overcome the limitations of traditional methods—particularly with clustered berries—the team developed a lightweight deep learning model based on YOLOv5s. Two key architectural modifications were introduced to optimize the model for mobile deployment:

  • Ghost Modules: By replacing standard convolutional layers with Ghost modules, the model generates necessary feature maps using fewer parameters and "cheap" linear operations, reducing the computational burden on smartphone processors.
  • Bidirectional Feature Pyramid Network (biFPN): This enhancement improves multi-scale feature fusion, allowing the model to accurately detect berries of varying sizes and distances from the camera lens.

The resulting model was integrated into a custom Android application developed using the Kivy framework, enabling real-time analysis in the field or lab.

Experimental Results

The models were evaluated using a diverse dataset of 198 images containing 4,604 berries from various genotypes, including Southern Highbush and Rabbiteye cultivars.

Detection and Counting Accuracy

The modified YOLOv5s model demonstrated exceptional performance, miscounting only four berries out of the total 4,604—a negligible error rate of 0.04%. This significantly outperformed the traditional Hough Transform method, which missed 51 berries. The model achieved a mean Average Precision (mAP) of 92.3% across IoU thresholds of 0.50–0.95.

Automated blueberry detection and counting using the modified YOLOv5s model.

Weight Estimation

A key finding of the study was the strong correlation ($R^2 > 0.93$) between the 2D surface area of the berries in the images and their actual 3D weight. Using this relationship, the system estimated average berry weight with a Mean Absolute Error (MAE) of just 0.14g (approximately 8.3% error).

Performance on Mobile Hardware

When tested on a Pixel 7 smartphone, the model processed images in under one second. This speed, combined with high accuracy, confirms the viability of the tool for real-time high-throughput phenotyping.

Conclusion

The developed smartphone application provides a low-cost, accurate, and efficient alternative to manual blueberry phenotyping. By leveraging a modified YOLOv5s architecture with Ghost modules and biFPN, the tool achieves lab-grade precision on consumer-grade mobile hardware. While current testing was conducted in controlled environments, future work will focus on improving robustness for in-field conditions with variable lighting and complex backgrounds.

Summary updated

Abstract

The increasing popularity of blueberry has led to expanded blueberry production in many parts of the world. Berry size and average berry weight are key factors in determining the price and marketability of blueberries and therefore are important traits for breeders and researchers to evaluate. Manual measurement of berry size and average berry weight is labor-intensive and prone to human error. This study developed an automated algorithm and smartphone application for accurate blueberry count and size estimation. Two different computer vision pipelines based on traditional methods and deep neural networks were implemented to detect and segment individual blueberries from Red-Green-Blue (RGB) images. The first pipeline used traditional algorithms such as Hough Transform, Watershed, and filtering. The second pipeline deployed YOLOv5 models with additional modifications using the Ghost module and bi-Feature Pyramid Network (biFPN). A total of 198 images of blueberries, together with manually measured berry count and average berry weight, were used to train and test the model performance. The YOLOv5-based model miscounted four berries in 4,604 total berries across the 198 images. The mean average precision was 92.3%, averaged across an intersection-over-union threshold between 0.50−0.95. The model-derived average berry size was highly correlated with measured average berry weight (<i>R</i><sup>2</sup> &gt; 0.93), which translated to a mean absolute error of around 0.14 g (8.3%). An Android application was also developed in this study to allow easier access to implemented models for berry size and weight phenotyping.
BibTeX
@inproceedings{li2025high,
  author = {Xingjian Li and Sushan Ru and Zixuan He and James D. Spiers and Lirong Xiang},
  title = {{High-throughput phenotyping tools for blueberry count, weight, and size estimation based on modified YOLOv5s}},
  booktitle = {Fruit},
  year = {2025},
  doi = {10.48130/frures-0025-0006},
}
Figure