Skip to content

Arasoul/AI-Pharaoh

Repository files navigation

AI Pharaoh

License: MIT Python PyTorch

AI Pharaoh is an integrated artificial intelligence platform that bridges modern machine learning with Ancient Egyptian cultural heritage. It combines computer vision, natural language processing, and augmented reality to support both hieroglyph interpretation and monument-based cultural exploration.


Overview

The system operates through two main pipelines:

Pipeline A — Hieroglyph Translation Raw inscription image → glyph detection (YOLOv8) → segmentation (SAM) → hierarchical classification (ConvNeXt, 1,080 Gardiner codes) → spatial ordering → transliteration → NLP translation → English output

Pipeline B — Monument Recognition & AR Monument photo → detection (YOLOv8m) → knowledge base lookup → AR 3D overlay with audio narration


Repository Structure

AI-Pharaoh/
├── src/                    # Core pipeline source code
│   ├── pharaonic_dashboard.py   # Streamlit UI
│   ├── config.py                # Configuration loader
│   └── process_images.py        # Headless batch processor
├── translation/            # NLP translation engine (beam search, SRL, discourse)
├── transliteration/        # Gardiner sign → phonetic conversion
├── orientation/            # Spatial ordering & reading direction
├── docs/                   # Full stage-by-stage documentation
├── mobile-app/             # Unity AR application source (C#)
├── mobile-backend/         # Colab-based API backend (FastAPI + ngrok)
├── desktop-launcher/       # Desktop application source
├── config.example.json     # Example configuration (copy to config.json)
├── requirements.txt        # Python dependencies
├── LICENSE                 # MIT License
└── .gitignore

Quick Start

# 1. Clone the repository
git clone https://github.com/your-username/AI-Pharaoh.git
cd AI-Pharaoh

# 2. Install dependencies
pip install -r requirements.txt

# 3. Copy and edit configuration
cp config.example.json config.json
# Update model paths in config.json to match your setup

# 4. Run the dashboard
streamlit run src/pharaonic_dashboard.py

Note: Pre-trained model weights (.pt/.pth) are not included in this repository. See Model Weights below.


Documentation

Full pipeline documentation is available in docs/:

Document Description
Pipeline Overview End-to-end system walkthrough
Stage 1: Input & Config Image ingestion & config
Stage 2: YOLO Detection Glyph proposal generation
Stage 3: SAM Segmentation Mask refinement
Stage 4: NMS Box + mask non-max suppression
Stage 5: Classification ConvNeXt hierarchical classifier
Stage 6: Orientation Reading direction estimation
Stage 7: Spatial Ordering Reading sequence reconstruction
Stage 8: Transliteration Gardiner → phonetic conversion
Stage 9: Translation NLP translation engine
Stage 10: Monument Detection Artifact recognition

Model Weights

The model weight files are not included in this repository due to size constraints. They are available on request. The following weights are needed:

Model File Size
YOLOv8 glyph detector best.pt ~18 MB
SAM segmentation sam_vit_b_01ec64.pth ~358 MB
Stage 1 classifier (29 families) best_stage1_model.pt ~106 MB
Stage 2 classifier (1,080 codes) stage2_best_model.pth ~110 MB
YOLOv8m monument detector best.pt ~64 MB
Orientation classifier orientation_model.pth ~9 MB

Key Results

Component Metric Value
Hieroglyph Detection (YOLOv8) Test Accuracy 92.1%
Stage 1 Classification (29 families) Test Accuracy 96.77%
Stage 2 Classification (1,080 codes) Test Accuracy 93.2%
Combined End-to-End Accuracy 89.44%
Monument Detection (YOLOv8m) Test Accuracy 88.6%
Spatial Ordering Sequence Accuracy 100% (synthetic)
Transliteration (known codes) Phonetic Accuracy 98.2%

Built With

  • Detection: Ultralytics YOLOv8
  • Segmentation: Meta SAM ViT-B
  • Classification: ConvNeXt Tiny (Facebook AI)
  • NLP: Custom beam search + SRL pipeline
  • AR: Unity ARFoundation + ARCore
  • UI: Streamlit, React (desktop launcher)
  • Backend: FastAPI, ngrok

License

This project is licensed under the MIT License — see LICENSE.

Citation

If you use this work in your research, please cite:

@misc{ai_pharaoh_2026,
  title={AI Pharaoh: An Integrated AI Platform for Ancient Egyptian
         Heritage Interpretation},
  author={AI Pharaoh Team},
  school={October University for Modern Sciences and Arts (MSA)},
  year={2026}
}

About

AI Pharaoh is an AI-powered cultural heritage platform that combines Computer Vision, Natural Language Processing, and Augmented Reality to automatically recognize Egyptian monuments, interpret hieroglyphic inscriptions, and provide interactive educational experiences through a multi-stage intelligent pipeline.

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors