uchandar29 commited on
Commit
90d0df9
·
verified ·
1 Parent(s): 386207b

Uploading LeafNet dataset with image shards and parquet files using Zip Shard Format

Browse files
.DS_Store ADDED
Binary file (6.15 kB). View file
 
README.md ADDED
@@ -0,0 +1,131 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ pretty_name: LeafNet
3
+ license: cc-by-4.0
4
+ task_categories:
5
+ - image-text-to-text
6
+ - visual-question-answering
7
+ size_categories:
8
+ - 100K<n<1M
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: 7117690079
39
+ num_examples: 121337
40
+ download_size: 7117690079
41
+ dataset_size: 7117690079
42
+ ---
43
+
44
+ # LeafNet
45
+
46
+ ![LeafNet sample images](static/LeafNet_sample.jpeg)
47
+
48
+ LeafNet is a large image and text dataset of plant leaf diseases, built to train vision-language foundation models for plant pathology. The full dataset has about 186,000 leaf images from 22 crop species, sorted into 97 classes: 62 diseases caused by fungi, bacteria, oomycetes, viruses and mites, plus healthy leaves for each species. Each image is paired with a caption that names the crop and the disease and describes its symptoms. The symptom descriptions were taken from trusted sources such as NIH, NIFA and published studies, and experts reviewed samples of the data.
49
+
50
+ The images come from public datasets and from the authors' own collection in 7 countries, and most of them are field photos. The authors also built LeafBench, a test set of 2,570 images and 13,950 multiple-choice questions over 6 tasks, and used it to compare vision-language models. Their own model, SCOLD, reached 96.28% on disease identification with no fine-tuning and 99.15% after fine-tuning.
51
+
52
+ This release is the public training part of LeafNet, about 70% of the full dataset, with 121,337 image and caption pairs.
53
+
54
+ - Paper: [LeafNet: A Large-Scale Dataset and Comprehensive Benchmark for Foundational Vision-Language Understanding of Plant Diseases](https://arxiv.org/abs/2602.13662)
55
+ - Related paper: [A Vision-Language Foundation Model for Leaf Disease Identification](https://doi.org/10.1016/j.eswa.2025.130084) (SCOLD)
56
+ - Original dataset: [enalis/LeafNet](https://huggingface.co/datasets/enalis/LeafNet)
57
+ - License: the original dataset card lists `cc-by-4.0`, but access is gated and users must agree to use the data for non-commercial purposes only (academic research or education).
58
+
59
+ ## Structure
60
+
61
+ ```
62
+ train-0000-of-0001.parquet
63
+ images/
64
+ image-train-000-of-002.zip ... image-train-001-of-002.zip
65
+ path_to_shard.parquet
66
+ ```
67
+
68
+ Each row has:
69
+
70
+ - `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`.
71
+ - `id`: `leafnet_train_<counter>`, for example `leafnet_train_0`.
72
+ - `messages`: one user turn (the image only) and one assistant turn (the caption).
73
+ - `raw_metadata`: JSON string with `file_name` and `raw_image_paths`.
74
+
75
+ Example:
76
+
77
+ ```json
78
+ {
79
+ "images": [{"bytes": null, "path": "79bd8128155e97c0f3bd240960b997432e4a6faaa6d15ccc6f207fc1eafcd7d0"}],
80
+ "id": "leafnet_train_0",
81
+ "messages": [
82
+ {"role": "user", "content": [{"type": "image", "text": null}]},
83
+ {"role": "assistant", "content": [{"type": "text", "text": "a image of Tea healthy leaves with leaves appearing normal and healthy"}]}
84
+ ],
85
+ "raw_metadata": "{\"file_name\": \"D:/AI/Dataset/dataset/dataset/000000_Healthy_747.jpg\", \"raw_image_paths\": [\"000000_Healthy_747.jpg\"]}"
86
+ }
87
+ ```
88
+
89
+ ### Changes from the original data
90
+
91
+ - Built from the 7 parquet files in `data/`. All 121,337 rows are kept in the same order, in one `train` split. The paper's 6:2:2 split is not reproduced.
92
+ - The source has no question, only an image and a caption. No question was added: the user turn holds just the image, and the assistant turn is the caption.
93
+ - Captions are kept exactly as written, including their spacing. There are 89 different captions across all rows.
94
+ - `raw_metadata` keeps `file_name` as given in the source, which is a path on the authors' machine. The image's own path from the source parquet is kept in `raw_image_paths`. The caption is already in `messages`.
95
+ - The images were stored inside the source parquet files. They are moved into zip shards and stored once, deduplicated by SHA256, which leaves 80,371 unique images. Every row's image is packed.
96
+
97
+ ## Usage
98
+
99
+ ```python
100
+ from agml import loadImageTextToTextDataset
101
+
102
+ dataset = loadImageTextToTextDataset("Project-AgML/LeafNet")
103
+
104
+ sample = dataset["train"][0]
105
+ sample["images"] # list of PIL images
106
+ sample["messages"]
107
+ ```
108
+
109
+ ## Citation
110
+
111
+ ```bibtex
112
+ @article{quoc2026leafnet,
113
+ title={LeafNet: A Large-Scale Dataset and Comprehensive Benchmark for Foundational Vision-Language Understanding of Plant Diseases},
114
+ author={Quoc, Khang Nguyen and Dao, Phuong D and Quach, Luyl-Da},
115
+ journal={arXiv preprint arXiv:2602.13662},
116
+ year={2026}
117
+ }
118
+
119
+ @article{NGUYENQUOC2025130084,
120
+ title = {A Vision-Language Foundation Model for Leaf Disease Identification},
121
+ journal = {Expert Systems with Applications},
122
+ pages = {130084},
123
+ year = {2025},
124
+ issn = {0957-4174},
125
+ doi = {https://doi.org/10.1016/j.eswa.2025.130084},
126
+ url = {https://www.sciencedirect.com/science/article/pii/S0957417425037005},
127
+ author = {Khang {Nguyen Quoc} and Lan Le {Thi Thu} and Luyl-Da Quach}
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-002.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:96cf0e0b37c8ea783d3796f65d6688ba50a5c3c5e1d4a2fe88a28ea694037db7
3
+ size 5381412874
images/image-train-001-of-002.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:06420ebdab511ccc106a0b85cd981ed8cdb4d42957cf8325b00dd56e5fd07712
3
+ size 1720737358
images/path_to_shard.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:258a056825f5c41c15e6107641db01b1fe25d589e7b66ae380fa6a27cd38c4b2
3
+ size 4925619
static/LeafNet_sample.jpeg ADDED

Git LFS Details

  • SHA256: 2aad0f2d19ab146345b036fc7086df22c1a708487a9dd2cfe3aaa147b5a62209
  • Pointer size: 131 Bytes
  • Size of remote file: 647 kB
train-0000-of-0001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:48697fa7df1d80e068d60e3ab485ff3aaf58cceecf9ec09ed82384133afe0673
3
+ size 10614228