VaaniShield wav2vec2 voice-clone detector (int8 ONNX)
Detects AI-cloned or synthetic speech. Used by VaaniShield 2.0 to score live calls in 1-second windows. Built by Shravan Kasar.
Model
facebook/wav2vec2-basewith its top 4 transformer layers fine-tuned, mean-pooled frame embeddings, 3-layer MLP head- Input: 16 kHz mono float waveform, any length (
wav, shape[batch, samples]); input is normalised inside the model - Output:
logits[batch, 2]= (bona fide, spoof); softmax index 1 is the spoof probability voice_auth_classifier.int8.onnx: dynamic int8 quantization of MatMul/Gemm only (per-channel, reduce_range). The CNN feature encoder stays fp32: int8ConvIntegerwas about 7x slower on CPU, and plain per-tensor quantization flipped predictions on CPUs without VNNI. 122.6 MB, about 160 ms per 1 s window on one CPU core.
Training
ASVspoof 2019 Logical Access train split (25,380 utterances: bona fide speech and 6 TTS / voice-conversion attacks), 4 epochs on a Kaggle T4, mixed precision, class-weighted loss, random 1-4 s crops so the model works on the short windows used for live calls. Best epoch chosen on the dev set.
Evaluation
Stratified random subset of the ASVspoof 2019 LA evaluation set (16,000 utterances). It contains 13 attack systems (A07-A19) never seen in training. The decision threshold was chosen on the dev set and applied unchanged to eval.
| Model | Window | EER | Balanced accuracy |
|---|---|---|---|
| PyTorch fp32 | 4 s | 2.36% | - |
| PyTorch fp32 | 1 s | 10.47% | - |
| int8 ONNX (this file) | 4 s | 2.66% | 91.7% (threshold 0.39) |
| int8 ONNX (this file) | 1 s | 10.36% | 85.8% (threshold 0.36) |
EER per attack (fp32, 4 s): A07 1.7%, A08 0.2%, A09 0.0%, A10 8.1%, A11 0.2%, A12 0.1%, A13 0.0%, A14 0.9%, A15 2.7%, A16 0.3%, A17 0.2%, A18 1.6%, A19 0.3%.
Limitations
- ASVspoof 2019 attacks are older TTS/VC systems. Newer commercial voice cloners, phone-line codecs, compression and background noise will lower accuracy; this has not been measured.
- A10 (a neural TTS system) is the hardest attack; some A10 clips are missed entirely.
- One-second windows carry much less evidence than whole clips (10% vs 2.7% EER), so live scores should be smoothed over several windows. Treat the score as a warning signal, not proof.
- English-only training data.