{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/robust-image-watermarking-using-stable","title":"Attack-Resilient Image Watermarking Using Stable Diffusion","arxiv_id":"2401.04247","date":"2024-01-08","proceeding":null,"authors":["Lijun Zhang","Xiao Liu","Antoni Viros Martin","Cindy Xiong Bearfield","Yuriy Brun","Hui Guan"],"abstract":"Watermarking images is critical for tracking image provenance and proving ownership. With the advent of generative models, such as stable diffusion, that can create fake but realistic images, watermarking has become particularly important to make human-created images reliably identifiable. Unfortunately, the very same stable diffusion technology can remove watermarks injected using existing methods. To address this problem, we present ZoDiac, which uses a pre-trained stable diffusion model to inject a watermark into the trainable latent space, resulting in watermarks that can be reliably detected in the latent vector even when attacked. We evaluate ZoDiac on three benchmarks, MS-COCO, DiffusionDB, and WikiArt, and find that ZoDiac is robust against state-of-the-art watermark attacks, with a watermark detection rate above 98% and a false positive rate below 6.4%, outperforming state-of-the-art watermarking methods. We hypothesize that the reciprocating denoising process in diffusion models may inherently enhance the robustness of the watermark when faced with strong attacks and validate the hypothesis. Our research demonstrates that stable diffusion is a promising approach to robust watermarking, able to withstand even stable-diffusion--based attack methods. ZoDiac is open-sourced and available at https://github.com/zhanglijun95/ZoDiac.","url_abs":"https://arxiv.org/abs/2401.04247v2","url_pdf":"https://arxiv.org/pdf/2401.04247v2.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"robust-image-watermarking-using-stable","repo_url":"https://github.com/zhanglijun95/ZoDiac","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"denoising","task_name":"Denoising"}],"methods":[{"method_slug":"diffusion","method_name":"Diffusion"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2401.04247","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2401.04247"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/zhanglijun95/ZoDiac","reach":{"status":"ok"}}],"summary":{"ran":2,"ran_honours":2,"unverified":7},"by_repo_kind":{"official":{"samples":11,"ran":4,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":11,"samples":[{"code_sha256_prefix":"0577c3beb6756949","entry":"compute_psnr","repo":"zhanglijun95/ZoDiac","repo_kind":"official","path":"main/utils.py","file_url":"https://github.com/zhanglijun95/ZoDiac/blob/HEAD/main/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"0577c3beb6756949"}},{"code_sha256_prefix":"00aa681773f9aed4","entry":"create_output_folder","repo":"zhanglijun95/ZoDiac","repo_kind":"official","path":"main/utils.py","file_url":"https://github.com/zhanglijun95/ZoDiac/blob/HEAD/main/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"00aa681773f9aed4"}},{"code_sha256_prefix":"6154e3744ece5728","entry":"create_window","repo":"zhanglijun95/ZoDiac","repo_kind":"official","path":"loss/pytorch_ssim.py","file_url":"https://github.com/zhanglijun95/ZoDiac/blob/HEAD/loss/pytorch_ssim.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"6154e3744ece5728"}},{"code_sha256_prefix":"c56b7ef16f309a45","entry":"gaussian","repo":"zhanglijun95/ZoDiac","repo_kind":"official","path":"loss/pytorch_ssim.py","file_url":"https://github.com/zhanglijun95/ZoDiac/blob/HEAD/loss/pytorch_ssim.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"c56b7ef16f309a45"}},{"code_sha256_prefix":"634f529d3d26e87e","entry":"calculate_activation_statistics","repo":"zhanglijun95/ZoDiac","repo_kind":"official","path":"main/fid.py","file_url":"https://github.com/zhanglijun95/ZoDiac/blob/HEAD/main/fid.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"634f529d3d26e87e"}},{"code_sha256_prefix":"0def50a351111624","entry":"calculate_frechet_distance","repo":"zhanglijun95/ZoDiac","repo_kind":"official","path":"main/fid.py","file_url":"https://github.com/zhanglijun95/ZoDiac/blob/HEAD/main/fid.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":"RAISES","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"0def50a351111624"}},{"code_sha256_prefix":"ceb163acb8634f88","entry":"get_activations","repo":"zhanglijun95/ZoDiac","repo_kind":"official","path":"main/fid.py","file_url":"https://github.com/zhanglijun95/ZoDiac/blob/HEAD/main/fid.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"ceb163acb8634f88"}},{"code_sha256_prefix":"3ea2490fe9677271","entry":"get_img_tensor","repo":"zhanglijun95/ZoDiac","repo_kind":"official","path":"main/utils.py","file_url":"https://github.com/zhanglijun95/ZoDiac/blob/HEAD/main/utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"3ea2490fe9677271"}},{"code_sha256_prefix":"0086e76caac76ff6","entry":"normalize_tensor","repo":"zhanglijun95/ZoDiac","repo_kind":"official","path":"loss/watson_vgg.py","file_url":"https://github.com/zhanglijun95/ZoDiac/blob/HEAD/loss/watson_vgg.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"0086e76caac76ff6"}},{"code_sha256_prefix":"cc287dc402b9202b","entry":"softmax","repo":"zhanglijun95/ZoDiac","repo_kind":"official","path":"loss/watson_vgg.py","file_url":"https://github.com/zhanglijun95/ZoDiac/blob/HEAD/loss/watson_vgg.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"cc287dc402b9202b"}},{"code_sha256_prefix":"9151c793f90473f0","entry":"ssim","repo":"zhanglijun95/ZoDiac","repo_kind":"official","path":"loss/pytorch_ssim.py","file_url":"https://github.com/zhanglijun95/ZoDiac/blob/HEAD/loss/pytorch_ssim.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"9151c793f90473f0"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}