Inspiration
A fixed traffic-signal cycle cannot react intelligently to every change in demand. An ambulance may reach an intersection while its approach is red, while another approach has little traffic. We wanted to explore a controller that responds to queue conditions and treats emergency passage as a priority, while keeping its decisions visible and testable.
What it does
SirenSync AI simulates a four-way intersection with North, East, South and West approaches. Vehicle arrivals are generated under several demand patterns: mixed traffic, north–south rush, east–west rush, bursty demand and high density. A Double-DQN policy chooses ordinary signal hold/switch behavior based on queue and phase observations. A separate emergency-priority layer requests preemption when an ambulance is detected on the opposing phase. A signal-safety layer enforces minimum and maximum green times and a one-step all-red clearance interval. The interactive Streamlit application visualizes the road, signal states, vehicles, approach queues and AI decision trace. Users can select a controller, change the traffic pattern, run the simulation automatically or step it manually, dispatch an ambulance from any direction, and run a fresh benchmark.
How we built it
We built a custom Python intersection environment and represented each observation with 13 features: four directional queues, current phase, phase age, ambulance approach and ambulance waiting time. We implemented a Double Deep Q-Network in PyTorch with a replay buffer and target network. The model is warm-started using examples from a transparent queue/emergency expert policy and then fine-tuned through reinforcement-learning episodes in the simulator.
The AI policy is paired with a deterministic safety layer. The environment—not the neural network—enforces normal minimum green (5 simulation steps), emergency minimum green (3 steps), maximum green (22 steps) and an all-red clearance step. This makes the emergency-priority and transition constraints explicit.
The frontend is built with Streamlit and Plotly. NumPy generates synthetic arrivals, and Pandas supports benchmark reporting.
Challenges we ran into
Balancing ordinary queue reduction with emergency priority required care: a controller should not switch away from an approach that is already serving an ambulance, and a signal transition needs an all-red clearance interval. We separated the priority and safety rules from the learned policy so those constraints remain explicit. We also evaluated the learned policy against a queue-responsive baseline rather than relying only on a weak fixed-time comparison.
Accomplishments that we're proud of
- Built an interactive four-way traffic simulation instead of a static analytics-only dashboard.
- Implemented and trained a Double-DQN policy in a custom Python environment.
- Added an inspectable emergency-priority layer and signal transition constraints.
- Compared three controllers across four demand profiles using matched random seeds.
- Included trained weights, raw benchmark outputs, safety tests and reproducible setup instructions.
What we learned
A learning-based controller should be compared with a strong, transparent baseline. A neural network alone is not a safety mechanism, so priority and signal-transition constraints should be independently enforced. Simulation results are useful for prototyping, but they must be described with their limits and must not be presented as real-world impact evidence.
What's next for SirenSync AI
Future work could add turning movements, pedestrian phases, realistic lane geometry, sensor uncertainty, calibrated local traffic data, multi-intersection coordination and evaluation in a validated traffic simulator. Any real-road deployment would require transport-engineering review, certified signal hardware and supervised field validation.
Important limitation statement
SirenSync AI is a hackathon research prototype using synthetic traffic. It is not a live traffic service and must not be connected to public-road signal infrastructure. Its simulation does not establish real-world reductions in traffic delay or ambulance response time.