Results (accuracy, %)
Table with columns: PlantVillage (lab), PlantDoc (field), PlantDoc leaf crops, PlantWild (external), CCMT (farm photos), iNaturalist, species only| PlantVillage (lab) | PlantDoc (field) | PlantDoc leaf crops | PlantWild (external) | CCMT (farm photos) | iNaturalist, species only |
|---|
| 92.2 | 80.1 | 70.9 | 73.2 | 49.9 | 79.6 |
Test sets: PlantVillage 540, PlantDoc 236, crops 422, PlantWild 1,256 (27 classes), CCMT 395 (4 classes), iNaturalist 240 photographs taken after September 2026 (12 species). Most remaining errors are confusions between diseases of the same species.
Usage
The model must be prompted with the exact prompt used in training (prompt.txt); images were resized so that the longest side is 768 px.
import jsonfrom PIL import Imagefrom transformers import AutoModelForImageTextToText, AutoProcessorfrom peft import PeftModel base = "Qwen/Qwen3.8-27B"model = AutoModelForImageTextToText.from_pretrained(base, torch_dtype="bfloat16", device_map="auto")model = PeftModel.from_pretrained(model, "nallaworks/qwen3.8-27b-leaf-symptoms-lora")processor = AutoProcessor.from_pretrained(base)prompt = open("prompt.txt").read() # download from this repository image = Image.open("leaf.jpg").convert("RGB")image.thumbnail((768, 768))messages = [{"role": "user", "content": [{"type": "image"}, {"type": "text", "text": prompt}]}]text = processor.apply_chat_template(messages, add_generation_prompt=True)inputs = processor(text=[text], images=[image], return_tensors="pt").to(model.device)out = model.generate(**inputs, max_new_tokens=80, do_sample=False)print(processor.decode(out[0, inputs["input_ids"].shape[1]:], skip_special_tokens=True))
Hardware: about 55 GB of GPU memory in bfloat16 (trained on an NVIDIA DGX Spark). Training: LoRA rank 16, learning rate 1e-4, 8.2 h on a DGX Spark (1 epoch, 6,390 images); train_meta.json and train_log.jsonl have the details.
Limitations
- Closed label space: 27 classes, no "other" or "unknown" answer; diseases and crops outside the list (e.g. soybean rust, citrus, coffee, sugarcane) are forced into one of them.
- The self-reported confidence is not calibrated.
- Field accuracy is far from perfect, and PlantDoc and PlantWild are web-collected; on farm photographs (CCMT) accuracy is about 50%.
- Intended for research and for triage with human review, not for autonomous diagnosis or treatment decisions.
Citation
Siriani, A. L. R. (2026). Does the lab-to-field gap hold for vision-language models? Code, predictions and LoRA adapters. Zenodo. https://doi.org/10.5281/zenodo.23898477