Datasets:

Modalities:
Image
Text
Formats:
parquet
ArXiv:
License:
File size: 5,920 Bytes
3da879b
12e09f1
d07942c
 
 
 
3da879b
12e09f1
d07942c
12e09f1
d07942c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3da879b
12e09f1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
---
configs:
- config_name: default
  data_files:
  - split: train
    path: data/train-*
license: cc-by-nc-4.0
task_categories:
- image-text-to-text
size_categories:
- 1K<n<10K
dataset_info:
  features:
  - name: images
    list:
      image:
        decode: false
  - name: id
    dtype: string
  - name: messages
    list:
    - name: role
      dtype: string
    - name: content
      list:
      - name: type
        dtype: string
      - name: text
        dtype: string
  - name: origin_dataset
    dtype: string
  - name: raw_metadata
    dtype: string
  splits:
  - name: train
    num_bytes: 5423292272
    num_examples: 4759
  download_size: 5420450003
  dataset_size: 5423292272
---

# AgroCoT

AgroCoT is a multimodal Chain-of-Thought benchmark and instruction dataset for agriculture, covering crop and pest identification, disease diagnosis, plant/insect species recognition, and counting/detection tasks. Each example pairs an image with a multiple-choice or open-ended question, a final answer, and a step-by-step natural-language reasoning trace written by domain experts, spanning 5 task dimensions and 11 question types.

This dataset is indexed on https://project-agml.github.io/ as part of the AgML python library. Standardized to the HF `image_text_to_text` format: one conversational `messages` schema, imagefolder-native images, and (if present) a `text_only` parquet config. All images live in a single flat `images/` directory (no subfolders), following the HF `imagefolder` convention. Each file is named `<source-subdir>_<original-filename>`, sanitized so only `A-Za-z0-9._-` remain — this makes every filename unique across the original nested source folders. The `file_names` field in `metadata.jsonl` points at these flat paths (e.g. `images/Apple_Leaf_Rust_1.jpg`).

## Stats

| | |
|---|---|
| Total QA pairs | 4,759 |
| Unique images | 4,628 |
| Multi-image rows | 504 |
| Task dimensions (`dimension_id` 1-5) | 5 |
| Question format types (`type_id` 1-11) | 11 |

Rows per `type_id`: \
1 → 1,453  \
2 → 684    \
3 → 728    \
4 → 354    \
5 → 97     \
6 → 1,065  \
7 → 97     \
8 → 53     \
9 → 86     \
10 → 7     \
11 → 135           

The source paper organizes the benchmark into 5 first-level task dimensions — Object
Detection, Quantitative Analysis, Disease Monitoring, Spatial Understanding, and
Environmental Management — further split into 15 second-level sub-dimensions (e.g. Organism Identification, Organism Counting, Disease Diagnosis, Boundary Analysis, Agri-Tools). The exact mapping from `dimension_id`/`sub_dimension_id` to these names is not published in the source `VQRA.json`; counts above are reported by raw numeric ID, preserved verbatim in `raw_metadata`.

## Usage

```python
from datasets import load_dataset, concatenate_datasets

# Single image folder -> one default config
ds = load_dataset("Project-AgML/AgroCoT")

# Stream without downloading
ds = load_dataset("Project-AgML/AgroCoT", streaming=True)
```

Every record shares the SAME columns so heterogeneous datasets concatenate cleanly:
`id`, `file_names` (1..N images), `messages`, `origin_dataset`, and `raw_metadata`.
`raw_metadata` is a JSON-encoded string holding every original source field that was NOT
already folded into `messages`/`file_names` (the question, answer, options, and image
paths are omitted to avoid duplication), preserved verbatim, or `{}` if none remain;
restore them with `json.loads(row["raw_metadata"])`. Using a JSON string (not a native struct) is what lets `concatenate_datasets([...])` work across datasets whose raw fields differ in type. Multi-image rows return `images` as a list aligned to the `{"type": "image"}`
placeholders in `messages`.

## Optional preprocessing: Chain-of-Thought reasoning

By default the `assistant` turn in `messages` contains only the final short answer (e.g. A single MCQ letter), matching the rest of the AgML multimodal corpus. The source AgroCoT paper additionally provides a step-by-step `reasoning` trace for every example, which the authors report improves training when combined with the final answer.

This trace is preserved verbatim and is available per-row inside `raw_metadata`. To build a chain-of-thought assistant response, parse `raw_metadata` and prepend the reasoning to the existing answer text:

```python
import json
from datasets import load_dataset

ds = load_dataset("Project-AgML/AgroCoT")

def add_reasoning(example):
    raw = json.loads(example["raw_metadata"])
    reasoning = raw.get("reasoning", "")
    answer = example["messages"][-1]["content"][0]["text"]
    example["messages"][-1]["content"][0]["text"] = f"{reasoning}\n\nFinal Answer: {answer}"
    return example

ds_with_reasoning = ds.map(add_reasoning)
```

This step is optional and not applied by default, to keep the on-disk format identical to the zero-conversion `imagefolder` contract used across the rest of the AgML multimodal datasets.

## Citation

```bibtex
@misc{wen2025agrocot,
      title={AgroCoT: A Chain-of-Thought Benchmark for Evaluating Reasoning in Vision-Language Models for Agriculture},
      author={Wen, Yibin and Li, Qingmei and Ye, Zi and Zhang, Jiarui and Fan, Xiaoya and Mai, Zurong and Wu, Jing and Lou, Shuohong and Chen, Yuhang and Huang, Henglian and Zhang, Yang and Gu, Defeng and Zhao, Lingyuan and Lu, Yutong and Fu, Haohuan and Huang, Jianxi and Zheng, Juepeng},
      year={2025},
      eprint={2511.23253},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2511.23253}
}

Wen, Yibin; Li, Qingmei; Ye, Zi; Zhang, Jiarui; Fan, Xiaoya; Mai, Zurong; Wu, Jing; Lou, Shuohong; Chen, Yuhang; Huang, Henglian; Zhang, Yang; Gu, Defeng; Zhao, Lingyuan; Lu, Yutong; Fu, Haohuan; Huang, Jianxi; Zheng, Juepeng (2025), "AgroCoT: A Chain-of-Thought Benchmark for Evaluating Reasoning in Vision-Language Models for Agriculture", arXiv:2511.23253
```