Skip to content

About

No description, website, or topics provided.

Resources

Stars

3 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

EEG-EditBench

Probing Visual Information in EEG–Image Retrieval Models with Controlled Image Edits

arXiv Project Page Hugging Face Dataset MIT License

This work presents EEG-EditBench. Beyond 200-way retrieval, it asks a more direct question: can EEG-to-image models distinguish the viewed image from an edited version in which only one visual element has been changed?

EEG-EditBench overview

Dataset

EEG-EditBench is built from the 200 THINGS-EEG2 test images. It contains 2,137 quality-controlled edits covering object identity, attributes, background, and object presence.

Controlled edit types

The complete dataset, including the 200 source images, edited images, and metadata, is available on Hugging Face. After downloading it, place the images under data/images/:

data/images/
└── 00001_aircraft_carrier/
    ├── aircraft_carrier_06s.jpg
    ├── attribute/
    ├── background/
    ├── replacement/
    └── removal/

THINGS-EEG2

Download the original and preprocessed EEG recordings and stimulus images from the official resources:

When evaluating a model directly, preprocess the EEG data according to that model's requirements and pass its location through --eeg-data.

Usage

Preparation

git clone https://github.com/XiaoZhangYES/EEG-EditBench.git
cd EEG-EditBench
python -m pip install -e .

Evaluate with embeddings

Prepare an embeddings.npz file containing:

  • query_ids and query_embeddings for EEG queries;
  • image_ids and image_embeddings for the source and edited images.

Then run:

python scripts/evaluate.py embeddings \
  --manifest manifests/eeg_editbench.jsonl \
  --input embeddings.npz \
  --metric cosine \
  --output results.json

The similarity metric can be cosine or dot.

Evaluate with a model

Copy examples/model_adapter_template.py and connect its three methods to your model. The adapter loads the checkpoint and produces EEG-to-image scores; the benchmark handles image paths and metric computation.

python scripts/evaluate.py model \
  --manifest manifests/eeg_editbench.jsonl \
  --adapter path/to/my_adapter.py \
  --adapter-config path/to/model_config.json \
  --eeg-data path/to/things_eeg2_test_data \
  --output results.json

Prepared score matrices are also supported. See docs/evaluation.md for the input format and command.

Evaluation outputs

Each run writes one results.json containing:

  • 200-way Original accuracy;
  • EP-Top1 accuracy;
  • Identity, Attribute, Background, Removal, and Overall 2AFC accuracy.

Ties are counted as incorrect.

Dataset Construction

EEG-EditBench construction pipeline

Install the optional construction dependencies:

python -m pip install -e '.[construction]'

The construction pipeline is organized as explicit stages for source understanding, edit-target generation, edit-prompt generation, image editing, quality control, and final filtering:

source-manifest -> source-understanding -> *-targets -> *-prompts
                -> images -> result-manifest -> quality-control -> filter

List all stages or inspect the options for one stage with:

eeg-editbench-build --help
eeg-editbench-build source-understanding --help

All prompts are stored as editable Markdown files under prompts/, so users can inspect or replace them without changing the Python code.

Acknowledgement

EEG-EditBench is built on the THINGS-EEG2 test set. We thank the dataset authors for making the EEG recordings, stimulus images, and preprocessing resources publicly available.

We also thank the authors of the following models for releasing the implementations used in our evaluation:

License

The code in this repository is released under the MIT License. Please refer to the Hugging Face dataset page for the dataset release information.

Citation

@misc{zhang2026eegeditbench,
  title         = {EEG-EditBench: Probing Visual Information in EEG--Image Retrieval Models with Controlled Image Edits},
  author        = {Kaifan Zhang and Lihuo He and Yuqi Ji and Junjie Ke and Lukun Wu and Tianhao You and Xinbo Gao},
  year          = {2026},
  eprint        = {2607.27857},
  archivePrefix = {arXiv},
  url           = {https://arxiv.org/abs/2607.27857}
}

About

No description, website, or topics provided.

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages