mlr2000's picture
Upload folder using huggingface_hub
66157f2 verified
|
Raw
History Blame Contribute Delete
3.3 kB
---
library_name: transformers
tags:
- audio
- watermark
- watermark-detection
- provenance
- vocbulwark
license: cc-by-4.0
---
# VocBulwark watermark detector
Standalone detector for the fixed **32-bit** provenance watermark embedded by
the companion VocBulwark vocoder. Given an audio clip, it extracts the watermark
bits with the Cage extractor and compares them to the known fixed code, reporting
how many bits match.
Self-contained: loads with `trust_remote_code=True`, no training repo required.
## Companion Models
This detector is part of a set of 6 repositories:
| Repo | Role |
|------|------|
| `mlr2000/vocoder-large` | Large vocoder |
| `mlr2000/vocoder-large-watermark-detector` | Watermark detector for the large model |
| `mlr2000/vocoder-large-speaker-encoder` | Speaker encoder for the large model |
| `mlr2000/vocoder-small` | Small vocoder (generates the watermarked audio) |
| `mlr2000/vocoder-small-watermark-detector` | Watermark detector (this repo) |
| `mlr2000/vocoder-small-speaker-encoder` | Speaker encoder for the small model |
## Usage
```python
import torchaudio
from transformers import AutoModel
det = AutoModel.from_pretrained("mlr2000/vocoder-small-watermark-detector", trust_remote_code=True).eval()
wav, sr = torchaudio.load("clip.wav") # [C, T]
res = det.detect(wav, input_sample_rate=sr) # resampled to 24 kHz internally
print(res)
# {'matches': 32, 'n_bits': 32, 'p_value': 8.9e-16} # from our model
```
See **`example_roundtrip.ipynb`** in this repo for an end-to-end example
(generate with the vocoder → detect here).
## How detection works
`detect()` returns a dict with:
- `matches`: how many of the 32 extracted bits equal the fixed code.
- `n_bits`: 32.
- `p_value`: the probability an *unrelated* clip matches at least this well under
`Binomial(32, 0.5)`.
A clip generated by our vocoder matches **all 32 bits** (`p_value` ~ 0); an
unrelated clip matches about half of them (`p_value` ~ 1). There is no built-in
yes/no threshold — read `matches` / `p_value` and pick whatever operating point
you need. Requiring all 32 bits gives an astronomically small false-positive
rate; allowing a few mismatches trades that for robustness to lossy channels.
## Notes
- Detection runs on **24 kHz mono**. Other inputs are resampled when you pass `input_sample_rate`, and multi-channel audio is downmixed to mono.
- This detector is paired with `mlr2000/vocoder-small`. It will not correctly verify audio generated by the large vocoder (`mlr2000/vocoder-large`), which uses a different fixed 50-bit watermark.
- A fixed public watermark is for **attribution** ("did our model make this"), not a secret mark.
- Not intended for surveillance or any use that violates the privacy of individuals.
## Citation
If you use this model, please cite:
```bibtex
@misc{muletta2026,
title = {Training a Discriminator-Free Foundation Vocoder
with Integrated Audio Watermarking},
author = {Muletta, Romolo and Deriu, Jan},
year = {2026},
note = {VT2 Project Report, ZHAW School of Engineering}
}
```
## License
`cc-by-4.0`. Trained on MLS (CC-BY-4.0) and Common Voice (CC0). Builds
on BigVGAN (MIT) and wav2vec 2.0 (Apache-2.0). Please retain attribution
when redistributing or building on this model.