Growing several wheat varieties together in one field is a promising agroecological practice. To study it, you need to know how much of each variety ends up in the harvest. We classify individual grains from plain RGB photos to estimate those proportions.
Varieties of the same wheat species have grains that look almost identical. Research trials have relied on manual sorting, which farmers can't do at scale. DNA sequencing works but destroys the sample and is hard to parallelize. We asked whether a standard camera and a fine-tuned vision model are enough.
We had hyperspectral data (216 bands) but kept only the three RGB channels. That makes the data 72× smaller, the camera much cheaper, and lets us start from ImageNet-pretrained vision models.
We fine-tuned five ImageNet-pretrained architectures end to end, backbone included: ResNet-18, EfficientNetV2-S, ViT-B/16, Swin-T and ConvNeXt-Tiny. Training uses AdamW with cosine annealing, heavy data augmentation (D4 symmetries, colour jitter, Gaussian noise, random erasing, Mixup/CutMix), label smoothing and stochastic weight averaging. At test time we average predictions over 32 views of each grain.
| Model | Native Y1 | Native Y2 | Params |
|---|---|---|---|
| ConvNeXt-Tiny | 0.944 ± 0.003 | 0.945 ± 0.002 | 28.6 M |
| Swin-T | 0.935 ± 0.002 | 0.931 ± 0.003 | 28.3 M |
| EfficientNetV2-S | 0.934 ± 0.003 | 0.938 ± 0.002 | 24.0 M |
| ViT-B/16 | 0.908 ± 0.003 | 0.911 ± 0.002 | 86.6 M |
| ResNet-18 | 0.853 ± 0.008 | 0.860 ± 0.004 | 11.2 M |
Balanced accuracy, 5-fold cross-validation. Each model fine-tunes in about 10 minutes.