Vision-Based Counting of Horticultural Seeds Using ViT-UNet Density Regression for Post-Harvest Quality Assessment
Abstract
Reliable counting of horticultural seeds is important for seed grading, batch consistency assessment, packaging, sowing-rate control, and post-harvest quality evaluation. Manual counting is labor-intensive, whereas conventional image-processing methods can be sensitive to seed adhesion, visual similarity, background variation, and illumination changes. This study developed a lightweight ViT-UNet density regression framework for point-supervised multiclass counting of cucumber, tomato, and pepper seeds. Vision Transformer (ViT) features were integrated with a U-Net-style decoder to predict category-specific density maps from RGB images. A dataset containing 231 images and 7789 annotated seed instances was constructed, and a held-out test set of 36 images was used for final evaluation. For total-count estimation, the proposed model achieved a mean absolute error (MAE) of 4.0678, root mean squared error (RMSE) of 5.1896, mean absolute percentage error (MAPE) of 14.7104%, and R2 of 0.8272. Bootstrap resampling yielded a 95% confidence interval of 3.0517–5.1832 for total-count MAE, and paired Wilcoxon signed-rank tests with Holm–Bonferroni correction provided statistical support for lower image-level total-count absolute errors of the proposed model relative to the evaluated deep-learning baselines and the ablation model. The network forward pass reached 94.10 FPS, whereas the full image-processing pipeline reached 2.55 FPS, indicating real-time inference potential at the model level but not yet full-pipeline industrial deployment. These results suggest that ViT-UNet density regression is a useful basis for non-destructive multiclass seed counting, while category-level discrimination, external validation, and pipeline optimization remain priorities for future work.
// Source
Authors: Mengxue Dong, 张春祥 Zhang Chunxiang, Jiegang Mou, Ziheng Tang, Yiming Zhang, Maosen Xu
Institutions: Zhejiang University, National University of Singapore, China Jiliang University