Inspiration

In British Columbia, Los Angeles, and many other places across the globe, wildfires have ravaged the land and put civilians at serious risk. Living in BC and seeing the skies turn grey and hazy from the smoke, I could only imagine what it must be like to face the fire up close. In these kinds of situations, search and rescue efforts can be incredibly dangerous—sometimes too dangerous to carry out safely.

That got me thinking: what if we could use AI to assist in search and rescue operations? Not just for wildfires, but for all sorts of disaster scenarios. That’s what inspired me to build this project.

What it does

I built a Search and Rescue AI Agent that learns to perform rescue operations in a simulated environment. The environment is a simplified version of a real-world scenario—there are wildfires acting as hazards, and a survivor hidden somewhere on the map.

The AI controls a robot that can move around and operate a robotic arm attached to it. It’s equipped with a Ray Perception Sensor to detect obstacles and objects in its surroundings. Over time, it’s learned to:

  • Avoid wildfires
  • Navigate the environment
  • Approach and pick up a survivor
  • Return them safely to a designated safe zone

There’s also an interactive demo where you can move hazards and the survivor to new spots—and the AI will adapt on the fly and still complete the mission.

How I built it

The entire simulation was built in Unity, using Unity ML-Agents for training the AI with reinforcement learning. Specifically, I used Proximal Policy Optimization (PPO)—a reinforcement learning algorithm that helps the AI learn behaviors by trial and error.

In each training episode, the environment is randomized. The AI starts out acting completely randomly—running into fire, spinning in circles—but over time it figures out which actions are rewarded (like exploring new areas, getting closer to the survivor) and which are penalized (like hitting a fire or standing still for too long). After enough training and tuning, it learns to perform full search and rescue operations on its own.

Challenges I ran into

There were a few major challenges that I had to work through.

One was that the AI became too cautious. Early on, it learned that driving into hazards caused big penalties—so it just avoided fire entirely. That might sound good, but sometimes the survivor was right past a fire. The AI wouldn’t even go near it, which meant it couldn’t complete the rescue. I had to tweak the penalty for hitting fire to teach it that sometimes taking a calculated risk is worth it.

Another big issue was with getting the survivor to the safe zone. The AI often spawned far away from the goal, so it never reached it during early training. Because of that, it never learned that reaching the safe zone with the survivor was a good thing. To fix this, I added a reward for exploration—dividing the map into grid cells and rewarding the AI for entering new ones. That got it moving around. But then it started exploring too much and forgot about the actual mission. I eventually trained it in phases: first encouraging exploration, and then removing those rewards and adding a time penalty to teach it to rescue as fast as possible.

Accomplishments I'm proud of

One thing I’m really proud of is that everything the robot does is controlled by AI—and it’s not just one AI. I actually trained three different agents for the different parts of the operation:

  • Discover: Drives the robot to explore, avoid hazards, and locate the survivor
  • Arm: Moves the robotic arm to grab onto the survivor
  • Return: Drives the robot back to the safe zone with the survivor

Breaking it up like this made the training way more manageable and helped make the system more modular and adaptable. Since everything is based on reinforcement learning, it can handle different scenarios and map layouts. In the interactive demo, you can test this yourself—move fires or survivors around, and the AI will still complete the task. This adaptability is crucial for real-world search and rescue.

What I learned

This project taught me a lot. I got a much deeper understanding of reinforcement learning, simulation environments, Unity development, and how to guide AI behavior through reward design. Solving the weird and unexpected behaviors that came up during training pushed me to think creatively and really understand what was going on behind the scenes.

What's next for Wildfire Search and Rescue AI

Right now, the whole system works in a simulation—but it was built with real-world implementation in mind. The robot has tank-drive mechanics and a functional robotic arm that mirrors designs used in real robots. The next step would be to make the environment more complex, and eventually port the AI to a physical robot.

If that happens, this could go from being a prototype to something that could genuinely help in real search and rescue operations—and that’s the ultimate goal.

Built With

Share this project:

Updates