Introducing Harf

Harf is a speech model that checks Quran recitation as you recite. It is built to hear what you actually said, even when the correct verse is easy to guess.
One letter changes. Harf is built to hear it.
- The verse says
- الَّذِينَ
- dh as in “this”
- The reciter says
- الَّزِينَ
- z as in “zoo”
A model that has learned the verse tends to write down the correct word and miss the mistake.
It hears first, then compares.
Harf keeps listening and judging apart. The acoustic model receives only audio and outputs the sounds it heard. A separate engine then compares those sounds with the verse.
- AudioRecitation arrives in 320 ms chunks
- Acoustic modelOutputs the sounds heard, never sees the verse
allazīna
- AlignmentCompares the sounds with the expected verse
Heard a l l a z ī n a Verse a l l a dh ī n a - WarningMarks the word and the kind of mistake
الَّذِينَChanged consonant: dh became z
An illustration of one word, not a recorded result.
What it listens for
- Changed consonantsOne letter is said as another
dhbecomes→z
- Vowel and length mistakesA long vowel is cut short, or a vowel changes
ībecomes→i
- Skipped, repeated and extra wordsThe words no longer follow the verse
Skipped
Repeated
Extra
Harf works with the Hafs reading.
What I built.
- The model
- I fine-tuned NVIDIA’s English streaming FastConformer to recognise the sounds of Quran recitation, live.
- The data
- I used recordings edited to contain mistakes, so the audio no longer matches the verse and guessing from the text doesn’t work on them.
- The comparison
- I kept listening and judging apart, and built a separate engine that lines up the sounds with the verse and names the mistake.
- The testing
- I scored 18 versions on clean and simulated phone audio with my own scorer, and kept the setbacks in the chart.
- What the tests showed
- No version won everywhere. Stage G made the fewest errors on clean audio, but Stage P did better on simulated phone audio: 23.4% against 26.5%.
At a glance
0.59 s
Typical delay from a mistake to its warning. 95% of warnings arrive within 1.39 s
- 82%
- Of labelled mistakes are caught
- 35%
- Of its warnings are right
- 320 ms
- Between live audio updates
- 109M
- Parameters
Mistakes and warnings measured on the first test set.
Trained on one PC, with one graphics card.
All 109 million parameters, trained on a single RTX 3060 Ti with 8 GB of memory.
- 280 hours of audio, counting edited copies of the same recordings
- Only 0.9 hours of that is people reciting with labelled mistakes
- Echo, noise and phone-style sound added, to prepare it for real use
Progress, including the setbacks.
Phoneme error rate of 18 full-size live versions on the first test set, so lower is better. They are in name order, and not every version builds on the one before. The larger dots mark Stage P.
Show as table
| Version | Clean audio | Simulated phone |
|---|---|---|
| Stage C | 15.6% | 28.3% |
| Stage D | 15.8% | 30.0% |
| Stage F | 14.9% | 28.0% |
| Stage G | 14.0% | 26.5% |
| Stage H | 15.5% | 26.6% |
| Stage I | 15.2% | 28.6% |
| Stage J | 15.8% | 28.0% |
| Stage K | 14.5% | 28.3% |
| Stage L | 14.8% | 24.2% |
| Stage M | 15.4% | 29.2% |
| Stage N | 14.7% | 24.2% |
| Stage O | 14.4% | 23.5% |
| Stage P | 14.3% | 23.4% |
| Stage Q | 14.6% | 25.2% |
| Stage R | 14.4% | 23.4% |
| Stage S | 15.4% | 24.9% |
| Stage T | 14.4% | 23.3% |
| Stage U | 14.9% | 24.5% |
Compared with other models.
These are research models that detect pronunciation mistakes, and every one except Harf live hears the whole recitation before it answers. Harf live, the version on this page, already does better than the challenge baseline. An offline version I am still training comes closer, but is about 7 F1 points behind the open CROTTC model.
| Model | Phoneme error rate | F1 | Precision | Recall |
|---|---|---|---|---|
| XLS-R + TCNWuhan University, 1st | 3.7% | 72.0% | 74% | 70% |
| CROTTC-IFUTokyo, 2nd | 3.7% | 71.7% | 73% | 70% |
| wav2vec 2.0Team RAM, 3rd | 4.1% | 71.6% | 68% | 76% |
| CROTTC k3Open model | 9.2% | 69.7% | 71% | 68% |
| Harf offlineIn training, not live | 8.0% | 62.3% | 54% | 74% |
| Harf liveStage P, 320 ms chunks | 14.3% | 49.3% | 35% | 82% |
| mHuBERTChallenge baseline | 13.1% | 44.5% | 31% | 78% |
All on the first test set with clean audio and the full phoneme set, scored with the official challenge scorer. The top three of 19 challenge teams are their published results. The open CROTTC model without the extra decoding, the challenge baseline and both Harf versions were run by me. Their phoneme error rates come from my own scorer, as the official one does not report it. Harf offline has 316 million parameters and does not run live. Phoneme error rate: lower is better. F1, precision and recall: higher is better.
What it can’t do yet
- It warns too often: about 20 false warnings a minute on the second test set, before calibration
- It can still copy the verse: it wrote the correct text for 27% of labelled consonant mistakes
- It has not been tested with a live microphone. Phone audio is simulated so far
- The current version does not run on phones yet
Show details
- The tests are not fully blind. They were not used as training data, but many versions were scored on them and earlier results guided later work.
- Speakers in the second test set read the same sentences as training speakers.
- Harf was trained with effects similar to the simulated phone audio, which favours it.
- Earlier versions Harf builds on also used other recitations. The rest of the training audio is correct recitation, synthetic voices and edited recordings.
- An older version (Stage D) ran in real time on a Galaxy A32. Stage P has not been exported for mobile, and the iOS client has not been compiled.
- First test set: 1,642 recitations, 1.92 hours. Second test set: 644 recitations, 52.8 minutes. The warning delay was measured on an RTX 3060 Ti.
Harf v1 is next.
Harf is not released yet. Version 1 will be chosen from the remaining training runs, calibrated, exported and measured again. It is a practice aid and does not replace a qualified teacher.
Built with NVIDIA FastConformer, NeMo and Quranic Phonemizer. Harf is an independent project and is not affiliated with these organisations.