SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2404.04956 · CVPR · 2024

Gaussian Shading: Provable Performance-Lossless Image Watermarking for Diffusion Models

Weiming Zhang, Nenghai Yu, Han Fang, Kejiang Chen, Kai Zeng, Zijin Yang

arXiv · PDF · Open in the Atlas

Code that ran

We lifted 14 functions out of this paper's own repositories and ran 5 of them in a sandbox. "Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results.

RepositoryRoleRan
bsmhmmlf/Gaussian-Shading canonical 5 of 14
FunctionStatusWhere it lives
convert_to_custom_text_state_dict Ran bsmhmmlf/Gaussian-Shading/open_clip/model.py
code served (permissive licence) · get_code("f19962ebb134b3d7")
get_cast_dtype Ran bsmhmmlf/Gaussian-Shading/open_clip/model.py
code served (permissive licence) · get_code("dcd422d66b0581d8")
image_distortion Ran bsmhmmlf/Gaussian-Shading/image_utils.py
code served (permissive licence) · get_code("5fa7b8bcd038a010")
latents_to_imgs Ran bsmhmmlf/Gaussian-Shading/image_utils.py
code served (permissive licence) · get_code("82db872730553ad6")
transform_img Ran bsmhmmlf/Gaussian-Shading/image_utils.py
code served (permissive licence) · get_code("f2eed600b6113eb3")
backward_ddim Not yet run bsmhmmlf/Gaussian-Shading/inverse_stable_diffusion.py
code served (permissive licence) · get_code("b9d521d7021e46bb")
build_model_from_openai_state_dict Not yet run bsmhmmlf/Gaussian-Shading/open_clip/model.py
code served (permissive licence) · get_code("57f1602ed20a9c21")
forward_ddim Not yet run bsmhmmlf/Gaussian-Shading/inverse_stable_diffusion.py
code served (permissive licence) · get_code("3b89ab9f937dccdd")
gather_features Not yet run bsmhmmlf/Gaussian-Shading/open_clip/loss.py
code served (permissive licence) · get_code("ddcbd45e940484ee")
hf_read_jsonlines Not yet run bsmhmmlf/Gaussian-Shading/io_utils.py
code served (permissive licence) · get_code("075fbc6126eeefe6")
load_jsonlines Not yet run bsmhmmlf/Gaussian-Shading/io_utils.py
code served (permissive licence) · get_code("81cef8be4a138b63")
prepare_inputs_for_generation Not yet run bsmhmmlf/Gaussian-Shading/open_clip/coca_model.py
code served (permissive licence) · get_code("fb651d0a97fd4d3f")
register_pooler Not yet run bsmhmmlf/Gaussian-Shading/open_clip/hf_model.py
code served (permissive licence) · get_code("2a377da4a76a2d44")
resolve_globs Not yet run bsmhmmlf/Gaussian-Shading/io_utils.py
code served (permissive licence) · get_code("afbb28c04b32db08")

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Ethical concerns surrounding copyright protection and inappropriate content generation pose challenges for the practical implementation of diffusion models. One effective solution involves watermarking the generated images. However, existing methods often compromise the model performance or require additional training, which is undesirable for operators and users. To address this issue, we propose Gaussian Shading, a diffusion model watermarking technique that is both performance-lossless and trainingfree, while serving the dual purpose of copyright protection and tracing of offending content. Our watermark embedding is free of model parameter modifications and thus is plug-and-play. We map the watermark to latent representations following a standard Gaussian distribution, which is indistinguishable from latent representations obtained from the non-watermarked diffusion model. Therefore we can achieve watermark embedding with lossless performance, for which we also provide theoretical proof. Furthermore, since the watermark is intricately linked with image semantics, it exhibits resilience to lossy processing and erasure attempts. The watermark can be extracted by Denoising Diffusion Implicit Models (DDIM) inversion and inverse sampling. We evaluate Gaussian Shading on multiple versions of Stable Diffusion, and the results demonstrate that Gaussian Shading not only is performance-lossless but also outperforms existing methods in terms of robustness.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2404.04956")
get_code_for_paper("2404.04956")
have("2404.04956")

Connect an agent — have() is free.