Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚦 TrafficVision Pro: Smart Event-Aware Traffic Management System

An AI-powered traffic incident management platform that predicts incident severity, estimates resolution time, identifies traffic hotspots, and recommends optimal resource deployment for smarter traffic operations.


📌 Overview

TrafficVision Pro leverages Machine Learning, Geospatial Analytics, and Interactive Dashboards to help traffic authorities respond faster and make data-driven decisions.

The system analyzes historical traffic incident data to:

  • Predict incident severity
  • Estimate clearance time
  • Detect traffic hotspots
  • Calculate traffic impact scores
  • Recommend deployment of personnel and resources
  • Visualize traffic patterns through an interactive dashboard

🎯 Problem Statement

Urban traffic management faces several challenges:

  • Increasing road accidents and vehicle breakdowns
  • Delayed emergency response
  • Inefficient resource allocation
  • Lack of predictive decision support
  • Difficulty identifying recurring congestion hotspots

These issues lead to:

  • Traffic congestion
  • Increased travel time
  • Economic losses
  • Reduced public safety

🚀 Key Features

🤖 AI-Based Severity Prediction

Predicts incident severity levels:

  • Low
  • Medium
  • High
  • Critical

using historical traffic incident patterns.

⏱ Resolution Time Estimation

Predicts the expected time required to clear an incident and restore normal traffic flow.

📊 Impact Assessment Engine

Calculates a traffic impact score based on:

  • Predicted severity
  • Estimated clearance time
  • Road closure requirements

Impact Score Range: 0 - 100

🚓 Resource Recommendation System

Automatically recommends:

  • Traffic officers
  • Barricades
  • Tow trucks
  • Operational instructions

to support rapid incident response.

🔥 Hotspot Detection

Uses DBSCAN clustering to identify:

  • Accident-prone zones
  • Congestion hotspots
  • High-risk locations

through geographic analysis.

📈 Advanced Analytics Dashboard

Provides:

  • Incident volume trends
  • Event cause analysis
  • Severity distribution
  • Feature importance analysis
  • Geographic hotspot visualization

🏗 System Architecture

Traffic Incident Dataset
           │
           ▼
   Data Processing
           │
           ▼
 Feature Engineering
           │
 ┌─────────┴─────────┐
 │                   │
 ▼                   ▼

Severity Model   Resolution Model
(CatBoost)       (CatBoost)

 │                   │
 └─────────┬─────────┘
           ▼

Recommendation Engine
           │
           ▼

 Hotspot Detection
    (DBSCAN)
           │
           ▼

 Streamlit Dashboard

📂 Project Structure

TrafficVision-Pro/
│
├── data/
│   ├── raw/
│   └── processed/
│
├── models/
│   ├── severity_model.cbm
│   └── resolution_model.cbm
│
├── reports/
│   ├── severity_importance.csv
│   ├── resolution_importance.csv
│   ├── top_hotspots.csv
│   └── data_summary.csv
│
├── src/
│   ├── data_processing.py
│   ├── train_model.py
│   ├── recommendation_engine.py
│   ├── hotspot_detection.py
│   └── utils.py
│
├── dashboard/
│   └── app.py
│
├── requirements.txt
│
└── README.md

📊 Dataset Information

Metric Value
Total Records 2404
Data Type Traffic Incidents
Features 40+ Attributes
Domain Smart Traffic Management

Key Attributes

  • Event Category
  • Event Cause
  • Priority Level
  • Zone
  • Junction
  • Corridor
  • Vehicle Type
  • Latitude
  • Longitude
  • Resolution Time
  • Road Closure Status

⚙ Data Processing Pipeline

Data Cleaning

  • Duplicate removal
  • Missing value handling
  • Date-time conversion
  • Outlier removal

Feature Engineering

Generated Features:

  • Hour of occurrence
  • Day of week
  • Month
  • Peak-hour indicator
  • Zone incident density
  • Junction density
  • Historical average resolution times

