File size: 11,622 Bytes
c8e03af
 
 
 
076a01d
 
c8e03af
 
076a01d
c8e03af
076a01d
54db8d6
57d4e57
c8e03af
076a01d
54db8d6
57d4e57
076a01d
 
54db8d6
57d4e57
076a01d
 
54db8d6
57d4e57
076a01d
 
54db8d6
57d4e57
076a01d
 
54db8d6
57d4e57
076a01d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c8e03af
 
076a01d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c8e03af
076a01d
c8e03af
076a01d
 
 
c8e03af
076a01d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c8e03af
 
 
076a01d
 
 
 
 
 
 
 
c8e03af
076a01d
 
57d4e57
874eec2
076a01d
 
 
 
 
c8e03af
076a01d
c8e03af
874eec2
 
 
 
 
 
 
 
 
 
 
 
 
 
076a01d
c8e03af
076a01d
 
 
54db8d6
 
076a01d
 
c8e03af
076a01d
c8e03af
 
076a01d
c8e03af
076a01d
c8e03af
076a01d
c8e03af
 
076a01d
 
 
 
c8e03af
076a01d
c8e03af
076a01d
 
 
c8e03af
076a01d
 
c8e03af
076a01d
c8e03af
 
 
 
 
 
 
 
 
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
---
license: cc-by-4.0
pretty_name: MACE-Bench
language: [en]
task_categories: [image-classification, visual-question-answering]
tags: [agriculture, plant-disease, crop-disease, vision-language-model, retrieval-augmented-generation, memory, benchmark, out-of-distribution]
size_categories: [1K<n<10K]
configs:
  - config_name: images
    default: true
    data_files:
      - split: train
        path: viewer/images-*.parquet
  - config_name: memory_banks
    data_files:
      - split: train
        path: viewer/memory_banks.parquet
  - config_name: captions
    data_files:
      - split: train
        path: viewer/captions.parquet
  - config_name: queries
    data_files:
      - split: train
        path: viewer/queries.parquet
  - config_name: predictions_P1
    data_files:
      - split: train
        path: viewer/predictions_P1.parquet
  - config_name: results_per_query
    data_files:
      - split: train
        path: viewer/results_per_query.parquet
---

<p align="center">
  <img src="https://huggingface.co/datasets/tirtho149/MACE-Bench/resolve/main/assets/og_image.png" alt="MACE" width="720">
</p>

<h3 align="center">Memory-Augmented Crop-Disease Evaluation of Frozen Vision-Language Models</h3>

<p align="center">
  Tirtho Roy*, Shreyan Ganguly*, Muhammad Arbab Arshad, Nikhil Bhattacharya, Soumik Sarkar<br>
  Iowa State University &nbsp;·&nbsp; AgriAI 2027 Workshop at AAAI-27 (under review) &nbsp;·&nbsp; *equal contribution
</p>

<p align="center">
  <a href="https://mace-bench.github.io/"><img src="https://img.shields.io/badge/Project-Page-e4572e?style=for-the-badge" alt="Project page"></a>
  <a href="https://openreview.net/forum?id=cY4X3GOwDA"><img src="https://img.shields.io/badge/OpenReview-AgriAI%202027-8c1b13?style=for-the-badge" alt="OpenReview"></a>
  <a href="https://github.com/MACE-Bench/MACE-Bench.github.io"><img src="https://img.shields.io/badge/Code-GitHub-24292e?style=for-the-badge&logo=github" alt="Code"></a>
  <img src="https://img.shields.io/badge/License-CC%20BY%204.0-2e9a4f?style=for-the-badge" alt="CC BY 4.0">
</p>

<p align="center">
  <b>10 crops</b> &nbsp;·&nbsp; <b>5,601 images</b> &nbsp;·&nbsp; <b>1,600 locked queries</b> &nbsp;·&nbsp; <b>418 memory banks</b> &nbsp;·&nbsp; <b>12,438 evaluation jobs with full prompts and replies</b>
</p>

---

## 🌶️ What is MACE?

A frozen vision-language model (VLM) diagnoses crop disease better when it can look things up. **MACE** gives it two
things: a source-grounded symptom knowledge base, and a **caption memory**. Each labeled reference image is described
once, in seven fields, by a captioner that never sees the label. At test time the test image is described the same way,
BM25 retrieves the four closest memory captions, and the VLM reads those captions **with their labels** (never the
memory images) before it answers. No training.

<p align="center">
  <img src="https://huggingface.co/datasets/tirtho149/MACE-Bench/resolve/main/assets/overview.png" alt="MACE overview" width="100%">
</p>

