Cross-Dataset Plant Disease Classification Under Field Conditions: Reproducible Unsupervised Domain Adaptation and Pareto-Guided Model Selection
Abstract
Plant Swarm is a reproducible research stack for transfer-aware plant disease detection and classification. It combines curated dataset loaders, Ultralytics YOLO detection wrappers, TIMM-based classifiers, and mixed-variable multi-objective swarm search so that Pareto-optimal configurations can be surfaced for both laboratory and in-field imagery. Overview The framework targets experiments where PlantDoc provides heterogeneous web imagery for supervised training and FieldPlant contributes expert-annotated, in-field images for transfer evaluation. Mixed-variable Particle Swarm Optimisation (PSO/MOPSO) explores hyperparameters, preprocessing switches (CLAHE, Retinex, HSV jitter), and model families (YOLOv8/YOLOv8s, ResNet, EfficientNet) while respecting latency and size constraints. Methodology Data ingestion & preprocessing Deterministic dataset recipes in configs/dataset/plantdoc.yaml and configs/dataset/fieldplant.yaml define folder layouts, splits, augmentations, and Albumentations equivalents so cross-validation runs are reproducible. PlantDoc operates in folder-labelled classification mode, whereas FieldPlant accepts a _classes.csv annotation file with multi-label columns. The optional configs/dataset/cross.yaml trains on PlantDoc while reserving FieldPlant for evaluation-only transfer. Label spaces differ across benchmarks; configs/labels/fieldplant_to_plantdoc.json records a mapping for collapsing FieldPlant labels into PlantDoc’s taxonomy when needed. During ingestion the loaders surface deterministic 80/10/10 splits (configurable via split_ratios) and honour environment overrides (FIELDPLANT_PATH). Model families Classification uses TIMM backbones through plantswarm/models/cls_timm.py with linear heads for efficient fine-tuning or frozen-feature evaluation. Detection experiments rely on Ultralytics YOLO wrappers in plantswarm/models/det_yolo.py and the training helper in plantswarm/training/det_loop.py so YOLOv8 variants can be called programmatically inside the search loop. Optimisation strategy The plantswarm/search/ package implements a hierarchy of swarm optimisers: pso_base.py defines particles, velocity updates, and convergence utilities for continuous search. mopso.py and pso_ndwpso.py extend this base to multi-objective settings that preserve non-dominated archives. qd_mapelites.py adds quality-diversity (QD) archiving so distinct high-performing solutions are retained alongside the Pareto front. Continuous hyperparameters (learning rate, HSV jitter) and discrete switches (model family, CLAHE variants) are encoded jointly through plantswarm/search/spaces.py, allowing mixed-variable exploration inside each particle vector. Multi-objective search setup Search configuration files describe which objectives and design variables are active. For example, configs/search/mopso_transfer.yaml targets detection transfer with the mixed space defined in configs/space/joint.yaml: Objective key Description Source mAP_in PlantDoc validation mean Average Precision Ultralytics evaluation inside each YOLO run mAP_xfer FieldPlant evaluation mAP using the same checkpoint --external-test fieldplant evaluation hooks latency_ms Median inference latency on the evaluation device Timing wrapper inside the evaluator params_M Total learnable parameters in millions Model summary from TIMM/Ultralytics Mixed-variable search spaces combine continuous and categorical descriptors. In configs/space/joint.yaml the swarm jointly tunes learning rate bounds and HSV augmentation intensity alongside discrete toggles for the YOLO variant and CLAHE grid size (off, grid4, grid8). Alternative spaces such as configs/space/cls.yaml restrict the search to classification-only backbones, while configs/space/preproc.yaml isolates preprocessing ablations. Pareto archiving & quality diversity MOPSO maintains an external archive of non-dominated solutions. Each particle’s objective vector is compared against the archive; solutions with worse accuracy or higher latency are discarded so the Pareto frontier remains compact. When the archive becomes dense, crowding-distance pruning is applied to preserve coverage across the trade-off surface. The optional MOPSO_QD mode (see configs/search/qd_mopso.yaml) hybridises Pareto selection with MAP-Elites-style bins from plantswarm/search/qd_mapelites.py, ensuring that rare but practically valuable configurations (e.g., ultra-low latency) stay discoverable for deployment studies. Training & evaluation workflow Classification branch The CLI supports deterministic classification training with TIMM backbones, Albumentations augmentation, and optional cross-dataset evaluation: # Train on PlantDoc and evaluate its validation split plantswarm train --dataset plantdoc --epochs 20 --ckpt runs/plantdoc.pt # Cross-dataset evaluation using FieldPlant without fine-tuning plantswarm eval runs/plantdoc.pt fieldplant --split test # Joint configuration: train on PlantDoc, validate on FieldPlant during training plantswarm train --dataset plantdoc --epochs 20 \ --external-test fieldplant --ckpt runs/plantdoc_fieldplant.pt Hyperparameters (--lr, --weight-decay, cosine scheduling) inherit defaults from the dataset YAMLs and can be overridden per run. Albumentations pipelines in the YAML files are activated automatically; --no-albumentations falls back to torchvision-only augmentations for ablation studies. Detection branch Ultralytics models plug into the same infrastructure via the dedicated wrappers: # Minimal YOLOv8n training on a YOLO-format dataset definition python -
Publication details
- Journal / source
- Zenodo (CERN European Organization for Nuclear Research)
- Publication date
- 1 January 2026