Inspiration
We called the Champaign Illinois fire department and asked them what their biggest concern was when responding to an emergency. Immediately, they told us one thing, the scariest thing about being a fire fighter is going into a building blind, having no clue where a fire is and how they can navigate a house. Our solution uses Matterport and costar home data to fill that gap.
What it does
Our solution uses Matterport and Costar data to find the layout and materials of a house. From there we run 10 fire simulations in parallel using multithreading and a lock-free queue. Each simulation of the fire reacts with the objects in the house, and allows us to simulate a real burning scenario with incredible accuracy. From there we simulate human behavior of the occupants in the house, as well as how a firefighter would enter a building to put out a fire and carry out people in danger. This allows us to generate accurate heat maps which can direct real firefighters of where the most likely danger sites are an how to approach the emergency situation before they get there.
How we built it
We start with a Matterport scan, which is one solid surface, meaning we don't have objects to run simulations on. We used classical 3D computer vision and computational geometry to construct a custom-made intermediate representation in Rust for efficient computation. We have a separate simulation component powered by a hybrid Rust and CFAST engine (state of the art fire physics model). To estimate which areas are most exposed to fire, we let an AI agent interact with our engine to run an ensemble of scenarios with different ignition points and occupant layouts. Each cell's score is its expected burning time across the ensemble, which is an empirical estimate of where fire tends to reach and how long it stays. Every scenario is independent, so this work is embarrassingly parallel. We spread work across CPU cores using multithreading, managed by a lock-free task queue. During each scenario, we simulate occupants and firefighters using dynamic A* and multi-source Dijkstra routing, incorporating alarm perception, pre-movement delays, congestion, and rerouting behavior informed by NIST human-behavior research. We also aggregate over our simulations to find which fire pattern is most probable. Then we calculate the optimal route for the firefighter and display the path as an interactive video.
Challenges we ran into
Fire behavior - making the fire behave accurately, this is something that is very widely studied, but it's behavior is always very unpredictable. There are many different factors that might cause a fire to spread, and it is extremely difficult to simulate them all. Using CFAST we managed to get a very accurate picture of what a house fire can look like. Speed - there is an extreme amount of calculations that we have to perform from custom made graph traversal algorithms, simulating in four dimensions(x, y, z, AND time) Hitboxes - getting the furnished scene, and allowing the furniture that we got from Matterport images and being able to have them interact with our simulated environment to prevent collisions/overlap and allowing them to catch on fire Visual effects - Fire and water are constantly moving and semi-transparent, making them difficult to represent using ordinary 3D models. We wrote custom GLSL shaders that utilize GPUs along with 3D density fields, procedural noise, and ray marching to create volumetric flames and pressurized hose streams. The biggest challenge was making these effects look realistic while remaining fast enough to render multiple simulations simultaneously.
Accomplishments that we're proud of
Real World Impact - We're extremely proud that we made something actually useful for our local fire department to fill a need that they asked for. Simulation Strength - we're also proud to have physically accurate fire predictions and psychologically accurate human movement predictions. Simulation Speed - We’re also proud that we can run 10 computationally expensive fire and evacuation scenarios in parallel, rank them by relevance, and display the most important results in under 20 seconds.
What we learned
We learned how to simulate fire physics accurately and in a computationally efficient manner. We also learned how to write shaders for the visual effects. We learned how to run multiple different scenarios to find likely outcomes and converge upon the best solutions using strong heuristics.
What's next for Agni
We plan on continuing our work with the Champaign, IL fire department where we can hopefully give them this technology as a way of being able to increase their preparedness as they respond to emergencies. We will continue to work to make our project more accurate and relevant to firefighters daily lives.
Peri track info
We called the Champaign fire department (address: 307 S Randolph St, Champaign, IL 61820; phone number: (217) 403-7200). We called Jeremy Mitchell, the Deputy Fire Marshall of the Champaign fire department. Here's a video link of us talking to him (unfortunately, the beginning portion cut off): https://youtube.com/shorts/oyWyggz5cFk