Egyptian Museum Artifact Detection is an innovative AI-powered application that revolutionizes museum experiences by combining computer vision, natural language processing, and interactive learning. Built for the Egyptian Museums, this platform enables visitors to instantly identify and learn about 84 iconic Egyptian artifacts through smartphone camera scanning or text search.
Upload an image โ AI detects artifact โ Receive historical context
Search Egyptian artifacts โ Browse results โ Explore cultural significance


graph LR
A[User] -->|Upload Image| B[Next.js Frontend]
B -->|POST /api/detect| C[Next.js API Route]
C -->|Forward Image| D[FastAPI Backend]
D -->|YOLO Inference| E[YOLOv8 Model]
E -->|Artifact ID| D
D -->|Detection Result| C
C -->|Fetch Context| F[Groq AI]
F -->|Historical Analysis| C
C -->|Combined Response| B
B -->|Display Result| A
| Metric | Value |
|---|---|
| Model | YOLOv8m |
| Classes | 84 Egyptian artifacts |
| Training Images | 5,000+ (augmented) |
| Validation mAP@0.5 | 89.3% |
| Validation mAP@0.5:0.95 | 72.1% |
| Inference Time (GPU) | ~25ms |
| Inference Time (CPU) | ~180ms |
| Model Size | 52.9 MB |
git clone https://github.com/nouran25/Egyptian-Museum-Artifact-Detection.git
cd Egyptian-Museum-Artifact-Detection
# Navigate to backend
cd backend
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Download model (or place your trained model)
# Place 'best.pt' in backend/ directory
# Start server
python main.py
Backend will run at: http://localhost:8000
# Navigate to frontend (or project root)
cd ..
# Install dependencies
npm install
# Create environment file
cp .env.example .env.local
# Add your API keys
# Edit .env.local:
GROQ_API_KEY=your_groq_api_key_here
YOLO_BACKEND_URL=http://localhost:8000/detect-artifact
NEXT_PUBLIC_BASE_URL=http://localhost:3000
# Start development server
npm run dev
Frontend will run at: http://localhost:3000
.env.localGROQ_API_KEY=gsk_xxxxxxxxxxxxx
YOLO_BACKEND_URL=http://localhost:8000/detect-artifact
NEXT_PUBLIC_BASE_URL=http://localhost:3000
MODEL_PATH=best.pt
CONFIDENCE_THRESHOLD=0.5
# Detect artifact from image
curl -X POST http://localhost:8000/detect-artifact \
-F "file=@/path/to/artifact-image.jpg"
# Response
{
"artifact_id": "Mask of Tutankhamun",
"confidence": 0.956,
"class_id": 36,
"detections_count": 1
}
/detect-artifactDetect artifact in uploaded image
Request:
Content-Type: multipart/form-data
file: File (image/jpeg, image/png)
Response:
{
"artifact_id": "Sphinx of Hatshepsut",
"confidence": 0.923,
"class_id": 16,
"detections_count": 1
}
/model-infoGet model configuration and available classes
Response:
{
"loaded": true,
"num_classes": 84,
"confidence_threshold": 0.5,
"total_artifacts": 84
}
/artifactsList all detectable artifacts
Response:
{
"artifacts": [
{"class_id": 0, "artifact_name": "Akhenaten"},
{"class_id": 1, "artifact_name": "Amenhotep III"}
],
"total": 84
}
/api/detectCombined detection and analysis
Request:
Content-Type: multipart/form-data
file: File
Response:
{
"artifact_id": "Statue of Khufu",
"confidence": 0.91,
"analysis": "The Statue of Khufu represents...",
"success": true
}
/api/analyseGet AI-generated cultural analysis
Request:
{
"artwork": {
"title": "Sphinx of Hatshepsut",
"culture": "Egyptian",
"objectDate": "ca. 1479โ1458 B.C."
}
}
Response:
{
"data": "The Sphinx of Hatshepsut is a remarkable...",
"success": true,
"model_used": "llama-3.3-70b-versatile"
}
Egyptian-Museum-Artifact-Detection/
โโโ app/ # Next.js app directory
โ โโโ page.tsx # Homepage
โ โโโ scan/
โ โ โโโ page.tsx # Artifact scanning page
โ โโโ search/
โ โ โโโ page.tsx # Artifact search page
โ โโโ api/
โ โโโ detect/route.ts # Detection API route
โ โโโ analyse/route.ts # AI analysis route
โโโ backend/
โ โโโ main.py # FastAPI application
โ โโโ best.pt # YOLOv8 trained model
โ โโโ requirements.txt # Python dependencies
โโโ components/ # Reusable React components
โโโ lib/ # Utility functions
โ โโโ museumAPI/
โ โโโ index.ts # API client
โ โโโ types.ts # TypeScript types
โโโ public/ # Static assets
โโโ assets/ # README assets (screenshots, diagrams)
โโโ model_training/ # Training scripts and results
โโโ .env.local # Environment variables (local)
โโโ next.config.js # Next.js configuration
โโโ tailwind.config.js # Tailwind CSS configuration
โโโ package.json # Node.js dependencies
โโโ README.md # This file
Our model was trained on a custom dataset of Egyptian artifacts:
from ultralytics import YOLO
# Load pretrained model
model = YOLO('yolov8m.pt')
# Train on custom dataset
results = model.train(
data='data.yaml',
epochs=150,
imgsz=640,
batch=16,
patience=50,
name='egyptian_artifacts'
)
# Validate
metrics = model.val()
# Export
model.export(format='onnx')
data.yaml)path: ../dataset
train: train/images
val: valid/images
test: test/images
nc: 84 # number of classes
names: [
'Akhenaten',
'Amenhotep III',
'Mask of Tutankhamun',
# ... 81 more artifacts
]
# Install Vercel CLI
npm i -g vercel
# Deploy
vercel --prod
# Set environment variables in Vercel dashboard
# Install Railway CLI
npm i -g @railway/cli
# Deploy
railway up
# Configure environment
railway variables set MODEL_PATH=best.pt
# Backend Dockerfile
FROM python:3.10-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .
EXPOSE 8000
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
# Frontend tests
npm test
# Backend tests
cd backend
pytest tests/
# End-to-end tests
npm run test:e2e
We welcome contributions! Hereโs how you can help:
git checkout -b feature/amazing-featuregit commit -m 'Add amazing feature'git push origin feature/amazing-featureThis project is licensed under the MIT License - see the LICENSE file for details.
MIT License
Copyright (c) 2024 Egyptian Museum Artifact Detection Team
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction...