AudioSealWatermarker<T>

Models & Types · AiDotNet.Safety.Watermarking

Localized keyed audio watermark: the spread-spectrum mark of AudioWatermarker, detected segment by segment so it reports which parts of a recording carry the mark.

Inheritance: ModelBase<T, Vector<T>, Vector<T>> → SafetyModuleBase<T> → AudioSafetyModuleBase<T> → AudioWatermarkerBase<T> → AudioSealWatermarker<T>

For Beginners

this watermarker can tell you which seconds of a recording carry your watermark, not just whether the recording does, which helps when only part of a clip was AI-generated.

How It Works

AudioSeal (San Roman et al. 2024) introduced localized detection: a detector that says, for each part of a clip, whether that part is watermarked, so a recording that splices generated speech into real speech is caught and the generated part located. AudioSeal reaches this with a jointly trained generator and detector network, which this library does not ship. This class provides the same localization with a keyed spread-spectrum mark instead: the audio is marked frame by frame as in AudioWatermarker, and DetectSegments runs the correlation test on each segment of segmentSamples samples separately.

Detect asks whether any part is marked: it takes the strongest of the pooled test and the per-segment tests and applies a Bonferroni correction for their number, so the false-positive rate of a single test holds. Segments are on the original frame grid, so localization covers edits that replace audio in place; cropping or inserting audio shifts the grid and is not covered.

References:

  • San Roman, Fernandez, Elsahar, Defossez, Furon, Tran. Proactive Detection of Voice Cloning with Localized

Watermarking (AudioSeal, ICML 2024) — the localization objective, not the network

  • Kirovski, Malvar. Spread-Spectrum Watermarking of Audio Signals (IEEE TSP, 2003) — the mark itself

Constructors

Constructor Summary
AudioSealWatermarker(double watermarkStrength, int segmentSamples) Preserves the original constructor signature using the default configuration.
AudioSealWatermarker(double watermarkStrength, int segmentSamples, string key) Initializes a new localized audio watermarker.

Properties

Property Summary
string ModuleName { get; }

Methods

Method Summary
IReadOnlyList<WatermarkResult> DetectSegments(Vector<T> audioSamples, int sampleRate) Runs the correlation test on each segment separately.
WatermarkResult Detect(Vector<T> audioSamples, int sampleRate)