8-gen bench (4 emotions × 2 corpora) at seed=42 against firdhokk
Whisper-LV3:
target RAVDESS CREMA-D
happy happy (0.999) ✓ happy (0.999) ✓
angry neutral (0.92) sad (0.99)
fearful happy (0.998) fearful (0.984) ✓
sad angry (0.99) fearful (0.99)
CREMA-D 2/4 vs RAVDESS 1/4. Larger / more naturalistic corpus
produces more class-pure fearful direction. Neither corpus solves
angry or sad — recipe shifts into 'vague expressivity' rather than
class-specific corners.
Practical: prefer CREMA-D when available; A/B both per emotion if
class precision matters.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
End-to-end SilentCipher: bit-perfect round-trip on real LibriSpeech
audio. Sesame's actual production watermarker now works in pure
candle 0.9 + Metal.
New components in src/silentcipher.rs:
detect(samples_16k) -> DetectResult
1. RMS-normalize to VCTK baseline (matches embed pre-conditioning)
2. STFT -> magnitude
3. dec_m_0(magnitude) -> (B, message_dim, 1, T) logits
4. argmax along message_dim -> (T,) per-frame predictions
5. Truncate to multiple of message_len
6. Reshape to (n_patches, message_len), per-column mode
7. Find terminator (value 0), rotate so payload follows it
8. Subtract +1 offset -> original codes
encode_bits / decode_bits (Phase 10.4 fix)
Switched from base-4 (2 bits per code) to base-`(message_dim - 1)`.
The 16 kHz model has message_dim=4 = 3 carrier values (1,2,3) +
terminator (0), NOT 4 carrier values. Original base-4 packing
occasionally produced value 3, which Python's
`np.identity(4)[index+1]` would have crashed on. Real capacity:
15 codes x log2(3) ~= 23.78 bits per patch.
SilentCipherWatermark (impl Watermarker)
Wraps a SilentCipherWatermarker with a fixed default_payload so
it satisfies the existing Watermarker trait. Maps confidence ->
DetectionResult.mean_presence and the lower-16-bits of the
decoded payload -> DetectionResult.message (None below confidence
0.7 to suppress false positives).
examples/silentcipher_apply
Mirrors audioseal_apply: --in / --out / --payload / --detect-only.
Loads from sony/silentcipher HF repo, embeds, optionally
resamples back to source rate, optionally re-detects to verify.
Verified end-to-end (LibriSpeech /tmp/asr_test.flac, 10.42 s @ 16 kHz):
Build: 29 ms (3 .ckpt files from HF cache)
Embed: 1213 ms = 0.116x realtime
Detect: 1838 ms = 0.18x realtime
payload: 0x00BC614E (in)
recovered: 0x00BC614E (out)
codes match: 15 / 15
confidence: 1.0000
Clean (un-watermarked) audio: confidence 0.475, codes mostly 0 -
strong signal-vs-noise discrimination at the 0.7 threshold.
This closes the most surprising gap from the Sesame stack analysis:
rtx-csm now has the *literal* Sesame watermarker (not Meta's
AudioSeal) working in pure candle. AudioSeal stays available for
callers that prefer it.
Phase 10.5 (next): wire as a third option in converse_server alongside
AudioSeal, and a 24/16 kHz ResampledWatermarker for the CSM path.
Plus an A/B bench (SilentCipher vs AudioSeal).
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
End-to-end encode pipeline working: 3 ckpts load from HF, STFT runs,
encoder + carrier-decoder forward, iSTFT reconstructs. Watermarked
audio out preserves length + carries an embedded message.
New components in src/silentcipher.rs (~150 LOC added):
SilentCipherWatermarker bundle of cfg + 3 networks + STFT + device
::from_ckpts(...) load enc_c.ckpt + dec_c.ckpt + dec_m_0.ckpt
pickle files via candle_core::pickle::read_all
::build_message(codes, T) one-hot + tile across time axis to match
n_frames; matches Python letters_encoding
shape semantics
::embed(samples_16k, codes) full encode pipeline:
1. RMS-normalize to VCTK baseline
2. STFT -> magnitude + phase
3. enc_c forward -> 32-channel carrier
4. enc_c.transform_message -> projected msg
5. cat(carrier_enc, mag.repeat(32),
msg_enc.repeat(32)) -> 96 channels
6. dec_c forward + utterance-level
normalization + ensure_negative_message
+ ReLU clamp
7. iSTFT -> watermarked audio
8. de-normalize energy
::encode_bits(payload) pack a u32 into message_len-1 2-bit codes
Smoke test (`examples/silentcipher_smoke`) verified end-to-end:
Build watermarker: 29 ms (loads 3 .ckpt files)
Synthetic sine embed: 187 ms / 1.00 s audio
Real speech embed: 1042 ms / 10.42 s audio = 0.10x realtime
The 0.10x realtime figure is comparable to AudioSeal in Phase 6f.wm
(73 ms per ~6.8 s sentence = ~0.011x realtime, but AudioSeal had
warm-cache benefit). On a fresh cold model, SilentCipher comes in
~10x faster than realtime — order-of-magnitude OK.
SNR vs original: 24.6 dB on the speech sample, target 47 dB per the
released hparams. The watermark is currently more audible than
intended. Likely cause: utterance-level normalization scale factor
needs refinement, OR the ensure_negative_message + ReLU path is
clipping more than the Python path. Will be diagnosed in Phase 10.4
when detection round-trip lands — the real test of correctness is
"can dec_m recover the embedded codes?", not absolute SNR.
Phase 10.4 will:
- Implement detect() to recover the embedded codes via dec_m_0
- Add Watermarker trait impl for SilentCipherWatermarker
- examples/silentcipher_apply CLI mirroring audioseal_apply
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>