| Claude Sonnet 5.5, 10 crops | In distribution | Held-out collection |
|---|:---:|:---:|
| SAGE (knowledge base only) | 42.8 | 50.7 |
| DINOv2 1-NN label lookup | 52.5 | 38.2 |
| Labels only (no captions) | 55.8 | 54.8 |
| **MACE retrieval** | **62.2** | **57.0** |

Accuracy (%), equal-crop mean. Claude Haiku 5.5 also ranks MACE above labels only and SAGE. Retrieved labels carry most of the gain; caption
text adds about six points in distribution. Run `python results/verify.py` to recompute every number.

## 🔍 Browse it here

Use the **dataset viewer** above. Each config is a live table:

| Config | What you see |
|---|---|
| `images` | Every image with crop, disease, source collection, its role (query or memory) and its full label-free caption |
| `memory_banks` | Every memory bank exactly as used: crop, seed, fold, K, member images with labels, and the queries it served |
| `captions` | The seven caption fields of every image, one column each |
| `queries` | The 1,640 locked queries with split and panel flags |
| `predictions_P1` | SAGE and MACE answers, confidence, cited evidence, retrieved memory and explanation for all 1,600 queries |
| `results_per_query` | One row per query, one column per method (1 = correct) |

## 🧠 What one memory entry looks like

<p align="center">
  <img src="https://huggingface.co/datasets/tirtho149/MACE-Bench/resolve/main/assets/memory_trace.png" alt="Memory entry, BM25 scoring and traces" width="100%">
</p>

<details>
<summary><b>The same entry as stored in the files</b></summary>

`captions.json["s15_r12256"]`

```json
{
  "organ": "whole_plant",
  "location": "Vine with leaves lying over soil; older leaves lower and at right",
  "lesion_shape_margin": "Irregular dried patches spreading from leaf edges; margins diffuse, tan-to-green transition",
  "color": "Green leaves; some yellowing; dried areas beige to tan-brown",
  "texture": "Dry, papery, crinkled dead tissue; healthy leaves rough with visible veins",
  "distribution": "Several leaves affected, mostly edges and tips; others fully green",
  "visible_discriminators": "Wilted, curled leaves; yellow-green blotching; dark soil; thin tendrils; small yellow flower",
  "uncertainty": "Cannot tell extent of damage on undersides; some leaf areas shadowed or overlapping"
}
```

In the VLM prompt it appears as one line:
`[m_s15_r12256] (label: Bacterial Wilt) organ: whole_plant; location: ...; visible_discriminators: ...`

</details>

## 🌾 Per-crop gain

<p align="center">
  <img src="https://huggingface.co/datasets/tirtho149/MACE-Bench/resolve/main/assets/crops.png" alt="Gain over SAGE per crop" width="100%">
</p>

<details>
<summary><b>Crops, queries and memory sizes</b></summary>

| Crop | IID queries | Held-out queries | Held-out collection | Memory images used |
|---|:---:|:---:|---|:---:|
| Apple | 100 | 60 | Bugwood | 333 |
| Corn | 100 | 60 | Bugwood | 1,022 |
| Cucumber | 100 | 60 | Bugwood | 286 |
| Grape | 100 | 60 | Bugwood | 226 |
| Mango | 100 | 60 | LeafNet | 204 |
| Potato | 100 | 60 | Bugwood | 172 |
| Rice | 100 | 60 | SBRD | 270 |
| Soybean | 100 | 60 | Bugwood | 962 |
| Tomato | 100 | 60 | CDDM | 765 |
| Wheat | 100 | 60 | Bugwood | 301 |

Memory images used = union over the three selection seeds, all folds and K in {1, 4, 16}. A query never sits in its own
memory, and the held-out collection never enters memory.

</details>

## 📦 What is in the repository

<details open>
<summary><b>Folder map</b></summary>