🤖 Machine Learning Models

Severity Prediction Model

Algorithm: CatBoost Classifier

Output Classes:

  • Low
  • Medium
  • High
  • Critical

Resolution Time Prediction Model

Algorithm: CatBoost Regressor

Output:

Estimated Resolution Time (minutes)

Why CatBoost?

  • Handles categorical features efficiently
  • Minimal preprocessing required
  • High performance on tabular datasets
  • Strong predictive accuracy

🔍 Explainable AI

The platform provides Feature Importance Analysis to explain prediction decisions.

Major Influencing Features:

  • Event Cause
  • Police Station
  • Vehicle Type
  • Zone
  • Corridor
  • Hour of Occurrence

Benefits:

  • Transparent predictions
  • Better decision support
  • Increased trust in AI recommendations

🔥 Hotspot Detection

Algorithm Used

DBSCAN (Density-Based Spatial Clustering)

Purpose

Identify:

  • High-density incident clusters
  • Congestion-prone regions
  • Persistent traffic hotspots

Inputs

  • Latitude
  • Longitude

Outputs

  • Hotspot Clusters
  • Incident Density
  • Average Resolution Time

📈 Dashboard Modules

1. Executive Overview

Displays:

  • Total Events Analyzed
  • Mean Resolution Time
  • Active Response Zones
  • Critical Hotspots
  • Severity Breakdown
  • System Status

2. Traffic Analytics

Provides:

  • Incident Volume by Hour
  • Event Cause Distribution
  • Temporal Trends
  • Traffic Pattern Analysis

3. AI Impact Predictor

Allows users to enter:

  • Event Category
  • Priority Level
  • Trigger Cause
  • Affected Zone
  • Occurrence Time
  • Road Closure Requirement

Outputs:

  • Severity Prediction
  • Clearance Time Estimation
  • Impact Score
  • Resource Recommendation

4. Hotspot Explorer

Features:

  • Interactive Heatmap
  • Cluster Visualization
  • Top Hotspots
  • Geographic Analysis

🛠 Technology Stack

Programming

  • Python

Data Processing

  • Pandas
  • NumPy

Machine Learning

  • CatBoost
  • Scikit-learn

Clustering

  • DBSCAN

Visualization

  • Plotly
  • Matplotlib

Mapping

  • Folium
  • Streamlit-Folium

Dashboard

  • Streamlit

📦 Installation

Clone Repository

git clone https://github.com/your-username/TrafficVision-Pro.git

cd TrafficVision-Pro

Create Virtual Environment

python -m venv venv

Activate Environment

Windows:

venv\Scripts\activate

Linux/Mac:

source venv/bin/activate

Install Dependencies

pip install -r requirements.txt

▶ Running the Application

streamlit run dashboard/app.py

Open in browser:

http://localhost:8501

📋 Example Workflow

  1. Open AI Impact Predictor
  2. Enter incident details
  3. Generate prediction
  4. View:
    • Predicted Severity
    • Estimated Clearance Time
    • Impact Score
    • Resource Recommendations
  5. Explore hotspot regions using the map dashboard

📊 Expected Outcomes

✔ Improved incident response planning

✔ Faster traffic clearance

✔ Better resource utilization

✔ Data-driven traffic management

✔ Identification of high-risk zones

✔ Enhanced operational efficiency


🔮 Future Enhancements

  • Real-time traffic API integration
  • Weather-aware predictions
  • CCTV-based accident detection
  • Emergency vehicle routing
  • Traffic signal optimization
  • Mobile application support
  • Live GPS tracking
  • Smart City integration

👥 Team

Developed as part of an AI-driven Smart Traffic Management initiative.


📜 License

This project is intended for academic, research, and demonstration purposes.


⭐ One-Line Summary

TrafficVision Pro is an AI-powered traffic management platform that predicts incident severity, estimates clearance time, identifies hotspots, and recommends optimal resource deployment for smarter and faster traffic operations.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages