Update README.md
Browse files123123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190---
license: mit
------license: mit---
# HC-Bench
**HC-Bench** is a compact multi-part image benchmark for evaluating recognition and prompting robustness, especially in **hidden-content** scenes. It contains:
- **object/** — 56 base images and 56 *hidden* variants of the same lemmas, plus prompts and metadata.- **text/** — 56 Latin/English and 56 Chinese lemma–description pairs with matching PNGs.- **wild/** — 53 in-the-wild images for additional generalization checks.
---
## Repository structure
```
HC-Bench/├─ object/│ ├─ base/ # 56 base images (7 types × 8 lemmas)│ ├─ hidden/ # 56 hidden-content variants (same lemmas)│ ├─ image\_base.txt # 7 types and their 8 lemmas each│ ├─ image\_generate\_prompts.txt# per-lemma scene prompts used for generation│ └─ lemmas\_descriptions.json # \[{Type, Lemma, Description}] × 56├─ text/│ ├─ Latin/ # 28 English PNGs│ ├─ Chinese/ # 28 Chinese PNGs│ ├─ English\_text.json # 56 entries (Type, Length, Rarity, Lemma, Description)│ └─ Chinese\_text.json # 56 entries (Type, Length, Rarity, Lemma, Description)└─ wild/ # 53 PNGs
````
---
## Contents
### `object/`- **`base/`**: Canonical image per lemma (e.g., `Apple.jpg`, `Einstein.png`).- **`hidden/`**: Composite/camouflaged image for the *same* lemma set (e.g., `apple.png`, `einstein.png`).- **`image_base.txt`**: The 7 high-level types and their 8 lemmas each (Humans, Species, Buildings, Cartoon, Furniture, Transports, Food).- **`image_generate_prompts.txt`**: Per-lemma prompts used to compose/generate scenes (e.g., *“A monorail cutting through a futuristic city with elevated walkways”* for `notredame`).- **`lemmas_descriptions.json`**: Minimal metadata with `{Type, Lemma, Description}` aligned 1:1 with the 56 lemmas.
### `text/`- **`Latin/`** & **`Chinese/`**: 28 images each (total 56).- **`English_text.json`** & **`Chinese_text.json`**: 56-entry lists pairing lemmas to descriptions in two languages. (Note: The `English_text.json`/`Chinese_text.json` files include extra fields `Length` and `Rarity` for flexibility.)
### `wild/`- 53 natural/urban scenes for robustness and transfer evaluation.
---
## Quick start (🤗 Datasets)
> HC-Bench uses the **ImageFolder**/“imagefolder” style. Class labels are inferred from directory names when present (e.g., `base`, `hidden`). If you prefer raw images without labels, pass `drop_labels=True`.
### Load **object/base** and **object/hidden**```pythonfrom datasets import load_dataset
base = load_dataset( "imagefolder", data_files="https://huggingface.co/datasets/JohnnyZeppelin/HC-Bench/resolve/main/object/base/*", split="train", drop_labels=True, # drop automatic label inference)
hidden = load_dataset( "imagefolder", data_files="https://huggingface.co/datasets/JohnnyZeppelin/HC-Bench/resolve/main/object/hidden/*", split="train", drop_labels=True,)````
### Load **wild/**
```pythonwild = load_dataset( "imagefolder", data_files="https://huggingface.co/datasets/JohnnyZeppelin/HC-Bench/resolve/main/wild/*", split="train", drop_labels=True,)```
### Load the **JSON** metadata (English/Chinese)
```pythonfrom datasets import load_dataset
en = load_dataset( "json", data_files="https://huggingface.co/datasets/JohnnyZeppelin/HC-Bench/resolve/main/text/English_text.json", split="train",)zh = load_dataset( "json", data_files="https://huggingface.co/datasets/JohnnyZeppelin/HC-Bench/resolve/main/text/Chinese_text.json", split="train",)```
> Docs reference: `load_dataset` for JSON & files, and ImageFolder for image datasets.
---
## Pairing base/hidden with metadata
Filenames differ in casing/spaces between `base/` (`Apple.jpg`) and `hidden/` (`apple.png`). Use `object/lemmas_descriptions.json` as the canonical list of 56 lemmas and join by `Lemma`:
```pythonimport pandas as pdfrom datasets import load_dataset
# 1) Canonical lemma listlemmas = load_dataset( "json", data_files="https://huggingface.co/datasets/JohnnyZeppelin/HC-Bench/resolve/main/object/lemmas_descriptions.json", split="train",).to_pandas()
# 2) Build (lemma -> file) mapsdef to_lemma(name): # normalize filenames to lemma import re, os stem = os.path.splitext(os.path.basename(name))[0] return re.sub(r"\s+", "", stem).lower()
base_ds = load_dataset( "imagefolder", data_files="https://huggingface.co/datasets/JohnnyZeppelin/HC-Bench/resolve/main/object/base/*", split="train", drop_labels=True,)hidden_ds = load_dataset( "imagefolder", data_files="https://huggingface.co/datasets/JohnnyZeppelin/HC-Bench/resolve/main/object/hidden/*", split="train", drop_labels=True,)
import osbase_map = {to_lemma(x["image"].filename): x["image"] for x in base_ds}hidden_map= {to_lemma(x["image"].filename): x["image"] for x in hidden_ds}
# 3) Joinlemmas["base_image"] = lemmas["Lemma"].apply(lambda L: base_map.get(L.lower()))lemmas["hidden_image"] = lemmas["Lemma"].apply(lambda L: hidden_map.get(L.lower()))```
---
---
## Statistics
* `object/base`: 56 images* `object/hidden`: 56 images* `text/Latin`: 28 images* `text/Chinese`: 28 images* `wild`: 53 images
---
## Citation
If you use **HC-Bench**, please cite:
```bibtex@misc{li2025semvinkadvancingvlmssemantic, title={SemVink: Advancing VLMs' Semantic Understanding of Optical Illusions via Visual Global Thinking}, author={Sifan Li and Yujun Cai and Yiwei Wang}, year={2025}, eprint={2506.02803}, archivePrefix={arXiv}, primaryClass={cs.CL}, url={https://arxiv.org/abs/2506.02803}, }```
---
README.md+190-3