Inspiration
Emergency vehicles often have to move through busy intersections where traffic conditions can change quickly. Information may come from different places, such as an operator, traffic counts, signal status, or a camera image. I wanted to explore how generative AI and multimodal AI could help organize this information and make an emergency traffic situation easier to understand. The goal of EmergencyAI is not to automatically control traffic signals, but to provide a simple decision-support tool that helps a human operator understand the situation.
What it does
EmergencyAI allows a user to create a simulated emergency traffic scenario by entering information such as emergency vehicle type, approach direction, distance and speed, current signal phase, weather and road conditions. The application calculates the emergency vehicle's estimated arrival time locally in Python and visualizes the intersection. Gemini then analyzes the scenario and produces a structured assessment including the traffic level, key concerns, and situation summary. The user can also upload a traffic image. Gemini analyzes the image for traffic density, congestion, pedestrians, road conditions, weather/visibility, possible obstructions, and uncertainty. EmergencyAI can then combine the operator-entered scenario with the image observations to create a more contextual analysis while keeping the two information sources separate. Users can also ask EmergencyAI follow-up questions about the current situation. Finally, the application can generate a downloadable incident summary from the existing scenario and analysis.
How we built it
I built EmergencyAI in Python using Streamlit for the web interface. The project uses the Google Gemini API for structured emergency traffic scenario analysis, traffic-image understanding, combined reasoning using scenario data and image observations, and contextual follow-up questions Deterministic calculations, such as emergency vehicle ETA. The incident report is also generated locally from the existing structured data.
Challenges we ran into
One of the main challenges was managing Gemini API rate limits during development. I also had to handle API errors such as temporary service availability errors and quota limits without losing the current scenario. Another challenge was combining image observations with manually entered information correctly. I wanted the application to distinguish between what the operator entered and what Gemini could actually observe in the image. For example, an operator may report that an ambulance is approaching, while the uploaded image may not clearly show an emergency vehicle. EmergencyAI keeps both sources separate and identifies information that may need human verification.
Accomplishments that we're proud of
I am happy that the application can use Gemini in several different ways within one workflow instead of using it only as a chatbot. EmergencyAI can analyze structured scenario data, understand a traffic image, combine the two sources, identify uncertainty, and answer questions using the current context. I also reduced unnecessary API usage by performing ETA calculations and incident-report generation locally.
What we learned
This project helped me better understand multimodal generative AI, structured Gemini responses, Streamlit session state, and API rate limits.
What's next for EmergencyAI
The current version uses simulated scenarios and uploaded traffic images. Future versions could explore live traffic feeds, richer traffic data sources, historical incident information, and improved visualization.
Log in or sign up for Devpost to join the conversation.