4
stars
24
commits
Jupyter Notebook
primary language
Apr 29, 2026
updated
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.
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
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 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
Download from: https://github.com/ando-khachatryan/HiDDeN.git
Download from: https://github.com/ningyu1991/ArtificialGANFingerprints.git
Download from: https://github.com/facebookresearch/stable_signature
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
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:
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
...
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.
We have recently added our performance results on StegaStamp and VINE(train diffusion model on diffusiondb and test on other domain dataset):
| Dataset | PSNR β | Forged BitAcc β | FPR@10-6 β |
|---|---|---|---|
| DiffusionDB | 33.38 | 82.87% | 74.50% |
| MS-COCO | 33.21 | 84.58% | 82.40% |
| CelebA-HQ | 35.55 | 89.79% | 97.70% |
| ImageNet | 33.20 | 85.89% | 86.20% |
| Dataset | PSNR β | Forged BitAcc β | FPR@10-6 β |
|---|---|---|---|
| DiffusionDB | 36.48 | 93.63% | 97.80% |
| MS-COCO | 35.60 | 94.03% | 100.00% |
| CelebA-HQ | 36.95 | 96.17% | 99.80% |
| ImageNet | 35.58 | 93.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.
24 commits
Jupyter Notebook
58.5%
Python
41.5%
4
stars
24
commits
Jupyter Notebook
primary language
Apr 29, 2026
updated
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.
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
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 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
Download from: https://github.com/ando-khachatryan/HiDDeN.git
Download from: https://github.com/ningyu1991/ArtificialGANFingerprints.git
Download from: https://github.com/facebookresearch/stable_signature
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
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:
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
...
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.
We have recently added our performance results on StegaStamp and VINE(train diffusion model on diffusiondb and test on other domain dataset):
| Dataset | PSNR β | Forged BitAcc β | FPR@10-6 β |
|---|---|---|---|
| DiffusionDB | 33.38 | 82.87% | 74.50% |
| MS-COCO | 33.21 | 84.58% | 82.40% |
| CelebA-HQ | 35.55 | 89.79% | 97.70% |
| ImageNet | 33.20 | 85.89% | 86.20% |
| Dataset | PSNR β | Forged BitAcc β | FPR@10-6 β |
|---|---|---|---|
| DiffusionDB | 36.48 | 93.63% | 97.80% |
| MS-COCO | 35.60 | 94.03% | 100.00% |
| CelebA-HQ | 36.95 | 96.17% | 99.80% |
| ImageNet | 35.58 | 93.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.
24 commits
Jupyter Notebook
58.5%
Python
41.5%