WeDefense: A Toolkit to Defend Against Fake Audio

Lin Zhang, Johan Rohdin, Xin Wang, Junyi Peng, Tianchi Liu, You Zhang, Hieu-Thi Luong, Shuai Wang, Chengdong Liang, Anna Silnova, Nicholas Evans · DOI

TL;DR

WeDefense is the first comprehensive, open-source toolkit designed for both the detection and localization of fake audio. It provides a standardized, modular pipeline that covers everything from flexible data augmentation and model training to critical post-processing steps like score calibration and explainable AI (XAI).

What Problem Does This Paper Address?

As generative AI makes it trivial to synthesize "perceptually indistinguishable" speech, the need for robust countermeasures has skyrocketed. However, the research community faces a fragmentation problem. Most existing codebases are "one-offs" tailored to specific competitions (like the ASVspoof challenges) or specific datasets.

This lack of standardization makes it difficult to compare different models on a level playing field. Furthermore, most tools focus solely on detection (is this whole clip fake?) while ignoring localization (which specific parts of this clip were manipulated?). WeDefense steps in to provide a "Swiss Army knife" for the field, emphasizing reproducible research and the often-overlooked steps of calibration and analysis.

Methods

WeDefense is built to be modular and extensible, drawing inspiration from successful speech toolkits like WeNet. Its architecture supports two primary tasks:

  1. Fake Audio Detection: Utterance-level classification.
  2. Fake Audio Localization: Frame-level prediction to find "partial fakes" (where synthetic segments are spliced into real audio).

Key Technical Components: * Front-ends: Supports both traditional digital signal processing (Fbank, LFCC) and state-of-the-art Self-Supervised Learning (SSL) models like wav2vec2 and XLSR. * Back-ends: Includes a variety of architectures ranging from standard CNNs (ResNet, LCNN-LSTM) to specialized models like AASIST and MHFA. * Augmentation: Beyond standard noise and reverb, it integrates domain-specific techniques like RawBoost and codec simulation to help models generalize to different recording conditions. * Post-processing: A major focus of the toolkit is Score Calibration (using Logistic Regression to turn raw scores into meaningful log-likelihood ratios) and Score Fusion to combine multiple models. * Explainability: It integrates tools like UMAP for visualizing feature embeddings and Grad-CAM to produce heatmaps showing which parts of the audio the model found suspicious.

Datasets

The paper evaluates the toolkit using two primary benchmarks:

  • PartialSpoof: Specifically designed for the "partial fake" scenario, where short synthetic segments are embedded within genuine recordings.
  • ASVspoof5: The latest and most challenging iteration of the ASVspoof series, featuring crowdsourced data, diverse spoofing algorithms, and adversarial attacks.

Key Insights and Ideas

  • SSL is the New Baseline: The results confirm that SSL-based front-ends significantly outperform traditional CNNs. Even with a lightweight back-end, SSL models benefit from massive pre-training on diverse speech data.
  • Calibration is Critical: Raw model scores are often "uncalibrated"—the model might be overconfident or underconfident. The authors show that applying a simple linear transformation (calibration) drastically improves metrics like $C_{llr}$ (Cost of Log-Likelihood Ratio), which is vital for real-world deployment.
  • The Localization Gap: Detecting a fully synthetic clip is relatively "solved" on some datasets, but localizing a 0.5-second fake segment in a 10-second clip remains a massive challenge. WeDefense provides the first unified framework to tackle this head-on.
  • Fusion Mitigates Mismatch: When a model trained on one dataset (e.g., PartialSpoof) is tested on another (e.g., ASVspoof5), performance usually tanks. WeDefense demonstrates that simple fusion strategies can help recover some of this lost robustness.

Key Results

  • Detection Performance: On the PartialSpoof evaluation set, the best SSL-based model (MHFA) achieved an Equal Error Rate (EER) of 0.80%, compared to 6.92% for a standard ResNet18.
  • The ASVspoof5 Challenge: The latest benchmark proved much harder; the best single-system EER was 8.08%, highlighting the difficulty of detecting adversarial and crowdsourced fakes.
  • Calibration Impact: For the SSL-MHFA model on ASVspoof5, calibration improved the $C_{llr}$ from 1.279 (poorly calibrated) to 0.564 (well-calibrated).
  • Localization: Localization EERs are still relatively high (around 12% for the best models on PartialSpoof), indicating that finding the exact boundaries of a fake segment is significantly harder than just flagging the whole file.

Limitations and Future Work

The authors acknowledge that while WeDefense is a strong start, it is still evolving:

  • Model Coverage: The number of supported localization models is currently modest.
  • Metric Development: They are working on integrating more sophisticated localization metrics beyond point-based EER.
  • Optimization: The "recipes" provided in the paper use simplified settings for efficiency; the team is currently working on releasing "SOTA-chasing" recipes with optimized training strategies.
  • Community Driven: As an open-source project, its long-term success depends on the community contributing new models and datasets.

Summary updated

BibTeX
@misc{zhang2026wedefense,
  author = {Lin Zhang and Johan Rohdin and Xin Wang and Junyi Peng and Tianchi Liu and You Zhang and Hieu-Thi Luong and Shuai Wang and Chengdong Liang and Anna Silnova and Nicholas Evans},
  title = {{WeDefense: A Toolkit to Defend Against Fake Audio}},
  year = {2026},
  eprint = {2601.15240},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2601.15240},
}
Figure