WaterFlow: Learning Fast & Robust Watermarks using Stable Diffusion

Vinay Shukla, Prachee Sharma, Ryan A. Rossi, Sungchul Kim, Tong Yu, Aditya Grover · DOI

TL;DR

WaterFlow introduces a novel, fast, and highly robust watermarking technique for images by embedding watermarks directly into the latent space of Stable Diffusion models. This approach achieves state-of-the-art robustness against a wide range of attacks, including complex combinations, while maintaining high perceptual quality and significantly outperforming previous methods in speed.

What Problem Does This Paper Address?

The proliferation of high-fidelity generative AI models has created an urgent need for robust visual watermarking to track ownership, prevent misuse, and combat deepfakes. Existing watermarking methods often struggle with a critical trade-off: achieving high robustness against various attacks (like compression, rotation, or adversarial perturbations) typically comes at the cost of noticeable image quality degradation, or they are computationally too expensive for practical, real-time applications. Furthermore, many current techniques are vulnerable to sophisticated attacks from generative models themselves, which can effectively erase embedded watermarks. This paper aims to bridge this gap by developing a watermarking system that is simultaneously fast, robust, and perceptually invisible.

Methods

WaterFlow leverages the power of pretrained latent diffusion models (LDMs), specifically Stable Diffusion, to embed watermarks. The core innovation lies in operating within the LDM's latent space and embedding watermarks in the Fourier domain of these latents.

Here's a breakdown of the key techniques:

  • Latent Space Embedding: Instead of directly manipulating image pixels, WaterFlow first converts an image into its latent representation using DDIM inversion (a process that recovers the latent code from an image). This latent space is semantically rich and allows for more efficient and robust watermark embedding.
  • Fourier Domain Watermarking: Watermarks are embedded in the Fourier transform of the latent representation. This approach is known for its inherent robustness to various transformations.
  • Learned Latent-to-Frequency Mapping: The paper introduces trainable neural networks (Residual Flows) that learn to map real and imaginary components of the latent's Fourier space to generate input-specific watermarks. This adaptive approach allows the watermark to be tailored to the image's latent characteristics.
  • Adaptive Enhancement: To further improve perceptual quality without sacrificing detectability, WaterFlow incorporates an adaptive enhancement step. This procedure uses a blending factor to ensure the watermarked image meets a specified SSIM threshold compared to the original, effectively treating enhancement as a benign perturbation.
  • Two Variants (WF-R and WF-Q): The framework offers two modes: WaterFlow-Robust (WF-R) for maximum robustness and WaterFlow-Quality (WF-Q) for prioritizing perceptual fidelity while still maintaining strong robustness. These variants are achieved through a simple postprocessing adjustment, allowing for dynamic trade-offs without retraining.

Datasets

The authors evaluated WaterFlow on three diverse datasets:

  • MS-COCO: A large-scale dataset of real-world images commonly used for image recognition and segmentation.
  • DiffusionDB: A dataset of images generated by Stable Diffusion models, covering a wide range of semantic and aesthetic styles.
  • WikiArt: A curated collection of artworks spanning various artistic styles and historical periods.

Key Insights and Ideas

  • Latent Space is Key: Operating in the latent space of diffusion models is a powerful strategy for robust watermarking, offering a more expressive and resilient medium than pixel space.
  • Fourier Domain in Latents Works: Embedding watermarks in the Fourier domain of latents provides a strong foundation for robustness against a wide array of attacks.
  • Learned, Input-Specific Watermarks: The use of trainable networks to generate watermarks tailored to each image's latent representation significantly improves adaptability and robustness compared to fixed watermarks.
  • Dynamic Trade-offs are Possible: The ability to adjust the quality-robustness balance with a simple parameter without retraining is a significant practical advantage.
  • Combination Attacks are the Real Challenge: The paper highlights that modern generative attacks, especially when combined, pose the most significant threat, and WaterFlow's strength lies in its ability to withstand these complex scenarios.

Key Results

WaterFlow demonstrated state-of-the-art performance across multiple metrics:

  • Robustness: WF-R achieved the highest overall robustness, consistently outperforming existing methods on AUC and TPR@1%FPR metrics across all datasets and attacks, including complex combinations. WF-Q also ranked second in robustness while prioritizing quality.
  • Speed: WaterFlow is significantly faster than many existing robust watermarking methods. It completes watermarking in approximately 6.15 seconds on average, which is nearly 90 times faster than ZoDiac.
  • Image Quality: Both WF-R and WF-Q surpassed baseline methods like Tree-Ring and ZoDiac in perceptual fidelity (PSNR, SSIM, LPIPS). WF-Q, in particular, achieved excellent quality scores, often matching or exceeding top baselines.
  • Combination Attacks: WaterFlow is the first method shown to effectively withstand complex combination attacks, achieving significant improvements in detection rates compared to baselines.

Limitations and Future Work

  • Dataset and Model Specificity: The current method relies on pre-trained Stable Diffusion models and may not generalize perfectly to other domains (e.g., medical scans, satellite data) or different types of generative models (e.g., autoregressive, transformer-based).
  • Invertibility Assumption: The approach assumes access to a known latent space and an invertible generative process, which might limit its applicability to models that do not meet these criteria.
  • Visual Artifacts: In some cases, the watermark may introduce slight visual artifacts, though this is controllable via loss balancing and adaptive enhancement.

Future work includes:

  • Expanding evaluation to more datasets and real-world attack scenarios.
  • Exploring fine-tuning diffusion backbones jointly with the watermarking objective.
  • Adapting WaterFlow to other generative paradigms.
  • Developing defenses against emerging watermark-removal attacks.
  • Investigating learnable post-processing steps to further enhance fidelity and robustness.

Summary updated

BibTeX
@misc{shukla2025waterflow,
  author = {Vinay Shukla and Prachee Sharma and Ryan A. Rossi and Sungchul Kim and Tong Yu and Aditya Grover},
  title = {{WaterFlow: Learning Fast \& Robust Watermarks using Stable Diffusion}},
  year = {2025},
  eprint = {2504.12354},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2504.12354},
}
Figure