audio-feature-extraction · audio · WASM q8 · 6.69 MB · 256-d x-vector · CC-BY-4.0

WeSpeaker ResNet34-LM — 6.69 MB Speaker Voiceprints

The production CNN speaker encoder used inside PyAnnote 3.1 diarization pipelines — now running 100% locally in your browser in ~192 ms on CPU WebAssembly. Turn any 16 kHz utterance into a 256-dimensional unit voiceprint on S255 for verification, enrollment vaults, and turn-by-turn speaker clustering.

At a glance

WeSpeaker ResNet34-LM model card, runtime, and license specifications
Upstream model Wespeaker/wespeaker-voxceleb-resnet34-LM (VoxCeleb2 Large-Margin fine-tuned ResNet34)
Browser ONNX build onnx-community/wespeaker-voxceleb-resnet34-LM
Task / API audio-feature-extraction via AutoFeatureExtractor (WeSpeakerFeatureExtractor, 16 kHz mono, 80-bin fbank) + AutoModel → L2-normalized last_hidden_state [1, 256]
Architecture ResNet34-LM (4 residual stages + TSTP temporal statistics pooling) → 256-d x-vector (~15× smaller than WavLM-Base-Plus-SV)
Quantization & size q8 WASM · 6.69 MB (fp16 13.28 MB · fp32 26.54 MB), cached locally after first download
Backend & runtime CPU WebAssembly (shared Transformers.js 3.7.5 via lib/webai.js — zero WebGPU required)
License CC-BY-4.0 (attribution required per WeSpeaker / VoxCeleb2 model card)

Live 256-d Voiceprint Barcode & Separation Studio

L2 normalization is mandatory: WeSpeaker ResNet34-LM returns raw last_hidden_state [1, 256] vectors trained with Additive Angular Margin Softmax. Every clip below is projected onto the unit sphere (‖v‖2 = 1.0000) in a Web Worker so cosine similarity equals the exact dot product: same-speaker LibriSpeech halves score ~0.72 while non-matching speakers or tones drop to ~0.10–0.25.

4×4 Cosine Similarity Matrix

Click any cell to inspect both 256-d voiceprint barcodes and their elementwise agreement.

Run extraction above to populate the live cosine matrix.

256-d Voiceprint Barcode Diff

Top & middle: unit x-vector activations (indigo positive, amber negative). Bottom: elementwise product a[i]·b[i] (green agrees, red opposes).

Inside the Model: From 16 kHz Waveform to 256-d x-Vector

Unlike heavy 100 MB self-supervised speech transformers, WeSpeaker ResNet34-LM extracts 80-dimensional log-Mel filterbanks (25 ms Hamming window, 10 ms frame shift, utterance CMN) and passes them through a compact 2D convolutional residual network with Temporal Statistics Pooling (mean + standard deviation over time) to emit one speaker-discriminative 256-d vector regardless of clip duration.

Show the code · worker.js — embed() (WeSpeakerFeatureExtractor + ResNet34-LM + L2 norm)
Show the code · wespeaker-core.mjs — decideVerification()