--- license: mit task_categories: - image-classification - visual-question-answering language: - en tags: - visual-illusions - pareidolia - multimodal - synthetic - fashion-mnist pretty_name: IllusionFashionMNIST Training Set size_categories: - 1Kdf_data.csv | | Paper | [arXiv:2412.08169](https://arxiv.org/abs/2412.08169) | | Code | [IllusoryVQA/IllusoryVQA](https://github.com/IllusoryVQA/IllusoryVQA) | ## Repository structure | Path | Files | Description | | --- | ---: | --- | | ill_images/ | 3,300 | Primary training images. The folder contains both illusion-bearing examples and the 300 examples assigned to the No illusion class. | | raw_images/ | 3,000 | Source-condition images used to generate the illusion-bearing examples. No raw counterpart is provided for the 300 No illusion rows. | | df_data.csv | 1 | Canonical metadata and target labels. | | README.md | 1 | Dataset card. | The value in image_name is the filename stem. For example, FashionMnist_train_0 corresponds to ill_images/FashionMnist_train_0.jpg. ## Metadata schema The CSV contains one row per primary training example. | Column | Type | Description | | --- | --- | --- | | image_name | string | Image identifier and filename stem. | | Pprompt | string | Positive scene prompt used during illusion-image generation. | | Nprompt | string | Negative generation prompt. It is empty for No illusion rows. | | illusion_strength | float or empty | Control strength used for illusion generation. It is 1.5 for illusion-bearing rows and empty for No illusion rows. | | label | string | Ground-truth Fashion-MNIST class ID (09) or No Illusion. | Read the CSV with string-preserving options because label contains both numbers and text: ~~~python import pandas as pd metadata = pd.read_csv( "df_data.csv", dtype={"label": "string"}, keep_default_na=False, ) metadata["label_normalized"] = metadata["label"].str.strip().str.casefold() ~~~ ## Label mapping The following order matches Fashion-MNIST and the class lists used in the official experiment code. | Numeric ID | Class label | Value stored in df_data.csv | | ---: | --- | --- | | 0 | T-shirt/top | 0 | | 1 | Trouser | 1 | | 2 | Pullover | 2 | | 3 | Dress | 3 | | 4 | Coat | 4 | | 5 | Sandal | 5 | | 6 | Shirt | 6 | | 7 | Sneaker | 7 | | 8 | Bag | 8 | | 9 | Ankle boot | 9 | | 10 | No illusion | No Illusion | Use ID 10 when converting the textual No illusion target to a fully numeric label space. ## Download Install the required packages: ~~~bash pip install -U huggingface_hub pandas pillow ~~~ Download the complete repository: ~~~python from huggingface_hub import snapshot_download dataset_dir = snapshot_download( repo_id="VQA-Illusion/FashionMnist_train", repo_type="dataset", ) print(dataset_dir) ~~~ Command-line alternative: ~~~bash huggingface-cli download VQA-Illusion/FashionMnist_train \ --repo-type dataset \ --local-dir FashionMnist_train ~~~ ## Load and pair images with metadata Use df_data.csv as the source of truth rather than treating the top-level image directories as semantic classes. ~~~python from pathlib import Path import pandas as pd from huggingface_hub import snapshot_download root = Path(snapshot_download( repo_id="VQA-Illusion/FashionMnist_train", repo_type="dataset", )) df = pd.read_csv( root / "df_data.csv", dtype={"label": "string"}, keep_default_na=False, ) df["illusion_path"] = df["image_name"].map( lambda name: root / "ill_images" / (name + ".jpg") ) df["raw_path"] = df["image_name"].map( lambda name: root / "raw_images" / (name + ".jpg") ) df["raw_path"] = df["raw_path"].map( lambda path: path if path.exists() else None ) id_to_label = { 0: "T-shirt/top", 1: "Trouser", 2: "Pullover", 3: "Dress", 4: "Coat", 5: "Sandal", 6: "Shirt", 7: "Sneaker", 8: "Bag", 9: "Ankle boot", 10: "No illusion", } def to_label_id(value): value = str(value).strip() return 10 if value.casefold() == "no illusion" else int(value) df["label_id"] = df["label"].map(to_label_id) assert df["illusion_path"].map(Path.exists).all() ~~~ ## Intended use Suitable uses include: - supervised training for illusion-aware image classification; - VQA-style prompting over a fixed answer vocabulary; - paired comparisons between source-condition and generated illusion images; and - robustness analysis for multimodal and vision-language models. For VQA evaluation, ask whether the image contains an illusion and restrict the answer space to the ten Fashion-MNIST classes plus No illusion. The exact prompt templates used in the paper are available in Appendix G and in the official code repository. ## Dataset creation and safety The authors generated diverse English scene descriptions with several language models, combined those descriptions with source-condition images, and produced the illusion images with ControlNet. Human reviewers validated dataset quality. The paper also reports content-safety screening and the removal of images flagged by NSFW detectors from the public release. ## Important usage notes - df_data.csv is the authoritative index. Do not infer the semantic target from the top-level directory name. - Hugging Face may automatically display the top-level image folders as imagefolder classes. Those folder-derived labels describe image variants, not Fashion-MNIST targets. - The No illusion label is textual while the other labels are numeric strings; normalize it explicitly as shown above. - Only illusion-bearing rows have files in raw_images/. - This benchmark primarily covers a single large hidden category per image. See the paper for the full limitations. ## License This dataset repository declares the MIT license. Users should also review and comply with any applicable terms associated with Fashion-MNIST and other upstream components. ## Citation If you use this dataset, please cite: ~~~bibtex @misc{rostamkhani2024illusoryvqa, title = {Illusory VQA: Benchmarking and Enhancing Multimodal Models on Visual Illusions}, author = {Rostamkhani, Mohammadmostafa and Ansari, Baktash and Sabzevari, Hoorieh and Rahmani, Farzan and Eetemadi, Sauleh}, year = {2024}, eprint = {2412.08169}, archivePrefix = {arXiv}, primaryClass = {cs.CV}, url = {https://arxiv.org/abs/2412.08169} } ~~~ ## Contact Questions and reproducibility issues can be submitted through the [official GitHub repository](https://github.com/IllusoryVQA/IllusoryVQA).