Inspiration

In 2020, California experienced a record number of wildfires, devastating families and destroying homes. In addition to 10 million acres being burnt in 2020, these wildfires also created a loss of $15 billion, leading to widespread economic problems and structural damage to cities. One of the biggest issues with wildfires is the lack of preparation and ineffective resource allocation. Seeing the lack of advanced ML techniques being used for improved resource allocation we decided to create WildfiresAI: a multi-faceted platform that utilizes Machine Learning to tackle the Wildfires.

What it does

WildfiresAI has 4 main features and helps governments and people prepare for wildfires. The localization aspect of our web app uses a Tensorflow Object Detection Model (Yolo3) to localize smoke caused by a fire by surrounding it with a box and providing the percent confidence of it being a fire. This feature allows for early detection of fires, allowing users to easily determine the presence and progression of a fire. In our web app, a user can upload an image and our model will localize the fire. In addition, our model can be applied to video by applying the model to each frame. In the future, we plan to implement the model on security cameras to alert users of fires and allow for convenient analysis of fire progression.

Our next page contains two features that predict the burn area (acres) and put-out time (days) of a fire using various machine learning models. Based on the location, discovery month, temperature, humidity, and other features of the surrounding conditions, we can predict the size of a potential fire. Integrating this fire size prediction with other factors like distance from the nearest city, we are also able to predict how long it would take for firefighters to put out the fire. These features are extremely helpful for government officials and fire departments, as they will be able to effectively prepare and allocate resources for a potential wildfire. The addition of our accurate predictions of fire size and put-out time, will also allow for evacuations to be more precise and efficient, allowing governments to better plan for such events.

Lastly, we have a visualization page that provides key visualizations of potential fires. Using predicted fires from our machine learning models, we used Folium to display fires across the US with a convenient sorting function by size and cause. There are two maps, one that allows users to filter files by size, and the other that allows users to filter by cause. These visualizations allow the government to better understand the attributes of future fires, once again allowing for improved resource allocation.

How we built it

Our website was built with four main languages. We used HTML, CSS, and JS for our frontend and Flask (Python) for our backend/model development. As for the ML models, we used a variety of state-of-the-art models We used many different machine learning models created from the Python libraries Scikit-learn, Tensorflow, and XGBoost. All of our data was found on Kaggle.

On the localize page we used a custom trained Tensorflow2 Object Detection model to create a bounding box around smoke from a fire. For the image upload portion we used Flask to locally download the image and then upload the image to the model, and then displayed the final result

For the predictions page, we had two different models working hand in hand. For predicting the fire burn area we used an ensemble model which averaged the predictions of 3 different models, an ElasticNet, XGBoost, and SVM. We used grid-search to tune the hyperparameters for all of the models. After a user inputs the data, we use Flask to take the inputs and make a prediction with the model. After predicting the fire burn area, we use the prediction to predict how long the put-out time will take. To predict the putout time we used a Tensorflow Neural Network.

For the visualization page, we used Folium, a Python library, to create the maps, and used our ensemble model to create the predicted fires and load them into a CSV. We loaded this CSV into the Folium map, and based on the fire size created different sized markers that display the size, state, and cause of a fire. For the first map, we made the markers different colors based on fire size, and the second map based on the cause.

Challenges we ran into

Our two biggest issues were with our ensemble model and the Flask integration of the models. The ElasticNet, XGBoost, and SVM models originally had poor accuracy, so we spent a lot of time improving the accuracy as well as learning how to combine them together to make the ensemble model. We also had a lot of issues with integrating the models into the Flask backend, however, after much debugging and reading through the documentation we were able to fix the issues.

Accomplishments that we're proud of

We are proud of creating a fully functional app within the allotted time frame. We are also proud of creating the localizer model, as we had never worked with object detection before.

What we learned

We learned how to use the object detection model from TensorFlow, the XGBoost model, ensemble models, and Folium.

What's next for WildfiresAI

The main thing we hope to do is implement our fire localizer model in security cameras in public, and create a system that will automatically alert fire stations when a fire is detected.

Built With

Share this project:

Updates