--- license: cc-by-nc-4.0 gated: manual extra_gated_heading: "Acknowledge the license to access this model" extra_gated_prompt: "This model is released under CC-BY-NC-4.0 — free for personal and research use. Commercial use is prohibited under this license; for a commercial license, contact eliya@vocos.io." extra_gated_description: "Requests are reviewed manually." extra_gated_button_content: "Agree and request access" extra_gated_fields: I agree to the non-commercial license terms above and understand commercial use requires a separate license: checkbox Intended use (one sentence): text pipeline_tag: audio-classification library_name: pytorch language: - multilingual base_model: microsoft/wavlm-large datasets: - eliya/qwen3_deepfake_dataset - eliya/voxcpm_deepfake_dataset - eliya/omnivoice_deepfake_dataset tags: - audio-classification - deepfake-detection - anti-spoofing - speech - aasist - wavlm - age-estimation - gender-classification --- # forensics_0.3B_v2_deepfake_age_gender_classifier ### Deepfake detection + speaker age & gender - hardened against the newest open-source TTS systems **🔒 Gated — access requires approval.** **Latest release — Q3 2026.** **The newest, most advanced model in the Forensics family.** Purpose-built and tested against the latest open-source TTS/voice-synthesis engines — qwen3, voxcpm, and omnivoice — plus AI-generated music as an additional adversarial signal, this model achieves **state-of-the-art results against the latest open-source TTS models: 99%+ accuracy** on the held-out test set of each. This is the sharpest edge of the Forensics family against next-generation synthetic voice. On top of real/fake detection, it estimates the speaker's **age** and **gender** in the same forward pass — one model, three outputs. > Access to this repo requires manual approval. Submit a request from the repo page and it'll be reviewed directly. - **Backbone:** `microsoft/wavlm-large` (~300M params, fully unfrozen) - **Pooling:** AASIST graph-attention - **Extra heads:** age (regression) + gender (female / male / child) ## Part of the Forensics family | Model | Use it for | |---|---| | [`forensics_0.3B_base_deepfake_classifier`](https://huggingface.co/eliya/forensics_0.3B_base_deepfake_classifier) | general-purpose default | | [`forensics_0.3B_xlsr_wild_deepfake_classifier`](https://huggingface.co/eliya/forensics_0.3B_xlsr_wild_deepfake_classifier) | uncontrolled / real-world audio | | **`forensics_0.3B_v2_deepfake_age_gender_classifier`** 🆕 (this model, gated) | speaker age/gender, hardened against the newest TTS threats — our latest release | | [`forensics_0.3B_wavlm_oc_softmax_deepfake_classifier`](https://huggingface.co/eliya/forensics_0.3B_wavlm_oc_softmax_deepfake_classifier) | tighter bonafide boundary, ensembling | Full family: [huggingface.co/collections/eliya/forensics-speech-deepfake-detection-family](https://huggingface.co/collections/eliya/forensics-speech-deepfake-detection-family) ## Training Trained using an agentic training loop — see [eliyasegev/autotrain](https://github.com/eliyasegev/autotrain). Multi-task objective: cross-entropy + OC-Softmax + supervised contrastive for deepfake detection, plus a regression loss for age and a classification loss for gender — all trained jointly. Trained on 5M+ speech samples spanning a mix of proprietary and publicly available data — some of our own self-created data has been open-sourced as well. Built for robustness against a wide range of TTS generation methods — including some of the most advanced synthesis techniques available today, plus the newest TTS engines (**qwen3**, **voxcpm**, **omnivoice**). Also trained on environmental sound and music, extending fake-detection beyond speech to those domains as well. Every row additionally carries age/gender labels. AdamW, cosine LR schedule, and the full Forensics augmentation stack (codec transcoding, noise augmentation, RIR, RawBoost, SpecAugment, FreqMask, splice/mix, cross-class splice). ## Results Deepfake-detection EER across the standard external benchmark suite: | Eval set | EER % | |---|---| | Val (held-out) | 1.11 | | MLAAD (v7) | 0.71 | | CodecFake | 0.81 | | DFADD | 0.00 | | MD-CommonVoice | 0.35 | | In-the-Wild | 2.20 | | ASVspoof2019-LA | 0.85 | | ASVspoof2021-LA | 3.49 | | ASVspoof2024 | 14.09 | | ADD2022-Track1 | 16.86 | | ADD2022-Track3 | 2.88 | | ADD2023-Round1 | 5.53 | | ADD2023-Round2 | 11.60 | | LibriSeVoc | 0.08 | | SONAR | 1.14 | | **Avg (all sets)** | **4.11** | | **Avg (external only)** | **4.33** | On the three newest-TTS test sets (qwen3, voxcpm, omnivoice) — the threats this model was specifically hardened against — accuracy exceeds **99%**. Age/gender evaluation plots are included alongside the model weights. ## Files in this repo | file | purpose | |---|---| | `checkpoint_epoch_9.safetensors` | model weights, safe format | | `checkpoint_epoch_9.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 ```bash pip install -r requirements.txt # torch, torchaudio, transformers, safetensors hf download eliya/forensics_0.3B_v2_deepfake_age_gender_classifier --local-dir . ``` (This is a gated repo — you'll need an approved access request before the download works.) ## Run ```bash python inference.py ``` (Optionally override the checkpoint: `python inference.py `.) 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 age_years: gender: female | male | child (conf ..) ``` ## Example ``` $ python inference.py real_human.wav fake_probability: 0.1022 bonafide_score: 0.8978 verdict: REAL $ python inference.py designed_tts_voice.wav fake_probability: 0.8646 bonafide_score: 0.1354 verdict: FAKE age_years: 34 gender: male (conf 0.98) ``` 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 - Supervised Contrastive Learning: Khosla et al., NeurIPS 2020, arXiv:2004.11362 - Age/gender head design (age regression scaled to 0-100 years, 3-class female/male/child gender): Burkhardt et al., 2023, *"Speech-based Age and Gender Prediction with Transformers"*, arXiv:2306.16962 - CCC loss (age regression): Lin, 1989, *"A Concordance Correlation Coefficient to Evaluate Reproducibility"*, Biometrics - RawBoost augmentation: Tak et al., 2021 (ICASSP 2022), arXiv:2111.04433 - FreqMask augmentation: Xie et al., 2024, arXiv:2408.06922 - 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.