Vision-Based Counting of Horticultural Seeds Using ViT-UNet Density Regression for Post-Harvest Quality Assessment
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.
Authors
- 张春祥 Zhang Chunxiang
- Maosen Xu (ORCID: https://orcid.org/0000-0002-3310-1698)
- Ziheng Tang (ORCID: https://orcid.org/0009-0001-9910-6539)
- Yiming Zhang (ORCID: https://orcid.org/0000-0001-8547-6654)
- Jiegang Mou
- Mengxue Dong
Institutions
- National University of Singapore (SG)
- China Jiliang University (CN)
- Zhejiang University (CN)
Publication Details
- Journal
- Horticulturae
- Published
- 2026-08-03
- DOI
- https://doi.org/10.3390/horticulturae12080961
- Primary Topic
- Smart Agriculture and AI
- Type
- article
- Field-Weighted Citation Impact
- 0.00
Funders
- China Scholarship Council
- Department of Education of Zhejiang Province