The Art of Deception: Color Visual Illusions and Diffusion Models

Alexandra Gomez-Villa, Kai Wang, C. Alejandro Párraga, Bartlomiej Twardowski, Jesus Malo, Javier Vazquez-Corral, Joost van de Weijer · DOI

Abstract

Visual illusions provide a unique window into the underlying mechanisms of perception, revealing how biological systems interpret ambiguous stimuli based on natural world statistics. This paper investigates whether state-of-the-art generative models, specifically Denoising Diffusion Implicit Models (DDIMs), exhibit similar perceptual biases. We demonstrate that the deterministic inversion process in DDIMs naturally replicates human-like illusory perception by "correcting" stimuli toward a learned natural image manifold. Furthermore, we introduce a novel optimization framework to generate high-resolution, realistic visual illusions from text prompts. Our results, validated by both automated benchmarks and human psychophysical studies, suggest that these models' "errors" are actually sophisticated features of their learned priors, bridging the gap between artificial and biological vision.

Introduction

Visual illusions (VIs) occur when the brain's interpretation of a stimulus deviates from its physical reality, typically because the stimulus is "out-of-distribution" relative to the statistical regularities of the natural environment. A long-standing question in computer vision is whether artificial neural networks (ANNs) trained on natural images develop similar vulnerabilities. While previous work has explored this in Convolutional Neural Networks (CNNs), the behavior of modern generative Diffusion Models (DMs) remains largely unexplored. This study posits that DMs, by virtue of being trained on massive datasets of natural images, inherit the same perceptual priors—and thus the same "deceptions"—as human observers.

Figure 1: Overview of the proposed framework. (a-c) Replication of classic brightness and color illusions via DDIM inversion. (d-f) Generation of novel, realistic illusions using text-to-image models and a custom perceptual loss.

Methodology

The core of our approach centers on the deterministic inversion process of Denoising Diffusion Implicit Models (DDIM).

Replication via DDIM Inversion

To test if a model "perceives" an illusion, we perform DDIM inversion on classic stimuli, such as the Adelson Checkerboard. As the image is mapped back into its latent noise representation, the model attempts to "Gaussianize" the input. During the intermediate steps, the model's internal priors force the image toward the natural image manifold. This process introduces shifts in brightness and color that align with human illusory perception, effectively "correcting" the physical stimulus to match a more probable natural interpretation.

Generation of Novel Illusions

We extend this insight to create a generation pipeline using text-to-image models (e.g., DeepFloyd IF). We optimize the noisy latent ($z_t$) using two primary loss functions:

  1. Perceptual Loss ($\mathcal{L}_{VI}$): This term enforces a desired perceived intensity in specific "target" regions, ensuring that physically identical patches appear different to a human observer.
  2. Similarity Loss ($\mathcal{L}_{sim}$): This ensures the illusory elements blend seamlessly into the generated scene and remain faithful to the provided text prompt.

Experimental Results

We evaluated our approach across several benchmarks and human studies.

Automated Benchmarks

  • BRI3L Dataset: On this large-scale brightness illusion dataset, our DDIM-based method achieved a 100% Perceptual Accuracy Score (PAS) at a threshold of 1.0. This significantly outperformed classical vision models like ODOG (72%) and CIWAM (56%).
  • Visual Question Answering (VQA): On the HallusionBench dataset, the DDIM method reached 100% accuracy in identifying illusory intensity, whereas standard Variational Autoencoders (VAEs) and other deep learning baselines typically scored below 35%.

Human Psychophysical Validation

To confirm the efficacy of our generated illusions, we conducted experiments with 15 human observers. Participants identified the model-enforced illusions as "different" in 64% of cases, compared to a baseline of 13% for control images. This confirms that the model can successfully engineer deception that fools human vision.

Figure 2: Detailed view of color constancy replication. The model's inversion process (b) correctly shifts the perceived colors of the Rubik's cube tiles, mimicking human color constancy under varying illumination.

Discussion and Conclusion

Our findings suggest that perceptual illusions are not flaws but rather a byproduct of learning the complex statistics of the natural world. By treating these biases as features, we can use Diffusion Models to both predict human perception and generate sophisticated visual stimuli.

One limitation of the current approach is that spatial resolution decreases as the inversion process approaches pure noise, making it difficult to replicate fine-grained illusions. Future work will explore the use of attention maps to automate the placement of illusory targets, potentially leading to even more seamless and complex visual deceptions. Ultimately, integrating these diffusion-based perceptual priors could significantly enhance the contextual understanding of Vision-Language Models (VLMs).

Summary updated

BibTeX
@inproceedings{gomezvilla2025art,
  author = {Alexandra Gomez-Villa and Kai Wang and C. Alejandro Párraga and Bartlomiej Twardowski and Jesus Malo and Javier Vazquez-Corral and Joost van de Weijer},
  title = {{The Art of Deception: Color Visual Illusions and Diffusion Models}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2025},
  doi = {10.1109/cvpr52734.2025.01737},
}
Figure