Ripe and unripe tomato counting from handheld camera images using deep-learning detection and segmentation-based classification
Handheld RGB imaging could support tomato-count assessment, but occlusion and variable illumination can impair counting. We compared direct YOLO12m detection with Segment Anything Model (SAM) masks classified by YOLO11-cls. After a provenance review identified overlap between the original counting row and model-development data, evaluation was repeated on 52 images of 13 plants from an independent row, with four views per plant. Manual image-level counts were the reference, and inference used paired errors averaged within plants. On 136 real detector-test tiles, YOLO12m achieved precision 0.868, recall 0.774, [email protected] of 0.817 and [email protected]:0.95 of 0.616. Mean absolute counting errors were 1.08 and 2.12 fruit per image for unripe and ripe fruit with YOLO12m, compared with 1.73 and 8.19 with SAM. Plant-level paired t-tests favoured YOLO12m strongly for ripe fruit (p = 0.000035) and marginally for unripe fruit (p = 0.041, unadjusted). The results support direct detection for image-level counting under the tested conditions. SAM fragmentation remains an unquantified explanation, and transfer across cultivars, seasons, sites and cameras requires independent validation.
Authors
- Anikó Nyéki (ORCID: https://orcid.org/0000-0002-5388-2241)
- Bálint Ambrus (ORCID: https://orcid.org/0000-0002-8591-4041)
- László Moldvai (ORCID: https://orcid.org/0009-0003-2426-852X)
Institutions
- Széchenyi István University (HU)
Publication Details
- Journal
- Scientific Reports
- Published
- 2026-11-26
- DOI
- https://doi.org/10.1038/s41598-026-82131-3
- Primary Topic
- Smart Agriculture and AI
- Type
- article
- Field-Weighted Citation Impact
- 0.00