The Art of Deception: Color Visual Illusions and Diffusion Models

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

Abstract

Visual illusions (VIs) are perceptual anomalies that reveal the underlying mechanisms of the human visual system. This paper investigates whether state-of-the-art Denoising Diffusion Models (DMs) share these human-like perceptual biases. By analyzing the DDIM inversion process, researchers found that DMs naturally replicate human illusory perception. Leveraging this insight, they developed a novel generation pipeline that optimizes the latent space of text-to-image models to create complex, artistically diverse visual illusions. These AI-generated illusions successfully deceive both artificial neural networks and human observers, achieving a 100% Perception Accuracy Score on key benchmarks and fooling humans in 64% of trials.

Introduction

Visual illusions are more than mere curiosities; they represent the brain's attempt to interpret "out-of-distribution" visual data based on the statistics of the natural world. When we encounter stimuli that deviate from these statistics, our brains force them into familiar contexts, leading to a mismatch between reality and perception. This study explores whether artificial neural networks, specifically generative Diffusion Models, exhibit similar "errors" in perception and if these biases can be harnessed to engineer new forms of visual deception.

Observing Illusions through DDIM Inversion

The researchers first examined if DMs naturally "see" illusions using Denoising Diffusion Implicit Models (DDIM) to invert real-world illusory images. Inversion involves finding the mathematical noise path that would generate a specific image. They discovered that during the intermediate steps of this path, the model introduces shifts in brightness and color that align perfectly with human illusory perception.

Overview of DDIM inversion on classic illusions and novel generated illusions from text prompts.

This finding suggests that the illusion is not merely a property of the final pixels but emerges during the trajectory through the model's latent space. It indicates that DMs have internalized fundamental aspects of high-level human vision, such as color constancy—the ability to perceive a surface as the same color under varying lighting conditions.

Engineering Deception: The Generation Pipeline

Building on these observations, the authors created a pipeline to generate brand-new illusions. By modifying a text-to-image pipeline (specifically DeepFloyd IF), they introduced a custom dual-component loss function: $$\mathcal{L} = \gamma\mathcal{L}_{VI} + \beta\mathcal{L}_{sim}$$

  • Perceptual Loss ($\mathcal{L}_{VI}$): Forces target regions toward specific illusory shifts in color or brightness.
  • Similarity Loss ($\mathcal{L}_{sim}$): Ensures these regions remain harmonized with the background generated from the text prompt, preventing them from looking "pasted in."

Unlike standard prompting, this method explicitly optimizes the latent space at each timestep. This allows for the creation of complex illusions embedded within diverse artistic styles, such as a "Van Gogh" avocado chair or a "Sumi ink" landscape of the Great Wall, while maintaining the strict physical requirements of a visual illusion.

Key Results and the "Natural Manifold"

The study validated its findings using several benchmarks, including the BRI3L dataset (22,000+ brightness illusions) and HallusionBench. The results were striking:

  • Superior Replication: The DDIM-based approach achieved a 100% Perception Accuracy Score (PAS) on BRI3L, vastly outperforming classical vision science models like ODOG (72.44%).
  • State-of-the-Art Performance: On HallusionBench, the method reached 100% accuracy, compared to just 33.3% for previous deep learning models.
  • Human Validation: In psychophysical experiments with 15 observers, humans reported seeing the intended illusory effects in 64% of the AI-generated images, compared to only 13% in control images.

The authors propose the "Natural Manifold" hypothesis to explain these findings: because DMs are trained on vast datasets of natural images, they learn a manifold of natural statistics. When they encounter an illusory stimulus (which is statistically "unnatural"), the model tries to "correct" it toward this learned manifold, mirroring the evolutionary adaptation of the human visual system.

Conclusion

This research demonstrates that high-level generative models capture fundamental aspects of human vision. While challenges remain—such as "spatial destruction" during inversion and trade-offs between prompt complexity and illusion strength—this work provides a bridge for improving Vision-Language Models (VLMs). By understanding how these models "hallucinate" or perceive illusions, researchers can develop more robust systems for nuanced visual understanding.

Summary updated

BibTeX
@inproceedings{gomezvilla2025art,
  author = {Alex 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