Instructions to use Haitam03/iqraeval-w2vbert2-ctc with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Haitam03/iqraeval-w2vbert2-ctc with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("automatic-speech-recognition", model="Haitam03/iqraeval-w2vbert2-ctc")# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForCTC processor = AutoProcessor.from_pretrained("Haitam03/iqraeval-w2vbert2-ctc") model = AutoModelForCTC.from_pretrained("Haitam03/iqraeval-w2vbert2-ctc", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Arabic Mispronunciation Detection: w2v-BERT 2.0 Phoneme Recogniser
This model transcribes Arabic read speech into the 68-phoneme IqraEval inventory. To detect mispronunciations, compare its transcript with the reference phonemes of the text the speaker read: every substituted, deleted or inserted phoneme is a detected error. The official IqraEval scoring does this comparison.
Reference : < y a t a H a d d a v u n n aa s u ...
Predicted : < y a t a H a d d a s u n n aa s u ...
^ v → s substitution detected
What made the difference: cleaning the training data
Iqra_TTS contains synthetic speech with deliberately injected pronunciation errors. A trained model used as a judge showed that about 19% of those injected errors are not audible: the TTS voice said the correct phoneme, but the label claims an error. Labels like these teach a model to report errors that aren't there.
This model was trained on native speech plus only the correctly read TTS clips. That removed the false labels, cut false alarms, and gave the best score of all our runs. It still catches real errors (recall 0.73) without ever seeing an injected-error example.
Results
Iqra'Eval 2025 test set (QuranMB.v2: 98 Quranic verses × 18 speakers, human-annotated). Official scoring; the leaderboard ranks by F1.
| Model | F1 | Precision | Recall | PER |
|---|---|---|---|---|
| This model | 0.460 | 0.336 | 0.729 | 0.140 |
| Our xlsr-53 Arabic CTC recogniser (same data, all TTS clips) | 0.43 | 0.29 | 0.80 | 0.17 |
Our first model, v1 (Wav2Vec2-mispronunciation-detector) |
0.419 | 0.300 | 0.693 | 0.203 |
| Official 2025 baseline | 0.441 | 0.309 | 0.771 |
Trained only on data released for the 2025 challenge. The checkpoint (step 10k) was chosen from the dev curve; nearby checkpoints score within ±0.005 F1 on the test set.
Usage
Audio must be 16 kHz mono.
import torch, librosa
from transformers import Wav2Vec2BertForCTC, AutoFeatureExtractor
repo = "Haitam03/iqraeval-w2vbert2-ctc"
model = Wav2Vec2BertForCTC.from_pretrained(repo).eval()
fx = AutoFeatureExtractor.from_pretrained(repo)
wave, _ = librosa.load("recording.wav", sr=16000)
inputs = fx(wave, sampling_rate=16000, return_tensors="pt")
with torch.no_grad():
ids = model(**inputs).logits.argmax(-1)[0].tolist()
# greedy CTC decoding: merge repeats, drop the blank
blank, phones, prev = model.config.pad_token_id, [], None
for i in ids:
if i != prev and i != blank:
phones.append(model.config.id2label[i])
prev = i
print(" ".join(phones))
To get the reference phonemes for a text, use the official MSA phonetiser, which needs fully diacritised input. To score predictions against references and human annotations, see score_testset.py in the project repository.
Phoneme set
The 68 symbols of the IqraEval inventory (sws_arabic.txt in this repo), plus the CTC blank (id 68):
- consonants in a Buckwalter-style romanisation (e.g.
<= ء,E= ع,S= ص); - geminates written as doubled symbols (
bb,ll, …); - short and long vowels (
a u i,aa uu ii); - emphatic vowel variants (
A U I AA UU II).
Training
| Base model | facebook/w2v-bert-2.0 (606M), with adapter and a new 69-way CTC head |
| Data | Iqra_train (~79 h native read MSA) + Iqra_TTS clips labelled original (correctly read Quranic verses) |
| Dev set | Iqra_train dev + held-out Iqra_TTS row groups, unmodified |
| Objective | CTC on the phoneme sequence |
| Optimiser | AdamW, lr 5e-5 (head 5e-4), weight decay 0.01, 500 warm-up steps, cosine decay over 12k steps |
| Batch | 32 utterances per step (4 per GPU × 2 GPUs × 4 accumulation steps), clips up to 15 s |
| Regularisation | first 6 transformer layers frozen, SpecAugment time masking (p = 0.05), speed perturbation (0.9–1.1×), added noise (SNR 10–30 dB) |
| Hardware | 2× NVIDIA T4 (Kaggle), fp16, ~10 h |
Limitations
- False alarms remain the main weakness: precision 0.34 means about 2 of every 3 flagged phonemes were actually read correctly. Many are places where speakers genuinely differ from the text-based reference without making an annotated error (e.g. connected-speech vowel shortening).
- It isn't a tajweed assessor. It was trained on MSA-style reading and judges against IqraEval's MSA phonetisation, so tajweed phenomena (madd length, ghunna, idgham…) aren't evaluated.
- No error examples in training, so the model slowly drifts toward the canonical pronunciation with longer training, which lowers recall. The chosen checkpoint balances this.
- Greedy decoding, no language model. The reference text isn't used by the model itself.
Citation
@software{bouanane2025arabicmdd,
title = {Arabic Mispronunciation Detection with Self-Supervised Speech Models},
author = {Bouanane, Haitam},
year = {2025},
url = {https://github.com/hBouanane/wav2vec2-mispronunciation-detector}
}
- Downloads last month
- 29
Model tree for Haitam03/iqraeval-w2vbert2-ctc
Base model
facebook/w2v-bert-2.0Datasets used to train Haitam03/iqraeval-w2vbert2-ctc
IqraEval/Iqra_TTS
Evaluation results
- Detection F1 on Iqra'Eval 2025 test set (QuranMB.v2)test set self-reported0.460
- Detection precision on Iqra'Eval 2025 test set (QuranMB.v2)test set self-reported0.336
- Detection recall on Iqra'Eval 2025 test set (QuranMB.v2)test set self-reported0.729
- Phoneme error rate on Iqra'Eval 2025 test set (QuranMB.v2)test set self-reported0.140