This project began with a simple but powerful question: Why isn't there an app that gives real-time Tajweed feedback while reciting the Quran?
Inspired by Tarteel AI and the power of modern speech recognition, we set out to build a tool that listens to a user recite a verse and responds with specific, understandable Tajweed feedback—starting with the rule of Qalqalah.
This project aims to build an AI system that detects Qalqalah Kubra (major Qalqalah) in Quranic recitation. The system leverages forced alignment, audio processing, and machine learning to provide targeted feedback on the correct pronunciation of Tajweed rules, with an initial focus on the letter Qaf (ق).
librosa, numpy, soundfile, pydub, joblibscikit-learn (for model training)nemo_toolkit, torch (for ASR)ffmpeg (audio conversion)To tackle the challenge of having no public dataset with audio and Tajweed mistake labels, we pursued three distinct model training strategies, each with its own trade-offs.
Location: manual_annotation_approach/
qalqalah_annotator.py) for precise manual annotation.Location: automated_mass_approach/
Location: falaq_word_approach/ and complete_qalqalah_pipeline.py
The three approaches yielded vastly different results, highlighting the trade-off between data quantity and quality.
| Approach | Dataset Size | Accuracy | Precision | Recall | Best Use Case |
|---|---|---|---|---|---|
| Manual Annotation | 56 samples | 58.3% | 0.57 | 0.67 | Research / Prototyping |
| Mass Approach | 301 samples | 83.6% | 0.70 | 0.50 | General Purpose Model |
| Falaq Pipeline | 29 samples | 100% / 57.14% | 1.00 | 1.00 | Proof-of-Concept |
Note: The Falaq Pipeline achieved 100% on its internal validation set but 57.14% (4/7 correct) on an external test set of real-world examples.
Key Insight: The model is currently biased toward "Not Qalqalah" when faced with unseen data. The 57.14% external accuracy score makes it clear that while the forced alignment method is highly effective for creating clean training data, the model needs a much more diverse and balanced dataset to generalize to new reciters and environments.
User Audio Input (WAV)
↓
NVIDIA ASR Transcription
↓
CTC Forced Aligner (Word Timestamps)
↓
PyDub Audio Segmentation
↓
Feature Extraction (24 features)
↓
Qalqalah Binary Classifier
↓
Feedback Output (Qalqalah Detected/Not Detected)
├── manual_annotation_approach/ # Manual annotation scripts & models
│ ├── qalqalah_annotator.py # GUI for manual annotation
│ └── qalqalah_model.pkl # Trained model
├── automated_mass_approach/ # Mass extraction approach
│ ├── mass_qalqalah_extractor.py # Data extraction script
│ └── mass_qalqalah_model.pkl # Trained model
├── falaq_word_approach/ # Specialized Falaq approach
│ ├── falaq_word_trainer.py # Training script
│ ├── positive_samples_wav/ # Expert reciter samples
│ └── negative_samples_wav/ # Incorrect pronunciation samples
├── complete_qalqalah_pipeline.py # End-to-end pipeline for testing
├── ctc_forced_aligner_test.py # Forced aligner testing script
├── convert_to_mono_wav.py # Audio preprocessing utility
└── README.md # This file
librosa, scikit-learn, pydub, nemo_toolkit, torchconvert_to_mono_wav.py.falaq_word_trainer.py is recommended).complete_qalqalah_pipeline.py.This project represents a significant step toward real-time, ML-powered Tajweed feedback. The journey from 58% accuracy with limited manual data to 100% accuracy on a specialized internal set proves the effectiveness of the forced alignment and hard negative mining pipeline.
However, the 57.14% accuracy on an external test set serves as a crucial benchmark, demonstrating that while the method for data curation is sound, the current model has not yet generalized. This work lays a strong and promising foundation, with a clear path forward focused on dataset expansion and diversification.
This is more than a technical challenge—it's a mission to revive the beauty and precision of Quranic recitation through the responsible use of AI.
Project by: Nabhan Mazid and Muaz Ahmed
Contact: nabhanmazid@gmail.com | GitHub: nmazid121 | LinkedIn: Nabhan Mazid
18 commits
Python
90.6%
HTML
9.4%
This project began with a simple but powerful question: Why isn't there an app that gives real-time Tajweed feedback while reciting the Quran?
Inspired by Tarteel AI and the power of modern speech recognition, we set out to build a tool that listens to a user recite a verse and responds with specific, understandable Tajweed feedback—starting with the rule of Qalqalah.
This project aims to build an AI system that detects Qalqalah Kubra (major Qalqalah) in Quranic recitation. The system leverages forced alignment, audio processing, and machine learning to provide targeted feedback on the correct pronunciation of Tajweed rules, with an initial focus on the letter Qaf (ق).
librosa, numpy, soundfile, pydub, joblibscikit-learn (for model training)nemo_toolkit, torch (for ASR)ffmpeg (audio conversion)To tackle the challenge of having no public dataset with audio and Tajweed mistake labels, we pursued three distinct model training strategies, each with its own trade-offs.
Location: manual_annotation_approach/
qalqalah_annotator.py) for precise manual annotation.Location: automated_mass_approach/
Location: falaq_word_approach/ and complete_qalqalah_pipeline.py
The three approaches yielded vastly different results, highlighting the trade-off between data quantity and quality.
| Approach | Dataset Size | Accuracy | Precision | Recall | Best Use Case |
|---|---|---|---|---|---|
| Manual Annotation | 56 samples | 58.3% | 0.57 | 0.67 | Research / Prototyping |
| Mass Approach | 301 samples | 83.6% | 0.70 | 0.50 | General Purpose Model |
| Falaq Pipeline | 29 samples | 100% / 57.14% | 1.00 | 1.00 | Proof-of-Concept |
Note: The Falaq Pipeline achieved 100% on its internal validation set but 57.14% (4/7 correct) on an external test set of real-world examples.
Key Insight: The model is currently biased toward "Not Qalqalah" when faced with unseen data. The 57.14% external accuracy score makes it clear that while the forced alignment method is highly effective for creating clean training data, the model needs a much more diverse and balanced dataset to generalize to new reciters and environments.
User Audio Input (WAV)
↓
NVIDIA ASR Transcription
↓
CTC Forced Aligner (Word Timestamps)
↓
PyDub Audio Segmentation
↓
Feature Extraction (24 features)
↓
Qalqalah Binary Classifier
↓
Feedback Output (Qalqalah Detected/Not Detected)
├── manual_annotation_approach/ # Manual annotation scripts & models
│ ├── qalqalah_annotator.py # GUI for manual annotation
│ └── qalqalah_model.pkl # Trained model
├── automated_mass_approach/ # Mass extraction approach
│ ├── mass_qalqalah_extractor.py # Data extraction script
│ └── mass_qalqalah_model.pkl # Trained model
├── falaq_word_approach/ # Specialized Falaq approach
│ ├── falaq_word_trainer.py # Training script
│ ├── positive_samples_wav/ # Expert reciter samples
│ └── negative_samples_wav/ # Incorrect pronunciation samples
├── complete_qalqalah_pipeline.py # End-to-end pipeline for testing
├── ctc_forced_aligner_test.py # Forced aligner testing script
├── convert_to_mono_wav.py # Audio preprocessing utility
└── README.md # This file
librosa, scikit-learn, pydub, nemo_toolkit, torchconvert_to_mono_wav.py.falaq_word_trainer.py is recommended).complete_qalqalah_pipeline.py.This project represents a significant step toward real-time, ML-powered Tajweed feedback. The journey from 58% accuracy with limited manual data to 100% accuracy on a specialized internal set proves the effectiveness of the forced alignment and hard negative mining pipeline.
However, the 57.14% accuracy on an external test set serves as a crucial benchmark, demonstrating that while the method for data curation is sound, the current model has not yet generalized. This work lays a strong and promising foundation, with a clear path forward focused on dataset expansion and diversification.
This is more than a technical challenge—it's a mission to revive the beauty and precision of Quranic recitation through the responsible use of AI.
Project by: Nabhan Mazid and Muaz Ahmed
Contact: nabhanmazid@gmail.com | GitHub: nmazid121 | LinkedIn: Nabhan Mazid
18 commits
Python
90.6%
HTML
9.4%