The pipeline, end to end
Every Hadith you see in Lightio passes through four steps. Three of them happen on your iPhone — only one touches our server.
Capture
You frame an object & tap shutter
Detect
YOLOX-M finds objects on-device
Search
Label sent to find Hadith
Display
Result rendered & saved
The image itself never leaves your device. Only the resulting object label — a short string like "date" or "sheep" — is sent to our search backend.
Object detection
Lightio uses YOLOX-M, an Apache 2.0-licensed object detector compiled to Core ML for Apple's Neural Engine. It recognizes the 80 categories in the COCO vocabulary — a carefully chosen subset that covers most everyday objects relevant to Hadith literature.
We chose YOLOX-M over alternatives for three reasons:
- License clarity. Apache 2.0 is unambiguously permissive for App Store distribution.
- Size. ~31% smaller than the previous YOLOv7 model we used, with comparable accuracy.
- Speed. Real-time inference on iPhone — no waiting after capture.
The model returns bounding boxes with confidence scores. We display all detections above the user-configurable confidence threshold (default 50%).
Hadith sources
Lightio's Hadith corpus is built exclusively from Kutub al-Sittah (the Six Canonical Collections) plus two well-regarded supplementary works. Every Hadith you see includes its source collection, narrator chain (isnad), and authenticity grading.
The most rigorously authenticated Hadith collection. Compiled by Imam al-Bukhari (d. 870 CE).
The second of the two "Sahihayn." Compiled by Imam Muslim ibn al-Hajjaj (d. 875 CE).
Focused on Hadith of legal significance. Compiled by Abu Dawud al-Sijistani (d. 889 CE).
Includes notes on grading. Compiled by Imam al-Tirmidhi (d. 892 CE).
The most stringent of the four Sunan works. Compiled by Imam al-Nasa'i (d. 915 CE).
Completes the Kutub al-Sittah. Compiled by Imam Ibn Majah (d. 887 CE).
We do not include weak (da'if) or fabricated (mawdu') Hadiths in the corpus. Where a Hadith's grading is contested among scholars, we surface the majority view.
Object → Hadith mapping
This is the part most people are curious about. How does the app know that "date" should bring back a Hadith about Ajwa dates?
- Curated keyword sets. Each of the 80 COCO labels is mapped to a hand-curated list of Arabic and English terms relevant to that object (e.g. "date" → tamr, 'ajwa, rutab).
- Full-text search. We search the Hadith corpus for matches in the Arabic text and English translations, weighted by how prominent the term is in each Hadith.
- AI ranking. A reasoning step ranks candidate Hadiths by topical relevance to the detected object — not just keyword frequency.
- Diversity sampling. If you detect the same object twice, you'll get different Hadiths from the candidate set when possible.
AI-generated summaries
The original Arabic text and its scholarly translation are always shown unchanged. We add an AI-generated summary — labeled as such — in English by default, switching to your country's primary language once you verify your phone number (the country is inferred from the dialing code). This helps with comprehension when the Hadith is long or context-heavy.
Summaries are generated by OpenAI's models with prompts engineered to:
- Preserve the Hadith's meaning without paraphrasing scholarly interpretation.
- Avoid theological commentary or jurisprudential rulings.
- Mark any uncertainty explicitly rather than fabricate confidence.
- Fall back to "summary unavailable" if the model can't generate something faithful.
Summaries are aids, not replacements. We always recommend reading the source text alongside.
Prayer time calculation
Prayer times use the open-source Adhan algorithm, a widely-trusted implementation by Batoul Apps. Calculations run entirely on-device once you've granted location permission once.
We expose 8 calculation methods:
- MWL — Muslim World League (Fajr 18°, Isha 17°). Safe global default.
- ISNA — Islamic Society of North America (Fajr 15°, Isha 15°).
- Egypt — General Authority of Survey (Fajr 19.5°, Isha 17.5°).
- Umm al-Qura — Makkah, Saudi Arabia (Isha = 90 min after Maghrib).
- Karachi — University of Islamic Sciences (Fajr 18°, Isha 18°).
- Tehran — Institute of Geophysics, University of Tehran (Fajr 17.7°, Isha 14°, Maghrib 4.5° below horizon — Jafari).
- Muhammadiyah — Munas Tarjih ke-31, PP Muhammadiyah Decree 734/KEP/I.0/B/2021, Indonesia (Fajr 18°, Isha 18°).
- Kemenag — Ministry of Religious Affairs, Indonesia (Fajr 20°, Isha 18°). Subuh ~8 min earlier than Muhammadiyah.
You can also override the Asr calculation between Standard (Shafi'i) and Hanafi behavior independently of your chosen method.
Sun visuals & weather context (v1.6.1+)
Sunrise, solar noon, and sunset shown beneath Today's Schedule are fetched from Apple WeatherKit using the latitude and longitude already stored in your prayer profile. These values are display-only — actual prayer time calculation remains fully on-device via Adhan. Current weather conditions are also fetched at prayer notifications to enrich hadith reflection search (e.g., surfacing rain-related hadiths when it's raining at your location). No additional personal data is sent to WeatherKit beyond the coordinates already in your profile.
Known limitations
We'd rather you know the limits up front than discover them disappointed.
The 80-object ceiling
Lightio can only detect objects in the COCO vocabulary. That means specialized religious items (prayer beads, kufi, qur'an stand) and cultural objects aren't detected. Expanding vocabulary is on our roadmap.
Object ≠ Theme
Detecting "cup" surfaces Hadiths about drinking, vessels, and hospitality — but not necessarily the most spiritually significant Hadith for your situation. Lightio is a discovery tool, not a fatwa engine.
Translation nuance
English translations of Hadith vary across scholars. We use widely-accepted translations and always show the original Arabic, but for legal/theological matters we recommend consulting qualified scholars and primary sources.
AI summaries can drift
Despite careful prompting, AI summaries occasionally introduce subtle inaccuracies. We mark summaries explicitly and treat them as supplementary — always defer to the source text.
How we review
Lightio's Hadith corpus and object mappings are reviewed quarterly. We track every reported correction in a public-feel internal log and fix issues before the next release.
If you spot a mistranslation, misattribution, or questionable mapping, please email us with a screenshot and the correct interpretation. We take corrections seriously.
Found something we should fix?
We treat methodology corrections as the highest-priority bug class. Help us improve Lightio for everyone.
Report a methodology issue