Skip to content
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Traffic Signal AI – Prototype

Overview

This repository contains a working prototype of an AI-based traffic signal recommendation system. The prototype analyzes traffic videos and provides signal timing suggestions using computer vision and machine learning.

The objective of this project is to demonstrate feasibility and system design, not production-scale deployment.


What the System Does

  • Accepts a traffic video as input
  • Detects and counts vehicles using a computer vision model
  • Extracts traffic composition features
  • Uses a supervised machine learning model to generate signal timing suggestions
  • Displays results through a simple dashboard interface

Inputs

  • Traffic video (roadside camera footage)
  • Road type (City Street, Highway, Residential)

Outputs

  • Vehicle counts (cars, motorcycles, buses, trucks)
  • Traffic signal timing recommendation

System Design

  • Vehicle detection is performed using a YOLOv8-based computer vision model
  • Traffic frames are processed using OpenCV for video analysis and preprocessing
  • Extracted traffic features are used as input to a trained XGBoost machine learning model to generate signal timing recommendations
  • Hard-coded rule-based logic is intentionally avoided in the final prototype
  • Vehicle speed is excluded, as it cannot be reliably inferred from a single uncalibrated camera

Tech Stack

  • Python
  • YOLOv8 – Vehicle detection
  • OpenCV – Video processing
  • XGBoost – Supervised ML model for signal timing prediction
  • Streamlit – Dashboard UI

My Contributions

  • Implemented the computer vision pipeline for vehicle detection using YOLOv8
  • Processed traffic video streams using OpenCV
  • Extracted traffic features such as vehicle counts and traffic composition
  • Trained and integrated the XGBoost model used for generating traffic signal timing recommendations

How to Run Locally

Install dependencies:

pip install -r requirements.txt

Run the Streamlit application:

python -m streamlit run ui_app.py


Acknowledgements

This project was developed collaboratively by:

  • Kausthuv Narayan Medhi
  • Swapnil Borgohain
  • Dibakar Sarma

About

AI-based traffic signal recommendation prototype using video analysis

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages