8000 Interactive Memorization Classroom (Listen & Repeat), Full Kids Mode (Progress Islands) & 100% Offline Live Recitation (Tasmee') by Yousif-GO · Pull Request #4068 · quran/quran_android · GitHub
[go: up one dir, main page]

Skip to content

Interactive Memorization Classroom (Listen & Repeat), Full Kids Mode (Progress Islands) & 100% Offline Live Recitation (Tasmee') - #4068

Open
Yousif-GO wants to merge 1 commit into
quran:mainfrom
Yousif-GO:pr/kids-mode-and-live-recitation
Open

Yousif-GO wants to merge 1 commit into
quran:mainfrom
Yousif-GO:pr/kids-mode-and-live-recitation

Conversation

@Yousif-GO
Copy link
Copy Markdown

Interactive Memorization Classroom (Listen & Repeat), Full Kids Mode (Progress Islands) & 100% Offline Live Recitation (Tasmee')

Motivation — First-of-Its-Kind Real Memorization Session

Most Quran apps only support passive audio playback or manual tap-to-reveal hiding. Learners — especially children and solo Hifz students — still lack an interactive, offline memorization session that genuinely mirrors sitting with a teacher (Mu'allim):

  1. Listen to the Sheikh recite a natural waqf phrase,
  2. Repeat the hidden Mushaf words aloud from memory,
  3. Receive instant on-device word-by-word verification (Rasm, Makharij, and Tashkeel), and
  4. Correct mistakes from the exact word missed (with Sheikh-only replay and 0.75× slow-mo word review) before advancing.

This contribution adds these capabilities while keeping Normal Mode reading 100% unchanged and uncluttered.


Privacy & Data Guarantees (100% On-Device, Child-Safe)

Because this feature listens directly to reciters — including children and families — privacy is e 8000 nforced at the architecture level:

  • Zero Cloud Audio Upload: Microphone audio is processed exclusively in volatile device RAM during the active recitation turn and discarded immediately. No audio recordings, voiceprints, or transcripts are ever sent to any server, cloud API, or third party.
  • 100% Offline After One-Time Model Download: Both the Kids Memorization Classroom and Live Recitation (Tasmee') run locally on CPU via ONNX Runtime — working completely offline (airplane mode, classrooms, mosques) with zero API keys, zero accounts, and zero cloud ASR fees.
  • Local-Only Progress & Profile: Child profile name, stars, streaks, Surah accuracy badges, and per-Surah tricky-word revision history are stored purely in local SharedPreferences on the device — zero telemetry or analytics.
  • Verified Model Integrity: Downloaded models and assets are verified against published SHA256SUMS.

Open, Free & Publicly Accessible Quran ASR Models (yousifgamalo/quran-asr-onnx)

All speech models powering this PR were trained, audited, quantized, and published openly and for free on Hugging Face by the author:

  • Repository: https://huggingface.co/yousifgamalo/quran-asr-onnx
  • License: CC-BY-NC-4.0 (free for non-profit, educational, and research use; commercial use prohibited — aligned with non-profit Quran education).
  • Full Transparency: Includes Android INT8 ONNX bundles, FP32 ONNX models, canonical quran.json (all 6,236 verses, 0 <unk> tokens), vocabularies, mel_basis_80x257.bin, streaming_config.json, SHA256SUMS, canonical teacher stop files (husary_muallim_full.json & minshawi_teacher_full.json), and full PyTorch / NVIDIA NeMo .nemo checkpoints (/nemo).

Training Corpus & Dual-Decoder Curation

  • Architecture: NVIDIA NeMo FastConformer fine-tuned for Quranic Arabic ASR with full diacritics (Tashkeel) (1,024 SentencePiece BPE pieces + <blk>).
  • Trained on 99,782 dual-decoder consensus-curated 16 kHz clips (97,646 train + 2,136 validation), filtered from 121,652 blended recordings:
    • Professional Recitations: yousifgamalo/mp3quran (232 reciter configurations).
    • Non-Professional / Everyday Reciters: yousifgamalo/quran-cleaned-nonprofessional-recordings (411 splits) — ensuring strong accuracy on children, beginners, and everyday voices, not only studio Qaris.
  • Consensus Curation: Audited via CTC + RNNT agreement, 80 ms frame-feasibility bounds, speaking-rate filtering, and canonical quran.json Rasm boundary checks (0 <unk> tokens across all 6,236 verses).

Published Validation Benchmarks (2,136 Curated Clips)

Version 1 — Offline Batch Scoring Model (fastconformer_quran_int8.onnx, 125.2 MB):

Decoder / Subset Clips Exact WER (with Tashkeel) No-Diacritic WER CER
CTC — Full Validation 2,136 4.72% (4.75% macro) 4.28% 2.59%
↳ CTC — Professional (mp3quran) 962 2.59% 2.34% 1.67%
↳ CTC — Non-Professional 1,174 6.38% 5.74% 3.18%
RNNT — Full Validation 2,136 2.99% (3.02% macro) 2.83% 2.27%

Version 2 — Strictly-Causal Stateful Streaming Model (streaming/fastconformer_quran_streaming_int8.onnx, 125.4 MB — 0 ms future lookahead, 32.6× real-time on CPU at 560 ms chunks):

Streaming Mode / Subset Lookahead CTC Exact WER CTC No-Diacritic WER CTC CER RNNT Exact WER
1,120 ms High-Accuracy (Overall) [70, 13] 12.00% 10.27% 5.74% 10.29%
↳ 1,120 ms Professional (962 clips) [70, 13] 7.44% 6.23% 3.49% 5.93%
↳ 1,120 ms Non-Professional (1,174 clips) [70, 13] 15.60% 13.47% 7.27% 13.68%
560 ms Balanced Real-Time (Overall) [70, 6] 14.07% 11.89% 6.36% 12.03%
↳ 560 ms Professional (962 clips) [70, 6] 8.55% 7.02% 3.71% 6.51%
160 ms Low-Latency (Overall) [70, 1] 18.28% 15.36% 7.94% 15.85%
80 ms Ultra-Low Latency (Overall) [70, 0] 21.44% 18.02% 8.99% 19.34%

What's Included

  1. Guided Listen & Repeat Memorization Classroom (All 114 Surahs / 6,236 Ayat)

    • Sheikh Mahmoud Khalil Al-Husary (Al-Mu'allim) as default canonical waqf stop reference + Sheikh Al-Minshawi (Teacher & Kids) aligned to the same natural stops (zero invalid mid-sentence cuts).
    • Dual On-Device ASR: Cache-aware streaming feedback (fastconformer_quran_streaming_int8.onnx) + full-turn two-tier grading (fastconformer_quran_int8.onnx) distinguishing Rasm/Makharij, missing words, and Tashkeel errors, with a 220 ms speaker-drain guard to prevent echo bleed.
    • Repeat From First Mistake & Revision Analytics: Sheikh-only replay starting from the first missed word + per-Surah tricky-word revision sheet with 0.75× slow-mo word replay.
    • Hifz Controls: Pass thresholds (70% / 80% / 90%), per-Ayah repeat (1×–10×), per-Surah repeat (1×–10×), and Auto-Next.
  2. Dedicated Full Kids Mode (KidsModeActivity) with Interactive Progress Islands

    • Clean separation from Normal Mode — accessed via a single Crescent Island icon in the home toolbar (or a single gateway card in Options).
    • Progress Islands: Interactive archipelago spanning Juz 'Amma, Juz 29 (Tabarak), and all 30 Juz Seas with 3D stepping-stone islands, milestone gates, bobbing explorer boat, and an Island Launch Sheet (Listen & Repeat / Recite Now).
    • Interactive Return on Back: Pressing Back from a Kids lesson cleanly stops audio/mic and sails directly back to the practiced island with a non-blocking Welcome-Back Sea Ribbon.
    • Rewards Vault & My Space: Full-Surah accuracy medallions (Silver 80%+, Gold 90%+, Diamond 97%+), stars, daily streak, learner ranks, editable child profile, and all Kids lesson controls.
  3. Normal Mode Live Recitation (Tasmee') & In-Place Word Masking

    • In-place Mushaf word hiding preserving ornate frames and ﴿١﴾ medallions across 5 reveal modes (Word by Word, Single Word, Word Window, Full Ayah, Single Word Tajweed).
    • Press-to-start Live Recitation dock with a matte housing where the microphone symbol itself glows when listening, revealing words monotonically offline as you recite.
    • Spaced-repetition Memory Flashcards & Memorization Range Repetition.

Screenshots

Normal Mode Home (Unchanged + Kids Entry) Kids Mode — Progress Islands Island Launch Sheet
Kids Rewards Vault (Badges & Rank) Kids My Space (Teacher & Hifz Settings) Normal Mode Options Live Recitation (Tasmee' Ready)

Verification & Testing

  • 47/47 unit tests passing across KidsClassroomTest, TajweedLipSyncAndStreamingAsrTest, and TasmeeMonotonicMatcherTest (covering two-tier grading, streaming mel/Welford extraction, mistake-tail slicing, 30-Juz journey planner, rewards/badges persistence, KidsModeActivity return navigation, and monotonic Tasmee' decoding).
  • Verified end-to-end on physical hardware (Samsung Galaxy SM-F966B) and Android 36 emulator.

Maintainer Notes

  • Rebased cleanly on latest quran/quran_android:main with upstream productFlavors (com.quran.labs.androidquran), signingConfigs, and pages/madani preserved.
  • Happy to split into smaller focused PRs (e.g., ① Memorization & Live Tasmee', ② Full Kids Mode & Progress Islands, ③ Flashcards) or move bundled demo assets (ayahinfo_*.zip, sample Tajweed pages, word_alignment.db) to on-demand downloads per maintainer preference.

@Yousif-GO Yousif-GO changed the title nteractive Memorization Classroom (Listen & Repeat), Full Kids Mode (Progress Islands) & 100% Offline Live Recitation (Tasmee') Interactive Memorization Classroom (Listen & Repeat), Full Kids Mode (Progress Islands) & 100% Offline Live Recitation (Tasmee') Nov 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0