Attack-Resilient Image Watermarking Using Stable Diffusion

Lijun Zhang, Xiao Liu, Antoni Viros i Martin, Cindy Xiong Bearfield, Yuriy Brun, Hui Guan

In an era where generative AI can conjure hyper-realistic images in seconds, the question of image provenance has never been more urgent. Digital watermarking—the art of hiding a signature within an image—serves as a primary defense for artists, photographers, and content platforms. However, a new threat has emerged: the same generative models used to create images can also be weaponized to "purify" them, effectively stripping away traditional watermarks through regeneration attacks.

To counter this, researchers have introduced ZoDiac, a novel framework that turns the tables on generative AI. By leveraging the internal "latent space" of Stable Diffusion, ZoDiac creates watermarks that are not only invisible to the human eye but remarkably resilient to sophisticated AI-based removal attacks.

The Vulnerability of Traditional Watermarks

Traditional watermarking methods typically hide information in pixel-level details (such as the least significant bits) or frequency domains (like DCT). While these techniques are effective against simple edits like cropping or mild compression, they are fundamentally fragile. Modern "regeneration attacks" use models like Stable Diffusion to slightly denoise or redraw an image. This process easily destroys shallow, pixel-level signatures.

Existing robust watermarking methods, such as RivaGAN or StegaStamp, largely fail when faced with these diffusion-based removal attacks. The core challenge is to create a watermark that is baked into the image's structural representation so deeply that removing it would require destroying the visual integrity of the image itself.

The ZoDiac Approach: Watermarking in the Latent Space

ZoDiac addresses this vulnerability using a "zero-shot" approach, meaning it requires no additional model training. It utilizes a pre-trained, frozen Stable Diffusion model to embed signatures through a precise, three-step process:

  1. Latent Vector Initialization: Given an original image, ZoDiac uses DDIM inversion to reverse-engineer the specific "latent vector" that the diffusion model would use to generate that exact image.
  2. Watermark Encoding: Instead of modifying surface pixels, ZoDiac injects a concentric, ring-like watermark pattern into the Fourier space of this latent vector. The latent vector is then optimized so that when the diffusion model processes it, the resulting image firmly contains the watermark in its underlying structure while looking nearly identical to the original.
  3. Adaptive Image Enhancement: To guarantee high visual quality, the system adaptively blends the watermarked image with the original. It employs a binary search to find the perfect equilibrium where the watermark remains highly detectable, but the visual alteration is imperceptible.

Detection simply reverses this process: a suspicious image is inverted back into the latent space, and a statistical test is applied to determine if the signature pattern is present.

Key Results and Performance

The researchers evaluated ZoDiac across three distinct benchmarks—MS-COCO (real-world photographs), DiffusionDB (AI-generated images), and WikiArt (digital and traditional artworks)—testing it against a battery of ten individual attacks and two composite attacks.

Watermark Detection Rate (WDR) comparison and visual fidelity of ZoDiac.

ZoDiac significantly outperformed state-of-the-art baselines, particularly against AI-based attacks:

  • Unprecedented Robustness: Against powerful Stable Diffusion-based removal methods, traditional watermarking detection rates plummeted to between 0% and 48%. In stark contrast, ZoDiac maintained a Watermark Detection Rate (WDR) above 98%.
  • Composite Attack Resilience: When multiple attacks were combined (excluding rotation), ZoDiac maintained a ~50% detection rate, whereas all other baseline methods failed completely (0%).
  • High Reliability: The framework achieved a False Positive Rate (FPR) below 6.4%, ensuring it rarely hallucinates a watermark in an unwatermarked image.
  • Visual Fidelity: ZoDiac maintained excellent image quality, achieving a PSNR of ~30dB and an SSIM of 0.92, making the structural changes virtually invisible to the human eye.

The authors hypothesize that the iterative denoising process of diffusion models inherently acts as a defense mechanism. Because the watermark is embedded in the latent space the model naturally "expects," the model's own mathematics help preserve the signature against external noise.

Limitations and Future Directions

While ZoDiac represents a significant leap forward, it has a few notable limitations:

  • Sensitivity to Rotation: Like many inversion-based methods, ZoDiac struggles with image rotation because the DDIM inversion process is not rotation-invariant. While an "auto-correction" defense (testing multiple angles) can mitigate this, a natively invariant version remains a goal for future work.
  • Zero-bit Constraints: Currently, ZoDiac is a "zero-bit" system. It can confirm the presence of a specific watermark but cannot yet encode a unique payload, such as a hidden ID or URL.
  • Computational Cost: The iterative optimization required for each image takes between 45 and 255 seconds. This computational overhead may currently limit its use in high-volume, real-time applications.

Despite these constraints, ZoDiac successfully demonstrates that Stable Diffusion is not just a threat to image provenance, but a highly promising tool for defending it.

ZoDiac is open-sourced and available on GitHub.

Summary updated

BibTeX
@inproceedings{zhang2024attack,
  author = {Lijun Zhang and Xiao Liu and Antoni Viros i Martin and Cindy Xiong Bearfield and Yuriy Brun and Hui Guan},
  title = {{Attack-Resilient Image Watermarking Using Stable Diffusion}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=e6KrSouGHJ},
}
Figure