From lab leaves to field photos

Abstract

A crop disease classifier covering 38 classes, trained on clean lab images, collapses on messy field photos: 0.95 F1 in the lab against 0.11 in the field. Twelve sprints of ablations across mixed domain training, backbone sweeps, routing and segmentation converged on one ResNet-50 recipe that holds 0.95 lab F1 with 0.65 field F1.

0.00Field F1 (PlantDoc)
0.00Lab F1 (PlantVillage)
0Disease classes
0Training sprints
Data

Two datasets, two worlds

Method

Twelve sprints, one rule

Every claim ships with a number. Checkpoints only survive if they beat what came before on both worlds.

S0 + S1

Baseline

Start simple, measure everything

Deterministic splits, a frozen MobileNetV2 head, logging from day one: 0.9613 accuracy and 0.9501 F1 on PlantVillage.

0.96Lab accuracy
0.95Lab F1
S3

Robustness

Augment train, never test

Flips, rotation, brightness, blur and JPEG noise on the train set only; a run ships only if it beats the baseline.

S4

The field gap

Lab accuracy collapses outdoors

The baseline managed 0.11 F1 on PlantDoc. Fine tuning recovered 0.51 but forgot PlantVillage, dropping it to 0.31. The gap became the thesis.

0.11Field F1
0.31Lab F1
S5 + S6

Mixed training

Concatenate domains, keep both

Joint PlantVillage + PlantDoc batches held 0.96 lab with 0.41 field and no forgetting. Eightfold field upsampling added nothing.

0.96Lab F1
0.41Field F1
S7

Capacity

Bigger backbones trade, never win

ResNet-50 cleared 0.65 in the field but forgot the lab at 0.29. No single head passed both gates, so the architecture had to change.

0.65Field F1
0.29Lab F1
S8 + S9 + S11

The routing detour

A documented negative result

Two heads, two backbones, a learned router at 74%: routed scoring reached 0.39 against the single model's 0.63. Routing was shelved.

74%Router accuracy
0.39Routed score
S10

Segmentation

Cutting leaves out hurts

GrabCut preprocessing dropped field F1 from 0.41 to 0.27. The same sweep found the real lever: backbone learning rate with repeat 20 sampling.

0.27Field F1
S12

The final recipe

Cheap levers, then ship

Test time augmentation did nothing. Class balanced sampling cleared every gate: 0.661 field accuracy, 0.654 field F1, lab intact.

Shipped to production
0.66Field accuracy
0.65Field F1
CheckpointLab accField accField F1
Stage 1 baseline0.960.140.11
Mixed training0.960.410.41
Repeat 20 sweep0.990.630.56
Shipped · class balanced0.960.660.65

Held out test splits, seed 42. Accuracy counts the top guess; F1 is macro.

Everything behind these numbers

Ablation logs, confusion matrices, plots and the shipped weights live in the results folder.

© 2026 Folium. All Rights Reserved