Hotspots and Smoke Detection from Forest and Land Fires Using the YOLO Algorithm ( You Only Look Once )

– The term forest and land fires is used to refer to unplanned, controlled and unwanted fires that destroy vegetated areas and their ecosystems triggered by natural or human causes . Early detection of hotspots can reduce the risk of wider forest and land fires. The use of the Deep Learning YOLO ( You Only Look Once ) algorithm is carried out to detect fire and also the smoke it produces. This study tested in 3 ways, 1) 1341 after data augmentation (496 original data), 2) 608 after data augmentation (253 original data), and 3) 1790 after data augmentation (746 original data). Detection of fire and smoke objects in the form of design, implementation and testing resulted in the YOLOv4 framework successfully producing high confidence of up to 97% in the second test. Based on the test results in this study, it is known that the image datasets used for training data greatly affect object detection and affect the confidence value. The more diverse the shape of the object from the image datasets, the lower the confidence value obtained.

Understanding the characteristics of haze in a fire environment is critical to counteracting problems associated with poor air quality, such as fires on peatlands. The term air pollution usually refers to the transfer of natural and/or synthetic hazardous materials into the atmosphere as a direct and/or indirect consequence to the environment or organisms living in the affected environment. Examples of air pollutants in general are Ozone (O3) , Lead (Pb), Nitrogen Dioxide (NO 2 ), Particulate Matter (PM), and Dioxide (SO2).
Monitoring hotspots as a preventive measure in areas that are difficult to access can be done by using remote sensing technology ( drones) or unmanned aircraft [12]. This aircraft is controlled automatically through a computer program. [13]. Drones are used in video image capture, which is then followed by image enhancement techniques . In using this technique, fire features can be used to efficiently detect fire such as: fire color, smoke, sparks, fire texture, fire area distribution, and edge detection. Furthermore, the resulting image from image enhancement can be trained by utilizing deep learning algorithms. namely the YOLO ( You Only Look Once ) V4 algorithm. [13]. The YOLO ( You Only Look Once ) algorithm is a deep learning algorithm that utilizes a convolutional neural network (CNN) to detect objects. This algorithm will divide the image into sxs sized grids which then in each grid will predict the bounding box and the class map of each grid . If on one grid predicted object, then the grid will predict the bounding box that surrounds the object. The confidence value will be calculated for each bounding box which will then be selected based on the value obtained. [14].

II. METHODS
A. Data image data collection in the form of images containing fire and smoke such as images of fires. Collection of image data or fire images as datasets which function as training data for the deep learning method on the you only look once (YOLO) algorithm. The research data is used to train the You Only Look Once (Yolo) algorithm in detecting fire and smoke. In this study, 746 image data were collected from various sources.

B. Preprocessing
preprocessing design is the preparation of the data that has been collected before the training stage is carried out. In preprocessing there are several stages. The first stage is labeling , and the second is data argumentation, for the two stages.
1 Labeling: In this process hotspots and smoke will be marked on the image data that has been collected by giving a box or bounding box and the box will be given a name (annotations). 2 Data Augmentation: This step is done in order to significantly increase the diversity of data available for the training model, without actually collecting new data.

C. Training
In this process, the YOLO Training stages will be carried out using datasets. at this stage all image data will be processed and will be studied by YOLO. In the training process, a GPU (Graphic Processing Unit) is needed because it will process a large number of images. This can be done using the help of Google Colab .

D. Deploy YOLO / Python Implementation
At this stage, object detection is carried out by building a program using programming language codes and libraries to make it easier to provide programming language codes. In this study the programming language used is the Python programming language . And the library used is openCV

E. Testing
At this stage, tests are carried out in the form of calculating Average Precision (AP) , Training Loss, F-Measure , and Sensitivity (Recall).
Precision is the ratio of the amount of data that is correctly predicted to be positive with the overall results that are predicted to be positive. Precision can be calculated using the equation. [15] = + Recall is a measurement on data with the correct positive classification. Recall can be calculated using the equation. [15] = + F1 Score aims to compare the average precision and recall. F1 Score can be calculated using the equation. [15] − = 2 * * + True Positive (TP) is a condition where the model predicts the data as yes ( TRUE ) and the actual answer is yes ( TRUE ). False Positive (FP) is a condition where the model predicts the data as yes ( TRUE ) and the actual answer is no ( FALSE ). False Negative (FN), a condition in which the model predicts data as no ( FALSE ) and the actual answer is yes ( TRUE ). [15] III.

RESULTS AND DISCUSSION
A. Preprocessing

Image Labelling
The data that has been collected is then labeled or marked with image data. in this process marks the point of fire and smoke on the image data that has been collected. In this research, the labeling process uses an online datasets generator on the app.roboflow.com website. In fig 2 (a) the data argumentation process is carried out to add and reduce the saturation value by 50% from the original image data so as to produce 2 new image data for each existing image data. Fig 2 (b) Data Argumentation Process The data argumentation process is carried out to cut the original image data by 25% to produce 1 new image data for each existing image data.  In Fig. 4, the data augmentation process is carried out to rotate left, right, and down the original image data so as to produce 3 new image data for each existing image data.

