Fire Detection Using Sensor Fusion and TinyML - Arduino Nano 33 BLE Sense
Created By: Nekhil R.
Public Project Link: https://studio.edgeimpulse.com/public/160533/latest
In order to properly identify a fire situation, a fire detection system needs to be accurate and fast. However, many commercial fire detection systems use simple sensors, so their fire recognition accuracy can be reduced due to the limitations of the sensor’s detection capabilities. Existing devices that use rule-based algorithms or image-based machine learning might be unable to adapt to changes in the environment because of their static features.
In this project, we will develop a device that can detect fire by means of sensor fusion and machine learning. The combination of sensors will help to make more accurate predictions about the presence of fire, versus single-sensor monitoring. We will collect data from sensors such as temperature, humidity, and pressure in various fire situations and extract features to build a machine-learning model to detect fire events.
We have only two classes in this project: No Fire and Fire. For the No Fire case, we collected data at different points in the room. For capturing the Fire data, we built a fire using a camp-like setup in my backyard. To make our model robust, we collected data at different points in the area.
13 minutes of data are collected for two labels and split between Training and Testing datasets. Once the data is uploaded, Edge Impulse has a tool called Data Explorer which gives you a graphical overview of your complete dataset.
This tool is very useful for quickly looking for outliers and discrepancies in your labels and data points.
For the Processing block we used Spectral analysis and for the Learning block we used Classification. Other options such as Flatten and Raw Data are also available as Processing blocks. Each Processing block has it’s features and uses, if you need to dive into that, you can find information covering each of them here.
These are our Spectral Analysis parameters of Filter and Spectral power. We didn’t use any filter for the raw data.
The below image shows the Generated features for the collected data, and we can see that the data is well separated and distinguishable. As you can notice in the case of Fire event, there are actually three clusters of data and it shows the parameters are changing at different points.
To learn more about the individual effect these parameters have on your model, you can refer to this documentation. This could require a bit of trial and testing to find the optimal settings.
After training, we achieved 98% validation accuracy for the data, so the model seems to be working well.
The Confusion matrix is a great tool for evaluating the model, as you can see below, 2.1% of the data samples are misclassified as No Fire.
By checking the Feature explorer we can easily identify the samples which are misclassified. It also shows the time at which the incorrect classification happened. Here is one example.
This machine learning model seems to be working well enough for our project, so let’s see how our model performs on unseen data.
The Confusion matrix and Feature explorer show that our model performs very well.
The above sample was recorded the when there is no fire present, and the below sample is recorded when there is a fire.
It looks like real-world data of No Fire and Fire events are well classified, so our model is ready for deployment onto the Arduino.
This is the final hardware setup for the project: