Home/Portfolio/Traffic Signal Optimization

Traffic Signal Optimization

A computer vision and traffic analytics project focused on detecting, tracking, and classifying vehicle movement through an intersection in real time. The system uses lane polygons, motion history, and tracker tuning to identify turning and straight-going vehicles accurately, with the long-term goal of supporting adaptive traffic signal timing and congestion reduction.

Key Features

  • Vehicle detection and multi-object tracking across a live intersection video feed.
  • Lane-based classification using custom polygons for straight, left-turn, and right-turn movement.
  • Direction validation with motion vectors, compass-style labels, and lane-specific scoring logic.
  • Tracker tuning pipeline for comparing BoT-SORT, custom BoT-SORT, and ByteTrack performance.
  • Real-time visual overlays for IDs, motion arrows, lane assignment, turn confirmation, and count status.
  • Foundation for future adaptive signal timing based on live traffic flow and lane occupancy.

Screenshots

Traffic signal optimization tracking interface
botsort tracker test
bytetrack tracker test

How It Works

Detect & Track

YOLO identifies vehicles frame by frame while the tracker preserves IDs across motion, overlap, and partial occlusion.

Classify Lane Movement

Custom lane polygons and bottom-center road points determine which part of the intersection a vehicle belongs to and how it should be evaluated.

Score & Optimize

Motion history, turn validation, and direction scoring are used to build accurate lane counts that can later drive adaptive signal logic.

Current Development Focus

Improving ID stability during occlusion and close vehicle overlap.

Fine-tuning BoT-SORT parameters to reduce ID switching and short-lived tracks.

Improving blocker detection when trucks or buses cover adjacent lanes.

Refining turn confirmation logic using lane-aware direction changes.

Building more reliable lane counts for downstream traffic signal decision-making.

Preparing the project for future simulation and optimization experiments.

Tech Stack

PythonOpenCVYOLOUltralyticsBoT-SORTByteTrackNumPyPandasCSV AnalyticsComputer VisionTraffic Analytics