A Perceptron Algorithm for Forest Fire Prediction Based on Wireless Sensor Networks

: Forest fire prediction constitutes a significant component of forest management. Timely and accurate forest fire prediction will greatly reduce property and natural losses. A quick method to estimate forest fire hazard levels through known climatic conditions could make an effective improvement in forest fire prediction. This paper presents a description and analysis of a forest fire prediction methods based on machine learning, which adopts WSN (Wireless Sensor Networks) technology and perceptron algorithms to provide a reliable and rapid detection of potential forest fire. Weather data are gathered by sensors, and then forwarded to the server, where a fire hazard index can be calculated.

monitor the forest accurately. With the impact of human activities and changes in global climate, forest fires have been in intensified for the past 10 years. Finding an effectively way to predict forest fire hazard has become top priority in forest fire research field [ajasekaran, Sruthi, Revathi et al. (2015)]. An effective scheme to predict forest fire is to analyze the relationship between previous weather parameters and the occurrence of forest fire. Wireless sensor networks comprise an army of low costs, low power, small size and multi-functional sensor nodes equipped with finite battery life that can gain and interact with each other over a short distance [Gao, Lin and Jiang (2015)]. In recent years, researchers have poured much attention to wireless sensor networks due to their wide range of applications such as military, environmental, health and home applications [Lin, Liu, Wang et al. (2017)]. The technology of wireless sensor networks makes it feasible for early detection and prediction of forest fire based on weather parameters. A perceptron is an algorithm for supervised learning of binary classifiers, which was invented in 1957 at the Cornell Aeronautical Laboratory [Al_Janabi, Al_Shourbaji and Salman (2017)]. Initially seemed promising, the proception algorithm could not be trained to recognize many patterns for a dataset can be classified correctly if and only if the dataset itself is linear separable [Sakr, Elhajj, Mitri et al. (2015)].

System design
Due to the complex environment and large area of the forest, the stability and endurance of the WSN are required generally. Lora (Long Range) technology is a low-power wireless LPWAN protocol with long transmission distance and high security, which is one of the most significant factors that determines the efficiency of the entire system. Equipped with temperature, humidity and wind sensors, Lora terminals deployed in forests collect weather data and transmit the them to server through Lora web gate. Weather parameters are obtained every 15 minutes, and if there is potential of forest fire, these parameters will be measured every 2 minutes, whose purpose is to reduce the usage of battery power. These sensors are powered by solar panels based on rechargeable technologies [Gao, Lin and Jiang (2015)], which converts solar into electricity to make sure our sensors could work regularly.

Algorithm design
Perceptron is a linear model of two types of classification, whose input data is the feature vector of the sample instance, and the category of the sample instance is output, taking two values of 1 and -1 respectively [Liu and Zhang (2015)]. The perceptron belongs to a discriminant model and represents a class hyperplane for linearly dividing data, which is the simplest feedforward artificial neural network consisting of two layers of neurons. The first layer serves as an input layer for directly transmitting data from dataset to the next layer of neurons, whose output represent the fire hazard index of the forest under current weather parameter. For the vector in the m-dimensional linear space, define the function: , Among them, the function F is the mapping of the sample space to the set {-1, 1}, being used to divide the sample space, is called weight, and b∈R is called bias. Sign is a symbolic function whose expression is: The input vectors can be divided into two categories by the different values returned by the function. The process above is equivalent to dividing a sample into two parts by a hyperplane S in the m-dimensional vector space, whose equation is: (3) For a given data set where , there exists a hyperplane S capable of data set Each instance is correctly separated to the sides of the hyperplane, i.e., , Figure 1: Lora equipment deployed in forest then the dataset T is called a linearly separable data set, otherwise the data set T is linearly inseparable. The perceptron is an algorithm which is driven by misclassification. To find out that one can separate the instance data, we define a loss function to calculate the distance from the misclassification point to the hyperplane. For each vector that is misclassified, the distance from the sample point x to the hyperplane S can be represent as: where is the L2 norm of ω, whose value is only related to the value of itself.
Record the set of all error points as M, iwi ∈ {-1, 1}. For each given , b, define the loss function of the perceptron as: The objective function is the minimum value of the loss function, which translates the problem into a solution to the minimum value of the loss function.
The algorithm uses the stochastic gradient descent method to iteratively update the values of the parameters and b. If the misclassification point set M is fixed, it is obvious that the gradient of its loss function L( ,b) is (8) For an arbitrary misclassification point , and update the value of ,b by the following formula: , (10) where η(0<η≤1) is the step size, also called the learning rate. The longer the step size is, the faster the loss function decreases. The value of , b may cross the minimum point even cannot converge for a large learning. In contrary, if the step size is too small, the algorithm may run for a long time.

Analysis and simulation
Vectors consisting of temperature, humidity, rainfall and wind speed from the sample dataset with fire hazard index are used to trained perceptron. In this paper, two perceptron are built, one separates forest fire index into low and middle, and the other one separates into middle and high. In order to evaluate the performance of perceptron algorithm for forest fire prediction, we deployed a group of sensors for monitoring weather parameter, including temperature, rainfall, windspeed and humidity in Nanjing from June to September in the year 2015. All four parameters are the average value of the day. We can also obtain the target value of a sample vector by calculating a linear combination of four components of the sample vector, whose coefficient vector is (1/50, -1/100, -1/100, 1/60) and constant term is 11/5. The first 10% of data are tagged as high fire index, and the last 60% of data are recognized as low fire index.
As is shown in Fig. 2, the number from error separate of the perceptron decreases to zero after multiple rounds of learning, that is, the data set is linear and separable. It is reasonable to conclude that the forest fire index with the four parameters of temperature, humidity, rainfall, and wind speed can be approximated represented as linearly related data sets under certain conditions. Fire weather index is usually higher especially when air humidity is low while temperature is high. From Fig. 3, the humidity value of high fire index is significantly lower than the other sample points, and the influence of temperature on the forest fore index is obviously much smaller than the humidity effect. As is illustrated in Fig. 4, the perceptron algorithm can approximate the fire index rating by wind speed and humidity. Forest fire value is lower with high wind speed and low humidity.
Higher temperatures and wind speeds can greatly increase the probability of fire risk. As is shown Fig. 5, points with higher forest fire risk levels are concentrated in the upper right corner of the graph, and the perceptron gives a straight line to correctly divide the sample points.
Through the above data simulation, the conclusion is that the perceptron algorithm can nearly classify the forest fire risk rating, because of which, for a given meteorological data, the perceptron algorithm should also correctly give its fire risk rating. And the more data used to train the perceptron, the more accurate its judgment.

Summary
High incidence and destructiveness of forest fire determine the importance of forest fire prediction. Since forest fire is serious natural disaster for human and society, reliable forest fire forecasting measure is an indispensable part of forest management. In this paper, utilizing perceptron model and Lora technology, forest fire prediction can be implemented in a more convenient way. Due to the limited data obtained, our system still has certain limitations, and it needs taking a longer time to be tested before being used in practice.