Team Ai
Datasetpublic

1roOt/qr-code-illusions-30k

๐Ÿ”ฎ QR Code Illusions 30k A high-fidelity, verified paired dataset of 30,000 artistic QR Code illusions, complete with multi-decoder verification and quantitative robustness scoring for training ControlNet and Flow-Matching models. ๐ŸŒŸ Overview The QR Code Illusions 30k dataset is designed to train conditional diffusion models (ControlNet, ControlNet-LLLite, LoRA, and Flow-Matching MMDiT adapters) capable of embedding scannable QR codes into aesthetic artwork.โ€ฆ See the full description on the dataset page: https://huggingface.co/datasets/1roOt/qr-code-illusions-30k.

sourceHugging Faceopenrailupdated 8d agoView on Hugging Face
2likes449downloads
Dataset Card

๐Ÿ”ฎ QR Code Illusions 30k

A high-fidelity, verified paired dataset of 30,000 artistic QR Code illusions, complete with multi-decoder verification and quantitative robustness scoring for training ControlNet and Flow-Matching models.

[image]


๐ŸŒŸ Overview

The QR Code Illusions 30k dataset is designed to train conditional diffusion models (ControlNet, ControlNet-LLLite, LoRA, and Flow-Matching MMDiT adapters) capable of embedding scannable QR codes into aesthetic artwork.

Unlike synthetic or naive QR blends, each sample in this dataset represents a fine-tuned optical illusion where:

  1. 1.The QR code is seamlessly embedded into architectural structures, natural foliage, lighting highlights, and artistic textures.
  2. 2.Visual aesthetics are preserved without harsh black/white square artifacts.
  3. 3.Every image is rigorously validated across multiple real-world QR decoders (pyzbar, OpenCV WeChat QR) and tested against physical distortions (rotation, perspective shift, blur, compression).

๐ŸŽจ Featured Samples

Here are four representative examples selected directly from the dataset:

Sample IDCondition SignalOriginal QRGenerated Illusion (Try scanning with your phone!)Metadata & Prompt Details
`#31`<br>Elf Archer<img src="assets/sample00000031cond.png" width="160"/><img src="assets/sample00000031qr.png" width="160"/><img src="assets/sample_00000031.png" width="220"/>Class: B (Balanced)<br>Style: Cinematic Film<br>Schedule: schedule_K (str=1.35)<br>Prompt: an elf archer, cinematic shot, 35mm film photography, anamorphic lens, dramatic lighting, depth of field, distressed wood grain, weathered timber, rustic textures, dappled sunlight...
`#48`<br>Log Cabin<img src="assets/sample00000048cond.png" width="160"/><img src="assets/sample00000048qr.png" width="160"/><img src="assets/sample_00000048.png" width="220"/>Class: C (Artistic)<br>Style: Watercolor<br>Schedule: schedule_K (str=1.35)<br>Prompt: a cozy log cabin nestled at the edge of a snow-covered pine forest, delicate watercolor painting, fluid wet-on-wet washes, raw paper texture, intricate mosaic tile work, high-contrast chiaroscuro shadows...
`#50`<br>Anime Cafe<img src="assets/sample00000050cond.png" width="160"/><img src="assets/sample00000050qr.png" width="160"/><img src="assets/sample_00000050.png" width="220"/>Class: B (Balanced)<br>Style: Anime Art<br>Schedule: schedule_K (str=1.35)<br>Prompt: a cozy anime cafe, masterpiece anime artwork, vibrant colors, clean lineart, Makoto Shinkai style, high quality animation still, dense foliage, layered autumn leaves, chiaroscuro shadows...
`#54`<br>Enchanted Glade<img src="assets/sample00000054cond.png" width="160"/><img src="assets/sample00000054qr.png" width="160"/><img src="assets/sample_00000054.png" width="220"/>Class: B (Balanced)<br>Style: Dark Fantasy<br>Schedule: schedule_F (str=0.92)<br>Prompt: an enchanted glade, dark fantasy aesthetic, somber tone, grim atmosphere, moody lighting, desaturated shadows, dense foliage, layered autumn leaves, dappled sunlight casting organic shadows...

