LeafBench / README.md
uchandar29's picture
Update README.md
ba0dae3 verified
|
Raw History Blame Contribute Delete
6.12 kB
metadata
pretty_name: LeafBench
license: mit
task_categories:
  - image-text-to-text
  - visual-question-answering
size_categories:
  - 10K<n<100K
configs:
  - config_name: default
    data_files:
      - split: train
        path: train-0000-of-0001.parquet
dataset_info:
  features:
    - name: images
      list:
        - name: bytes
          dtype: 'null'
        - name: path
          dtype: string
    - name: id
      dtype: string
    - name: messages
      list:
        - name: role
          dtype: string
        - name: content
          list:
            - name: type
              dtype: string
            - name: text
              dtype: string
    - name: raw_metadata
      dtype: string
  splits:
    - name: train
      num_examples: 13950
tags:
  - agriculture
  - vision-language
  - vqa
  - agvqa
  - leafnet
  - leafbench
language:
  - en

LeafBench

LeafBench is a multiple-choice visual question answering benchmark for testing how well vision-language models understand plant diseases. It was built from LeafNet, a dataset of about 186,000 leaf images from 22 crop species in 97 classes, collected in 7 countries. Every question asks about the leaf in the image and gives a closed set of answers, so the model must pick one instead of writing free text.

The questions cover 6 tasks, from telling healthy and diseased leaves apart to naming the disease, the crop, the pathogen type, the pathogen's scientific name and the main symptom. The authors tested 12 vision-language models zero-shot. Healthy or diseased questions were easy, with the best models above 90%, but pathogen and scientific name questions stayed below 65% even for frontier models. On the dataset card, GPT-4o averages 72.78%, SCOLD (the authors' own model trained on LeafNet) 72.38% and Gemini 2.5 Pro 69.18%.

Tasks

Task question_type Rows
Healthy-Diseased Classification HDC 2,580
Disease Identification DC 2,580
Crop Species Identification CSI 2,580
Scientific Name Classification SNC 2,070
Pathogen Classification PC 2,070
Symptom Identification SI 2,070

The dataset card calls Disease Identification DI, but the data uses DC. Healthy-Diseased questions have two options (Yes or No). All other questions have four.

Structure

train-0000-of-0001.parquet
images/
  image-train-000-of-001.zip
  path_to_shard.parquet

Each row has:

  • images: list with one {"bytes": null, "path": <sha256>}. The path is the SHA256 of the image bytes and points into a zip shard through images/path_to_shard.parquet.
  • id: leafbench_train_<counter>, for example leafbench_train_0.
  • messages: one user turn (image, then question with options) and one assistant turn (answer).
  • raw_metadata: JSON string with question_id, question_type and raw_image_paths.

Example:

{
  "images": [{"bytes": null, "path": "37a342d681b968f2df2c18298560f39059aeed3fd6beae378addab30fd0076cd"}],
  "id": "leafbench_train_0",
  "messages": [
    {"role": "user", "content": [
      {"type": "image", "text": null},
      {"type": "text", "text": "Does the image show a diseased plant?\nA. Yes\nB. No"}
    ]},
    {"role": "assistant", "content": [{"type": "text", "text": "A. Yes"}]}
  ],
  "raw_metadata": "{\"question_id\": \"hdc::1\", \"question_type\": \"HDC\", \"raw_image_paths\": [\"f3ff804e-bca4-4a23-9af9-1f5b8c5c9980___JR_FrgE.S 3053.JPG\"]}"
}

Changes from the original data

  • Built from the 6 parquet files in data/. All 13,950 rows are kept in the same order. The source has one test split, which is stored here as train.
  • Options come from the A to D columns and are added to the question as lines like A. text. Missing options (C and D in Healthy-Diseased questions) are left out. All text is kept exactly as written, including a leading space in the Scientific Name question and extra spaces in some options.
  • Answers combine the answer letter and its option text, for example A. Yes.
  • raw_metadata keeps question_id and question_type. The image's own path from the source parquet is kept in raw_image_paths. The question, options and answer are already in messages.
  • The images were stored inside the source parquet files, once per question. They are moved into a zip shard and stored once, deduplicated by SHA256. The rows name 2,506 different image files, which hold 2,535 unique images, because some different images share a file name. The dataset card says 2,910 images and the paper says 2,570.
  • The tiny subset in leafbench_tiny.csv (880 questions) is not included. All of its questions are also in the full benchmark.

Usage

from agml import loadImageTextToTextDataset

dataset = loadImageTextToTextDataset("Project-AgML/LeafBench")

sample = dataset["train"][0]
sample["images"]    # list of PIL images
sample["messages"]

Citation

@article{quoc2026leafnet,
  title={LeafNet: A Large-Scale Dataset and Comprehensive Benchmark for Foundational Vision-Language Understanding of Plant Diseases},
  author={Quoc, Khang Nguyen and Dao, Phuong D and Quach, Luyl-Da},
  journal={arXiv preprint arXiv:2602.13662},
  year={2026}
}

This dataset is indexed and structured on https://project-agml.github.io/ as part of Project AgML @ UC Davis. This dataset was reformatted from its original format to match HuggingFace's Imagefolder standards but requires an external module (agml) that processes and returns a HF Dataset object faster than HF module functions.