VisionX is a next-generation traffic optimization system built for Smart India Hackathon 2026. It replaces inefficient fixed-time traffic lights with a Deep Reinforcement Learning (DQN) agent that dynamically manages intersection phases in real-time, reducing total waiting vehicles by over 85%.
This project uses a hybrid OS architecture. The graphical interface and server run on Windows, while the AI training and simulation physics run on WSL (Ubuntu/Linux) for maximum GPU efficiency.
VisionX-Smart-Traffic/
βββ ai_agent/ # PyTorch Model & SUMO Simulation (Run in WSL)
β βββ rl_agent.py # Training script
β βββ run_demo.py # Production script (Used for Pitch)
βββ backend/ # Node.js Data Bridge (Run in Windows PowerShell)
β βββ server.js
βββ frontend/ # React Dashboard (Run in Windows PowerShell)
βββ src/App.jsx
Before running the system, ensure you have the following installed:
| Environment | Requirement |
|---|---|
| Windows | Node.js (v16+) |
| WSL / Linux | Python 3.10+, PyTorch, NumPy, Requests |
| WSL / Linux | Eclipse SUMO (Simulation of Urban MObility) |
Note: Ensure
SUMO_HOMEis added to your WSL environment variables after installing SUMO.
Open a Windows PowerShell or Command Prompt terminal.
cd backend
npm install express cors
Open a second Windows PowerShell terminal.
cd frontend
npm install
npm install -D tailwindcss postcss autoprefixer
Open your WSL / Ubuntu terminal.
cd ai_agent
pip install torch numpy requests traci
β οΈ IMPORTANT: Because the AI agent runs inside WSL and the backend server runs on Windows, you must manually link their IP addresses before running the demo.
ipconfig in Windows PowerShell and copy your IPv4 Address (e.g., 192.168.1.15).ai_agent/run_demo.py and replace the BACKEND_URL variable with your actual IP address:BACKEND_URL = "http://192.X.X.X:3000" # Replace with your IPv4
Launch the three components in this exact order to ensure the backend is ready before the AI begins sending data.
cd backend
node server.js
# Expected Output: π Pro Bridge Active on Port 3000
cd frontend
npm run dev
# Then open http://localhost:5173 in your browser
cd ai_agent
python3 run_demo.py
# Expected Output: π¦ Production Agent Live. Listening for React Overrides...
The SUMO GUI will open automatically. The React Dashboard will instantly sync and begin displaying live traffic data.
Our rigorous TraCI simulation tests prove the superiority of the DQN model:
| Metric | Baseline (30s Fixed Cycle) | VisionX AI |
|---|---|---|
| Max queue per lane | 10+ vehicles | 2β3 vehicles |
| Cumulative wait time | High (cascading jams) | ~85% reduction |
| Adaptability | None | Real-time dynamic |
π See
real_ai_comparison.pngin the repository for the full benchmark data plot.β
| Layer | Technology |
|---|---|
| AI / ML | PyTorch (DQN), TraCI |
| Simulation | Eclipse SUMO |
| Backend | Node.js, Express |
| Frontend | React.js, Tailwind CSS |
| OS Bridge | WSL2 (Ubuntu) + Windows |