Automatic annotation and performance evaluation of orchard pear fruit using SAM-based zero-shot segmentation
Abstract
High-quality annotated data are essential for training high-performance models; therefore, the automatic annotation of instance segmentation training datasets helps improve model development efficiency and reduce development costs. In this study, the Segment Anything Model (SAM) and its variants, Segment Anything Model 2 (SAM 2) and Segment Anything Model 3 (SAM 3), were employed to achieve fully automatic segmentation of all objects in images by leveraging their zero-shot segmentation capability. Color and roundness were used as prompts to filter masks: the yellow hue and roundness of mature pears differed significantly from non-target objects such as leaves. Based on these features, pear masks were retained and corresponding JSON files were generated to accomplish fully automatic annotation of pears in images of pear tree rows. The dataset obtained through automatic annotation followed by manual correction was compared with a purely manually annotated dataset in terms of model training performance. Experimental results indicate that SAM outperforms SAM2 in terms of recall (0.81 vs. 0.56), Average Precision ( AP ; 0.80 vs. 0.55), and computational efficiency (5.2 s vs. 10.1 s per image), whereas SAM2 achieves higher Precision ( P ; 0.65 vs. 0.42). Compared with SAM3, SAM exhibits lower recall (0.81 vs. 0.91) and AP (0.80 vs. 0.88), but markedly higher Precision (0.42 vs. 0.29) and shorter inference time (5.2 s vs. 8.1 s per image), suggesting that SAM3 tends to generate excessive segmentations and a higher false-positive rate. Notably, the performance metrics of the instance segmentation model trained using the SAM-based automatic annotation approach differ by less than 1% from those of the manually annotated model, indicating accuracy comparable to that of fully manual annotation. Furthermore, when automatic annotation is combined with manual correction, the average annotation time per image is reduced by more than 70% (45 ± 0.6 s vs. 157 ± 5 s for fully manual annotation). These findings demonstrate that, compared with SAM2 and SAM3, the proposed SAM-based automatic annotation approach has strong potential for large-scale and efficient dataset construction in intelligent agriculture–related vision applications.
Fields of Study & Subjects
Smart Agriculture and AI
Spectroscopy and Chemometric Analyses
Postharvest Quality and Shelf Life Management
Publication details
- Journal / source
- Smart Agricultural Technology
- Publisher
- Elsevier BV
- Volume
- 13
- Pages
- 101826–101826
- Publication date
- 23 January 2026
- Language
- EN