Autonomous Road Infrastructure Quality & Statutory Contractual Compliance Engine
Developed for MoRTH (Ministry of Road Transport & Highways), eMARG (PMGSY), and NHAI Defect Liability Audits.
India spends thousands of crores annually on highway construction and maintenance under MoRTH, NHAI EPC Contracts, and the PMGSY (eMARG) scheme. However:
- Defects go unpenalized because manual inspections are slow, subjective, and corruptible.
- Contractors escape liability during the statutory 5-Year / 10-Year Defect Liability Period (DLP).
- Potholes are repeatedly counted, inflating repair estimates and municipal budgets.
PathGuard-AI solves this end-to-end:
- πΉ Detects Road Damage: Runs real-time computer vision on dashcam video uploads or live camera streams.
- π Measures True Physical Geometry: Computes true width (
$W_{cm}$ ), length ($L_{cm}$ ), depth ($D_{cm}$ ), and volume ($V_{m^3}$ ) of each defect. - π Live Web Road Detection: Uses real-time OpenStreetMap reverse geocoding to identify the exact road, jurisdiction, and pavement standard from GPS coordinates.
- π’ Auto-Matches Contractors: Automatically identifies the responsible contractor, contract ID, compliance email, and active DLP expiry.
- π Uber H3 & PostGIS Deduplication: Snaps defects to Uber H3 hexagons (
Res 11corridor &Res 12defect) and performs spatial radius deduplication (ST_DWithin 3m) on Supabase Cloud. - βοΈ Automates Legal Liability: Generates legally binding Statutory Notices of Liability under Clause 17 with a 14-day cure period and estimated repair costs calculated using MoRTH Schedule of Rates (SOR βΉ/mΒ³).
flowchart TD
subgraph Input["1. Multi-Modal Ingestion"]
A["Dashcam Video Upload (.mp4 / .mov)"]
B["Live USB Webcam Feed"]
C["Synthetic Highway Simulation"]
end
subgraph Intelligence["2. Web & Geospatial Intelligence"]
D["GPS Telemetry / Lat-Lon Coordinates"]
E["OpenStreetMap Nominatim Live API"]
F["Uber H3 Hexagonal Grid (Res 11 & 12)"]
end
subgraph Vision["3. Deep Vision & Geometry"]
G["Ultralytics YOLOv8s Neural Network"]
H["Adaptive Classical CV Contour Engine"]
I["Physical Depth (cm) & Volume (mΒ³)"]
end
subgraph Contract["4. Contractual Compliance"]
J["eMARG / NHAI Contractor Registry"]
K["MoRTH SOR Repair Cost Calculator (βΉ)"]
L["Parametric DLP Aging & Liability Evaluator"]
end
subgraph Cloud["5. Cloud Storage (Supabase)"]
M[("Supabase Cloud PostgreSQL")]
N["PostGIS Spatial Deduplication (ST_DWithin)"]
O["Immutable Audit Trail (ticket_history)"]
end
subgraph UI["6. Bharat Dashboard"]
P["Streamlit In-Car Telemetry UI"]
Q["Pydeck 3D Hexagonal Spatial Grid"]
R["Statutory Clause 17 Notice Generator"]
end
Input --> Vision
Intelligence --> Contract
D --> E
E --> J
D --> F
Vision --> I
I --> K
F --> N
K --> L
J --> L
L --> Cloud
N --> M
Cloud --> UI
M --> P
P --> Q
P --> R
π For complete technical and mathematical specifications, see
docs/ARCHITECTURE.md.
Enter any Latitude and Longitude in India (or select from Highway Presets like NH-48, NH-44, or Mumbai-Pune Expressway). The system makes a real-time live call to the OpenStreetMap Web API to auto-resolve:
- Real road name (e.g.
Delhi-Gurugram Expressway) - District & State jurisdiction (e.g.
Gurugram, Haryana) - Pavement standard (Flexible Bituminous Asphalt vs Rigid Concrete)
Automatically matches the road section against the national highway registry:
- Assigns the responsible contractor (e.g.
L&T Infrastructure Engineering Ltd,Navayuga Engineering,IRB Infrastructure) - Resolves the official contract ID, contractor compliance email, and statutory DLP expiry date.
- Supports direct drag-and-drop of
.mp4,.mov, and.avidashcam videos. - Processes frames in real-time with dual-engine AI:
- YOLOv8 Deep Neural Network trained on the 665-image Roboflow Pothole dataset.
- Adaptive Classical CV Fallback for guaranteed execution across any hardware.
- Zero local database hassle: Fully migrated away from Docker and local VMs to Supabase Cloud.
- Spatial Deduplication: Uses PostGIS
ST_DWithin(geom, 3.0 meters)to ensure potholes driven over multiple times are merged into a single master ticket instead of duplicated.
- Automatically generates formal Notice of Liability documents citing Clause 17.
- Computes repair liability in Indian Rupees (βΉ) using government Schedule of Rates (SOR).
- Establishes a 14-business-day statutory cure deadline before authorizing third-party repair against performance bank guarantees.
PATH_GUARD/
βββ config/ # Configuration files
β βββ default_config.yaml # Default system settings (DLP rules, SOR rates, camera)
β βββ supabase_config.yaml # Supabase connection template
βββ data/ # Dataset storage
β βββ pothole_dataset.yaml # Roboflow YOLOv8 665-image dataset configuration
β βββ Pothole.v1-raw.yolov8# Train / Validation / Test images & labels
βββ docs/ # Documentation
β βββ ARCHITECTURE.md # System architecture, sequence diagrams & formulas
β βββ pathguard_implementation_plan.pdf
βββ pathguard/ # Core Python Engine
β βββ __init__.py
β βββ config.py # Config loader with .env and environment variable overrides
β βββ vision.py # Module 1: Enhanced Vision Pipeline (YOLOv8 + Classical CV)
β βββ spatial.py # Module 2: Uber H3 Geospatial Indexing
β βββ geocoding.py # Module 2: Live OpenStreetMap Reverse Geocoding & Contractor Resolver
β βββ database.py # Module 2: PostGIS Deduplication Engine & Supabase Client
β βββ contracts.py # Module 3: DLP Aging & Wear-vs-Workmanship Engine
β βββ notices.py # Module 4: Statutory eMARG Notice Dispatcher
β βββ pdf_ingest.py # Tender document ingestion (PyMuPDF)
β βββ gps_relay.py # GPS interface (Simulated & NMEA hardware)
β βββ ml/ # Machine Learning subsystem (trainer, depth, datasets)
βββ dashboard.py # Streamlit Bharat Edition Live Dashboard
βββ main_engine.py # Headless CLI orchestration pipeline
βββ train.py # ML training CLI
βββ .env.example # Template for Supabase credentials
βββ pyproject.toml # Project metadata
βββ requirements.txt # Python dependencies
βββ README.md # Project documentation
Clone the repository and install dependencies in Python 3.11:
# Clone the repository
git clone https://github.com/monishchaparla/PathGuard-AI.git
cd PathGuard-AI
# Create virtual environment
python -m venv venv
.\venv\Scripts\Activate.ps1
# Install dependencies
.\venv\Scripts\python -m pip install -r requirements.txt- Sign up for free at supabase.com and create a new project.
- In the Supabase SQL Editor, run the SQL commands from
scripts/init_db.sql. - Copy your project connection URI from Project Settings β Database β Connection string (URI).
- Copy
.env.exampleto.envand paste your credentials:(Note: You can also enter and test your Supabase credentials directly through the dashboard UI sidebar!)DATABASE_HOST=db.yourprojectref.supabase.co DATABASE_PORT=5432 DATABASE_NAME=postgres DATABASE_USER=postgres DATABASE_PASSWORD=YourDatabasePassword DATABASE_SSLMODE=require SUPABASE_URL=https://yourprojectref.supabase.co
.\venv\Scripts\python -m streamlit run dashboard.pyOpen http://localhost:8501 in your browser.
| ID | Defect Classification | IRC Specification | Typical DLP Remedy |
|---|---|---|---|
| 0 | Pothole | IRC:82-2015 Β§3.1 | Mill & Patch with Bituminous Concrete (BC) |
| 1 | Longitudinal Crack | IRC:82-2015 Β§3.2 | Polymer-modified asphalt crack sealing |
| 2 | Transverse Crack | IRC:82-2015 Β§3.3 | Routing and hot-applied rubberized sealant |
| 3 | Alligator Cracking | IRC:82-2015 Β§3.4 | Structural base failure: Full-depth excavation |
| 4 | Rutting | IRC:82-2015 Β§3.5 | Surface micro-milling & Dense Bituminous Macadam |
| 5 | Raveling | IRC:82-2015 Β§3.6 | Bituminous slurry seal / Fog seal |
| 6 | Defective Patching | IRC:82-2015 Β§3.7 | Complete edge-cut milling and re-laying |
- MoRTH Standard EPC Agreement (Clause 17):
- Mandates a 5-Year Defect Liability Period (DLP) for Bituminous Flexible Pavements.
- Mandates a 10-Year DLP for Rigid Cement Concrete Pavements.
- Authorizes issuing a formal notice with a 14-business-day cure period.
- eMARG (electronic Maintenance of Rural Roads under PMGSY):
- Requires mandatory geo-tagged condition surveys during the 5-year maintenance period.
- CPWD General Conditions of Contract (Clause 17 & 35):
- 1-Year maintenance liability for urban civil and municipal roadway works.
- Monish Chaparla (@monishchaparla)
- Hasini Priya (@Hasini-priya)
- Mamatha Malapati (@Malapati-mamatha-9719)
- Likhitha (@likhitha7815-gif)
Developed for the Student AI & Smart Cities Hackathon. All rights reserved.