Official implementation of THE SELF-RE-WATERMARKING TRAP: FROM EXPLOIT TO RESILIENCE.
- Python 3.8+
- Conda (recommended)
- CUDA 11.8 if using GPU
All dependencies are captured in environment.yml for reproducibility.
We provide a bash script that handles environment creation, checkpoint download, and running training/testing.
- Clone the repository:
git clone --recurse-submodules https://github.com/SVithurabiman/SRW.git- Run the setup script:
bash run_all.sh [train|test]This script will:
-
Create a Conda environment from environment.yml
-
Activate the environment
-
Download pretrained checkpoints from HuggingFace into
results/ -
Run training if
trainis passed as an argument. After running, outputs and logs will be saved inresults/. -
Run testing/evaluation if
testis passed as an argument
If you prefer to run manually:
Training
python -m SRW.train --dataset_config ./SRW/configs/dataset.yaml --exp_config ./SRW/configs/train.yaml
Visualizing Training
This repository uses TensorBoard to log training progress.
Launch TensorBoard:
tensorboard --logdir results --port 6006Then open in your browser:
http://localhost:6006
Evaluation / Testing
python -m SRW.test --dataset_config ./SRW/configs/dataset.yaml --exp_config ./SRW/configs/test.yaml
All experiment settings are in the configs/ folder:
-
configs/train.yaml – default training settings
-
configs/test.yaml – default test settings
-
configs/dataset.ymal - default Image and Message settings
Modify paths, hyperparameters, or model options in these YAML files as needed.
If you find this work useuful, please cite:
@inproceedings{senthuran2026selfrewatermarking,
title={The Self‑Re‑Watermarking Trap: From Exploit to Resilience},
author={Vithurabiman Senthuran and Yong Xiang and Iynkaran Natgunanathan and Uthayasanker
Thayasivam},
booktitle={International Conference on Learning Representations (ICLR)},
year={2026},
url={https://openreview.net/forum?id=st1hrLTP14}
}