Your Text Encoder Can Be An Object-Level Watermarking Controller

Naresh Kumar Devulapally, Mingzhen Huang, Vishal Asnani, Shruti Agarwal, Siwei Lyu, Vishnu Suresh Lokhande

TL;DR

This paper introduces a novel method for watermarking specific objects within AI-generated images, offering fine-grained control over copyright protection. By cleverly fine-tuning text encoder embeddings, their approach allows users to watermark individual elements of an image directly through text prompts, achieving high accuracy with significantly reduced computational overhead.

What Problem Does This Paper Address?

The rapid advancement of AI image generation models (like Stable Diffusion) has raised significant concerns about copyright and authorship. While existing watermarking techniques can embed information into entire images, they often lack the flexibility to target specific objects or regions. This limitation is problematic for scenarios where only certain elements of an image need protection, or when users desire more granular control over their AI-generated content. Furthermore, many existing methods require extensive model modifications or access to latent spaces, making them less practical for widespread adoption. This paper aims to bridge this gap by enabling object-level watermarking directly within the text-to-image generation pipeline, offering a more flexible, efficient, and robust solution.

Methods

The core innovation lies in leveraging the text encoder of Latent Diffusion Models (LDMs). Instead of modifying the entire generative model, the authors introduce a new "pseudo-token," denoted as $W^*$, and fine-tune its text embedding. This $W^*$ token acts as a trigger for watermarking.

Here's a breakdown of their approach:

  • Token Embedding Fine-tuning: The $W^*$ token's embedding is trained to embed a watermark bit string. This is done by introducing a watermark loss ($L_w$) and a latent matching loss ($L_z$) to ensure imperceptibility.
  • Optimal Timestep Selection: Through empirical studies, they identified an optimal noise timestep ($\tau^*$) during the diffusion process that balances image quality and watermark robustness.
  • Object-Level Control via Cross-Attention: The key to object-level watermarking is the inherent cross-attention mechanism in LDMs. By analyzing the attention maps between the special token ($W^*$) and visual regions corresponding to specific text prompt tokens (e.g., "cat" in "A photo of a [cat W*]"), the model can precisely localize the watermark to the desired object.
  • Plug-and-Play Integration: The trained $W^*$ token embeddings can be seamlessly integrated into various Stable Diffusion variants and other LDMs without requiring significant architectural changes or retraining of the core model components.

Datasets

The authors evaluated their method on two datasets:

  • MS-COCO: A subset of 2,000 images was used for training the $W^*$ token embeddings.
  • WikiArt: Used for evaluation, along with captions from MS-COCO.

They also used prompts from a previous work [6] for text-to-image generation evaluation. No new benchmarks were introduced; rather, they evaluated against existing methods on standard datasets.

Key Insights and Ideas

  • Text Encoder as a Watermark Controller: The most significant insight is that by fine-tuning a text token's embedding, one can effectively control watermarking at the object level, directly through the text prompt. This is a departure from methods that rely on image manipulation or post-processing.
  • Leveraging Cross-Attention for Precision: The paper demonstrates how the natural cross-attention mechanisms within LDMs can be repurposed to achieve precise object localization for watermarking, eliminating the need for explicit segmentation masks during inference.
  • Efficiency Through Token Fine-tuning: The approach achieves remarkable parameter efficiency (a 105x reduction compared to baselines) by only fine-tuning token embeddings, making it highly practical.
  • Early Integration for Robustness: Introducing the watermark early in the diffusion process (during generation) leads to improved robustness against various post-generation attacks.

Key Results

  • High Bit Accuracy: The method achieves 99% bit accuracy for 48 bits, even under various attacks.
  • Parameter Efficiency: A 105x reduction in model parameters compared to prior methods.
  • Throughput: Achieves a throughput of 48 bits.
  • Imperceptibility: Maintains high image quality, with PSNR values comparable to or better than baselines. For full-image watermarking, they report over 7dB improvement in PSNR compared to AquaLoRA [6].
  • Object-Level Performance: Successfully watermarks up to three distinct objects within a single image, with heatmaps accurately indicating watermark presence. Even with significant object overlap (40%), detection remains robust (89% bit accuracy).
  • Plug-and-Play Capability: Demonstrated successful integration with various Stable Diffusion pipelines, including those using Textual Inversion and styled UNets.

Limitations and Future Work

  • Reliance on Attention Maps: The method's object localization relies on the accuracy of cross-attention maps. While generally effective, these maps can sometimes exhibit spillover, leading to imperfect localization, especially in complex scenes. The authors acknowledge that external segmentation models (like SAM) can enhance precision but note the potential drawback of relying on external dependencies.
  • Multiple Overlapping Watermarks: Extracting multiple watermarks from heavily overlapping regions using the same detector is identified as a challenging area, potentially leading to performance degradation.
  • Future Work: The authors suggest future research directions in training-free watermarking and controllable watermarking across any T2I pipeline. They also aim to motivate further research into handling multiple overlapping watermarks more effectively.

Summary updated

BibTeX
@inproceedings{devulapally2025your,
  author = {Naresh Kumar Devulapally and Mingzhen Huang and Vishal Asnani and Shruti Agarwal and Siwei Lyu and Vishnu Suresh Lokhande},
  title = {{Your Text Encoder Can Be An Object-Level Watermarking Controller}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2025},
}
Figure