Skip to main content

Artefact free robust high quality audio watermarking

Project description

:loud_sound: 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.

:mate: 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

:gear: 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 !

:abacus: 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 :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},
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

silentcipher-1.0.5.tar.gz (15.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

silentcipher-1.0.5-py3-none-any.whl (12.1 kB view details)

Uploaded Python 3

File details

Details for the file silentcipher-1.0.5.tar.gz.

File metadata

  • Download URL: silentcipher-1.0.5.tar.gz
  • Upload date:
  • Size: 15.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.11.7

File hashes

Hashes for silentcipher-1.0.5.tar.gz
Algorithm Hash digest
SHA256 2e40ff64d64c050d715584980552288256795fd93f84c1409ca477f92164369a
MD5 4e7ca5048ddf21557a0aee96ec5c798a
BLAKE2b-256 e6de7ec7f4710450fe02caad913da8e79ff8bf2f57bd000a0768da45ccf342ee

See more details on using hashes here.

File details

Details for the file silentcipher-1.0.5-py3-none-any.whl.

File metadata

  • Download URL: silentcipher-1.0.5-py3-none-any.whl
  • Upload date:
  • Size: 12.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.11.7

File hashes

Hashes for silentcipher-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 d9fcc9df2818b4c2922ac302334bb54722240e3e20576901dedc5060a6607411
MD5 97c4b0dcf6e4226da0c4f46cc99732bf
BLAKE2b-256 276cbf99f56cd4a28bd496e742ff43c2d158bb977d9a1bd363f8d2fbc4bcfc97

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page