Dynamic watermarks in images generated by diffusion models

Yunzhuo Chen, Jordan Vice, Naveed Akhtar, Nur Al Hasan Haldar, Ajmal Mian

Abstract

As generative AI models reach new heights of realism, the need for reliable provenance and copyright protection has never been more urgent. This paper presents a dual-stage watermarking framework for diffusion models that embeds both a model-specific QR code into the latent noise distribution and a content-adaptive dynamic watermark into the final pixel space. Our approach achieves a 97% source identification accuracy while maintaining superior visual quality compared to existing methods, with an FID of 2687.34. The dual-layered nature of the watermark ensures high robustness against common image-processing attacks, including cropping, compression, and texture reduction.

Introduction

The proliferation of text-to-image diffusion models, such as Stable Diffusion and DALL-E, has raised significant concerns regarding intellectual property (IP) and the potential for misinformation. While watermarking is a standard defensive measure, existing techniques often face a trade-off between imperceptibility and robustness. Static watermarks are easily bypassed or removed, while aggressive watermarking can degrade the artistic quality of the generated output.

This research addresses these challenges by proposing a system that is both invisible to the human eye and inextricably linked to the specific AI model that generated the image. By utilizing a two-pronged strategy, we create a redundant safety net for model identification and image verification.

Methodology

The proposed framework consists of two primary components: a model-specific "fingerprint" and an image-specific "chameleon" watermark.

1. Model-Specific Watermarking

The first stage modifies the latent diffusion process. During the training or fine-tuning phase, a unique QR code—containing metadata such as the training machine's IP address and a timestamp—is embedded directly into the model's learned noise distribution. This process is governed by a Watermark Retrieval Key ($\kappa$). To extract this information, a user must possess the specific key to "reverse" the diffusion process and reconstruct the QR code from the latent space.

The dual-stage watermarking framework, illustrating the training and inference stages for both model-level and image-level watermarks.

2. Image-Specific Dynamic Watermarking

The second stage focuses on the pixel level, using a fine-tuned decoder to embed a watermark that adapts to the generated content.

  • Feature Space Consistency: The system uses cosine similarity to ensure the watermark is semantically aligned with the image features.
  • Pixel Space Fidelity: By optimizing for the Structural Similarity Index Measure (SSIM), the framework adjusts the watermark's shape and color to blend into the specific content of the image, maximizing visual fidelity.

A pre-trained extractor, based on the HiDDeN architecture, is then used to retrieve binary messages from the images for source classification.

Experimental Results

The framework was evaluated using the Stable Diffusion Model (SDM) as the base architecture. We compared our results against several state-of-the-art methods, including Tree-Ring watermarking and techniques proposed by Chen et al. and Xin et al.

Identification and Robustness

The system achieved a 97% accuracy in source model identification under "No Attack" conditions. Furthermore, the watermarks proved remarkably resilient to adversarial processing. Even under "Texture Reduction"—the most challenging test—the watermark remained detectable 95.7% of the time. It maintained over 94% classification accuracy against rotation, blurring, cropping, and compression.

Comparison between input watermarks and extracted watermarks for both model-level (QR code) and image-level watermarking, demonstrating high reconstruction fidelity.

Image Quality

In terms of Fréchet Inception Distance (FID), our method scored 2687.34, significantly outperforming Tree-Ring (3298.22) and Xin et al. (3477.38). A lower FID indicates that the generated images are closer to the distribution of real images. Additionally, the Inception Score (IS) of 4.61 is very close to the 5.01 score of unwatermarked "clean" images, proving that the watermarking process has a minimal impact on visual diversity.

Discussion and Key Insights

A major breakthrough of this work is the realization that a diffusion model's inherent noise can serve as a storage medium for structured data. By embedding the QR code into the noise distribution, the watermark becomes a fundamental part of how the model "thinks" about generating pixels.

Furthermore, the shift from static to dynamic watermarking is crucial. Traditional watermarks often fail because they do not "fit" the image (e.g., a bright watermark on a dark background). By making the watermark content-aware, we ensure it remains hidden while staying mathematically robust. Statistical analysis showed that watermarking only altered image statistics (like GLCM Contrast) by about 5%, preserving the natural "mathematical signature" of the artwork.

Conclusion

This dual-stage framework provides a powerful tool for IP protection in the age of generative AI. While highly effective on Stable Diffusion, future work will involve validating the framework across a wider variety of architectures, such as GANs and newer transformer-based models like FLUX. We also recognize the ongoing "cat-and-mouse" game with adversarial attacks and will continue to refine the system's resilience against extreme texture reduction and blurring.

Summary updated

BibTeX
@inproceedings{chen2025dynamic,
  author = {Yunzhuo Chen and Jordan Vice and Naveed Akhtar and Nur Al Hasan Haldar and Ajmal Mian},
  title = {{Dynamic watermarks in images generated by diffusion models}},
  booktitle = {Workshops @ CVPR},
  year = {2025},
}
Figure