Interactive pothole mapping & monitoring dashboard with real-time AI inference
π Live Web App: Try It Now! π
This repository is part of a two-component system for pothole tracking and classification:
| Repository | Description |
|---|---|
| ML-PotholeClassification-IAI | π§ ML Pipeline β Model training, dataset preparation, and ONNX export |
| PotholeTrackApp-MLClassifier | πΊοΈ This repo β Web application with interactive map, pothole visualization, and real-time inference |
PotholeTrack is a Progressive Web Application (PWA) that provides municipalities and infrastructure teams with an intelligent road monitoring system. The application processes uploaded road imagery through a two-stage ML pipeline:
- Detection Stage: YOLOv9-seg instance segmentation identifies and localizes potholes
- Severity Stage: YOLO11n classifier categorizes each detection into Low/Medium/High severity bands aligned with ASTM D6433 standards
The trained models are deployed via ONNX Runtime for efficient CPU inference, enabling real-time processing without GPU requirements.
- AI-Powered Detection: Two-stage YOLOv9-seg + YOLO11n pipeline for detection and severity classification
- Interactive Mapping: Google Maps integration with color-coded severity markers (π΄ High, π Medium, π’ Low)
- GPS Auto-Extraction: Automatically reads coordinates from image EXIF metadata
- Status Tracking: Mark potholes as active or fixed with real-time dashboard updates
- CSV Export: Download filtered or complete datasets for reporting and analysis
- Mobile-Optimized PWA: Install on devices for offline-capable access with responsive design
- Re-Analysis: Rerun detection on uploaded images as models improve
| Metric | Value |
|---|---|
| Precision | 0.80 |
| Recall | 0.70 |
| mAP@50 | 0.76 |
| mAP@50-95 | 0.37 |
| Training | 52 epochs |
| Metric | Value |
|---|---|
| Top-1 Accuracy | 0.76 |
| Classes | Low, Medium, High |
| Training | 28 epochs |
For model training details and methodology, see the ML-PotholeClassification-IAI repository.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β React Frontend (PWA) β
β Google Maps β’ Filter Panel β’ Stats Dashboard β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Express.js Backend β
β Drizzle ORM β’ Image Storage β’ REST API β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βββββββββββββββ΄ββββββββββββββ
βΌ βΌ
βββββββββββββββββββββββββββββ βββββββββββββββββββββββββββββββββββββ
β PostgreSQL (Neon) β β Python FastAPI Service β
β Images β’ Detections β β YOLOv9-seg + YOLO11n-cls ONNX β
βββββββββββββββββββββββββββββ βββββββββββββββββββββββββββββββββββββ
Frontend:
- React 18 + TypeScript + Vite
- TanStack Query (server state)
- Tailwind CSS + shadcn/ui
- Google Maps JavaScript API
Backend:
- Node.js + Express
- Drizzle ORM + Neon PostgreSQL
- TypeScript with ES modules
AI/ML Service:
- Python FastAPI + Uvicorn
- ONNX Runtime for inference
- Ultralytics model format
- Node.js 18+
- Python 3.10+
- PostgreSQL database
- Google Maps API Key (Get one here)
# Clone the repository
git clone https://github.com/RedLynx101/PotholeTrackApp-MLClassifier.git
cd PotholeTrackApp-MLClassifier
# Install Node.js dependencies
npm install
# Install Python dependencies
pip install -r python_service/requirements.txt
# Configure environment variables
cp env.example .env
# Edit .env with your API keys and database URL# Start both services (Node.js + Python)
npm run devThis starts:
- Express server (frontend + API) on port 5000
- Python YOLO service on port 8000
Run the entire stack with Docker Compose:
# Configure environment
cp env.example .env
# Edit .env with your credentials
# Build and start
docker compose up --build -d
# View logs
docker compose logs -f web
docker compose logs -f ml
# Stop services
docker compose down| Container | Description | Port |
|---|---|---|
web |
Express/Vite frontend + API | 5000 |
ml |
Python ONNX inference service | 8000 |
| Variable | Description | Required |
|---|---|---|
VITE_GOOGLE_MAPS_API_KEY |
Google Maps JavaScript API key | β |
DATABASE_URL |
PostgreSQL connection string | β |
SESSION_SECRET |
Express session secret | β |
PYTHON_SERVICE_URL |
Override ML service URL | β |
βββ client/ # React frontend (PWA)
β βββ src/
β β βββ components/ # UI components
β β βββ pages/ # Route pages
β β βββ lib/ # Utilities
β βββ index.html
βββ server/ # Express.js backend
β βββ routes.ts # API endpoints
β βββ storage.ts # Database layer
β βββ objectStorage.ts # Image storage
βββ python_service/ # AI inference service
β βββ main.py # FastAPI server
β βββ detector/ # YOLOv9-seg ONNX model
β βββ severity/ # YOLO11n-cls ONNX model
βββ shared/ # Shared TypeScript types
β βββ schema.ts # Database schema (Drizzle)
βββ public/ # Static assets + PWA manifest
| Method | Endpoint | Description |
|---|---|---|
GET |
/api/potholes |
Retrieve all images with detections |
POST |
/api/potholes/upload |
Upload image and run detection |
PATCH |
/api/potholes/:id |
Update image metadata |
PATCH |
/api/potholes/:id/location |
Set GPS coordinates |
POST |
/api/potholes/:id/reanalyze |
Rerun detection pipeline |
| Method | Endpoint | Description |
|---|---|---|
GET |
/api/potholes/stats |
Get detection statistics |
| Method | Endpoint | Description |
|---|---|---|
GET |
/health |
Health check |
POST |
/predict |
Run AI detection pipeline |
Based on ASTM D6433 pavement distress standards:
| Severity | Marker | Description |
|---|---|---|
| High | π΄ Red | Severe hazard, exposed base layers, immediate attention required |
| Medium | π Orange | Moderate damage, visible edge raveling |
| Low | π’ Green | Minor surface distress, minimal traffic impact |
| Fixed | βͺ Gray | Repaired, marked inactive |
Map not loading:
- Verify
VITE_GOOGLE_MAPS_API_KEYis set correctly - Ensure Maps JavaScript API is enabled in Google Cloud Console
Python service not starting:
- Check ONNX models exist in
python_service/detector/andpython_service/severity/ - Verify Python dependencies:
pip install -r python_service/requirements.txt
Database errors:
- Confirm
DATABASE_URLis correct and PostgreSQL is accessible - Run
npm run db:pushto sync schema
This project was developed as part of CMU 95-891: Introduction to Artificial Intelligence (Fall 2025).
Evelynn Chen
Noah Hicks
Yiying Lu
Iteoluwa Ibitoye
This project is licensed under the MIT License - see the LICENSE file for details.
- Ultralytics for the YOLO framework
- Google Maps Platform for mapping services
- shadcn/ui for React components
- MWPD and PothRGBD dataset creators for training data
- ASTM International for the D6433 pavement distress standards
Built with β€οΈ at Carnegie Mellon University