MACE-Bench / README.md
tirtho149's picture
Add retriever study (code, predictions, one-pager), refresh response cache
874eec2 verified
|
Raw History Blame Contribute Delete
11.6 kB
metadata
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

MACE

Memory-Augmented Crop-Disease Evaluation of Frozen Vision-Language Models

Tirtho Roy*, Shreyan Ganguly*, Muhammad Arbab Arshad, Nikhil Bhattacharya, Soumik Sarkar
Iowa State University  ·  AgriAI 2027 Workshop at AAAI-27 (under review)  ·  *equal contribution

Project page OpenReview Code CC BY 4.0

10 crops  ·  5,601 images  ·  1,600 locked queries  ·  418 memory banks  ·  12,438 evaluation jobs with full prompts and replies


🌶️ 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.

MACE overview

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

Memory entry, BM25 scoring and traces

The same entry as stored in the files

captions.json["s15_r12256"]

{
  "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: ...

🌾 Per-crop gain

Gain over SAGE per crop

Crops, queries and memory sizes
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.

📦 What is in the repository

Folder map
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.

🔎 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/.

⚡ Quick start

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

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 (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

@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}
}