| Path | Contents |
|---|---|
| `benchmark/images/` | All 5,601 study images (1,640 queries, 4,541 memory images; 580 are both, in different folds) plus `metadata.csv` |
| `benchmark/splits/` | Frozen splits: IID 5 folds x 3 seeds, held-out collections, and `memory.parquet` (facility-location memory selections, nested over K) |
| `benchmark/kb/`, `benchmark/metadata/` | Symptom knowledge base for every crop; full AgMEM-Bench v2.1 metadata |
| `metadata.csv` | One row per study image: crop, label, collection, query/memory role, SAGE row, SHA-256 |
| `captions.json` | Label-free caption of every image |
| `study/` | Locked queries, panels, `memory_banks.jsonl`, `evaluation_jobs.jsonl.gz` (every job with its exact memory list), captions table |
| `runs/P1` ... `runs/P9` | Per package: predictions, full traces (prompt text and raw reply of every call), manifest, status |
| `results/` | Per-query results, every reported number, verify scripts, cost and budget ledgers, follow-up results |
| `extension/` | Follow-up tests E1 to E4: protocol, raw and processed results, statistics, tables, figures, report |
| `cache/` | Response cache of all 31,326 cached calls, and agentic-run records, so reruns replay for free |
| `code/` | Full pipeline: `agmem/` (packets, prompts, BM25, agent, model interface), `mace10/` (study), `benchmark/`, `experiments/`, `tests/` |
| `viewer/` | Parquet copies of the tables shown in the dataset viewer (images embedded); the raw files above are the source |
| `retriever_study/` | Follow-up retriever study: summary, one-pager; its code and results are in `code/experiments/retriever_pilot/` |
| `assets/` | Figures used on this card |

Packages: **P1** SAGE and MACE · **P2** MACE on selection seeds 1 and 2 · **P3** memory size K = 1 and 16 ·
**P4** labels only, masked, shuffled, random · **P5** same- vs other-source memory · **P6** agentic MACE ·
**P7** image references · **P8** labels only on all queries · **P9** DINOv2-retrieved labels.

</details>

## 🔎 Follow-up: can a small neural retriever replace BM25?

We replaced BM25 with small scoring networks, including a 29-parameter MLP whose weights a larger LLM writes from the
feature schema, memory captions or labeled examples, and reran diagnosis on all 1,600 queries with everything else fixed.

| Model (IID / held-out) | MACE, BM25 | BM25 + image similarity | LLM-written MLP |
|---|:---:|:---:|:---:|
| Sonnet 5.5 | 62.2 / 57.0 | 63.5 / 58.8 | 62.0 / 57.7 |
| Haiku 5.5 | 55.5 / 53.5 | 57.3 / 54.7 | 57.4 / 54.2 |

No difference is significant. The LLM-written MLP matches BM25 on retrieval, while the same network fitted on the same
16 examples falls 20 points behind. Details, code, every prediction and a one-page summary:
[`retriever_study/`](https://huggingface.co/datasets/tirtho149/MACE-Bench/tree/main/retriever_study).

## ⚡ Quick start

```python
from datasets import load_dataset

imgs  = load_dataset("tirtho149/MACE-Bench", "images", split="train")        # image + crop, label, role, caption
banks = load_dataset("tirtho149/MACE-Bench", "memory_banks", split="train")  # every memory bank as used
print(imgs[0]["label"], "|", imgs[0]["caption"][:120])
```

## ♻️ Reproduce

```bash
huggingface-cli download tirtho149/MACE-Bench --repo-type dataset --local-dir MACE-Bench && cd MACE-Bench
pip install -r code/requirements.txt
python results/verify.py                                     # every reported accuracy, under a minute
cd code && mkdir -p .cache && tar -xzf ../cache/llm.tar.gz -C .cache
AGMEM_DATA=$PWD/../benchmark python verify_release.py        # rebuilds all memory banks and jobs, replays every call
```

We ran this on a fresh copy of the repository. All 12,438 jobs, including every memory bank, rebuild identically. All
5,601 captions and 11,998 text diagnoses replay from the cache, so every prompt is reproduced byte for byte, and each
cached reply gives the saved prediction. `python -m mace10.results` recomputes all 1,062 values of
`results/results.json`. Full steps, including fresh reruns, are in `REPRODUCE.md`.

## 📜 Sources and license

Images, labels and the knowledge base come from [SAGE](https://huggingface.co/datasets/tirtho149/SAGE) (CC BY 4.0)
through AgMEM-Bench v2.1, with near-copies and images containing disease-naming text removed. Captions, memory banks,
predictions, traces and results are CC BY 4.0; code is MIT (`benchmark/LICENSE.md`). Every image keeps its original
collection in `metadata.csv` (`collection`, `orig_filename`): PlantWild, Bugwood, Soybean disease, Corn disease, CDDM,
BD crop/vegetable, LeafNet, PlantDoc, PlantVillage and others. Some original collections have their own terms, so
please check and credit the original source when you reuse individual images.

## 📖 Citation

```bibtex
@unpublished{roy2026mace,
  title  = {MACE: Memory-Augmented Crop-Disease Evaluation of Frozen Vision-Language Models},
  author = {Roy, Tirtho and Ganguly, Shreyan and Arshad, Muhammad Arbab and Bhattacharya, Nikhil and Sarkar, Soumik},
  note   = {AgriAI 2027 Workshop at AAAI-27, under review},
  year   = {2026}
}
```