Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: other
|
| 3 |
+
tags:
|
| 4 |
+
- watermarking
|
| 5 |
+
- image-watermarking
|
| 6 |
+
- adversarial-training
|
| 7 |
+
- robust-watermarking
|
| 8 |
+
---
|
| 9 |
+
|
| 10 |
+
# CAT-Pixelseal-Compositional
|
| 11 |
+
|
| 12 |
+
This is the **CAT (Compositional Adversarial Training)** checkpoint for PixelSeal with a **compositional adversary (T=2)**.
|
| 13 |
+
|
| 14 |
+
## Overview
|
| 15 |
+
|
| 16 |
+
CAT is a plug-in training framework that replaces random augmentation with a learned sequential adversary to improve watermark robustness. Instead of sampling augmentations uniformly and independently, CAT trains a lightweight adversary—a frozen DINOv2 backbone + GRU controller + MLP heads—that adaptively selects a sequence of augmentations most likely to break the current watermark model at each training step.
|
| 17 |
+
|
| 18 |
+
This checkpoint corresponds to the **T=2 (compositional)** setting with:
|
| 19 |
+
- **Param head type**: `random_uniform` — augmentation parameters are sampled uniformly at random within learned ranges
|
| 20 |
+
- **Adversary depth**: 2 (two adversarial augmentations chained per training step)
|
| 21 |
+
- **Entropy weight** (λ_ent): 0.1 — entropy regularization to prevent collapse to a single attack
|
| 22 |
+
- **VI alpha** (α): 0.0
|
| 23 |
+
|
| 24 |
+
## Architecture
|
| 25 |
+
|
| 26 |
+
| Component | Config |
|
| 27 |
+
|---|---|
|
| 28 |
+
| Embedder | `unet_small2_yuv_quant` — U-Net operating in YUV space, 8 blocks, batch norm |
|
| 29 |
+
| Extractor | `convnext_tiny` — ConvNeXt-Tiny encoder + pixel decoder |
|
| 30 |
+
| Payload | 16 bits |
|
| 31 |
+
| Adversary | DINOv2 backbone + GRU + MLP, hidden dim 256, Gumbel-Softmax τ=1.0 |
|
| 32 |
+
|
| 33 |
+
## Training
|
| 34 |
+
|
| 35 |
+
Trained with CAT (T=2) on SA-1B using 4 GPUs:
|
| 36 |
+
|
| 37 |
+
```bash
|
| 38 |
+
OMP_NUM_THREADS=40 torchrun --nproc_per_node=4 train.py --local_rank 0 \
|
| 39 |
+
--video_dataset none --image_dataset sa-1b-full-resized --workers 4 \
|
| 40 |
+
--extractor_model convnext_tiny --embedder_model unet_small2_yuv_quant \
|
| 41 |
+
--hidden_size_multiplier 1 --nbits 16 \
|
| 42 |
+
--scaling_w_schedule Cosine,scaling_min=0.2,start_epoch=200,epochs=200 \
|
| 43 |
+
--scaling_w 1.0 --scaling_i 1.0 --attenuation jnd_1_1 \
|
| 44 |
+
--epochs 500 --iter_per_epoch 1000 \
|
| 45 |
+
--scheduler CosineLRScheduler,lr_min=1e-6,t_initial=500,warmup_lr_init=1e-8,warmup_t=5 \
|
| 46 |
+
--optimizer AdamW,lr=5e-4 \
|
| 47 |
+
--lambda_dec 1.0 --lambda_d 0.1 --lambda_i 0.1 --perceptual_loss yuv \
|
| 48 |
+
--num_augs 2 --augmentation_config configs/all_augs.yaml \
|
| 49 |
+
--disc_in_channels 1 --disc_start 50 \
|
| 50 |
+
--use_adversary True \
|
| 51 |
+
--adversary_entropy_weight 0.1 \
|
| 52 |
+
--adversary_hidden_dim 256 \
|
| 53 |
+
--adversary_gumbel_temperature 1.0 \
|
| 54 |
+
--adversary_param_head_type random_uniform \
|
| 55 |
+
--adversary_vi_alpha 0.0 \
|
| 56 |
+
--adversary_start_epoch 5 \
|
| 57 |
+
--percep_loss_start_epoch 50
|
| 58 |
+
```
|
| 59 |
+
|
| 60 |
+
## Augmentation Library
|
| 61 |
+
|
| 62 |
+
Trained against 15 augmentation families (see `configs/augs.yaml`): identity, JPEG, crop, rotate, rotate90, horizontal flip, perspective, Gaussian blur, brightness, contrast, saturation, hue, H.264, H.264 RGB, H.265.
|
| 63 |
+
|
| 64 |
+
## Usage
|
| 65 |
+
|
| 66 |
+
See the [CAT repository](https://github.com/facebookresearch/videoseal) and `configs/` for architecture details. Load with:
|
| 67 |
+
|
| 68 |
+
```python
|
| 69 |
+
from videoseal.models.videoseal import Videoseal
|
| 70 |
+
model = Videoseal.load_from_checkpoint("adv_d2_phtrandom_uniform_a0.0_ew0.10/checkpoint.pth")
|
| 71 |
+
```
|
| 72 |
+
|
| 73 |
+
## Citation
|
| 74 |
+
|
| 75 |
+
```bibtex
|
| 76 |
+
@article{cat2025,
|
| 77 |
+
title={Compositional Adversarial Training for Robust Visual Watermarking},
|
| 78 |
+
author={Anonymous Authors},
|
| 79 |
+
year={2025},
|
| 80 |
+
}
|
| 81 |
+
```
|
| 82 |
+
|
| 83 |
+
## License
|
| 84 |
+
|
| 85 |
+
Inherits the license from the VideoSeal repository (Meta Platforms, Inc.).
|