Datasets:
Uploading standardized LeafBench dataset with image shards and metadata files
Browse files- README.md +131 -0
- images/image-train-000-of-001.zip +3 -0
- images/path_to_shard.parquet +3 -0
- train-0000-of-0001.parquet +3 -0
README.md
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
pretty_name: LeafBench
|
| 3 |
+
license: other
|
| 4 |
+
task_categories:
|
| 5 |
+
- image-text-to-text
|
| 6 |
+
- visual-question-answering
|
| 7 |
+
size_categories:
|
| 8 |
+
- 10K<n<100K
|
| 9 |
+
configs:
|
| 10 |
+
- config_name: default
|
| 11 |
+
data_files:
|
| 12 |
+
- split: train
|
| 13 |
+
path: train-0000-of-0001.parquet
|
| 14 |
+
dataset_info:
|
| 15 |
+
features:
|
| 16 |
+
- name: images
|
| 17 |
+
list:
|
| 18 |
+
- name: bytes
|
| 19 |
+
dtype: 'null'
|
| 20 |
+
- name: path
|
| 21 |
+
dtype: string
|
| 22 |
+
- name: id
|
| 23 |
+
dtype: string
|
| 24 |
+
- name: messages
|
| 25 |
+
list:
|
| 26 |
+
- name: role
|
| 27 |
+
dtype: string
|
| 28 |
+
- name: content
|
| 29 |
+
list:
|
| 30 |
+
- name: type
|
| 31 |
+
dtype: string
|
| 32 |
+
- name: text
|
| 33 |
+
dtype: string
|
| 34 |
+
- name: raw_metadata
|
| 35 |
+
dtype: string
|
| 36 |
+
splits:
|
| 37 |
+
- name: train
|
| 38 |
+
num_examples: 13950
|
| 39 |
+
---
|
| 40 |
+
|
| 41 |
+
# LeafBench
|
| 42 |
+
|
| 43 |
+
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.
|
| 44 |
+
|
| 45 |
+
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%.
|
| 46 |
+
|
| 47 |
+
- Paper: [LeafNet: A Large-Scale Dataset and Comprehensive Benchmark for Foundational Vision-Language Understanding of Plant Diseases](https://arxiv.org/abs/2602.13662)
|
| 48 |
+
- Original dataset: [enalis/LeafBench](https://huggingface.co/datasets/enalis/LeafBench)
|
| 49 |
+
- Image and caption dataset: [Project-AgML/LeafNet](https://huggingface.co/datasets/Project-AgML/LeafNet)
|
| 50 |
+
- Evaluation code: [EnalisUs/LeafBench](https://github.com/EnalisUs/LeafBench)
|
| 51 |
+
- License: the original dataset card is not consistent. Its metadata says `mit` and its text says CC BY 4.0. Access is gated, and users must agree to use the data for non-commercial purposes only (academic research or education).
|
| 52 |
+
|
| 53 |
+
## Tasks
|
| 54 |
+
|
| 55 |
+
| Task | `question_type` | Rows |
|
| 56 |
+
|---|---|---|
|
| 57 |
+
| Healthy-Diseased Classification | `HDC` | 2,580 |
|
| 58 |
+
| Disease Identification | `DC` | 2,580 |
|
| 59 |
+
| Crop Species Identification | `CSI` | 2,580 |
|
| 60 |
+
| Scientific Name Classification | `SNC` | 2,070 |
|
| 61 |
+
| Pathogen Classification | `PC` | 2,070 |
|
| 62 |
+
| Symptom Identification | `SI` | 2,070 |
|
| 63 |
+
|
| 64 |
+
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.
|
| 65 |
+
|
| 66 |
+
## Structure
|
| 67 |
+
|
| 68 |
+
```
|
| 69 |
+
train-0000-of-0001.parquet
|
| 70 |
+
images/
|
| 71 |
+
image-train-000-of-001.zip
|
| 72 |
+
path_to_shard.parquet
|
| 73 |
+
```
|
| 74 |
+
|
| 75 |
+
Each row has:
|
| 76 |
+
|
| 77 |
+
- `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`.
|
| 78 |
+
- `id`: `leafbench_train_<counter>`, for example `leafbench_train_0`.
|
| 79 |
+
- `messages`: one user turn (image, then question with options) and one assistant turn (answer).
|
| 80 |
+
- `raw_metadata`: JSON string with `question_id`, `question_type` and `raw_image_paths`.
|
| 81 |
+
|
| 82 |
+
Example:
|
| 83 |
+
|
| 84 |
+
```json
|
| 85 |
+
{
|
| 86 |
+
"images": [{"bytes": null, "path": "37a342d681b968f2df2c18298560f39059aeed3fd6beae378addab30fd0076cd"}],
|
| 87 |
+
"id": "leafbench_train_0",
|
| 88 |
+
"messages": [
|
| 89 |
+
{"role": "user", "content": [
|
| 90 |
+
{"type": "image", "text": null},
|
| 91 |
+
{"type": "text", "text": "Does the image show a diseased plant?\nA. Yes\nB. No"}
|
| 92 |
+
]},
|
| 93 |
+
{"role": "assistant", "content": [{"type": "text", "text": "A. Yes"}]}
|
| 94 |
+
],
|
| 95 |
+
"raw_metadata": "{\"question_id\": \"hdc::1\", \"question_type\": \"HDC\", \"raw_image_paths\": [\"f3ff804e-bca4-4a23-9af9-1f5b8c5c9980___JR_FrgE.S 3053.JPG\"]}"
|
| 96 |
+
}
|
| 97 |
+
```
|
| 98 |
+
|
| 99 |
+
### Changes from the original data
|
| 100 |
+
|
| 101 |
+
- 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`.
|
| 102 |
+
- 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.
|
| 103 |
+
- Answers combine the answer letter and its option text, for example `A. Yes`.
|
| 104 |
+
- `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`.
|
| 105 |
+
- 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.
|
| 106 |
+
- The tiny subset in `leafbench_tiny.csv` (880 questions) is not included. All of its questions are also in the full benchmark.
|
| 107 |
+
|
| 108 |
+
## Usage
|
| 109 |
+
|
| 110 |
+
```python
|
| 111 |
+
from agml import loadImageTextToTextDataset
|
| 112 |
+
|
| 113 |
+
dataset = loadImageTextToTextDataset("Project-AgML/LeafBench")
|
| 114 |
+
|
| 115 |
+
sample = dataset["train"][0]
|
| 116 |
+
sample["images"] # list of PIL images
|
| 117 |
+
sample["messages"]
|
| 118 |
+
```
|
| 119 |
+
|
| 120 |
+
## Citation
|
| 121 |
+
|
| 122 |
+
```bibtex
|
| 123 |
+
@article{quoc2026leafnet,
|
| 124 |
+
title={LeafNet: A Large-Scale Dataset and Comprehensive Benchmark for Foundational Vision-Language Understanding of Plant Diseases},
|
| 125 |
+
author={Quoc, Khang Nguyen and Dao, Phuong D and Quach, Luyl-Da},
|
| 126 |
+
journal={arXiv preprint arXiv:2602.13662},
|
| 127 |
+
year={2026}
|
| 128 |
+
}
|
| 129 |
+
```
|
| 130 |
+
|
| 131 |
+
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.
|
images/image-train-000-of-001.zip
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d6461126419a86705d4d1f1edd97b42fdfd938aa15bcf3b41fec5d4e10cb1850
|
| 3 |
+
size 275639867
|
images/path_to_shard.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6751cf4cde182c2bb94a18b736883d5ed0f8d1e94b30096864cb90ab10f09cc7
|
| 3 |
+
size 162584
|
train-0000-of-0001.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c03e0c00222178ffb198dc235b226d18b380bc4d87c779e67e1b753a27ee9a84
|
| 3 |
+
size 1708880
|