Skip to content

Latest commit

Β 

History

162 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ—ΊοΈ PotholeTrack Web Application

Interactive pothole mapping & monitoring dashboard with real-time AI inference

πŸš€ Live Web App: Try It Now! πŸš€

Node.js 18+ TypeScript React 18 Python 3.10+ License: MIT


🌐 Related Projects

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

πŸ“– Overview

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:

  1. Detection Stage: YOLOv9-seg instance segmentation identifies and localizes potholes
  2. 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.


✨ Features

  • 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

πŸ“Š Model Performance

Detection Model (YOLOv9-seg)

Metric Value
Precision 0.80
Recall 0.70
mAP@50 0.76
mAP@50-95 0.37
Training 52 epochs

Severity Classifier (YOLO11n-cls)

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.


πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    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   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Technology Stack

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

πŸš€ Quick Start

Prerequisites

  • Node.js 18+
  • Python 3.10+
  • PostgreSQL database
  • Google Maps API Key (Get one here)

Installation

# 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

Running Locally

# Start both services (Node.js + Python)
npm run dev

This starts:

  • Express server (frontend + API) on port 5000
  • Python YOLO service on port 8000

🐳 Docker Deployment

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

πŸ”§ Environment Variables

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 ❌

πŸ“ Repository Structure

β”œβ”€β”€ 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

πŸ“ API Endpoints

Images & Detections

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

Statistics

Method Endpoint Description
GET /api/potholes/stats Get detection statistics

Python Service (Internal)

Method Endpoint Description
GET /health Health check
POST /predict Run AI detection pipeline

πŸ“ Severity Classification Schema

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

πŸ› Troubleshooting

Map not loading:

  • Verify VITE_GOOGLE_MAPS_API_KEY is set correctly
  • Ensure Maps JavaScript API is enabled in Google Cloud Console

Python service not starting:

  • Check ONNX models exist in python_service/detector/ and python_service/severity/
  • Verify Python dependencies: pip install -r python_service/requirements.txt

Database errors:

  • Confirm DATABASE_URL is correct and PostgreSQL is accessible
  • Run npm run db:push to sync schema

πŸ‘₯ Team

This project was developed as part of CMU 95-891: Introduction to Artificial Intelligence (Fall 2025).

Evelynn Chen
Noah Hicks
Yiying Lu
Iteoluwa Ibitoye


πŸ“œ License

This project is licensed under the MIT License - see the LICENSE file for details.


πŸ™ Acknowledgments

  • 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

About

A Progressive Web Application (PWA) for detecting, classifying, and tracking potholes using a two-stage machine learning pipeline with YOLOv9 segmentation and YOLOv11 classification.

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages