← all work

Traffic Digital Twin

A city-scale traffic digital twin: computer vision, graph neural networks, and reinforcement learning that watch real intersections, predict congestion, and optimize signal timings.

  • YOLOv8
  • PyTorch Geometric
  • Reinforcement learning
  • Streamlit
  • SQLAlchemy
// key result

Models Varanasi's Lanka → BHU Gate → Assi → Sigra corridor as a live, optimizable digital twin.

An exploratory project that builds a digital twin of urban traffic, a live, data-driven model of real intersections you can run experiments on. It’s an end-to-end pipeline, from camera feed to signal recommendation, focused on the Varanasi Lanka corridor (Lanka Chowk → BHU Gate → Assi → Sigra).

The pipeline, four stages

  1. Vehicle detection. YOLOv8 processes traffic-camera feeds to detect vehicles and measure density; a Kalman tracker stitches detections across frames.
  2. Traffic graph. Intersections and roads are modeled as a directed graph (NetworkX → PyTorch Geometric).
  3. Congestion prediction. A custom Spatial-Temporal GCN (STGCN) forecasts flow across the network.
  4. Signal optimization. A PPO reinforcement-learning agent recommends signal-timing adjustments to reduce congestion.

Everything is persisted through SQLAlchemy and surfaced in a Streamlit + Plotly dashboard. It’s the project where computer vision, graph learning, and control all have to work together, exactly the kind of systems problem I like.

Source on GitHub →