Catch You Everything Everywhere: Guarding Textual Inversion via Concept Watermarking

Weitao Feng, Jiyan He, Jie Zhang, Tianwei Zhang, Wenbo Zhou, Weiming Zhang, Nenghai YuarXiv 2023

Abstract

AI-Generated Content (AIGC) has achieved tremendous success in text-to-image tasks. Emerging personalization techniques like Textual Inversion (TI) can describe unseen concepts with only a few reference images. However, this introduces a threat where malicious users misuse concepts to generate illegal images. We propose concept watermarking, embedding watermark information into the target concept to be extracted from generated images. By jointly training a watermark encoder and decoder with the sampler in the loop, our method shows resilience to different diffusion processes while preserving utility. This allows platforms to allocate unique watermarked concepts to users for subsequent tracing and forensics.

Introduction: The Challenge of Personalized AIGC

Personalization techniques like Textual Inversion (TI) allow users to teach a model a specific new concept—such as a unique art style or a specific person’s face—using just a few reference images. These concepts are shared as lightweight "embeddings" on platforms like CivitAI. However, this ease of sharing creates significant risks for intellectual property and safety. A malicious user could use a celebrity's concept to create misleading deepfakes or infringe on an artist's style.

Overview of the concept watermarking framework for tracing and forensics.

Currently, there is no reliable way for a platform to prove which user generated a specific "illegal" image. Traditional image watermarking fails here because the watermark must be present in the output of a model it wasn't originally part of.

Methodology: Concept Watermarking

The proposed framework embeds watermarks into the TI embeddings themselves rather than the final pixels. This is achieved through a "sampler-in-the-loop" training strategy.

Detailed pipeline of the training and verification stages for concept watermarking.

Training Stage

  1. Watermark Encoder (U-Net): Takes the original TI embedding and a bit-string message (the watermark) to produce a "watermarked embedding" that is semantically identical to the original.
  2. Gradient Truncated Diffusion Sampling: To train the system, the watermarked embedding passes through a Diffusion Model. To manage computational costs, the authors use a "truncated" approach, only propagating gradients through the final $k$ steps (typically $k=3$).
  3. Watermark Decoder (EfficientNet): Reconstructs the original bit-string message from the final generated image.
  4. Optimization: The system uses a combination of Message Loss ($L_{Msg}$), CLIP Loss ($L_{CLIP}$) for semantic fidelity, Regularization Loss ($L_{Reg}$), and Contrastive Loss ($L_{Cst}$) to prevent watermark collisions.

Verification Stage

In the verification stage, the platform uses a set of prompt templates to generate images from a suspected concept. The decoder then extracts the message $m$ to identify the user associated with that specific watermarked embedding.

Evaluation and Results

The researchers tested the method on a diverse dataset including 5 individuals (e.g., Gal Gadot), 2 art styles (e.g., Monet), and 3 objects (e.g., Fiat Panda). GPT-3.5 was used to generate diverse prompts to ensure the watermark remains extractable across various contexts.

Key Performance Metrics

  • High Accuracy: The method achieved a 97.4% Success Rate (SR) for 8-bit watermarks, with a Bit Error Rate (BER) of only 0.3%.
  • Traceability: The system supports up to 255 unique users per concept (8 bits), allowing for granular user identification.
  • Robustness: The watermark is resilient to cross-sampler generation (DDIM, DDPM, Euler) and common image attacks like JPEG compression, cropping, and rotation.

Discussion and Future Work

Concept watermarking effectively "tags the recipe, not the dish." By baking the watermark into the identity of the concept, it becomes naturally resistant to pixel-level distortions. However, challenges remain regarding the computational cost of training and the bit-capacity for global-scale platforms. Future work may explore "universal" watermarkers that work across all concepts without requiring concept-specific training.

Summary updated

Abstract

AIGC (AI-Generated Content) has achieved tremendous success in many applications such as text-to-image tasks, where the model can generate high-quality images with diverse prompts, namely, different descriptions in natural languages. More surprisingly, the emerging personalization techniques even succeed in describing unseen concepts with only a few personal images as references, and there have been some commercial platforms for sharing the valuable personalized concept. However, such an advanced technique also introduces a severe threat, where malicious users can misuse the target concept to generate highly-realistic illegal images. Therefore, it becomes necessary for the platform to trace malicious users and hold them accountable. In this paper, we focus on guarding the most popular lightweight personalization model, ie, Textual Inversion (TI). To achieve it, we propose the novel concept watermarking, where watermark information is embedded into the target concept and then extracted from generated images based on the watermarked concept. Specifically, we jointly train a watermark encoder and a watermark decoder with the sampler in the loop. It shows great resilience to different diffusion sampling processes possibly chosen by malicious users, meanwhile preserving utility for normal use. In practice, the concept owner can upload his concept with different watermarks (ie, serial numbers) to the platform, and the platform allocates different users with different serial numbers for subsequent tracing and forensics.
BibTeX
@misc{feng2023catch,
  author = {Weitao Feng and Jiyan He and Jie Zhang and Tianwei Zhang and Wenbo Zhou and Weiming Zhang and Nenghai Yu},
  title = {{Catch You Everything Everywhere: Guarding Textual Inversion via Concept Watermarking}},
  year = {2023},
  eprint = {2309.05940},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2309.05940},
}
Figure