# Industry 4.0 towards Forestry 4.0: Fire Detection Use Case +
## 5 Methodology
### Dynamic Query Window-Based Selector for Stream Rate Change
#### 5.3.2 The Proposed Dynamic Window-Based Selector
The dataset is generated using Rule 30 to bring it close to reality, for example by showing temperature goes higher during the noon, late afternoon and lower after midnight [27; 56] ([[https://en.wikipedia.org/wiki/Rule_30](https://en.wikipedia.org/wiki/Rule_30)]([https://en.wikipedia.org/wiki/Rule_30](https://en.wikipedia.org/wiki/Rule_30))), ([[http://www.auburn.edu/academic/forestry_wildlife/fire/weather_elements.htm](http://www.auburn.edu/academic/forestry_wildlife/fire/weather_elements.htm)]([http://www.auburn.edu/academic/forestry_wildlife/fire/weather_elements.htm](http://www.auburn.edu/academic/forestry_wildlife/fire/weather_elements.htm))). However, the authors of [57] discussed the techniques and strategies for greening IoT by reducing the pollution hazards. Furthermore, we use the standard European Forest Fire Information System which describes the Forest Fire Danger Ratings into four categories; Green, Yellow, Orange, and Red ([[http://effs.jrc.ee.europa.eu](http://effs.jrc.ee.europa.eu)]([http://effs.jrc.ee.europa.eu](http://effs.jrc.ee.europa.eu))) to define alert types thresholds for each sensor (see Figure 14). Our assumption for data generation is that each of the sensors remains in the thresholds defined for each alert type, e.g., when the temperature is less than 30, humidity is always greater than 30 and so on (see Table 4 and Figure 15). In particular, we assume there are 100 nodes installed to produce weather sensor values (i.e., temperature, humidity, CO, and CO\({}_{2}\)) depending on the alert type threshold. For example, for green, yellow, orange and red, there are 2, 6, 12, and 60 values per minute sent from sensors respectively (see Table 5). The day is divided into different sections depending on the alert type, and in total there are 8 h of green, 7 h of yellow, 6 h of orange and 3 h of red. The rationale behind this assumption is that the midnight and early minoring hours are less likely to fire occurrences, i.e., green alerts. In contrast, the noon hours are the high probability for fire occurrence, i.e., red alerts. The sample of generated data for the weather variables values is provided in Table 6.

Substantially, high wind speed promotes supplying more oxygen from the surrounding environment. Therefore it increases the fire at a fast rate. Consequently, the wind speed, which probably has the most significant impact on a wildfire's behavior, is the most unpredictable factor. Due to wind speed's unpredictability during a day, we could not generate a wind speed stream using Rule 30 to be close to reality. We generate it within the speed range; between 1 and 20 km per hour [58]. Figure 14: Average of sensor value per day generated using rule 30 and the corresponding alerts in uni-sensor environment: (**a**) temperature (**b**) humidity (**c**) CO (**d**) CO2. Figure 15: Forest fire use case dataset generator flowchart. \begin{table}
\begin{tabular}{l c c c c} \hline \hline
**Weather** & **Green** & **Yellow** & **Orange** & **Red** \\
**Variables** & & & & & \\ \hline Temperature & \(<\)30 \({}^{\circ}\)C & \(\geq\)30 & \(\geq\)37 \({}^{\circ}\)C & \(\geq\)40 \({}^{\circ}\)C \\ \hline Humidity & \(>\)30\% & \(\leq\)30\% & \(\leq\)20\% & \(\leq\)10\% \\ \hline CO (ppm) & \(<\)10 & \(\geq\)10 & \(\geq\)25 & \(\geq\)50 \\ \hline CO2 (ppm) & \(<\)350 & \(\geq\)350 & \(\geq\)2000 & \(\geq\)5000 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Weather variable alert thresholds. ### Experimental Setup

We run six experiments for static window sizes including 1, 5, 10, 15, 30, and 60 s, using a tumbling window and one experiment for dynamic window size. Static window sizes experiments aim to show the static window's impact and the stream rate changes on the reported alerts including the reported alerts, missed alerts and latencies. According to the latency setting, we ran a dynamic window size experiment to evaluate our proposed technique by adapting window size between 60 s and 1 s based on the input stream rate change.