Speech-based classifier that labels an utterance as one of five Arabic varieties: EGY (Egyptian/Sudanese), GLF (Gulf, Iraqi, Yemeni), LEV (Levantine: Palestinian, Jordanian, Lebanese, Syrian), MAG (Maghrebi) or MSA (Modern Standard Arabic).
It keeps the omniASR_W2V_300M encoder frozen and trains only 4.3 M parameters: LoRA (rank 16) on every attention
block (3.15 M) and an attentive-statistics-pooling classification head (1.19 M). Training took 2 epochs
(~1.7 GPU-hours on one RTX 5090) on 873.9 h of audio.
Numbers of record, from the training-time evaluation path: untrimmed audio, centre 30 s crop, macro-F1 over the classes present.
Full per-class tables and confusion matrices are in eval/v2s1_results.json.
| set | clips | accuracy | macro-F1 | LEV precision | LEV recall |
|---|---|---|---|---|---|
| ADI-20 test | 14,072 | 0.9450 | 0.9346 | 0.903 | 0.957 |
| NADI test (no MSA class) | 3,817 | 0.9374 | 0.9346 | 0.909 | 0.958 |
| ADI-20 val | 10,345 | 0.9387 | 0.9105 | 0.832 | 0.968 |
| NADI val | 3,828 | 0.9287 | 0.9248 | 0.884 | 0.961 |
| ADI-5 (MGB-3) dev | 1,566 | 0.7957 | 0.7972 | 0.910 | 0.724 |
Epoch 2 was selected on the mean validation macro-F1 of the three validation sets (0.8633 after epoch 1, 0.8775 after epoch 2).
Per class, ADI-20 test (precision / recall / F1): EGY .921/.895/.908, GLF .960/.951/.956, LEV .903/.957/.929, MAG .964/.949/.956, MSA .944/.905/.924.
Elyadata/ADI-whisper-ADI20)The released 20-country model was scored on exactly the same clips and audio and its 20 outputs were collapsed to the
same 5 regions. Paired exact McNemar tests and a cluster bootstrap over source videos / source groups
(B = 2000) are in eval/ely_vs_did5.json.
| set | n | this model: acc / macro-F1 | Whisper-large-v3: acc / macro-F1 | acc difference [95 % CI] |
|---|---|---|---|---|
| ADI-20 test | 14,072 | .9450 / .9346 | .9441 / .8595 | +.0009 [-.0087, +.0116], McNemar p = .74 (tie) |
| ADI-20 val | 10,345 | .9387 / .9105 | .9552 / .8117 | -.0165 [-.0328, +.0027] |
| NADI test | 3,817 | .9376 / .9350 | .7781 / .7993 | +.1595 [+.1453, +.1736] |
How to read this:
pip install -r requirements.txt # torch 2.8, fairseq2 0.6, omnilingual-asr 0.1.0 (CUDA 12.8 build)
huggingface-cli download Mohammed-nabulsi/omniasr-w2v300m-lora-arabic-did5-v2 --local-dir did5
cd did5 && python did_model.py clip1.wav clip2.wav
from did_model import DialectID
m = DialectID() # downloads the frozen omniASR_W2V_300M encoder on first use
m.predict_file("clip.wav") # {'EGY': 0.01, 'GLF': 0.02, 'LEV': 0.94, 'MAG': 0.02, 'MSA': 0.01}
Input must be 16 kHz mono (the loader does not resample). Clips longer than 30 s are centre-cropped. The model was
trained on untrimmed audio with no VAD and no augmentation. Labels are in adapters/labels.json
(EGY 0, GLF 1, LEV 2, MAG 3, MSA 4).
did_model.py was checked against these weights: on the 348 Levantine clips of ADI-5 dev it gives LEV recall .727
(253/348) against the recorded .724 (252/348); the one-clip difference is the documented bf16 batch-composition effect.
| path | content |
|---|---|
adapters/lora_ep2.pt |
LoRA weights, 192 tensors (96 projections x A, B), 3,145,728 params. md5 6e091074fee8e1c23d1892c74a8c9788 |
adapters/head_ep2.pt |
pooling + classifier head, 10 tensors, 1,187,078 params. md5 04f89ecb430266be4874877c5b92a4ee |
adapters/labels.json |
label order |
did_model.py |
self-contained inference code |
configs/ |
the resolved training configuration (every value sourced) and the verbatim launch line |
training_code/ |
the training scripts that produced the weights |
eval/ |
the training run's own results, and the paired comparison with Whisper |
omniASR_W2V_300M (24 layers, d = 1024). LoRA r = 16, alpha = 32, dropout 0.05 on q/k/v/output
projections of all 24 attention blocks. Head: attentive statistics pooling (1024 -> 128 -> tanh -> 1, softmax over valid
frames, weighted mean + std = 2048) -> LayerNorm -> Linear 2048->512 -> GELU -> Dropout 0.2 -> Linear 512->5.python train_multi.py --max-epochs 2 --patience 3 --rep "" --lr-head 5e-4 --lr-lora 2e-4 --workers 24 --seed 13 --test-ckpt last| source | clips / hours (train) |
|---|---|
| ADI-20, "ely40" selection (about 40 h per country, video round-robin) | 356,470 / 800.3 h |
| ADI-5 (MGB-3) | 14,420 / 53.2 h |
| NADI 2025 subtask 1 (Algeria, Egypt, Jordan, Mauritania, Morocco, Palestine, UAE, Yemen) | 17,916 / 20.4 h |
Training clips per region: EGY 95.4 h, GLF 338.1 h, LEV 177.4 h, MAG 218.3 h, MSA 44.6 h. Country -> region map: LEV = PAL, JOR, LEB, SYR; GLF = KSA, KUW, QAT, UAE, OMA, YEM, IRA, BAH; MAG = ALG, MOR, LIB, MAU, TUN; EGY = EGY, SUD; MSA = MSA.
Leakage controls, applied before training:
The adapters and code in this repository are released under Apache-2.0. The frozen base encoder
facebook/omniASR-W2V-300M is Apache-2.0. The training datasets state
no license on their Hub pages (ADI-20, ADI-17, NADI 2025 subtask 1 is gated); check their terms before reusing the data. No audio is redistributed here.
Datasets and prior work: H. Elleuch, S. Mdhaffar, Y. Estève, F. Bougares, "ADI-20: Arabic Dialect Identification dataset and models", Interspeech 2025 (arXiv:2511.10070); ADI-5 / MGB-3 (Ali et al., 2017); NADI 2025 shared task.
@misc{nabulsi2026did5,
title = {Arabic dialect identification with a frozen Omnilingual wav2vec2-300M encoder and LoRA},
author = {Nabulsi, Mohammed},
year = {2026},
url = {https://huggingface.co/Mohammed-nabulsi/omniasr-w2v300m-lora-arabic-did5-v2}
}
adapters/lora_ep2.pt 12 MiBadapters/head_ep2.pt 5 MiBfacebook/omniASR-W2V-300M