holdrain/WMCopier

4

stars

24

commits

Jupyter Notebook

primary language

Apr 29, 2026

updated

Browse cluster: Digital Watermarking & Media Authentication β†’

README

WMCopier: Forging Invisible Image Watermarks on Arbitrary Images

The official code of NeurIPS 2025 paper WMCopier: Forging Invisible Image Watermarks on Arbitrary Images.

This repository explores attacks against invisible watermarking schemes using diffusion models, providing practical tools for watermark forgery and evaluation.

Framework of WMCopier


πŸš€ Getting Started

0. Install Requirements

First, create and activate a conda environment with Python 3.9+:

conda create -n wmcopier python=3.9
conda activate wmcopier

Then install all required dependencies:

pip install -r requirements.txt

1. Model Weights Configuration πŸ“₯

Several neural-network-based watermarking algorithms in this project require pretrained model weights.
Please follow the instructions below to download the corresponding weights and place them in:

β€’ DwTDCT, RivaGAN

DwTDCT is a classical, non–neural-network watermarking algorithm, while RivaGAN is a neural watermarking method.
Both algorithms are integrated in this project by directly calling the Python API provided by: https://github.com/ShieldMnt/invisible-watermark.git

β€’ HiDDeN

Download from: https://github.com/ando-khachatryan/HiDDeN.git

β€’ StegaStamp

Download from: https://github.com/ningyu1991/ArtificialGANFingerprints.git

β€’ Stable Signature

Download from: https://github.com/facebookresearch/stable_signature

β€’ Vine

This watermarking algorithm does not require manual weight preparation.
When invoked for the first time, it will automatically download the required model weights from HuggingFace.

πŸ“ Example Directory Structure (after downloading all weights)

WMSuite/algorithms/
└── checkpoints/
	β”œβ”€β”€ hidden/
	β”‚   β”œβ”€β”€ combined-noise--epoch-400.pyt
	β”‚   β”œβ”€β”€ crop-epoch-300.pyt
	β”‚   └── no-noise--epoch-400.pyt
	β”œβ”€β”€ stable_signature/
	β”‚   β”œβ”€β”€ dec_48b_whit.torchscript.pt
	β”‚   β”œβ”€β”€ sd2_decoder.pth
	β”‚   └── v2-1_512-ema-pruned.ckpt
	└── stegastamp/
		β”œβ”€β”€ AFHQ_cat2dog_256x256_decoder.pth
		└── AFHQ_cat2dog_256x256_encoder.pth

2. Generate Watermarked Auxiliary Dataset

You can easily generate watermarked images by running:

bash WMSuite/emb.sh

We highly recommend using WMSuite as an independent repository to help with your own watermarking experiments. πŸ‘‰ https://github.com/holdrain/WMSuite.git

WMSuite currently supports six watermarking algorithms:

3. Train a diffusion attacker

Train the watermarked unconditional diffusion model:

bash scripts/train.sh

Alternatively, you can use our pretrained model (trained on 5,000 watermarked images). Download the checkpoint package from Google Drive.

After downloading, unzip the file and place the extracted folders so that your project structure looks like:

-WMCopier
  -checkpoints
  -configs
  ...

4. Perform the Forgery Attack

You can try our forgery attack with a simple example on RivaGAN watermark by running the notebook: demo/forge.ipynb

For large-scale experiments on an entire image folder, run:

bash scripts/attack.sh

We do not publish the checkpoints here, following discussions with Amazon’s AGI Team. For more details, please refer to the "Broad Impact" section in our paper.

5. Update

We have recently added our performance results on StegaStamp and VINE(train diffusion model on diffusiondb and test on other domain dataset):

  1. StegaStamp Results:
DatasetPSNR ↑Forged BitAcc ↑FPR@10-6 ↑
DiffusionDB33.3882.87%74.50%
MS-COCO33.2184.58%82.40%
CelebA-HQ35.5589.79%97.70%
ImageNet33.2085.89%86.20%
  1. VINE Results:
DatasetPSNR ↑Forged BitAcc ↑FPR@10-6 ↑
DiffusionDB36.4893.63%97.80%
MS-COCO35.6094.03%100.00%
CelebA-HQ36.9596.17%99.80%
ImageNet35.5893.40%96.40%

The results show that WMCopier's strong generability. Residual-based approaches assume that the residual extracted from one watermarked image can be added to another clean image and still be detected. This assumption does not hold for all watermarking methods, which limits the performance of residual-based approaches on several watermakring algorithms.

We will include a more detailed discussion of this observation in our paper soon.

πŸ”— Reference

Contributors

holdrain

24 commits

holdrain/WMCopier

4

