uchandar29 commited on
Commit
088e540
·
verified ·
1 Parent(s): f780ad6

Uploading standardized LeafBenchV2 dataset with image shards and metadata files in Zip Shard Format

Browse files
README.md ADDED
@@ -0,0 +1,147 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ pretty_name: LeafBenchV2
3
+ license: cc-by-4.0
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_bytes: 401694166
39
+ num_examples: 54580
40
+ download_size: 401694166
41
+ dataset_size: 401694166
42
+ ---
43
+
44
+ # LeafBenchV2
45
+
46
+ LeafBenchV2 is a multiple-choice visual question answering benchmark for testing how well vision-language models understand plant diseases. It comes with LeafNet 2.0, an image and text dataset of about 256,000 leaf images from 37 crop species and 197 crop and disease classes, collected across 9 regions with tropical, subtropical and temperate climates. The benchmark images are taken from the LeafNet2.0 evaluation subset of 6,361 images, which were checked by hand.
47
+
48
+ Each image is asked up to 9 questions, one per task, ranging from simple checks such as healthy or diseased to fine-grained questions about the pathogen, its scientific name and the lesions. The authors tested 16 vision-language models. Gemini 2.5 Pro scored best overall with 67.78%, GPT-4o reached 64.72% and the best open model, Qwen3-VL-4B, reached 60.02%. Most models scored above 90% on healthy or diseased classification but dropped sharply on pathogen, scientific name and lesion questions. Models trained on agricultural data did better than several larger general models on symptom questions.
49
+
50
+ LeafBenchV2 follows LeafBench from the first LeafNet paper, which had 13,950 questions over 6 tasks.
51
+
52
+ - Paper: [A multiregional image–text dataset and benchmark for vision-language modeling of plant diseases](https://doi.org/10.64898/2026.07.01.735881) (bioRxiv)
53
+ - Related paper: [LeafNet: A Large-Scale Dataset and Comprehensive Benchmark for Foundational Vision-Language Understanding of Plant Diseases](https://arxiv.org/abs/2602.13662)
54
+ - Original dataset: [enalis/LeafBenchV2](https://huggingface.co/datasets/enalis/LeafBenchV2)
55
+ - Image and caption dataset: [Project-AgML/LeafNet2.0](https://huggingface.co/datasets/Project-AgML/LeafNet2.0)
56
+ - Evaluation code: [EnalisUs/LeafBench](https://github.com/EnalisUs/LeafBench)
57
+
58
+ ## Tasks
59
+
60
+ | Task | `question_type` | Rows |
61
+ |---|---|---|
62
+ | Disease Identification | `DI` | 6,306 |
63
+ | Pathogen Classification | `PC` | 6,306 |
64
+ | Crop Species Identification | `CSI` | 6,306 |
65
+ | Symptom Identification | `SI` | 6,306 |
66
+ | Healthy/Diseased Classification | `HDC` | 6,306 |
67
+ | Scientific Name Classification | `SNC` | 6,306 |
68
+ | Leaf Symptom Detection | `LSD` | 6,282 |
69
+ | Disease Severity Classification | `DSC` | 6,282 |
70
+ | Lesion Identification | `LI` | 4,180 |
71
+
72
+ Every question has four options, A to D. Healthy/Diseased and Disease Severity questions have only two real options, and their other options are the text `nan` in the source.
73
+
74
+ ## Structure
75
+
76
+ ```
77
+ train-0000-of-0001.parquet
78
+ images/
79
+ image-train-000-of-001.zip
80
+ path_to_shard.parquet
81
+ ```
82
+
83
+ Each row has:
84
+
85
+ - `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`.
86
+ - `id`: `leafbenchv2_train_<counter>`, for example `leafbenchv2_train_0`.
87
+ - `messages`: one user turn (image, then question with options) and one assistant turn (answer).
88
+ - `raw_metadata`: JSON string with `question_id`, `question_type`, `image_folder` and `raw_image_paths`.
89
+
90
+ Example:
91
+
92
+ ```json
93
+ {
94
+ "images": [{"bytes": null, "path": "412729ce8fb7275534901ca894eae6e3220af05b1f154343fe288f7d5ee10881"}],
95
+ "id": "leafbenchv2_train_0",
96
+ "messages": [
97
+ {"role": "user", "content": [
98
+ {"type": "image", "text": null},
99
+ {"type": "text", "text": "What disease is shown on the Apple leaf in this image?\nA. Black rot\nB. Powdery mildew\nC. Narrow Brown Spot\nD. leaf blight"}
100
+ ]},
101
+ {"role": "assistant", "content": [{"type": "text", "text": "A. Black rot"}]}
102
+ ],
103
+ "raw_metadata": "{\"question_id\": \"DI:1\", \"question_type\": \"DI\", \"image_folder\": \"Apple___Black_rot\", \"raw_image_paths\": [\"Apple___Black_rot_0156.JPG\"]}"
104
+ }
105
+ ```
106
+
107
+ ### Changes from the original data
108
+
109
+ - Built from the 7 parquet files in `data/`. All 54,580 rows are kept in the same order. The source has one `test` split, which is stored here as `train`.
110
+ - Options come from the `A` to `D` columns and are added to the question as lines like `A. text`. Option text is kept exactly as written, including extra spaces and the literal `nan` options.
111
+ - Answers combine the answer letter and its option text, for example `A. Black rot`. In 2,705 rows the correct option is `nan`, mostly pathogen and scientific name questions on healthy leaves. These rows are kept as they are, so their answer reads like `C. nan`.
112
+ - `raw_metadata` keeps `question_id`, `question_type` and `image_folder`. The `image_name` column is kept in `raw_image_paths`. The question, options and answer are already in `messages`.
113
+ - 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 6,305 different images, which hold 6,189 unique images. The paper reports 6,361 benchmark images.
114
+ - The images here are encoded differently from the same pictures in LeafNet 2.0, for example PNG instead of JPEG, so only 25 of them share a hash with LeafNet 2.0 images.
115
+
116
+ ## Usage
117
+
118
+ ```python
119
+ from agml import loadImageTextToTextDataset
120
+
121
+ dataset = loadImageTextToTextDataset("Project-AgML/LeafBenchV2")
122
+
123
+ sample = dataset["train"][0]
124
+ sample["images"] # list of PIL images
125
+ sample["messages"]
126
+ ```
127
+
128
+ ## Citation
129
+
130
+ ```bibtex
131
+ @article{nguyen2026leafnet2,
132
+ title={A multiregional image--text dataset and benchmark for vision-language modeling of plant diseases},
133
+ author={Nguyen, Trang V. and Quoc, Khang Nguyen and Harwath, David and Quach, Luyl-Da and Dao, Phuong D.},
134
+ journal={bioRxiv},
135
+ year={2026},
136
+ doi={10.64898/2026.07.01.735881}
137
+ }
138
+
139
+ @article{quoc2026leafnet,
140
+ title={LeafNet: A Large-Scale Dataset and Comprehensive Benchmark for Foundational Vision-Language Understanding of Plant Diseases},
141
+ author={Quoc, Khang Nguyen and Dao, Phuong D and Quach, Luyl-Da},
142
+ journal={arXiv preprint arXiv:2602.13662},
143
+ year={2026}
144
+ }
145
+ ```
146
+
147
+ 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:0061c75f486cca94dde8123e0ffb56cc02437090326b76843f0d1d6aaf5f4991
3
+ size 394833919
images/path_to_shard.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cab7b665d20375bb5a969dc534ea0ee8f5a26e441e422a5433041d8d870f1666
3
+ size 394123
train-0000-of-0001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9c07b52f9be6f2bdfa1b7adc3f372d14a4c8fae6587587b802a51119f41bff91
3
+ size 6466124