# Forest Fire Detection and Notification Method Based on AI and IoT Approaches
## 5 Experimental Results and Discussions
### Proof of Concept Experimentation  
After the MQ-2 flammable gas and smoke sensor detected the smoke, the camera immediately recorded the footage to be sent to the personal computer, as given in Table 2. As shown in Figures 4 and 5, our approach performed well and quickly identified fire accidents, even multiple fires and flames, in both indoor and outdoor environments.  
As seen in Figure 4, the confidence level was mostly above 80%. This is because we had to retrain the data to obtain the better output result. We retrained the data to YOLOv5x and set the batch size to 16 and the epoch to 3 at first. Then, we observed the accuracy level and it was average, as it can be seen here. There was a big difference between YOLOv5s and YOLOv5x. If we were to keep the pre-trained data, we would obtain approximately 30%. However, as it can be seen, there was a big jump in confidence level.  
Figure 5 shows that, after increasing the epoch size to 10, the confidence level went up a little. This research shows and proves that the more you constantly train the data, the better your outcome is. These fire detection methods are conducted through some calculations. The IoU or Jaccard Index is used to determine if the prediction is correct to an object or not. It is defined as the predicted box intersection divided by the actual box intersection divided by their union [(42; 43)]. In other words, it is an effective metric for  
Figure 4: Visible experiment results in forest fire scenes.  
Figure 5: Visible experiment results in indoor and outdoor environments with fire scenes.  
evaluating detection results, and is defined as the area of overlap between the detected fire region and the ground truth divided by the area of union between the detected fire region and the ground truth (1):  
\[IoU=\frac{groundTruth\cap prediction}{groundTruth\cup prediction} \tag{1}\]  
The FM score and IoU value range is between 0 and 1, where these metric scores reach their best values at 1.  
To understand mAP, the precision and recall calculation is needed, as we detailed in previous research [44]. TP stands for \"true positives\", FP stands for \"false positives\", and FN stands for \"false negatives\". Precision, or the percentage of true positive predictions among all positive forecasts, is the positive predictive value. The average precision and recall rates of the fire detection techniques can be calculated using the following equations:  
\[\begin{array}{c}Precision=\frac{TP}{TP+FP}\\ Recall=\frac{TP}{TP+FN}\end{array} \tag{2}\]  
We need to determine the AP for each class in order to calculate the mAP. However, we only have one class. A PR (precision-recall) curve is obtained by plotting these precision and recall values. Average precision is the region beneath the PR curve (AP). The PR curve has a zig-zag shape, as recall rises steadily while precision generally falls with intermittent increases. The AP, which in VOC 2007 was defined as the mean of precision values at a set of 11 equally spaced recall levels [0, 0.1,..., 1] (0 to 1 at a step size of 0.1), describes the shape of the precision-recall curve rather than the AUC. However, in VOC 2010, the computation of the AP changed so, instead of just taking 11, we take all points into account [45].  
\[AP=\frac{1}{11}\sum_{r\in(0,0.1...,1)}p_{interp(r)} \tag{3}\]  
The greatest precision measured for a method for which the corresponding recall exceeds r is used to interpolate the precision at each recall level r.  
Using quantitative and qualitative performance data, we rank the durability of previously introduced publications employing the suggested approach in many classifications, as shown in Table 3. In accordance with the scores, the proposed approach worsened when far- and small-region flames occurred, but it was able to successfully distinguish between fake or non-fire sceneries and actual fires with a quick processing time performance.