stars

24

commits

Jupyter Notebook

primary language

Apr 29, 2026

updated

Browse cluster: Digital Watermarking & Media Authentication β†’

README

WMCopier: Forging Invisible Image Watermarks on Arbitrary Images

The official code of NeurIPS 2025 paper WMCopier: Forging Invisible Image Watermarks on Arbitrary Images.

This repository explores attacks against invisible watermarking schemes using diffusion models, providing practical tools for watermark forgery and evaluation.

Framework of WMCopier


πŸš€ Getting Started

0. Install Requirements

First, create and activate a conda environment with Python 3.9+:

conda create -n wmcopier python=3.9
conda activate wmcopier

Then install all required dependencies:

pip install -r requirements.txt

1. Model Weights Configuration πŸ“₯

Several neural-network-based watermarking algorithms in this project require pretrained model weights.
Please follow the instructions below to download the corresponding weights and place them in:

β€’ DwTDCT, RivaGAN

DwTDCT is a classical, non–neural-network watermarking algorithm, while RivaGAN is a neural watermarking method.
Both algorithms are integrated in this project by directly calling the Python API provided by: https://github.com/ShieldMnt/invisible-watermark.git

β€’ HiDDeN

Download from: https://github.com/ando-khachatryan/HiDDeN.git

β€’ StegaStamp

Download from: https://github.com/ningyu1991/ArtificialGANFingerprints.git

β€’ Stable Signature

Download from: https://github.com/facebookresearch/stable_signature

β€’ Vine

This watermarking algorithm does not require manual weight preparation.
When invoked for the first time, it will automatically download the required model weights from HuggingFace.

πŸ“ Example Directory Structure (after downloading all weights)

WMSuite/algorithms/
└── checkpoints/
	β”œβ”€β”€ hidden/
	β”‚   β”œβ”€β”€ combined-noise--epoch-400.pyt
	β”‚   β”œβ”€β”€ crop-epoch-300.pyt
	β”‚   └── no-noise--epoch-400.pyt
	β”œβ”€β”€ stable_signature/
	β”‚   β”œβ”€β”€ dec_48b_whit.torchscript.pt
	β”‚   β”œβ”€β”€ sd2_decoder.pth
	β”‚   └── v2-1_512-ema-pruned.ckpt
	└── stegastamp/
		β”œβ”€β”€ AFHQ_cat2dog_256x256_decoder.pth
		└── AFHQ_cat2dog_256x256_encoder.pth

2. Generate Watermarked Auxiliary Dataset

You can easily generate watermarked images by running:

bash WMSuite/emb.sh

We highly recommend using WMSuite as an independent repository to help with your own watermarking experiments. πŸ‘‰ https://github.com/holdrain/WMSuite.git

WMSuite currently supports six watermarking algorithms:

3. Train a diffusion attacker

Train the watermarked unconditional diffusion model:

bash scripts/train.sh

Alternatively, you can use our pretrained model (trained on 5,000 watermarked images). Download the checkpoint package from Google Drive.

After downloading, unzip the file and place the extracted folders so that your project structure looks like:

-WMCopier
  -checkpoints
  -configs
  ...

4. Perform the Forgery Attack

You can try our forgery attack with a simple example on RivaGAN watermark by running the notebook: demo/forge.ipynb

For large-scale experiments on an entire image folder, run:

bash scripts/attack.sh

We do not publish the checkpoints here, following discussions with Amazon’s AGI Team. For more details, please refer to the "Broad Impact" section in our paper.

5. Update

We have recently added our performance results on StegaStamp and VINE(train diffusion model on diffusiondb and test on other domain dataset):

  1. StegaStamp Results:
DatasetPSNR ↑Forged BitAcc ↑FPR@10-6 ↑
DiffusionDB33.3882.87%74.50%
MS-COCO33.2184.58%82.40%
CelebA-HQ35.5589.79%97.70%
ImageNet33.2085.89%86.20%
  1. VINE Results:
DatasetPSNR ↑Forged BitAcc ↑FPR@10-6 ↑
DiffusionDB36.4893.63%97.80%
MS-COCO35.6094.03%100.00%
CelebA-HQ36.9596.17%99.80%
ImageNet35.5893.40%96.40%

The results show that WMCopier's strong generability. Residual-based approaches assume that the residual extracted from one watermarked image can be added to another clean image and still be detected. This assumption does not hold for all watermarking methods, which limits the performance of residual-based approaches on several watermakring algorithms.

We will include a more detailed discussion of this observation in our paper soon.

πŸ”— Reference

Contributors

holdrain

24 commits

Languages

Jupyter Notebook

58.5%

Python

41.5%