AI-powered traffic prediction map for Tunisia. Predicts road congestion using XGBoost trained on 8.5M rows across all 24 governorates. Built with Leaflet.js, OSRM, FastAPI. 84.92% accuracy. First tool of its kind for the Tunisian road network. 100% free stack.
# 🇹🇳 Tunisia AI Traffic Map
### AI-Powered Traffic Congestion Prediction & Route Optimization for Tunisia
**A machine learning system that predicts road congestion levels across all 24 Tunisian governorates and recommends optimized routes using geospatial intelligence and a custom-trained traffic model.**
---
## 📌 Project Overview
**Tunisia AI Traffic Map** is an end-to-end machine learning system that predicts road congestion levels and recommends optimized routes across Tunisia. It combines geospatial data processing, road network analysis, traffic simulation, and gradient-boosted classification into a deployed, publicly accessible service.
Commercial navigation platforms such as Google Maps and Waze rely on massive volumes of proprietary, crowd-sourced GPS data to power their congestion models — data that is largely unavailable for a country like Tunisia. This project investigates a different approach: instead of depending on data that does not exist, it engineers a domain-specific dataset from open geospatial sources and a custom traffic simulation engine, then trains a supervised model on top of it.
The result is a system that produces congestion predictions and route recommendations for locations spanning all 24 Tunisian governorates, from dense urban centers to rural and remote road networks.
---
## 🚦 Problem Statement
Traffic prediction systems typically depend on large-scale, continuously updated data sources — historical GPS traces, live telemetry from millions of devices, and dense sensor networks. These prerequisites create a structural barrier for smaller markets:
- **Data scarcity** — Tunisia does not have the volume of real-time GPS or telemetry data that commercial platforms rely on.
- **Coverage gaps** — Existing tools concentrate prediction quality in major cities, with degraded or absent coverage in smaller towns and rural areas.
- **Local traffic behavior is underrepresented** — patterns specific to Tunisia (e.g. Friday pr …