Add model card
Browse files
README.md
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
library_name: pytorch
|
| 3 |
+
pipeline_tag: image-classification
|
| 4 |
+
tags:
|
| 5 |
+
- watermarking
|
| 6 |
+
- diffusion
|
| 7 |
+
- provenance
|
| 8 |
+
- attribution
|
| 9 |
+
- stable-diffusion
|
| 10 |
+
---
|
| 11 |
+
|
| 12 |
+
# DiffSign public watermark decoder (256-bit)
|
| 13 |
+
|
| 14 |
+
Public verification artifact for the anonymous **DiffSign** submission,
|
| 15 |
+
*Public Authorization and the Adaptive Attack Surface of Diffusion-Watermark
|
| 16 |
+
Attribution*.
|
| 17 |
+
|
| 18 |
+
This repository contains **only the public decoder** `D_psi`. The secret
|
| 19 |
+
encoder `E_phi` is server-private by design and is deliberately not published:
|
| 20 |
+
DiffSign's threat model assumes an adversary holds the full public
|
| 21 |
+
verification interface but cannot invoke the encoder.
|
| 22 |
+
|
| 23 |
+
## Artifact
|
| 24 |
+
|
| 25 |
+
| | |
|
| 26 |
+
|---|---|
|
| 27 |
+
| File | `diffsign_public_decoder_256bit.pth` |
|
| 28 |
+
| Size | 21,702,122 bytes |
|
| 29 |
+
| SHA-256 | `1cf105cd89de5aba6beefe5e48af2082de78de296e912557ab2d7905c2ab975c` |
|
| 30 |
+
| Tensors | 38 (5,422,300 parameters) |
|
| 31 |
+
| Output | logits `[batch, 256, 2]` |
|
| 32 |
+
| Raw LLRs | `logit(bit=1) - logit(bit=0)`, shape `[batch, 256]` |
|
| 33 |
+
|
| 34 |
+
Top-level fields: `format_version`, `artifact`, `decoder_state_dict`,
|
| 35 |
+
`decoder_config`, `preprocessing`, `llr_convention`. It contains no
|
| 36 |
+
`encoder_state_dict` and no optimizer, scheduler, or training state.
|
| 37 |
+
|
| 38 |
+
## Preprocessing
|
| 39 |
+
|
| 40 |
+
Pair the decoder with the public VAE from
|
| 41 |
+
[`stable-diffusion-v1-5/stable-diffusion-v1-5`](https://huggingface.co/stable-diffusion-v1-5/stable-diffusion-v1-5):
|
| 42 |
+
|
| 43 |
+
1. Convert to RGB and resize to 512x512.
|
| 44 |
+
2. Normalize pixels to `[-1, 1]`.
|
| 45 |
+
3. Take the VAE posterior mode and multiply by the latent scaling factor.
|
| 46 |
+
4. Evaluate `D_psi` once.
|
| 47 |
+
5. Return `logit(bit=1) - logit(bit=0)` as `float32[256]` raw LLRs.
|
| 48 |
+
|
| 49 |
+
Public verification is normative in `float32`. Half precision is permitted for
|
| 50 |
+
throughput but is not the reference configuration: it shifts raw LLRs by up to
|
| 51 |
+
`2e-2` and can flip a hard decision on a bit whose LLR is already near zero,
|
| 52 |
+
so two verifiers on different hardware may disagree.
|
| 53 |
+
|
| 54 |
+
## Usage
|
| 55 |
+
|
| 56 |
+
```python
|
| 57 |
+
from diffsign.physical import PublicWatermarkDecoder
|
| 58 |
+
|
| 59 |
+
decoder = PublicWatermarkDecoder.from_pretrained(
|
| 60 |
+
"diffsign_public_decoder_256bit.pth",
|
| 61 |
+
device="cuda",
|
| 62 |
+
)
|
| 63 |
+
raw_llrs = decoder.decode_raw_llrs(image) # float32[256]
|
| 64 |
+
```
|
| 65 |
+
|
| 66 |
+
The raw LLRs are divided by the fixed calibration temperature `0.7144` and
|
| 67 |
+
decoded by a CRC-aided successive-cancellation list decoder (length-256
|
| 68 |
+
non-systematic polar code, list size 8) into a 112-bit payload, which resolves
|
| 69 |
+
through an audited transparency log to a signed receipt.
|
| 70 |
+
|
| 71 |
+
## Scope
|
| 72 |
+
|
| 73 |
+
Inference only. No training loop, dataset loader, attack implementation,
|
| 74 |
+
third-party baseline, benchmark harness, or bulk generation script.
|