Khurram Badar / Archive / Papers / The school PHOTO EXTRACTION SPECIFICATION v1.0

The school PHOTO EXTRACTION SPECIFICATION v1.0

briefing · 2026-07-23 · 1442 words · Khurram Badar

Algorithm for structuring 2,000+ wall-data photographs into the the school Atlas knowled Execution: Claude Code, subscription mode only (NO API key — never set ANTHROPIC_ 0. MISSION 1.

ai · education · energy

the school PHOTO EXTRACTION SPECIFICATION v1.0

---

0. MISSION

Convert every photograph of the school's walls, classrooms, corridors, and displays into structured, queryable records so leadership can ask questions like "how many classrooms display learning goals?", "which classrooms have fire extinguishers?", "which students made energy projects?" — and receive honest, sourced, photo-referenced answers.

The school's walls are the collection. This pipeline is the catalogue.

---

1. INTEGRITY RULES (override everything else)

1. **Never fabricate.** If text is unreadable, record `"[UNREADABLE]"` with a flag. Never complete a partial word from plausibility. A guess that happens to be right is still a fabrication.
2. **Verbatim transcription.** Wall text is copied exactly as written, including spelling errors. Corrections go in a separate `corrected_text` field, never overwrite the original.
3. **Confidence on every extraction.** Every name, number, and claim carries `high` / `medium` / `low`. Low-confidence items are never promoted to facts in rollups.
4. **Wall claims are unverified.** Any statistic, award, date, or achievement displayed on a wall is recorded as `wall_displayed_unverified` unless already verified against the client's platform or official sources.
5. **Credentials are never stored.** If a photo shows a password, login, WiFi key, or access code: record `credential_sighting: true`, note the location, and DO NOT transcribe the credential itself. This feeds the data-protection register.
6. **Student names are retained verbatim** (internal knowledge base only, covered by enrollment consent). They are marked `internal_only: true` — the public Atlas layer never surfaces them.
7. **Counts are honest.** The database only knows photographed rooms. Every aggregate answer must be phrased "X of Y documented rooms," never "X classrooms in the school."

---

2. DAILY SESSION PROTOCOL (subscription mode)

---

3. WALK-ORDER ROOM ANCHORING

Photos are processed in **capture order** (original iPhone filenames / EXIF timestamps — files are unrenamed).

---

4. PER-PHOTO READING PROCEDURE — NINE PASSES

Read every photo corner to corner. Execute all nine passes for every image; write `null` (not omission) for passes with no findings.

**PASS 1 — FRAME SWEEP.** Describe the whole frame in 1–2 sentences: what surface (wall board / door / shelf / desk / floor plan / window), orientation, lighting/legibility quality (`good` / `partial` / `poor`).

**PASS 2 — SEGMENTATION.** Divide the frame into visual segments (e.g., "top banner," "left poster," "center chart," "student work grid, 3×4"). Each segment gets an id (`seg-1`, `seg-2`…), a short label, and an approximate position (top-left, center, etc.). All subsequent passes reference segment ids.

**PASS 3 — TEXT TRANSCRIPTION.** Transcribe ALL readable text per segment, verbatim, preserving line breaks, capitalization, and errors. Mark unreadable spans `[UNREADABLE]`. Mark uncertain characters `[?]`. Record language(s): English / Arabic / Urdu / mixed. Arabic and Urdu text: transcribe if legible; otherwise describe and flag `NEEDS_ARABIC_REVIEW` / `NEEDS_URDU_REVIEW`.

**PASS 4 — NAMES & PEOPLE.** Extract every human name into typed records: `{name, role_guess: student|teacher|leader|unknown, grade_section (if shown), segment_id, confidence}`. Match against the master glossary (25 staff, ~65 students) — record `glossary_match: exact|variant|new`. Spelling variants are recorded, never merged silently.

**PASS 5 — VISUAL ATTRIBUTES.** Dominant colors (max 5, plain names), color-coding systems if present (e.g., "subjects color-coded: math=blue"), patterns (borders, grids, themes), display craft quality notes (handmade / printed / laminated / 3D model).

**PASS 6 — OBJECT INVENTORY.** Every discrete physical object: fire extinguisher, smoke detector, evacuation plan, first-aid kit, WiFi access point, projector, smartboard, camera, clock, plant, trophy, model, book, device. Typed as `{object_type, count, condition_note, segment_id}`. Safety and infrastructure objects are the highest-value extractions — never skip them.

**PASS 7 — CURRICULUM & SUBJECT CLASSIFICATION.** Tag content against the controlled vocabulary: `english, math, science, computer, islamiat, mscs, arabic, urdu, quran, steam, pe, reading, financial-literacy, digital-economy, ai-literacy, sustainability-esg, climate, space, health-wellbeing, uae-heritage, values-character, safety, admin-operations, celebration-event`. Multiple tags allowed. New themes not in the vocabulary: tag `other` + free-text + flag `NEW_THEME_CANDIDATE`.

**PASS 8 — ARTIFACT TYPING.** Classify what the display IS: `learning_goals_board, timetable, attendance_board, student_project, student_worksheet, teacher_material, notice_official, motivational_quote, subject_wall, safety_signage, evacuation_plan, door_plate, award_trophy, decoration, infrastructure, book_display, roster_list, other`. This field powers Mr. Rashid's count queries ("how many classes have goals on the notice board" = count rooms with `learning_goals_board`).

**PASS 9 — INTENT & SIGNIFICANCE.** One short paragraph, explicitly labelled `CLAUDE_INFERENCE`: what is this display trying to do pedagogically or operationally, and why does it matter for KHDA evidence / the Atlas? Notable commendations (e.g., a student's energy project deserving recognition) get flag `COMMEND_CANDIDATE` with the student name and project.

---

5. OUTPUT SCHEMA (one JSON record per photo)

```json
{
"photo_id": "the school-00417",
"filename": "IMG_4club8.HEIC",
"tour_sequence": 417,
"captured_at": "EXIF timestamp or null",
"location": {
"room": "36", "class": "2-A", "wing": "GF boys",
"source": "carried_forward", "confidence": "high"
},
"frame": { "surface": "wall board", "legibility": "good", "summary": "..." },
"segments": [ { "id": "seg-1", "label": "...", "position": "top-left" } ],
"text": [ { "segment_id": "seg-1", "verbatim": "...", "corrected_text": null,
"language": "en", "confidence": "high" } ],
"people": [ { "name": "...", "role_guess": "student", "grade_section": "2-A",
"glossary_match": "exact", "confidence": "high",
"internal_only": true } ],
"visual": { "colors": [], "patterns": [], "craft": "handmade" },
"objects": [ { "object_type": "fire_extinguisher", "count": 1,
"condition_note": null, "segment_id": "seg-3" } ],
"curriculum_tags": ["science", "sustainability-esg"],
"artifact_type": "student_project",
"verification_status": "wall_displayed_unverified",
"claude_inference": "…(labelled interpretation)…",
"flags": ["COMMEND_CANDIDATE"],
"credential_sighting": false
}
```

**Flag taxonomy:** `LOCATION_UNCERTAIN, NEEDS_ARABIC_REVIEW, NEEDS_URDU_REVIEW, NEW_THEME_CANDIDATE, COMMEND_CANDIDATE, CREDENTIAL_SIGHTING, VERIFY_EXTERNAL (claims needing the client's platform check), DUPLICATE_SUSPECT (same display re-photographed), POOR_IMAGE (recommend re-shoot), SAFETY_CONCERN`.

---

6. STORAGE

---

7. EXECUTION ORDER

1. **TEST BATCH:** first 20 photos in walk order. Human review of output quality before anything else runs. Measure `/status` consumption before/after → derive real photos-per-window number → set the daily target accordingly (100/day is the goal, the measurement is the truth).
2. Reprocess everything from photo #001 — existing knowledge-bank entries #001–#415 are reference context, not a substitute; they will later be diffed against new extractions as a quality check.
3. Process in strict walk order, day by day, ledger-resumed.
4. Weekly: regenerate rollups, review all flags with Khurram, run the glossary reconciliation (name variants).

---

*This spec is the single source of truth for extraction. Changes are versioned (v1.1, v1.2…) and noted in the repo CLAUDE.md. Subscription-only rule: if any step ever prompts for API credits, decline and stop.*

← FUTURE MINDS futureminds.uzTHE SOVEREIGN CUSTODY MASTERCLASS →
Two years of working thought, indexed.
Ask me to present it in your conference room — WhatsApp +971 55 623 9111
Book Session →