Downloads · 30 days
14
3% of all-time downloads
aboalaa1472/whisper-quran-lora-v1
whisper-quran-lora-v1 is a automatic speech recognition model from aboalaa1472. Use it when you need speech turned into text. It is set up for peft. The card lists the license as mit.
Graduation Project · Computer Engineering A parameter-efficient fine-tuning of Whisper Large V3 Turbo specifically for Quranic Arabic speech recognition, using LoRA (Low-Rank Adaptation) with 8-bit quantization.
Downloads · 30 days
14
3% of all-time downloads
All-time downloads
432
Public
Repo size
1.6 GB
Likes
0
Public
Click a slice to open those files.
.safetensors26.2 MB · 87%
From the Hugging Face model README
Graduation Project · Computer Engineering
A parameter-efficient fine-tuning of Whisper Large V3 Turbo specifically for Quranic Arabic speech recognition, using LoRA (Low-Rank Adaptation) with 8-bit quantization.
| Field | Details |
|---|---|
| Adapter Repo | aboalaa1472/whisper-quran-lora-v1 |
| Base Model | naazimsnh02/whisper-large-v3-turbo-ar-quran |
| Architecture | Whisper Large V3 Turbo + LoRA (PEFT) |
| Task | Automatic Speech Recognition (ASR) — Quranic Arabic |
| Language | Arabic (Classical / Quranic) |
| License | MIT |
Quranic recitation presents unique challenges for general-purpose ASR systems: precise tajweed rules, elongations (madd), and a phonetic richness distinct from Modern Standard Arabic. This project addresses those challenges by fine-tuning a specialized Whisper variant using LoRA, a parameter-efficient technique that adapts large pre-trained models with a fraction of the trainable parameters — making it feasible to train on modest hardware without sacrificing quality.
This work was conducted as part of a Computer Engineering Graduation Project with the goal of improving accessibility tools for Quranic recitation evaluation, memorization aids, and educational platforms.
| Split | Source | Samples |
|---|---|---|
| Training | tarteel-ai/everyayah — train | 5,000 |
| Validation | tarteel-ai/everyayah — validation | 500 |
The EveryAyah dataset contains high-quality recordings of Quranic verses by various reciters, making it an ideal resource for training recitation-aware ASR models.
| Parameter | Value |
|---|---|
Rank (r) | 32 |
LoRA Alpha (lora_alpha) | 64 |
| Target Modules | q_proj, v_proj |
| LoRA Dropout | 0.05 |
| Bias | none |
| Parameter | Value |
|---|---|
| Max Steps | 400 |
| Per-device Batch Size | 4 |
| Gradient Accumulation Steps | 4 |
| Effective Batch Size | 16 |
| Learning Rate | 1e-5 |
| Warmup Steps | 50 |
| Mixed Precision | FP16 |
| Quantization | 8-bit (BitsAndBytes) |
| Evaluation Strategy | Every 100 steps |
| Optimizer | AdamW (default) |
A deliberate decision was made to bypass the default torchcodec audio decoder due to compatibility constraints with the installed PyTorch version. Instead, a custom pipeline using librosa was implemented for robust, format-agnostic audio loading.
All audio files are decoded manually at 16 kHz using librosa.load(), converting raw bytes directly to float32 numpy arrays. This approach avoids dependency on the system codec stack and ensures reproducible behaviour across environments.
To improve the model's robustness to diverse recitation styles, microphone qualities, and recording conditions, two augmentation transforms were applied on-the-fly during training using the audiomentations library:
| Transform | Parameters | Probability |
|---|---|---|
| PitchShift | ±3 semitones | 50% |
| TimeStretch | Rate: 0.85 × – 1.15 × | 40% |
Augmentation is applied after decoding and before feature extraction, ensuring the mel spectrogram computed by the Whisper processor reflects the augmented signal.
Evaluation loss was monitored every 100 steps on the 500-sample validation split:
| Step | Epoch | Eval Loss |
|---|---|---|
| 100 | 0.32 | 0.3435 |
| 200 | 0.64 | 0.3064 |
| 300 | 0.96 | 0.3014 |
| 400 | 1.28 | 0.3029 |
The model converged quickly, with eval loss dropping from 0.343 → 0.301 — an ~12.3% improvement — indicating successful adaptation to Quranic speech patterns within a single epoch of training data.
pip install transformers peft torch librosa bitsandbytes accelerate
import torch
import librosa
from transformers import WhisperProcessor, WhisperForConditionalGeneration
from peft import PeftModel
# ── Configuration ────────────────────────────────────────────────
BASE_MODEL_ID = "naazimsnh02/whisper-large-v3-turbo-ar-quran"
ADAPTER_REPO = "aboalaa1472/whisper-quran-lora-v1"
AUDIO_PATH = "your_audio.wav" # 16 kHz mono WAV recommended
# ─────────────────────────────────────────────────────────────────
processor = WhisperProcessor.from_pretrained(BASE_MODEL_ID)
base_model = WhisperForConditionalGeneration.from_pretrained(
BASE_MODEL_ID,
torch_dtype=torch.float16,
device_map="auto",
)
model = PeftModel.from_pretrained(base_model, ADAPTER_REPO)
model.eval()
# Load and preprocess audio
audio_array, _ = librosa.load(AUDIO_PATH, sr=16000)
inputs = processor.feature_extractor(
audio_array,
sampling_rate=16000,
return_tensors="pt",
).to(model.device)
with torch.no_grad():
predicted_ids = model.generate(
inputs.input_features,
language="ar",
task="transcribe",
)
transcription = processor.tokenizer.batch_decode(
predicted_ids, skip_special_tokens=True
)[0]
print("📖 Transcription:", transcription)
Note: The adapter contains only the LoRA weight deltas (~tens of MBs). The base model (~3 GB) is downloaded separately from its own HuggingFace repository.
aboalaa1472/whisper-quran-lora-v1/
├── adapter_config.json # LoRA configuration (r, alpha, target_modules …)
├── adapter_model.safetensors # Trained LoRA weight deltas
└── README.md # This file
r=32 applied to q_proj and v_proj, the number of trainable parameters is reduced by over 99%, enabling training on a single consumer GPU.-100 before computing the cross-entropy loss, preventing the model from learning to predict padding.If you use this model or pipeline in your research, please cite our paper:
@article{alaa2026quranic,
title = {An Automated Multi-Stage Pipeline for Quranic Recitation Correction Using Fine-Tuned ASR and Diacritic Analysis},
author = {Mohamed Alaa and Omar Ahmed and Mohamed Abdelmonem and Mohamed Hamdy and Abdelrahman Osama and Shimaa Ibrahim},
journal = {Department of Computer Engineering, Shoubra Faculty of Engineering, Benha University},
year = {2026},
url = {[https://drive.google.com/file/d/1fyQOqmz3Kdp8vDlsazdV7VgsXZPqm6Rc/view?usp=sharing](https://drive.google.com/file/d/1fyQOqmz3Kdp8vDlsazdV7VgsXZPqm6Rc/view?usp=sharing)}
}