B. Training Data
Datasets that have been labeled, then proceed to the YOLO Training stage. In the training process, the YOLO algorithm is trained to detect hot spots and smoke. The training process requires a GPU ( Graphics Processing Unit) with high specifications, therefore the training process in this study uses the help of Google Colab . In the training process using the help of Google Colab there are several stages in the form of cuDNN configuration , Installing Darknet, extracting datasets , training configuration , and YOLO Training . 1 Configure cuDNN In the cuDNN configuration on Google Colab , the first step is to check the GPU hardware provided by Google Colab . The following is the syntax for checking Nvidia GPU hardware: In this study, the YOLO V4 training process took approximately 1 hour to 2 hours C. Deploy Yolo/ Python Implementation After the training process and obtaining the files in the form of cfg , weights and coco.names , the next step is to generate programming code using the Python language to implement the YOLO V4 algorithm in detecting fire and smoke objects through video captured by cameras. In implementing python the first thing to do is to import the opencv and numpy libraries . Video image is used. In Figure 4.18 is the code for video capture, Source code pad Fig 12 with a value of 0 is the value for real time video capture using a camera device on a PC or laptop. The value 0 can be replaced using the file directory path to retrieve video via a video file or can be replaced with an IP address if using an IP webcam.

Fig 12 video capture source code
Next, the class name label extraction is performed. Extract class name label. In this study, we will extract the class name label for the object of fire and smoke. The output results from the YOLO V4 training process in the form of cfg files and weights will be retrieved using the source code in Fig 13.

Fig 13 loads YOLO V4 source code
Next, the process of detecting fire and smoke objects is carried out as well as providing a bounding box to the detected object and calculating the confidence value. After the object detection process is carried out and the bounding box is given to the detected object, the video that has been detected is displayed.

D. Testing
In this study, 3 test models were carried out with the following details:  In testing using forest fire videos, the algorithm can detect fire and smoke objects and has a fairly high confidence value , reaching a value of 50% in detecting forest fire fire objects. In the candle fire detection test using 1341 datasets after augmenting forest fire image data, the YOLO V4 algorithm is able to recognize hotspots on candles, but not all hotspots are detected, as shown in Fig. 16 only a few hotspots are detected and also the resulting confidence value quite low, namely below 40%.

2
The test uses 608 datasets after augmenting the candle flame image data Subsequent tests were carried out by testing the YOLO V4 algorithm which had been carried out in the training process using 608 datasets after augmenting the fire image data on candles. The following results were obtained: Table 3 YOLO V4 test results Using 608 datasets after the augmentation of the fire image data on candles Then the average loss value obtained from the results of the 608 training datasets after the augmentation of the candle flame image data is as follows: Based on the diagram in Figure 17 it is known that the value of the Average Loss in this test is 0.4348. then the best mAP value is found in epoch 2400 which is 81%. Furthermore, the YOLO V4 algorithm which has been trained using 608 after augmentation of forest fire image data is tested using forest fire videos and real -time testing in detecting candle fire points. The following results are obtained: The results of forest fire video detection testing use datasets 608 after augmenting forest fire image data In testing using datasets 608 after the augmentation of candle flame image data as training data , in detecting hotspots in forest fire videos the YOLO V4 algorithm has not been able to recognize hotspots in forest fires. as seen in Figure 18 there is no bounding box given. In testing using the 608 dataset after augmenting the candle flame image data as training data , in the detection of hot spots in candle flame videos the YOLO V4 algorithm is able to recognize hotspots very well. as seen in Fig. 19 all the fire points on the candle can be detected and have a high confidence value of up to 97%.

Results
3 The test uses datasets totaling 1790 after augmenting image data of forest fires and candle fires Subsequent tests were carried out by testing the YOLO V4 algorithm which had been carried out in the training process using the 1790 dataset after augmenting the image data of forest fires and fire on candles. The following results were obtained: In testing using the 1790 dataset after augmenting image data of forest fires and candle fires as training data , in detecting fire spots in forest fire videos the YOLO V4 algorithm is able to recognize hotspots but has a fairly low confidence value , which is below 40%. In testing using the 1790 datasets after augmenting image data of forest fires and candle fires as training data, in detecting hotspots in video candle flames the YOLO V4 algorithm is able to recognize points of fire on candles with a fairly high confidence value, but the confidence value in this test is not very high. high when compared to the 2nd model test.

IV. CONCLUSION
After conducting research related to the detection of fire and smoke objects in the form of design, implementation and testing of applications that have been made, the following conclusions can be drawn: 1 Prevention of forest and land fires can be done by monitoring hotspots using the You Only Look Once (YOLO) V4 algorithm to detect objects of fire and smoke because the YOLO V4 algorithm has good results. However, in the process the YOLO V4 has a few problems when it detects in real time , namely the delay in video processing from the camera, this is because the specifications of the PC / Laptop used in this study are not capable enough to do the rendering process . 2 YOLO V4 is an algorithm that is quite effective in detecting hotspots and smoke that occurs in forest and land fires, because YOLO V4's ability to detect hotspots and smoke has good results and detection can be done in real time. 3 Based on the test results in this study, it is known that the image datasets used for training data greatly affect object detection and affect the confidence value. The more diverse the shape of the object from the image datasets, the lower the confidence value obtained. .