Semantic Regenerative Attacks for Watermark Removal
This repository contains code for SemanticRegen, a framework for removing watermarks from images using semantic regeneration. Our approach leverages Visual Question Answering (VQA), segmentation, and stable diffusion inpainting to systematically identify and remove various types of watermarks while preserving image integrity.
SemanticRegen is a novel attack on watermarking techniques that removes embedded watermarks without introducing significant distortions. Our approach:
This implementation is adapted from existing frameworks, including:
Download the following models and place them in the models/ folder:
sam_vit_h_4b8939.pth
stable_signature.onnx # from WAVES
stega_stamp.onnx # from WAVES
We use LangSAM, an open-source variant of Meta's Segment Anything Model (SAM):
pip install git+https://github.com/luca-medeiros/lang-segment-anything.git
If the above command fails, install GroundingDINO first:
pip install torch==2.1.1 torchvision==0.16.1 torchaudio==2.1.1 --index-url https://download.pytorch.org/whl/cu118
git clone https://github.com/IDEA-Research/GroundingDINO.git
cd GroundingDINO/
pip install -e .
And then, install:
git clone https://github.com/luca-medeiros/lang-segment-anything
cd lang-segment-anything
pip install -e .
To run experiments on the StableSig watermark, install Stable Diffusion from source:
git clone https://github.com/Stability-AI/stablediffusion
cd stablediffusion
pip install -e .
You may require additional dependencies:
pip install dlib ai_tools cognitive_face zprint pytorch-lightning==1.4.2 torchmetrics==0.8.2 kornia==0.6 open-clip-torch==2.7.0
Then, move the required model files into the correct directory:
cp txt2img.py stablediffusion/scripts/
cp models/sd2_decoder.pth stablediffusion/checkpoints/
To reproduce our results, run:
python run_Benchmark_SemanticRegen.py
python run_Benchmark_Baselines.py
To evaluate TreeRing Watermarks, run:
bash scripts/run_Benchmark_SemanticRegen.sh --wm_type TreeRing --w_channel 3 --w_pattern ring
bash scripts/run_Benchmark_SemanticRegen.sh --wm_type StegaStamp
bash scripts/run_Benchmark_SemanticRegen.sh --wm_type StableSig
bash scripts/run_Benchmark_SemanticRegen.sh --wm_type Invisible
We provide Jupyter notebooks for analyzing the results:
| Notebook | Purpose |
|---|---|
01-Benchmarking_Watermark_Attack_Removal.ipynb | Benchmarking watermark removal attacks |
02-Benchmarking_Image_Quality.ipynb | Image quality evaluation |
02-Benchmarking_Image_Quality_CLIP_scores.ipynb | CLIP score analysis |
02-Benchmarking_Image_Quality_plots.ipynb | Visualization of results |
03-Reliability_Experiments.ipynb | Robustness and reliability testing |
If you find SemanticRegen useful, please cite our work:
@article{SemanticRegen2025,
author = {Tallam, Krti and Cava, John and Geniesse, Caleb and Erichson, Benjamin and Mahoney, Michael W.},
title = {Removing Watermarks with Partial Regeneration using Semantic Information},
year = {2025},
archivePrefix = {arXiv},
primaryClass = {cs.CV}
}
We used NVIDIA A100 GPUs, totaling approximately 200 GPU node hours.
MiniChat-MA
License: LLAMA2
LangSam
License: Apache 2.0
BLIP2
License: BSD 3-Clause
StabilityAI Inpainting
License: CreativeML Open RAIL++-M
👤 Krti Tallam, John Kevin Cava, Caleb Geniesse 📧 Contact: [email protected]
Semantic Regenerative Attacks for Watermark Removal
This repository contains code for SemanticRegen, a framework for removing watermarks from images using semantic regeneration. Our approach leverages Visual Question Answering (VQA), segmentation, and stable diffusion inpainting to systematically identify and remove various types of watermarks while preserving image integrity.
SemanticRegen is a novel attack on watermarking techniques that removes embedded watermarks without introducing significant distortions. Our approach:
This implementation is adapted from existing frameworks, including:
Download the following models and place them in the models/ folder:
sam_vit_h_4b8939.pth
stable_signature.onnx # from WAVES
stega_stamp.onnx # from WAVES
We use LangSAM, an open-source variant of Meta's Segment Anything Model (SAM):
pip install git+https://github.com/luca-medeiros/lang-segment-anything.git
If the above command fails, install GroundingDINO first:
pip install torch==2.1.1 torchvision==0.16.1 torchaudio==2.1.1 --index-url https://download.pytorch.org/whl/cu118
git clone https://github.com/IDEA-Research/GroundingDINO.git
cd GroundingDINO/
pip install -e .
And then, install:
git clone https://github.com/luca-medeiros/lang-segment-anything
cd lang-segment-anything
pip install -e .
To run experiments on the StableSig watermark, install Stable Diffusion from source:
git clone https://github.com/Stability-AI/stablediffusion
cd stablediffusion
pip install -e .
You may require additional dependencies:
pip install dlib ai_tools cognitive_face zprint pytorch-lightning==1.4.2 torchmetrics==0.8.2 kornia==0.6 open-clip-torch==2.7.0
Then, move the required model files into the correct directory:
cp txt2img.py stablediffusion/scripts/
cp models/sd2_decoder.pth stablediffusion/checkpoints/
To reproduce our results, run:
python run_Benchmark_SemanticRegen.py
python run_Benchmark_Baselines.py
To evaluate TreeRing Watermarks, run:
bash scripts/run_Benchmark_SemanticRegen.sh --wm_type TreeRing --w_channel 3 --w_pattern ring
bash scripts/run_Benchmark_SemanticRegen.sh --wm_type StegaStamp
bash scripts/run_Benchmark_SemanticRegen.sh --wm_type StableSig
bash scripts/run_Benchmark_SemanticRegen.sh --wm_type Invisible
We provide Jupyter notebooks for analyzing the results:
| Notebook | Purpose |
|---|---|
01-Benchmarking_Watermark_Attack_Removal.ipynb | Benchmarking watermark removal attacks |
02-Benchmarking_Image_Quality.ipynb | Image quality evaluation |
02-Benchmarking_Image_Quality_CLIP_scores.ipynb | CLIP score analysis |
02-Benchmarking_Image_Quality_plots.ipynb | Visualization of results |
03-Reliability_Experiments.ipynb | Robustness and reliability testing |
If you find SemanticRegen useful, please cite our work:
@article{SemanticRegen2025,
author = {Tallam, Krti and Cava, John and Geniesse, Caleb and Erichson, Benjamin and Mahoney, Michael W.},
title = {Removing Watermarks with Partial Regeneration using Semantic Information},
year = {2025},
archivePrefix = {arXiv},
primaryClass = {cs.CV}
}
We used NVIDIA A100 GPUs, totaling approximately 200 GPU node hours.
MiniChat-MA
License: LLAMA2
LangSam
License: Apache 2.0
BLIP2
License: BSD 3-Clause
StabilityAI Inpainting
License: CreativeML Open RAIL++-M
👤 Krti Tallam, John Kevin Cava, Caleb Geniesse 📧 Contact: [email protected]