{"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/aqualora-toward-white-box-protection-for","title":"AquaLoRA: Toward White-box Protection for Customized Stable Diffusion Models via Watermark LoRA","arxiv_id":"2405.11135","date":"2024-05-18","proceeding":null,"authors":["Weitao Feng","Wenbo Zhou","Jiyan He","Jie Zhang","Tianyi Wei","Guanlin Li","Tianwei Zhang","Weiming Zhang","Nenghai Yu"],"abstract":"Diffusion models have achieved remarkable success in generating high-quality images. Recently, the open-source models represented by Stable Diffusion (SD) are thriving and are accessible for customization, giving rise to a vibrant community of creators and enthusiasts. However, the widespread availability of customized SD models has led to copyright concerns, like unauthorized model distribution and unconsented commercial use. To address it, recent works aim to let SD models output watermarked content for post-hoc forensics. Unfortunately, none of them can achieve the challenging white-box protection, wherein the malicious user can easily remove or replace the watermarking module to fail the subsequent verification. For this, we propose \\texttt{\\method} as the first implementation under this scenario. Briefly, we merge watermark information into the U-Net of Stable Diffusion Models via a watermark Low-Rank Adaptation (LoRA) module in a two-stage manner. For watermark LoRA module, we devise a scaling matrix to achieve flexible message updates without retraining. To guarantee fidelity, we design Prior Preserving Fine-Tuning (PPFT) to ensure watermark learning with minimal impacts on model distribution, validated by proofs. Finally, we conduct extensive experiments and ablation studies to verify our design.","url_abs":"https://arxiv.org/abs/2405.11135v1","url_pdf":"https://arxiv.org/pdf/2405.11135v1.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":"links_only","authors_date_abstract":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license), from the Kaggle arXiv metadata snapshot of 2026-09-12"},"code_links":[{"paper_slug":"aqualora-toward-white-box-protection-for","repo_url":"https://github.com/georgefwt/aqualora","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2405.11135","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2405.11135"}},"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/georgefwt/aqualora","reach":{"status":"ok"}}],"summary":{"ran":9,"ran_draft_wrong":1,"unverified":9},"by_repo_kind":{"official":{"samples":19,"ran":10,"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":19,"samples":[{"code_sha256_prefix":"45d76a4dde60b0d6","entry":"CustomLoRAConv2dLayerforward","repo":"georgefwt/aqualora","repo_kind":"official","path":"utils/lora_modules.py","file_url":"https://github.com/georgefwt/aqualora/blob/HEAD/utils/lora_modules.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":"45d76a4dde60b0d6"}},{"code_sha256_prefix":"fa6db3d9ab12b658","entry":"CustomLoRALinearLayerforward","repo":"georgefwt/aqualora","repo_kind":"official","path":"utils/lora_modules.py","file_url":"https://github.com/georgefwt/aqualora/blob/HEAD/utils/lora_modules.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":"fa6db3d9ab12b658"}},{"code_sha256_prefix":"9a0d3068d37b2b8d","entry":"PRVL_loss","repo":"georgefwt/aqualora","repo_kind":"official","path":"train/latent_wm_pretrain.py","file_url":"https://github.com/georgefwt/aqualora/blob/HEAD/train/latent_wm_pretrain.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":"9a0d3068d37b2b8d"}},{"code_sha256_prefix":"d8cb1d4dee4cd54c","entry":"base_augment","repo":"georgefwt/aqualora","repo_kind":"official","path":"train/latent_wm_pretrain.py","file_url":"https://github.com/georgefwt/aqualora/blob/HEAD/train/latent_wm_pretrain.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":"d8cb1d4dee4cd54c"}},{"code_sha256_prefix":"460b19e7ab3c2766","entry":"calculate_fpr","repo":"georgefwt/aqualora","repo_kind":"official","path":"evaluation/utils_eval.py","file_url":"https://github.com/georgefwt/aqualora/blob/HEAD/evaluation/utils_eval.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":"460b19e7ab3c2766"}},{"code_sha256_prefix":"12c4ff1381fbf7fd","entry":"get_threshold","repo":"georgefwt/aqualora","repo_kind":"official","path":"evaluation/utils_eval.py","file_url":"https://github.com/georgefwt/aqualora/blob/HEAD/evaluation/utils_eval.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":"12c4ff1381fbf7fd"}},{"code_sha256_prefix":"ae00b36c8caf5bde","entry":"normalize_embedding","repo":"georgefwt/aqualora","repo_kind":"official","path":"evaluation/dreamsim/model.py","file_url":"https://github.com/georgefwt/aqualora/blob/HEAD/evaluation/dreamsim/model.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":"ae00b36c8caf5bde"}},{"code_sha256_prefix":"a4d3e242707c8aa8","entry":"text_encoder_all_modules","repo":"georgefwt/aqualora","repo_kind":"official","path":"train/rob_enhance_finetune.py","file_url":"https://github.com/georgefwt/aqualora/blob/HEAD/train/rob_enhance_finetune.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":"a4d3e242707c8aa8"}},{"code_sha256_prefix":"8feb85aa601111fa","entry":"text_encoder_lora_state_dict","repo":"georgefwt/aqualora","repo_kind":"official","path":"train/rob_enhance_finetune.py","file_url":"https://github.com/georgefwt/aqualora/blob/HEAD/train/rob_enhance_finetune.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":"8feb85aa601111fa"}},{"code_sha256_prefix":"129b804760b3115f","entry":"zero_module","repo":"georgefwt/aqualora","repo_kind":"official","path":"utils/models.py","file_url":"https://github.com/georgefwt/aqualora/blob/HEAD/utils/models.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"129b804760b3115f"}},{"code_sha256_prefix":"8fcd7ebd984cf883","entry":"CustomLoRACompatibleConvforward","repo":"georgefwt/aqualora","repo_kind":"official","path":"utils/lora_modules.py","file_url":"https://github.com/georgefwt/aqualora/blob/HEAD/utils/lora_modules.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":"8fcd7ebd984cf883"}},{"code_sha256_prefix":"97702e2398569092","entry":"calculate_activation_statistics","repo":"georgefwt/aqualora","repo_kind":"official","path":"evaluation/pytorch_fid/fid_score.py","file_url":"https://github.com/georgefwt/aqualora/blob/HEAD/evaluation/pytorch_fid/fid_score.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":"97702e2398569092"}},{"code_sha256_prefix":"0def50a351111624","entry":"calculate_frechet_distance","repo":"georgefwt/aqualora","repo_kind":"official","path":"evaluation/pytorch_fid/fid_score.py","file_url":"https://github.com/georgefwt/aqualora/blob/HEAD/evaluation/pytorch_fid/fid_score.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":"fe4eb545bbb728e0","entry":"conv_nd","repo":"georgefwt/aqualora","repo_kind":"official","path":"utils/models.py","file_url":"https://github.com/georgefwt/aqualora/blob/HEAD/utils/models.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":"fe4eb545bbb728e0"}},{"code_sha256_prefix":"d8ae59700c63ed69","entry":"download_weights","repo":"georgefwt/aqualora","repo_kind":"official","path":"evaluation/dreamsim/model.py","file_url":"https://github.com/georgefwt/aqualora/blob/HEAD/evaluation/dreamsim/model.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":"d8ae59700c63ed69"}},{"code_sha256_prefix":"42e6b81c4d75c819","entry":"dreamsim","repo":"georgefwt/aqualora","repo_kind":"official","path":"evaluation/dreamsim/model.py","file_url":"https://github.com/georgefwt/aqualora/blob/HEAD/evaluation/dreamsim/model.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":"42e6b81c4d75c819"}},{"code_sha256_prefix":"3df5c01e06c4ce6e","entry":"ds","repo":"georgefwt/aqualora","repo_kind":"official","path":"evaluation/run_dreamsim.py","file_url":"https://github.com/georgefwt/aqualora/blob/HEAD/evaluation/run_dreamsim.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":"3df5c01e06c4ce6e"}},{"code_sha256_prefix":"e82666b86e1ca879","entry":"get_activations","repo":"georgefwt/aqualora","repo_kind":"official","path":"evaluation/pytorch_fid/fid_score.py","file_url":"https://github.com/georgefwt/aqualora/blob/HEAD/evaluation/pytorch_fid/fid_score.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":"e82666b86e1ca879"}},{"code_sha256_prefix":"0eb3e94e8635150e","entry":"import_model_class_from_model_name_or_path","repo":"georgefwt/aqualora","repo_kind":"official","path":"train/rob_enhance_finetune.py","file_url":"https://github.com/georgefwt/aqualora/blob/HEAD/train/rob_enhance_finetune.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":"0eb3e94e8635150e"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}