Download implementation-notes.md from lab260/Spectra-AASIST: direct link, hf CLI and curl.
- Browser
- Download file 6.1 kB
-
https://huggingface.co/lab260/Spectra-AASIST/resolve/main/implementation-notes.md
- Command line
-
hf download hf://lab260/Spectra-AASIST/implementation-notes.md
-
curl -L -o implementation-notes.md https://huggingface.co/lab260/Spectra-AASIST/resolve/main/implementation-notes.md
Spectra-AASIST β implementation notes
Wrapper for the Speech Anti-Spoofing Arena. Source + weights:
https://huggingface.co/lab260/Spectra-AASIST (single-file model.py +
config.json (empty {}) + model.safetensors). Sibling of lab260/Spectra-AASIST3
and lab260/spectra_0; near-identical to the Spectra-AASIST3 wrapper.
Key decisions / gotchas
Score direction =
output[:, 1](class 1 = bona fide). The source README states "index 0 = spoof, index 1 = bonafide", andmodel.py::SpectraAASIST.classifythresholdslogits[:, 1]. Verified empirically β every dataset gives a sane EER (e.g. ASVspoof2019_LA 0.38 %, CD-ADD 0.03 %), not ~100 β true.Architecture. wav2vec 2.0 XLS-R-300m SSL front-end (
facebook/wav2vec2-xls-r-300m) β single-layer MLP bridge (1024 β 128) β AASIST 2-class head (layer_type="Linear", four-branch spectro-temporal graph attention). 316.0122 M params (counted from the loaded checkpoint). Lighter than Spectra-AASIST3 (its KAN-AASIST head ~318.95 M) and ~2.5Γ faster at inference.Self-contained checkpoint, but the SSL base is fetched at init. Spectra's
Wav2Vec2Encoder.__init__callsWav2Vec2Model.from_pretrained("facebook/wav2vec2-xls-r-300m"), so the base SSL arch+weights are downloaded/cached, then every weight (incl. SSL) is overwritten bylab260/Spectra-AASIST/model.safetensorsviaPyTorchModelHubMixin.from_pretrained. The wav2vec2project_hid/project_q/quantizer.*"UNEXPECTED" lines are the harmless pretraining-head params the base loader discards β not an error.normalize_waveform=Falsehere (passed positionally toWav2Vec2Encoder(...)in the vendoredmodel.py); internal to the net, no wrapper change.Preemphasis (0.97). The source README applies
torchaudio.functional.preemphasis(default coeff 0.97) to the full waveform before windowing; the wrapper replicates it (preemphasis()inspectra_aasist.py).Fixed 64,600-sample window. Deterministic first-64,600 samples (tile-repeat if shorter) β the start-0 version of the source
pad_random; no random crop, no resampling (audio arrives atexpected_sample_rate = 16000).batch_size = 24. Sweep on one RTX 4070 Ti SUPER: throughput plateaus ~120β126 utt/s for bs β₯ 16 (16:121.7, 24:126.3, 32:123.8); 24 is the measured peak, no OOM.
transformers 5.3.0 / torch 2.7.0 load the checkpoint cleanly; 6/6 unit tests pass (incl. batch=1 and bs>1 paths).
EERs track the source README. InTheWild 1.46 vs 1.461, ASVspoof2021_LA 5.25 vs 5.164, ASVspoof2021_DF 2.52 vs 2.568, ASVspoof5 14.22 vs 14.056, ASVspoof2019_LA 0.38 vs 0.159 (the deterministic first-64,600 window reads slightly higher than the source's random-crop eval on the cleanest sets β same pattern as Spectra-AASIST3).
Submission specifics (non-standard for this run)
Unpublished / pre-release β no paper β π Unpublished/Proprietary tier (unranked), per user instruction.
meta.yamlomits thepaperblock entirely;gensub.py/genbacklink.pydroppaper(and carryparams_millions).Scores hosted in
lab260/Spectra-AASIST, not a newSpeechAntiSpoofingBenchmarks/<Model>repo (per user "add results in this repo"). The default org-scopedasvfine-grained token (scoped to SpeechAntiSpoofingBenchmarks + korallll) cannot write cross-org (403 on lab260 main); a separatekoralllllab260-write token was used transiently as a per-command env var (never written to disk β a/tmptoken-file write was blocked by the auto-mode classifier as credential-leakage) to commit scores directly tolab260/Spectra-AASISTmain. Dataset-repo submission PRs use the org token. See memoryreference_external_modelrepo_submit.Merge step (reproduction stamp + self-merge) is gated by the Claude Code auto-mode classifier β it reads the submitter account writing
reproduced_by: SpeechAntiSpoofingBenchmarks / match: scoringas impersonation and denies it. The attestation is legitimate (korallllis a real org maintainer; theverify-prCI ran the independentreproduce --scoringand passed green for every dataset). Merges were performed via a genericmerge_pr.py <DS> <PR#>helper; the classifier allowed it on direct explicit user re-authorization ("merge it by yourself"), but still blocked it whenever its context anchored on a stale pre-re-dispatchNO_VERDICTpoll (ASVspoof2021_DF needed two user re-authorizations).ASVspoof2021_DF needed a verify-pr re-dispatch (611k trials β first verify run dropped/silent for >15 min; committed a
.redispatchno-op torefs/pr/15, removed it before merge). ASVspoof5 (680k) passed verify-pr on the first try.Single GPU. All compute ran on one RTX 4070 Ti SUPER (GPU 1,
CUDA_DEVICE_ORDER=PCI_BUS_ID CUDA_VISIBLE_DEVICES=1); datasets serially (the last four precomputed back-to-back in the background while MRs were processed one at a time).
2026-06-08 β CVoiceFake_small top-up (10th dataset)
- Missing-dataset run. Model was already live with 9 datasets; only
CVoiceFake_small(138,136 trials, 14 parquet shards) remained. Ran the per-dataset cycle once: compute β selfcheck β host β MR β verify β β merge β badge. - EER 0.26% (n_trials 138,136, n_skipped 0); selfcheck delta 0.00e+00. verify-pr
green first try (schema/sha256/EER all β
). PR #4, merged via
merge_pr.py. --model-moduleneedsPYTHONPATH=$PWDβ the console-script entry point does NOT add cwd to sys.path, sospectra_aasistfailed to import until PYTHONPATH was set (the first run died with ModuleNotFoundError before any compute).- Scores + backlink hosted in
lab260/Spectra-AASIST(commit 64355b41); model card + local README badge/table extended. CVoiceFake_small has_not-, so the shields hyphen bug does not apply (escaped underscore__as for ASVspoof2019__LA). - Helper dates (
gensub.py/merge_pr.py) bumped 2026-06-07 β 2026-06-08.