Can Synthetic Data Overcome the Generalization Limits of AI-Based Flower and Pod Detection Across Cowpea Breeding Genotypes and Environments?
Authors: Hamid Kamangir, Jonathan Berlingeri, Earl Ranario, Isaac Kazuo Uyehara, Lars Lundqvist, Heesup Yun, Christine H. Diepenbrock, Brian N. Bailey, +1 more
Organizations: Department of Biological and Agricultural Engineering, University of California Davis, Davis, CA, USA. · Department of Plant Science, University of California Davis, Davis, CA, USA.
Abstract
High-throughput phenotyping requires AI-enabled computer vision models that generalize across genotypes, locations, and growing seasons, yet such models often lose accuracy under new conditions. Annotating real imagery for every genotype-by-environment (G x E) combination a breeding program encounters is prohibitively expensive. We quantify how G x E shifts affect AI-based detection of cowpea flowers and pods across two California locations and two growing seasons. Flower detection mAP@50 fell from 76.3% to as low as 50.6% under unseen shifts, and pod detection was more sensitive. Feature-space and image-quality diagnostics confirmed these losses track measurable distributional shifts. Because closing this gap with real data alone is not practical, we test whether synthetic imagery, rendered from a procedural 3D cowpea model, can substitute for that annotation burden. Synthetic supervision alone improved over pretraining but remained limited by a domain gap driven by camera image formation, not scene content. A domain-gap-aware camera-realism augmentation strategy, optimized against measured real-image statistics via Wasserstein distance, narrowed this gap, and a linear HDR representation converted a smaller measured gap into a larger detection gain than an 8-bit representation. Optimized HDR synthetic data combined with as few as five real images matched or exceeded the real-data baseline for spatial generalization, and pod detection benefited most at the lowest shot counts, with more modest gains under temporal shift. These results show that synthetic data can overcome the generalization limits of AI-based flower and pod detection, but only when the domain gap is measured and optimized rather than assumed away.
Collecting annotated plant images for automated phenotyping is often slow and expensive. Plant models simulating growth and development can generate unlimited synthetic images with exact labels. However, previous work has established that whether incorporating synthetic data improves performance depends on the ratio of synthetic to real images and the label distribution of the synthetic dataset. To systematically quantify both factors, we train ResNet-18 models on a canola branch-counting task using a calibrated L-system plant model. We vary each factor independently. Synthetic-to-real ratios of 1:5 to 1:22 broadly improve performance; the best ratio (1:7) reduces mean absolute difference by 7.6% over real-only training. For label distribution, a uniform synthetic distribution is strongly suboptimal (abs. diff. of approximately 1.70); interpolating 90% toward the real distribution yields abs. diff. 0.927, whereas Gaussian smoothing of the real label distribution yields the best overall result (abs. diff. 0.912, a 14.7% improvement over real-only). A minimum of 10 synthetic images per label offers a simpler alternative with modest gains, while 100 per label over-corrects and hurts performance.
Amirsalar Darvishpour, Mikolaj Cieslak, Adam Runions
Synthetic images are increasingly used to augment scarce real data for object detection. However, not all synthetic sets help equally, and the only way to know a set's value is to train a detector on it, which is slow and demands dense annotation. We ask whether a training-free metric can instead rank candidate synthetic training sets by their downstream utility. Existing image-set metrics such as FID, KID, and MMD compare two feature distributions with a single global statistic, which we show is mis-specified for detection-data selection in two ways: it is blind to per-image composition (object count, box scale, class mix), and even at fixed composition its global averaging washes out the appearance differences that separate high-mAP pools from low-mAP ones. We propose Conditional-Composition Domain Match (CCDM), which converts any feature-space distance into a composition-stratified comparison, matching candidate and target within metadata-defined strata without training a detector. On COCO and VisDrone-DET, the best CCDM variant ranks 19 candidate training sets in strong agreement with YOLOv8 mAP (Spearman \r{ho} = 0.97 and 0.96), outperforming FID, KID, and MMD. Furthermore, CCDM holds when reference metadata comes from detector pseudo-labels rather than ground-truth boxes.
Real-world synthetic image detectors often generalize poorly under domain shift despite strong in-domain performance. Using unsupervised UMAP projections, we find that natural and synthetic features remain partially separable on unseen datasets, yet performance still drops, suggesting that the classification head overfits to training-domain artifacts. Therefore, the key is to learn more transferable representations so that the decision criterion is more stable and robust to domain shifts. Based on the structural fact that synthetic images are produced by diverse generators, we propose a hierarchical contrastive learning framework that improves the separability between natural and synthetic images while preserving generator identity information. It jointly optimizes (i) a coarse contrastive objective between natural and synthetic images and (ii) a fine contrastive objective among synthetic images using generator identities. Trained on WildFake, our method achieves an average AUROC gain of +10.22 on cross-domain evaluation over Chameleon, AIGIBench, Community Forensics, and GenImage under the same settings as the strong baseline DIRE. For few-shot adaptation, we freeze the backbone and fit an SVM head on 10 labeled samples per class, improving AUROC by +10.64 on AIGIBench and +17.41 on Chameleon, averaged over 12 widely used detectors. Our code is publicly available at: https://github.com/heyongxin233/FiSeR.