--- tags: - espnet - audio - language-identification language: - abk - afr - amh - ara - asm - aze - bak - bel - ben - bod - bos - bre - bul - cat - ceb - ces - cmn - cym - dan - deu - ell - eng - epo - est - eus - fao - fas - fin - fra - glg - glv - grn - guj - hat - hau - haw - heb - hin - hrv - hun - hye - ina - ind - isl - ita - jav - jpn - kan - kat - kaz - khm - kor - lao - lat - lav - lin - lit - ltz - mal - mar - mkd - mlg - mlt - mon - mri - msa - mya - nep - nld - nno - nor - oci - pan - pol - por - pus - ron - rus - san - sco - sin - slk - slv - sna - snd - som - spa - sqi - srp - sun - swa - swe - tam - tat - tel - tgk - tgl - tha - tuk - tur - ukr - urd - uzb - vie - war - yid - yor datasets: - VoxLingua107 license: cc-by-4.0 --- ## ESPnet2 Spoken Language Identification (LID) model ### `espnet/lid_voxlingua107_mms_ecapa` This language identification model was trained using the ESPnet recipe from [ESPnet](https://github.com/espnet/espnet/) toolkit. It leverages the pretrained [MMS-1B](https://huggingface.co/facebook/mms-1b) as the encoder and [ECAPA-TDNN](https://arxiv.org/pdf/2005.07143) as the embedding extractor for robust spoken language identification. The model is trained on the [VoxLingua107](https://cs.taltech.ee/staff/tanel.alumae/data/voxlingua107/) dataset, which comprises over 6,600 hours of speech spanning 107 languages. Speech segments are sourced from YouTube videos and annotated using metadata. This repository provides comprehensive training logs, detailed inference results, and model checkpoints for reproducibility and further research. ### Usage Guide: How to use in ESPnet2 #### Prerequisites First, ensure you have ESPnet installed. If not, follow the [ESPnet installation instructions](https://espnet.github.io/espnet/installation.html). #### Quick Start Run the following commands to set up and use the pre-trained model: ```bash cd espnet pip install -e . cd egs2/voxlingua107/lid1 # Download the exp_voxlingua107_raw to egs2/voxlingua107/lid1 hf download espnet/lid_voxlingua107_mms_ecapa --local-dir . --exclude "README.md" "meta.yaml" ".gitattributes" ./run.sh --skip_data_prep false --skip_train true ``` This will download the pre-trained model and run inference using the VoxLingua107 test data. ### Train and Evaluation Datasets The model is evaluated on multiple language identification benchmarks with diverse characteristics: | Dataset | Domain | #Langs. Train/Test | Dialect | Training Setup (VL107-only) | | ------------- | ----------- | ------------------ | ------- | --------------------------- | | [VoxLingua107](https://cs.taltech.ee/staff/tanel.alumae/data/voxlingua107/) | YouTube | 107/33 | No | Seen | | [Babel](https://citeseerx.ist.psu.edu/document?repid=rep1&type=pdf&doi=31a13cefb42647e924e0d2778d341decc44c40e9) | Telephone | 25/25 | No | Unseen | | [FLEURS](https://huggingface.co/datasets/google/xtreme_s) | Read speech | 102/102 | No | Unseen | | [ML-SUPERB 2.0](https://huggingface.co/datasets/espnet/ml_superb_hf) | Mixed | 137/(137, 8) | Yes | Unseen | | [VoxPopuli](https://huggingface.co/datasets/facebook/voxpopuli) | Parliament | 16/16 | No | Unseen | ### Results **Accuracy (%) on In-domain and Out-of-domain Test Sets**
| ESPnet Recipe | Config | VoxLingua107 | Babel | FLEURS | ML-SUPERB2.0 Dev | ML-SUPERB2.0 Dialect | VoxPopuli | Macro Avg. | | ------------------------- | ----------- | ------------ | ----- | ------ | ---------------- | -------------------- | --------- | ---------- | |
[egs2/voxlingua107/lid1](https://github.com/espnet/espnet/tree/master/egs2/voxlingua107/lid1)
|
`conf/mms_ecapa_baseline`
| 94.2 | 86.7 | 95.8 | 89.0 | 73.4 | 85.6 | 87.5 |
For more detailed inference results, please refer to the `exp_voxlingua107_raw/lid_mms_ecapa_baseline_raw/inference` directory in this repository. ## LID config
expand ``` config: /work/nvme/bbjs/qwang20/espnet/egs2/lid_delta/lid1/conf/mms_1b_ecapa/mms_ecapa_bs3min_baseline.yaml print_config: false log_level: INFO drop_last_iter: false dry_run: false iterator_type: category valid_iterator_type: category output_dir: exp_voxlingua107_raw/lid_mms_ecapa_bs3min_baseline_delta_raw ngpu: 1 seed: 3702 num_workers: 8 num_att_plot: 0 dist_backend: nccl dist_init_method: env:// dist_world_size: null dist_rank: null local_rank: 0 dist_master_addr: null dist_master_port: null dist_launcher: null multiprocessing_distributed: false unused_parameters: true sharded_ddp: false use_deepspeed: false deepspeed_config: null gradient_as_bucket_view: true ddp_comm_hook: null cudnn_enabled: true cudnn_benchmark: true cudnn_deterministic: false use_tf32: false collect_stats: false write_collected_feats: false max_epoch: 30 patience: null val_scheduler_criterion: - valid - loss early_stopping_criterion: - valid - loss - min best_model_criterion: - - valid - accuracy - max keep_nbest_models: 2 nbest_averaging_interval: 0 grad_clip: 9999 grad_clip_type: 2.0 grad_noise: false accum_grad: 2 no_forward_run: false resume: true train_dtype: float32 use_amp: true log_interval: 100 use_matplotlib: true use_tensorboard: true create_graph_in_tensorboard: false use_wandb: true wandb_project: lid wandb_id: null wandb_entity: qingzhew-carnegie-mellon-university wandb_name: null wandb_model_log_interval: -1 detect_anomaly: false use_adapter: false adapter: lora save_strategy: all adapter_conf: {} pretrain_path: null init_param: [] ignore_init_mismatch: false freeze_param: [] num_iters_per_epoch: 1000 batch_size: 20 valid_batch_size: null batch_bins: 2880000 valid_batch_bins: null category_sample_size: 10 train_shape_file: - exp_voxlingua107_raw/lid_stats_16k/train/speech_shape valid_shape_file: - exp_voxlingua107_raw/lid_stats_16k/valid/speech_shape batch_type: catpow upsampling_factor: 0.5 language_upsampling_factor: 0.5 dataset_upsampling_factor: 0.5 dataset_scaling_factor: 1.2 max_batch_size: 16 valid_batch_type: null fold_length: - 120000 sort_in_batch: descending shuffle_within_batch: false sort_batch: descending multiple_iterator: false chunk_length: 500 chunk_shift_ratio: 0.5 num_cache_chunks: 1024 chunk_excluded_key_prefixes: [] chunk_default_fs: null chunk_max_abs_length: null chunk_discard_short_samples: true train_data_path_and_name_and_type: - - dump/raw/train_voxlingua107/wav.scp - speech - sound - - dump/raw/train_voxlingua107/utt2lang - lid_labels - text valid_data_path_and_name_and_type: - - dump/raw/dev_voxlingua107/wav.scp - speech - sound - - dump/raw/dev_voxlingua107/utt2lang - lid_labels - text multi_task_dataset: false allow_variable_data_keys: false max_cache_size: 0.0 max_cache_fd: 32 allow_multi_rates: false valid_max_cache_size: null exclude_weight_decay: false exclude_weight_decay_conf: {} optim: adam optim_conf: lr: 5.0e-06 betas: - 0.9 - 0.98 scheduler: tristagelr scheduler_conf: max_steps: 30000 warmup_ratio: 0.3 hold_ratio: 0.2 decay_ratio: 0.5 init_lr_scale: 0.6 final_lr_scale: 0.1 init: null use_preprocessor: true input_size: null target_duration: 3.0 lang2utt: dump/raw/train_voxlingua107/lang2utt lang_num: 107 sample_rate: 16000 num_eval: 10 rir_scp: '' model: espnet model_conf: extract_feats_in_collect_stats: false frontend: s3prl frontend_conf: frontend_conf: upstream: hf_wav2vec2_custom path_or_url: facebook/mms-1b download_dir: ./hub multilayer_feature: true specaug: null specaug_conf: {} normalize: utterance_mvn normalize_conf: norm_vars: false encoder: ecapa_tdnn encoder_conf: model_scale: 8 ndim: 512 output_size: 1536 pooling: chn_attn_stat pooling_conf: {} projector: rawnet3 projector_conf: output_size: 192 encoder_condition: rawnet3 encoder_condition_conf: {} pooling_condition: chn_attn_stat pooling_condition_conf: {} projector_condition: rawnet3 projector_condition_conf: {} preprocessor: lid preprocessor_conf: fix_duration: false sample_rate: 16000 noise_apply_prob: 0.0 noise_info: - - 1.0 - dump/raw/musan_speech.scp - - 4 - 7 - - 13 - 20 - - 1.0 - dump/raw/musan_noise.scp - - 1 - 1 - - 0 - 15 - - 1.0 - dump/raw/musan_music.scp - - 1 - 1 - - 5 - 15 rir_apply_prob: 0.0 rir_scp: dump/raw/rirs.scp loss: aamsoftmax_sc_topk loss_conf: margin: 0.5 scale: 30 K: 3 mp: 0.06 k_top: 5 required: - output_dir version: '202412' distributed: false ```
### Citation ```BibTex @inproceedings{wang2025geolid, author={Qingzheng Wang, Hye-jin Shim, Jiancheng Sun, and Shinji Watanabe}, title={Geolocation-Aware Robust Spoken Language Identification}, year={2025}, booktitle={Procedings of ASRU}, } @inproceedings{watanabe2018espnet, author={Shinji Watanabe and Takaaki Hori and Shigeki Karita and Tomoki Hayashi and Jiro Nishitoba and Yuya Unno and Nelson Yalta and Jahn Heymann and Matthew Wiesner and Nanxin Chen and Adithya Renduchintala and Tsubasa Ochiai}, title={{ESPnet}: End-to-End Speech Processing Toolkit}, year={2018}, booktitle={Proceedings of Interspeech}, pages={2207--2211}, doi={10.21437/Interspeech.2018-1456}, url={http://dx.doi.org/10.21437/Interspeech.2018-1456} } ```