ECAPA-TDNN Kazakh Speaker Embedding (Saidzoda Lab)
How to get access: please fill in the short form at saidzoda.com/access. We approve requests after we receive the form.
Fine-tune of speechbrain/spkrec-ecapa-voxceleb (Apache-2.0) on Kazakh speaker classification (AAM-softmax), replicating the Tajik ECAPA speaker-verification recipe (Tohirju/ecapa-tdnn-tajik) verbatim (same code, same architecture, same eval methodology) with Kazakh data.
Result
Equal-error-rate (EER), full-utterance embeddings, L2-normalized, raw cosine similarity
(no mean_var_norm_emb centering — see Methodology below):
| stock ecapa-voxceleb | Kazakh fine-tune (this model) | Δ | |
|---|---|---|---|
| closed-set EER | 4.94% | 1.50% | −3.44 pts (better) |
| open-set EER | 8.54% | 14.20% | +5.66 pts (worse) |
Open-set = 8 speakers never seen during training (24 train speakers, 10,877 train-pool
utterances). Unlike the Tajik run (which improved on both closed- and open-set EER),
this Kazakh fine-tune sharply improved closed-set discrimination but regressed
substantially on open-set generalization (the largest regression of the three CA-langs
fine-tunes) — it appears to have specialized toward the 24 training identities rather than
learning more broadly speaker-discriminative Kazakh features. See results.json for full
trial counts. Recommendation: keep the stock model for open-set/unseen-speaker
verification on Kazakh; the fine-tune is not a straightforward win here (contrast with
Tajik, where it is).
Training
- Trunk: ECAPA-TDNN, kept from
speechbrain/spkrec-ecapa-voxceleb(embedding_model.ckptloaded as-is), fine-tuned. Classifier head: freshly initialized, sized to the Kazakh train-speaker count (24 classes). - AAM-softmax: margin=0.2, scale=30.0. epochs=8, batch_size=32, lr=1e-4, 3s random crops. Identical hyperparameters to the Tajik run (no per-language tuning).
- Data: subsampled from a 1057-speaker Kazakh ASR-derived diarization bank
(
/data/tts_prep/kk/manifest.jsonl, ECAPA-clustered pseudo-speaker labels, 16kHz) down to 32 speakers / 10,877 utterances (band-sampled 200–800 clips/speaker, seed 1337) to match the Tajik run's scale (29 train speakers / 12,449 utts) — seesubsample_summary.jsonin the training run for the exact selected speaker IDs. - Speaker labels are ECAPA-clustering pseudo-labels, not human-verified — a known limitation that applies equally to the stock-vs-finetuned comparison above.
- Hardware: 1x H100 (Nvidia Brev), GPU7, ~93s training wall-clock.
Files
embedding_model.ckpt— ECAPA-TDNN trunk weights (speechbrain state_dict), best checkpoint by validation accuracy.classifier.ckpt— AAM-softmax classifier head (Kazakh train-speaker classes; not needed for embedding extraction, included for reproducibility).ecapa_common.py— the exact model-construction + feature-pipeline code used to build this architecture.label_map.json— {original pseudo speaker id → contiguous training label}.
How to use
import torch
from huggingface_hub import hf_hub_download
repo_id = "Tohirju/ecapa-tdnn-kazakh"
common_path = hf_hub_download(repo_id, "ecapa_common.py")
ckpt_path = hf_hub_download(repo_id, "embedding_model.ckpt")
import importlib.util
spec = importlib.util.spec_from_file_location("ecapa_common", common_path)
ecapa_common = importlib.util.module_from_spec(spec)
spec.loader.exec_module(ecapa_common)
model = ecapa_common.build_embedding_model(device="cpu")
state_dict = torch.load(ckpt_path, map_location="cpu")
model.load_state_dict(state_dict)
model.eval()
compute_features, mean_var_norm = ecapa_common.build_feature_pipeline(device="cpu")
wav = ecapa_common.load_wav_16k("some_kazakh_utterance.wav")
emb = ecapa_common.embed_utterance(wav, compute_features, mean_var_norm, model, device="cpu")
# emb: [192] L2-normalizable speaker embedding
License
Apache-2.0 (inherited from the speechbrain base model).
Caveats
- Training-speaker labels are unverified pseudo-labels from an ECAPA-clustering diarization pass, not human-annotated ground truth.
- Open-set EER regressed substantially relative to stock (see Result) — this fine-tune trades open-set generalization for closed-set sharpness. Evaluate on your own held-out speakers before deploying for unseen-speaker verification.
- Eval methodology deliberately skips speechbrain's
mean_var_norm_embglobal-centering step, applied identically to both models, so the head-to-head delta is fair even though it isn't speechbrain's ownverify_filesproduction pipeline.
This repo is public but gated (manual approval), per Saidzoda Lab policy.