Diffusion Illusions: Hiding Images in Plain Sight

By Ryan Burgert, Kanchana Ranasinghe, Xiang Li, Michael Ryoo

Introduction

We're excited to share our demo, "Diffusion Illusions: Hiding Images in Plain Sight," which showcases how optical illusions and steganography can be created using text-to-image diffusion models. A video demonstration is coming soon! Our demo shows how Score Distillation Loss, introduced in DreamFusion, can be used for more than just creating 3D models. For example, as shown in our paper "Peekaboo: Text to Image Diffusion Models are Zero Shot Segmentors", that loss can even be adapted for segmentation. In this demo, we use a variant of score distillation loss to optimize different optical illusions - hiding images in plain sight.

Source code: github.com/RyannDaGreat/Diffusion-Illusions. If you like it, please give it a star!

We'll keep this brief so we can dive right into the pictures - check the bottom of the page for more details about this project!

There are three kinds of illusions presented: Flippy Illusions, Rotating Overlays, and Hidden Characters

Flippy Illusions

If you wait a few seconds, the below images will flip upside-down - to reveal a new image! You can click and drag an image to rotate it by yourself, and double click to reset it.


Click here to reset all rotations Pause

Angelic Pretty
A Bunny in a Bomber-Jacket
Victorian Dress
A boat
Giraffe / Penguin
Bubble Fairy
Dog / Elephant
Dog / Sloth
Seagull / Bunny

A real-life demo:


Google Colab logoTry it on Colab!


Rotating Overlays

In this section, we have examples with two images. As the one on the top is rotated, the image changes! The one on the top is multiplied by the one on the bottom (pixelwise), simulating how light would be filtered through two transparent sheets with images printed on them. Effectively, we've made 4 images out of 2!

This works in real life too: you can overlay printouts of these images on top of each other for the same results, as seen in the youtube video.

You can click and drag them to inspect the top and bottom images separately, or right click and open image in new tab to print them out for yourself. To reset the position of an image, double click it.



Click here to reset all positions Pause


















A real-life demo:

Click here for a printable PDF full of these images, so you can try it yourself!

Google Colab logoTry it on Colab!


Hidden Characters

In this section, we have sets of 4 images. You can click and drag them on top of each other! They will all be multiplied together, and when they're all on top of each other they will reveal a secret 5th image. To reset the position of an image, double click it.

This works in real life too: you can overlay printouts of these images on top of each other for the same results, as seen in the youtube video.

I won't spoil it for you in this paragraph; try it out!



Click here to reset all positions


Click and drag these 4 pictures together! Can you find the hidden 5th picture?
(hint: it's easiest to see on the white background!)




Try it with these too!






Click here to reset all positions


(Hatsune Miku) * 4 = ?






Click here to reset all positions


(Hatsune Miku) * 4 = ?


Click here to reset all positions






This one isn't strictly a character...






Click here to reset all positions








Click here to reset all positions










A real-life demo [WARNING: SPOILERS!!!]


Google Colab logoTry it on Colab!


CVPR Demo Proposal Summary

Short Whitepaper

Click the this link to access a short 2-page whitepaper about this project, including mathetmatical formulae.

Project Overview

The project is comprised of three demonstrations:

  1. Generating images that appear as different objects when flipped upside down - For example, a giraffe could look like a penguin.
    Top accomplish this, let's define some functions and variables. We want to create an image "Image" such that when viewed right side up, "Image" matches "Prompt1" (in this case 'Giraffe'). And when Image is upside down, we want it to match the prompt "Penguin" We optimize an image we'll call "Image" using score distillation loss "SD". We optimize SD(Image,prompt_1)
  2. Revealing a hidden image through image overlay - Overlaying four images, such as Hatsune Miku, a bear in a field, Mario, and a pumpkin, to reveal a fifth image, Darth Vader, when light is shone behind it. The four images are optimized to look like the original objects when viewed individually, but when combined, they reveal the hidden image of Darth Vader.
  3. Revealing multiple images through image rotation - Overlaying two images to reveal four different images when rotated. The top image, when overlayed on the bottom image and light shines through, will reveal an image such as Darth Vader. When the top image is rotated 90 degrees, it becomes a different picture such as Pikachu. Another 90-degree rotation reveals another image and a final 90-degree rotation reveals a fourth image.

Interactive Experience

The project will include physical items such as transparencies for people to interact with, as well as a live demonstration that will allow people to create their own illusions on the spot. If space permits, we might bring a printer to let people play with the illusions they create. And if we have even more space, perhaps a robot arm to automatically demo the flippy images.

In this website you'll find multiple interactive exhibits where you can drag images around as if they were pieces of paper / transparencies. Until we demo at CVPR, this is the next best thing to the physical demo!

Similar Projects

Another project with a similar goal was released in February: Illusion-Diffusion, authored by Matthew Tanick. That project only achieves the first part of this demo, aka image flipping.

Our paper, "Peekaboo: Text to Image Diffusion Models are Zero Shot Segmentors", has an extremely similar formulation to the illusions on this website - it optimizes images using a variant of score distillation loss to perform zero shot segmentation.

Pseudocode

To help explain how these were calculated, I've included some easy-to-read pseudocode that covers how each of these illusions were made. The full source code can be found at github.com/RyannDaGreat/Diffusion-Illusions, or at any of the Google Colab links throughout this webpage.

Flippy Illusions


Rotating Overlays


Hidden Characters

Timelapses

Diffusion illisions are generated through an iterative process: we optimize the output images with gradient descent, starting from pure noise. Here are some timelapses showing how they evolve over time.

Flippy Illusion Timelapses

For reference, here are the end results of the above timelapse video:

Click here to reset all rotations Pause

Giraffe / Penguin
Angelic Pretty / Victorian Dress


Hidden Character Timelapses




Bibtex Citation