Spoofed-speech detectors: self-supervised encoder + MHFA (five checkpoints)

Five networks that score a speech recording as bona fide or spoof: a self-supervised encoder, an MHFA back-end (multi-head factorised attentive pooling) and a 2-class head. Weights and configuration only: each directory holds config.yaml (model definition and test-time settings only) and models/best_model.pt (a PyTorch state_dict, fp32, every weight), like an experiment directory of the recipe egs/detection/rtc_sdd/v15_ssl_mhfa of WeDefense. -a and -b differ in weights only. No performance claims are made.

Directory Encoder Back-end Parameters models/best_model.pt
w2vbert2-mhfa-a w2v-BERT 2.0 MHFA 581.8 M 2,327,583,187 bytes
w2vbert2-mhfa-b w2v-BERT 2.0 MHFA 581.8 M 2,327,583,187 bytes
w2vbert2-mhfa-u3xi w2v-BERT 2.0 MHFA with U3-xi pooling 582.7 M 2,331,051,233 bytes
xlsr1b-mhfa XLS-R 1B MHFA 966.9 M 3,867,952,835 bytes
omniasr-w2v1b-mhfa omniASR-W2V-1B MHFA 963.9 M 3,855,867,857 bytes

Download (run in the recipe directory)

huggingface-cli download JYP2024/rtc-sdd-mhfa-models --local-dir exp   # all, 14.7 GB; one: --include "xlsr1b-mhfa/*"

The code builds the base encoder from its own files before it loads a checkpoint, so these are needed as well:

  • w2vbert2-* (2.3 GB): huggingface-cli download facebook/w2v-bert-2.0 config.json preprocessor_config.json model.safetensors --revision da985ba0987f70aaeb84a80f2851cfac8c697a7b --local-dir pretrained_models/w2v-bert-2.0
  • xlsr1b-mhfa: s3prl 0.4.16; on first use it downloads XLS-R 1B (3.9 GB) into pretrained_models/s3prl_hub from https://huggingface.co/s3prl/converted_ckpts/resolve/main/xlsr2_960m_1000k.pt (offline use: see the recipe README)
  • omniasr-w2v1b-mhfa (3.9 GB): huggingface-cli download ylacombe/omniASR_W2V_1B_SSL --revision 49be43063f05cfeb664d6ae1ff46e2b6c7d4f822 --local-dir pretrained_models/omniASR_W2V_1B_SSL

Use

bash run.sh --stage 5 --stop_stage 6 --exp_dir exp/xlsr1b-mhfa --epoch best --test_sets <set>          # one model
bash run.sh --stage 8 --stop_stage 8 --unlab_set <unlab_set> \
  --teacher_exps "exp/w2vbert2-mhfa-a exp/xlsr1b-mhfa" [--teacher_weights "1 2"]                        # several
  • One model (stages 5-6): needs data/<set>/wav.scp (<utt> <wav path>), data/<set>/utt2lab (<utt> bonafide or <utt> spoof) and the recipe's data/train/utt2lab (it fixes the label order). Stage 5 writes one line <utt> <P(spoof)> per file to exp/xlsr1b-mhfa/scores/<set>_epbest.txt; stage 6 prints the Macro-F1 at threshold 0.5. Stage 7 of the recipe applies to w2vbert2-mhfa-a and w2vbert2-mhfa-b only.
  • Several models as teachers (stage 8): needs data/<unlab_set>/wav.scp (audio without labels) and data/train/utt2lab. It applies the echo step (copies under data/<unlab_set>_deecho), runs stage 5 per directory and writes the weighted mean of P(spoof) to data/<unlab_set>/fused_scores.txt (default: equal).

Licences

The licence of these checkpoints has not been set yet. Base encoders: facebook/w2v-bert-2.0, MIT; XLS-R 1B (facebook/wav2vec2-xls-r-1b), Apache-2.0; omniASR-W2V-1B, Apache-2.0. The U3-xi pooling code of the toolkit is adapted from github.com/mrjunjieli/wespeaker_u_cube, Apache-2.0.

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support