forensics_0.3B_wavlm_oc_softmax_deepfake_classifier
WavLM + AASIST deepfake speech detector trained with a combined CE + OC-Softmax objective, which pulls bonafide embeddings into a tight cluster and pushes every spoof type outside it — a different decision-boundary shape than the plain-CE model, useful as an ensemble partner.
Detects whether a speech clip is real (bonafide) or a deepfake (spoof).
- Backbone:
microsoft/wavlm-large(~300M params) - Pooling: AASIST graph-attention (gat_dims 128/64)
- Training run:
wavlm_aasist_27_03_oc_softmax_ce_from_16(last epoch, #10 of this sub-run, shipped)
Part of the Forensics family
| Model | Use it for |
|---|---|
forensics_0.3B_base_deepfake_classifier |
general-purpose default |
forensics_0.3B_xlsr_wild_deepfake_classifier |
uncontrolled / real-world audio |
forensics_0.3B_v2_deepfake_age_gender_classifier 🆕 |
speaker age/gender, hardened against the newest TTS threats — our latest release |
forensics_0.3B_wavlm_oc_softmax_deepfake_classifier (this model) |
tighter bonafide boundary, ensembling |
Full family: huggingface.co/collections/eliya/forensics-speech-deepfake-detection-family
Training (inferred)
Trained using an agentic training loop — see eliyasegev/autotrain.
CE + OC-Softmax combined loss, continuing from the epoch-16 checkpoint of wavlm_aasist_27_03_oc_softmax.
Same core data sources as the other models in this batch (SpeechFake, DFADD, CodecFake,
MD-CommonVoice, ASVspoof2019-LA) and the same augmentation stack (codec, MUSAN,
RIR, RawBoost, SpecAugment, splice/mix).
Results — epoch 10 / "last" (shipped checkpoint)
| Eval set | EER % |
|---|---|
| Val (held-out) | 1.78 |
| MLAAD (v7) | 0.38 |
| CodecFake | 0.72 |
| DFADD | 0.00 |
| MD-CommonVoice | 0.17 |
| In-the-Wild | 1.76 |
| ASVspoof2019-LA | 0.68 |
| ASVspoof2021-LA | 2.19 |
| ASVspoof2024 | 12.37 |
| ADD2022-Track1 | 15.91 |
| ADD2022-Track3 | 2.20 |
| ADD2023-Round1 | 5.94 |
| ADD2023-Round2 | 11.30 |
| LibriSeVoc | 0.05 |
| SONAR | 0.48 |
| Avg (all sets) | 3.73 |
| Avg (external only) | 4.14 |
Note: "last" was shipped rather than the metric-best epoch — epoch 8 has a slightly lower avg-all (3.66% vs 3.73%), though epoch 10 has a better In-the-Wild EER (1.76% vs 1.92%). It's a close call either way; worth a quick look before assuming epoch 10 is optimal.
Files in this repo
| file | purpose |
|---|---|
2nd_oc_softmax_ce_from16_last.safetensors |
model weights, safe format |
2nd_oc_softmax_ce_from16_last.pt |
model weights, legacy pickle |
config.json |
minimal architecture metadata (also used by the Hub to track downloads) |
inference.py |
run script — prefers the .safetensors file automatically |
model.py |
architecture |
requirements.txt |
deps |
Setup
pip install -r requirements.txt # torch, torchaudio, transformers, safetensors
hf download eliya/forensics_0.3B_wavlm_oc_softmax_deepfake_classifier --local-dir .
Run
python inference.py <audio.wav>
(Optionally override the checkpoint: python inference.py <audio.wav> <checkpoint.pt>.)
Audio is auto-converted to mono / 16 kHz and trimmed/padded to 5 s.
Output
fake_probability: <0..1> # threshold is domain-dependent — adjust to your use case; ~0.1-0.2 is usually the best range
bonafide_score: <0..1> # raw P(real)
verdict: REAL | FAKE
Example
$ python inference.py real_human.wav
fake_probability: 0.0984
bonafide_score: 0.9016
verdict: REAL
$ python inference.py tts_fake.wav
fake_probability: 0.8317
bonafide_score: 0.1683
verdict: FAKE
Higher fake_probability = more likely a deepfake. Score is 1 − sigmoid(logit),
since the classifier is trained with label 1 = real, 0 = fake.
References
- WavLM: Chen et al., 2022, "WavLM: Large-Scale Self-Supervised Pre-Training for Full Stack Speech Processing", arXiv:2110.13900
- AASIST: Jung et al., 2021 (ICASSP 2022), "AASIST: Audio Anti-Spoofing Using Integrated Spectro-Temporal Graph Attention Networks", arXiv:2110.01200
- OC-Softmax: Zhang et al., 2020 (IEEE SPL 2021), "One-Class Learning Towards Synthetic Voice Spoofing Detection", arXiv:2010.13995
- RawBoost augmentation: Tak et al., 2021 (ICASSP 2022), arXiv:2111.04433
- SpeechFake dataset: ACL 2025, "SpeechFake: A Large-Scale Multilingual Speech Deepfake Dataset Incorporating Cutting-Edge Generation Methods", arXiv:2507.21463
License
CC-BY-NC-4.0 — free for personal and research use. For commercial use, contact eliya@vocos.io.
- Downloads last month
- -
Model tree for eliya/forensics_0.3B_wavlm_oc_softmax_deepfake_classifier
Base model
microsoft/wavlm-large