Skip to main content

🔊 SilentCipher: Deep Audio Watermarking: Link to arxiv

Python

Code for SilentCipher, a method of embedding watermarking in any audio with state-of-the-art robustness.
Currently this repository supports audio at 16kHz and 44.1kHz.
Checkout our paper for more details.

[arXiv] [Colab notebook]

Summary

In this paper, we address artefacts introduces by Deep learning-based watermarking methods and introduce a way to remove the need for perceptual losses which leads to stable training allowing us to achieve SOTA in terms of both perceptual quality and robustness against distortion. Unlike previous methods which work on 16kHz sampling rate, we also showcase our results on 44.1kHz sampling rates opening the path for practical applications.

Abstract

In the realm of audio watermarking, it is challenging to simultaneously encode imperceptible messages while enhancing the message capacity and robustness. Although recent advancements in deep learning-based methods bolster the message capacity and robustness over traditional methods, the encoded messages introduce audible artefacts that restricts their usage in professional settings. In this study, we introduce three key innovations. Firstly, our work is the first deep learning-based model to integrate psychoacoustic model based thresholding to achieve imperceptible watermarks. Secondly, we introduce psuedo-differentiable compression layers, enhancing the robustness of our watermarking algorithm. Lastly, we introduce a method to eliminate the need for perceptual losses, enabling us to achieve SOTA in both robustness as well as imperceptible watermarking. Our contributions lead us to SilentCipher, a model enabling users to encode messages within audio signals sampled at 44.1kHz.

🧉 Installation

SilentCipher requires Python >=3.8.
I would recommend using a python virtual environment.

python -m venv env
source env/bin/activate

To install from PyPI:

pip install silentcipher

To install from source: Clone this repo and install in editable mode:

git clone [GIT_URL]
pip install build
python -m build
pip install dist/<package>.whl

⚙️ Models

Note: We will be uploading the model checkpoints soon. Stay Tuned!
Note: We are working to release the training code for anyone wants to build their own watermarker. Stay tuned !

🧮 Usage

SilentCipher provides a simple API to watermark and detect the watermarks from an audio sample. Example usage:

import librosa
import silentcipher

model = silentcipher.get_model(
    model_type='44.1k', # 16k
    ckpt_path='../Models/44_1_khz/73999_iteration', 
    config_path='../Models/44_1_khz/73999_iteration/hparams.yaml'
)

# Encode from waveform

y, sr = librosa.load('test.wav', sr=None)

# The message should be in the form of five 8-bit characters, giving a total message capacity of 40 bits 

encoded, sdr = model.encode_wav(y, sr, [123, 234, 111, 222, 11])

# You can specify the message SDR (in dB) along with the encode_wav function. But this may result in unexpected detection accuracy
# encoded, sdr = model.encode_wav(y, sr, [123, 234, 111, 222, 11], message_sdr=47)

result = model.decode_wav(encoded, sr, phase_shift_decoding=False)

assert result['status']
assert result['messages'][0] == [123, 234, 111, 222, 11], result['messages'][0]
assert result['confidences'][0] == 1, result['confidences'][0]

# Encode from filename

# The message should be in the form of five 8-bit characters, giving a total message capacity of 40 bits 

model.encode('test.wav', 'encoded.wav', [123, 234, 111, 222, 11])

# You can specify the message SDR (in dB) along with the encode function. But this may result in unexpected detection accuracy
# model.encode('test.wav', 'encoded.wav', [123, 234, 111, 222, 11], message_sdr=47)

result = model.decode('encoded.wav', phase_shift_decoding=False)

assert result['messages'][0] == [123, 234, 111, 222, 11], result['messages'][0]
assert result['confidences'][0] == 1, result['confidences'][0]

Want to contribute?

We welcome Pull Requests with improvements or suggestions. If you want to flag an issue or propose an improvement, but dont' know how to realize it, create a GitHub Issue.

License

  • The code in this repository is released under the license as found in the LICENSE file.

Maintainers:

Citation

If you find this repository useful, please consider giving a star ⭐ and please cite as:

@inproceedings{singh24_interspeech,
  author={Mayank Kumar Singh and Naoya Takahashi and Weihsiang Liao and Yuki Mitsufuji},
  title={{SilentCipher: Deep Audio Watermarking}},
  year=2024,
  booktitle={Proc. INTERSPEECH 2024},
}

Metadata

Release files for silentcipher 1.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for silentcipher 1.0.5
File Size Uploaded Provenance Actions
silentcipher-1.0.5.tar.gz 15.0 kB Without provenance Details for silentcipher-1.0.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for silentcipher 1.0.5
File Interpreter ABI Platform Actions
silentcipher-1.0.5-py3-none-any.whl Python 3 none any Details for silentcipher-1.0.5-py3-none-any.whl

Total release size: 27.2 kB

Release files / silentcipher-1.0.5.tar.gz

Download URL silentcipher-1.0.5.tar.gz
Size 15.0 kB
Tags Source
SHA-256 checksum
How to use checksums
2e40ff64d64c050d715584980552288256795fd93f84c1409ca477f92164369a
BLAKE2b-256 checksum
How to use checksums
e6de7ec7f4710450fe02caad913da8e79ff8bf2f57bd000a0768da45ccf342ee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.11.7

Release files / silentcipher-1.0.5-py3-none-any.whl

Download URL silentcipher-1.0.5-py3-none-any.whl
Size 12.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d9fcc9df2818b4c2922ac302334bb54722240e3e20576901dedc5060a6607411
BLAKE2b-256 checksum
How to use checksums
276cbf99f56cd4a28bd496e742ff43c2d158bb977d9a1bd363f8d2fbc4bcfc97
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.11.7

Security for silentcipher 1.0.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page