Few-Shot Synthetic Speech Detection
This repository contains the checkpoints and data manifests released for the GitHub project:
Ashigarg123/fewshot-spoof-detection
The models accompany Rapidly Adapting to New Voice Spoofing: Few-Shot Detection of Synthesized Speech Under Distribution Shifts and include few-shot prototypical networks, zero-shot SSL-AASIST classifiers, and the one-class Mahalanobis baseline.
Installation
Clone the code repository and install its dependencies:
git clone https://github.com/Ashigarg123/fewshot-spoof-detection.git
cd fewshot-spoof-detection
conda create -n fewshot-spoof python=3.10 -y
conda activate fewshot-spoof
pip install -r requirements.txt
pip install huggingface_hub
Follow the GitHub README to download the required XLS-R 300M frontend checkpoint and the evaluation audio.
Download Checkpoints
Download one checkpoint with huggingface_hub:
from huggingface_hub import hf_hub_download
checkpoint_path = hf_hub_download(
repo_id="ash56/few_shot_spoof_detection",
filename="checkpoints/binary_attn_5shot/best_model.pth",
)
print(checkpoint_path)
Or download all checkpoints, configs, and manifests:
from huggingface_hub import snapshot_download
release_dir = snapshot_download(
"ash56/few_shot_spoof_detection",
local_dir="checkpoints/released",
)
print(release_dir)
Released Models
| Directory | GitHub evaluator | Model argument |
|---|---|---|
checkpoints/binary_attn_5shot |
src/evaluate.py |
binary_attention |
checkpoints/binary_mean_5shot |
src/evaluate.py |
binary_mean |
checkpoints/multiclass_attn_5shot |
src/evaluate.py |
multiclass_attention |
checkpoints/zero_shot_ssl_aasist_binary |
src/zero_shot.py evaluate |
binary |
checkpoints/zero_shot_ssl_aasist_multiclass |
src/zero_shot.py evaluate |
multiclass |
checkpoints/one_class_mahalanobis |
src/mahalanobis.py evaluate |
not applicable |
For example, evaluate the binary self-attentive few-shot model after downloading
the full snapshot to checkpoints/released:
python src/evaluate.py --model binary_attention \
--ssl-checkpoint checkpoints/xlsr/xlsr2_300m.pt \
--checkpoint checkpoints/released/checkpoints/binary_attn_5shot/best_model.pth \
--eval-list checkpoints/released/manifests/evaluation/shiftyspeech/ja/apnet2.txt \
--audio-root /path/to/ShiftySpeech \
--output-dir runs/jsut_apnet2 \
--support-sizes 5 10 \
--num-iters 100 \
--seed 7 \
--device cuda:0
See the GitHub README for dataset setup and commands for every model family. XLS-R 300M and evaluation audio are not redistributed in this checkpoint repository.
Citation
If you use these checkpoints or the associated code, please cite:
@inproceedings{garg2025rapidly,
title={Rapidly Adapting to New Voice Spoofing: Few-Shot Detection of Synthesized Speech Under Distribution Shifts},
author={Garg, Ashi and Cai, Zexin and Xinyuan, Henry Li and Garc{\'\i}a-Perera, Leibny Paola and Khudanpur, Kevin Duh Sanjeev and Wiesner, Matthew and Andrews, Nicholas},
booktitle={2025 IEEE Automatic Speech Recognition and Understanding Workshop (ASRU)},
pages={1--7},
year={2025},
organization={IEEE}
}