Localized watermarking for AI-generated speech audios, with SOTA on robustness and very fast detector
Localized watermarking for AI-generated speech audios, with SOTA on robustness and very fast detector
This repo contains the official implementation for AudioSeal, a method for efficient audio watermarking, with state-of-the-art robustness and detector speed.
[arXiv]
[Hugging Face]
[Colab Notebook]
[Webpage]
[Blog]
[Press]
AudioSeal introduces a novel audio watermarking using ocalized watermarking and a novel perceptual loss. It jointly trains two components: a generator that embeds an imperceptible watermark into audio and a detector that identifies watermark fragments in long or edited audio files.
pip install audiosealTo install from source: Clone this repo and install in editable mode:
git clone https://github.com/facebookresearch/audioseal
cd audioseal
pip install -e .You can find all the model checkpoints on the Hugging Face Hub. We provide the checkpoints for the following models:
Note that the message is optional and has no influence on the detection output. It may be used to identify a model version for instance (up to $2**16=65536$ possible choices).
Here’s a quick example of how you can use AudioSeal’s API to embed and detect watermarks:
…Starting AudioSeal 0.2, you can run the watermarking over the stream of audio signals. The API is `model.streaming(batch_size), which will enable the convolutional cache during the watermark generation. Ensure to put this within context, so the cache is safely cleaned after the session:
…See example notebook for full details.
See here for details on how to train your own Watermarking model.
The team also develops other open-source watermarking solutions:
If you encounter the error ValueError: not enough values to unpack (expected 3, got 2), this is because we expect a batch of audio tensors as inputs. Add one
dummy batch dimension to your input (e.g. wav.unsqueeze(0), see example notebook for getting started).
In Windows machines, if you encounter the error KeyError raised while resolving interpolation: "Environmen variable 'USER' not found": This is due to an old checkpoint
uploaded to the model hub, which is not compatible in Windows. Try to invalidate the cache by removing the files in C:\Users\\.cache\audioseal
and re-run again.
If you use torchaudio to handle your audios and encounter the error Couldn't find appropriate backend to handle uri ..., this is due to newer version of
torchaudio does not handle the default backend well. Either downgrade your torchaudio to 2.1.0 or earlier, or install soundfile as your audio backend.
We borrow the code with some adaptations from the following repos:
libs/audiocraft/.libs/moshi/.We welcome Pull Requests with improvements or suggestions. If you want to flag an issue or propose an improvement, but don't know how to realize it, create a GitHub Issue.
If you find this repository useful, please consider giving a star :star: and please cite as:
@article{sanroman2024proactive,
title={Proactive Detection of Voice Cloning with Localized Watermarking},
author={San Roman, Robin and Fernandez, Pierre and Elsahar, Hady and D´efossez, Alexandre and Furon, Teddy and Tran, Tuan},
journal={ICML},
year={2024}
}No open issues yet, or sync has not completed.