๐Ÿ“Š Dataset Structure & Statistics

Splits (Zero Matrix Leakage)

To prevent model memorization, the dataset was partitioned using QR matrix hash bucketing ensuring no identical QR layout appears across train and evaluation sets:

  • โ€”`train`: 23,988 pairs
  • โ€”`validation`: 3,021 pairs
  • โ€”`test`: 1,486 pairs
  • โ€”`hard_test`: 1,505 pairs (high-difficulty scanning scenarios)
  • โ€”Total: 30,000 paired samples

Quality Tiers

  • โ€”Class A (10,564 pairs): Highly scannable under standard and adverse conditions; excellent visual fidelity.
  • โ€”Class B (5,576 pairs): Reliable scan under standard conditions; enhanced artistic subtlety.
  • โ€”Class C (13,860 pairs): High artistic immersion and visual blending (useful for contrast and texture pre-training).
  • โ€”Note: Corrupt and unreadable Class D samples have been strictly removed.

๐Ÿ“‹ Schema & Metadata Fields

Each sample contains:

FieldTypeDescription
idstringUnique sample identifier (e.g. sample_00000031)
imageImageTarget generated artwork (768ร—768 PNG)
conditionImageCondition signal with gray/black/white pattern (768ร—768 PNG)
original_qrImageGround-truth binary QR code
maskImageFinder and alignment pattern region mask
promptstringDetailed generation prompt
stylestringVisual style (cinematic, anime, watercolor, dark_fantasy, architectural, etc.)
prompt_typestringCategory (character, urban, nature, fantasy, sci_fi, etc.)
quality_classstringTier (A, B, C)
robustness_scorefloat32Normalized score [0.0, 1.0] across physical distortions
is_decodedboolWhether the QR code decoded successfully
decoder_countint32Number of distinct decoders confirming the payload
schedule_namestringControl schedule used (schedule_M, schedule_F, schedule_K, etc.)
controlnet_strengthfloat32Applied control strength
qr_versionint32QR matrix version (Version 1 to 10)
qr_ec_levelstringError correction level (L, M, Q, H)
payloadstringEmbedded URL payload
seedint64PRNG seed for reproducibility

๐Ÿš€ Quickstart & Usage

1. Load with Hugging Face datasets

python
from datasets import load_dataset

# Load the entire dataset
dataset = load_dataset("1roOt/qr-code-illusions-30k")

# Access train sample
sample = dataset["train"][0]
image = sample["image"]          # PIL.Image
condition = sample["condition"]  # PIL.Image
prompt = sample["prompt"]        # str

print(f"Loaded: {sample['id']} | Style: {sample['style']} | Class: {sample['quality_class']}")

2. Filter for High-Scannability Samples (Class A only)

python
# Filter for reliable scannability training
class_a_train = dataset["train"].filter(lambda x: x["quality_class"] == "A")
print(f"Number of Class A training samples: {len(class_a_train)}")

3. PyTorch DataLoader Example for ControlNet Training

python
from torch.utils.data import DataLoader
from torchvision import transforms

transform = transforms.Compose([
    transforms.ToTensor(),
    transforms.Normalize([0.5], [0.5])
])

def collate_fn(batch):
    images = torch.stack([transform(b["image"]) for b in batch])
    conditions = torch.stack([transform(b["condition"]) for b in batch])
    prompts = [b["prompt"] for b in batch]
    return {"images": images, "conditions": conditions, "prompts": prompts}

loader = DataLoader(dataset["train"], batch_size=4, shuffle=True, collate_fn=collate_fn)

โš–๏ธ License & Attribution

  • โ€”Generated Images: Base generations derived from Stable Diffusion architectures under the CreativeML OpenRAIL-M license.
  • โ€”QR Synthesis: Generated algorithmically via open-source tools under MIT / BSD licenses.
  • โ€”Dataset & Metadata: Released under OpenRAIL / Creative Commons Attribution 4.0 (CC BY 4.0).