A simple application to help people detect the mountain fire in a large scope to avoid casualties.
- Based on the specific RGB formula to detect the fire.[1]
- Consider some of mountain fires are happened with the smoke first because the wet environment, so detect the smoke without specific RGB formular.
a) Using LBP or HARR training the data source.[2-4]
b) Tracking the smoke moving paths by using GMM(Gaussian Mixed Model).
- Spliting the image to 3 channels image and get the R G B value.
- Build the positive smoke csv file and negative csv file for LBP or HARR training.
Using opncv opencv_createsamples.exe and opencv_traincascade.exe to tain the data. After , the test didn't show what I expect.
May have these reasons:
a) The positive data source and negative source very samiliar. For emample the cloud images produce the small differences with smoke.
b) The CPU i5 is not that fast for training, some parameters based on the cpu performance which limit the data accuracy. - By tracking smoke path(Gaussian Mixed Model) to replace by using training model to detect the smoke.
- Draw Rect to display the fire and smoke area.
Fire Image testing
Smoke Video testing
- Using Gaussian Mixed Model to detect the moving smoke also will be triggered by moving anaimals. Such as bird so need to double detect the thing's color to make sure the anaimal or the fire. But what if the mountain fire doesn't have light just smoke, how the program knows it is fire rather than anaimal when we use tracking model? I think still need to based on the training model and more training source. May try to use ANN or CNN in the future.
- Another thing is that can add some sensors to help the program to detect the environment and collect more useful data. For example the tempure sensors and smoke sensors.
The implementation is based on TensorFlow framework which is the most widely used in the machine learning industries. TensorFlow has the ability to utilize GPU or CPU computing power which reduced the training process significantly through parallel acceleration. The whole system is using Python and C++, which is the industry standard of machine learning due to its diversified API that shorten the implementation span.
The CNN model followed the AlexNet Architecture. The fundamental parts to build the CNN consisted of the following parts: Convolution, Polling, Flattening. However, the AlexNet architecture involved with five convolutional layers, followed by maximum pooling layers, then fully connected layers and SoftMax classifier. One of the restrictions for AlexNet is the input of an RGB image must be size of 256x256 fixed because of fully connected layers, where the input training set must resize it to be 256x 256.
The following image showed the implmentation's model:
1. (IMPORTANT!) In order to match with the code, save the tranning file into the root of F:\ disk
2. download and set the path for python v3.0+
3. install necessary packages, such as tensorflow and numpy
4. suggest to use pycharm
1. 0 represent the positive dataset, 1 represent the negative dataset.
<img src="https://github.com/ramesh-babu-ai/Mountain_Fire_And_Smoke_Detector/blob/master/ReadMe%20source/Training_Result.PNG"/><br>
2. run main.py
1. save the image into the testing file, specific data path please check the code (so far each time can only take one image, will improve with a loop)
2. modify the parameters for your necessary
3.run test.py