GA-BP Neural Network Regression Model for Predicting the Soil Moisture of Ecological Slope Protection

The neural network optimized by genetic algorithm(GA) is an efficient and accurate prediction method, which can quickly find the optimal solution through high-speed computing capability and self-learning function. The neural network model optimized by GA is applied to the prediction of soil moisture of ecological slope protection, which provides reference for practical application of slope vegetation screening. In this paper, nine meteorological factors and soil moisture data were obtained by field monitoring instruments and related meteorological data. Considering the lag of meteorological factors, the neural network optimized by GA is used to predict the soil moisture of 8 meteorological data. The results show that the root mean square error (RMSE) and the mean absolute percentage error (MAPE) of the prediction model are 0.22726 and 0.41234%, respectively, indicating that the prediction model runs well. Through V-fold cross-validation, it is found that the prediction results of the model is accurate and stable. The algorithm combining artificial neural network and GA can well predict the soil moisture of ecological slope protection, with high prediction accuracy, and has a good application prospect in other fields. predict and simulate soil humidity.Considering the lag, the prediction accuracy has greatly improved. (c) The established GA-BP neural network prediction model has high accuracy, and the deviation between soil moisture prediction results and actual values is small, which shows that the model can accurately predict the change of soil moisture with meteorological factors. (d) Comparing the prediction results of BP neural network and GA-BP neural network, it is found that GA-BP neural network is superior to BP neural network in predicting soil moisture of ecological slope protection s, and the optimization of GA plays a very important role.


Introduction
Soil moisture is one of the main factors in agricultural production and hydrological cycle, which not only plays an important role in maintaining plant growth, but also is a key link in the water cycle of soil-plant-atmosphere continuous system 1,2 . Studies have shown that suitable soil moisture is one of the most important factors for the healthy growth of plants 3 . Other studies have shown that soil moisture can improve the natural nutrient absorption of crops and plants. Less water will affect the growth of cells, resulting in a decrease in cell growth. Secondly, excessive water will affect the growth of some stages of plant life 4,5 . The soil moisture before planting will affect plant growth. Vegetation performs better when the soil is wet or dry 6 .Its accurate prediction is of great significance to the rational utilization and management of water resources. The change of soil moisture directly affects water consumption and crop growth, and the influence of soil moisture can improve the prediction of flowering time and the assessment of abiotic stress risk 7 .
It is an important index of drought resistance, flood control 8 and precise irrigation decision 9; 10 in agricultural production. Climate and vegetation change are the two main factors affecting the trend of soil moisture. Climate change dominates the change trend of soil moisture, while vegetation change plays a regulatory role in soil dryness and wetness under changing climate conditions 11 .Soil moisture is closely related to the optimization of slope vegetation, and meteorological factors such as environmental humidity, daily radiation, temperature and rainfall have great influence on soil moisture.Therefore, it is of great significance to use machine learning method to predict the soil moisture of the slope, and then use meteorological factors and soil moisture to optimize the slope protection plants.
At present, the mainstream soil moisture prediction methods mainly use empirical formula, linear regression and neural network to build prediction models 12 . Hummel 13 uses near infrared reflectance sensors to predict the soil moisture content of surface and underground soil, and uses stepwise multiple linear regression analysis data, and the prediction standard deviation is 5.31%. Joo 14 and others studied the comparison between soil moisture and hydrometeorological data, and found that the change of soil moisture showed seasonal characteristics. Kashif Gill 15 put forward a method to predict soil moisture by using support vector machine, which uses structural risk rather than empirical risk to ensure global optimization,The results show that SVM model is better than artificial neural network model in predicting soil moisture. Prakash et al, 16 used machine learning techniques such as multiple linear regression, support vector regression and recurrent neural network to predict soil moisture for 1 day, 2 days and 7 days, and the results showed that multiple linear regression had better prediction results. Qian Zhu 17 combined support vector machine (SVM) with double set Kalman filter (EnKF),Compared with support vector machine, it can be found that it can effectively improve the efficiency of soil moisture prediction. However, the parameters and kernel functions of support vector machine need to be selected artificially, and the calculation is complicated, which will affect the prediction accuracy to a certain extent. In complex practical applications, the traditional methods of soil moisture prediction often do not perform well, but the neural network model has better performance in soil moisture prediction 18,19 . Ji Ronghua et al, 20 used multi-level neural network to predict soil moisture,According to correlation analysis, rainfall, temperature and wind speed have significant effects on soil moisture. Principal component analysis is used to eliminate the correlation between the initial input parameters, and the first three principal components are specified to reconstruct the samples into lower dimensions, so as to reduce the network scale and improve the network performance. An Xiaoyu et al, 21 put forward an improved neural network prediction method for ascidian algorithm optimization. The results show that the optimal prediction model has small prediction error. It overcomes the shortcomings of neural network prediction model, such as low convergence accuracy and easy to fall into local optimum.
However, soil moisture involves complex structural effects and meteorological factors, and it is difficult to establish an ideal mathematical model for predicting soil moisture. Although artificial neural network can solve complex nonlinear mapping problems, it also has some shortcomings, such as over-fitting, falling into local optimum easily and slow convergence speed 22 . The neural network optimized based on GAs can be optimized from two aspects of learning efficiency and global optimization, which greatly improves the structure of the original network. Compared with the traditional neural network, it shows strong computational ability.The neural network has been successfully applied in engineering cost prediction 23 , stock price prediction 24,25, traffic flow 26 , image and text recognition 27,28 , medical treatment 29,30 and other fields.
In this study, considering the correlation between meteorological factors and soil moisture and the lag of meteorological factors, neural network is used to predict the nonlinear relationship between soil moisture and meteorological factors on ecological slope protection s. On this basis, GA is used for global optimization, and the optimal soil moisture prediction model is determined, which overcomes the problem of low prediction accuracy and achieves high-precision soil moisture prediction.  fig.1.A shows the four-layer BP network topology with m×d×b×t, and the process of calculating the output of pre-BP neural network can be summarized as three steps. Firstly, the data of eight meteorological factors obtained by climate monitoring instruments are used as input layers. Secondly, by comparing the output data with the measurement data, we use the loss function (also called cost function) to calculate the error. Third, we propagate the error back, find its derivative with respect to each weight in the network, and update the model. For BP artificial neural network, each layer transmits data to the next layer without cycle. After we repeat these three steps for multiple cycles and learn the weights, we apply the model to new data to predict multiple target values simultaneously. It can be assumed that the existing sample pairs  The thresholds of hidden layer neurons and output layer neurons are θ 1 and θ 2 ,

Methods
Then the output of hidden layer neurons is The output of neurons in the output layer is The error between network output and expected output is E = •BP neural network optimized by GA GA is a search algorithm for solving optimization problems, which is the most widely used evolutionary algorithm at present 31 . GAis an adaptive heuristic search algorithm that imitates the biological evolution mechanism of "natural selection, survival of the fittest" in nature, and is combined with artificial neural network, which is widely used to solve optimization problems 32 . GAs are efficient, practical and robust. GA encodes the data into chromosomes, and exchanges the information in chromosomes through selection, crossover and mutation in iteration, and finally finds out the chromosomes that meet the optimization objectives. By selecting, crossing and changing the population composed of a certain number of problem parameters, GA screens out the individuals with higher fitness and excludes the individuals with lower fitness, and continuously evolves and iterates to find the most satisfied individuals. Using GA to optimize the weights and thresholds of neural network networks can avoid falling into local optimum and effectively improve the training speed. The algorithm steps (see Fig.1.B) are as follows: Step 1: Determine the neural network topology; In this BP neural network model, the input layer is 8 kinds of weather and meteorological factors of each group of data, and the output layer is daily average soil moisture, which constitutes 8 nodes input layer and 1 node output layer.
Step 2: Obtaining an initial population; By preprocessing the input data, the population number is set, in which each individual contains the ownership value of BP neural network and the real number string of threshold value.
Step 3: where f i is the expected output value and f(x i ) is the actual output value.
Step 4: Select the operation;Selection operation refers to selecting excellent individuals from the original population through a certain probability and producing the next generation of individuals through reproduction. The probability of individual selection is correlated with fitness. The higher the fitness, the higher the probability of individual choice. Roulette is used in this paper. The probability of choice is where F i is the population fitness value of individual I, and N is the population number.
Step 5: Cross-operation: Cross-operation refers to randomly selecting two individuals from the population, and transferring the excellent characteristics of their parents to their offspring to produce new individuals with high adaptability through the exchange and combination of their chromosomes. That is to say, there are two individuals a k 、a l who cross-operate at j as follows where b is a random number between [0,1] .
Step 6:Mutation operation; The diversity of population can be maintained through population variation. Randomly select an individual from the population, and select a part of the individual to perform mutation operation, so as to produce a better individual. Individual a i mutates at j, forming a new gene a ij as follows.
where a max 、a min are the upper and lower bounds of a ij ，r 2 is a random number，g is the current iteration number，G max is the maximum evolution number.
Step 7: The fitness function of the individual in the newly generated population is calculated.
If the fitness function meets the requirements or the evolution times reach the maximum, the evolution is completed, otherwise, the step 4 is returned.
Step 8: Through GA optimization, the BP network is given initial weights and thresholds, and the prediction results are obtained after meeting the termination conditions.

•Error estimation
In order to quantitatively evaluate the effectiveness and accuracy of neural network prediction model optimized by GA, MSE (mean square error), RMSE (mean square error root), MAE (mean absolute error), and MAPE (mean absolute percentage error) are considered respectively.
(see Fig.1.C) where is the total number of training or test set; ̂( ) and ( ) is the forecast value and the actual value, respectively.

GA-BP soil moisture prediction model •Meteorological data monitoring scheme
In order to solve the problems of complicated operation and high monitoring cost of long-term monitoring instruments for slope environment, a monitoring device and prediction method for slope vegetation growth environment in typhoon area are adopted. By setting temperature and humidity sensors, wind speed and direction sensors, solar radiation sensors, rainfall sensors, soil temperature, humidity and salt comprehensive sensors, and adopting wireless network and cloud platform data transmission means, the long-term remote monitoring of slope growth environment is realized.Finally, based on the collected long-term data and the data provided by China Meteorological Network, the time series method and linear regression model can be used to make short-term prediction of the meteorological parameters on the slope, thus obtaining the time variability of the meteorological parameters on the slope.
The monitoring system for meteorological parameters of ecological slope protection s is composed of environmental temperature and humidity sensors, wind speed and direction sensors, solar radiation sensors, rainfall sensors, comprehensive sensors of soil temperature, humidity and salinity, data acquisition instruments, wireless communication modules and solar power supply system powered by the whole test system. The partial structure is shown in Fig. 2. is shown in fig. 3.

Figure 3. Field experiment diagram •Influencing Factors of Soil Moisture
The soil moisture of ecological slope protection s is closely related to local meteorological factors, and the change of soil moisture is affected not only by its own hydrological factors but also by surrounding meteorological factors. The motion of atmospheric systems is a highly unified process of certainty and randomness. From a macroscopic point of view, the uncertainty of soil moisture change is largely determined by the influence of weather conditions in the early stage. Climate is the main factor that determines the distribution of soil moisture on the earth, and the uncertainty of soil moisture mainly comes from the randomness of atmospheric factors. Therefore, meteorological factors can be used to predict soil humidity. In this paper, nine meteorological elements are obtained, namely, daily maximum environmental temperature (X1), daily minimum environmental temperature (X2), daily average temperature (X3), daily average environmental humidity (X4), daily average dew point temperature (X5), daily average wind speed (X6), daily average rainfall (X7), daily total radiation (X8) and daily average soil temperature (X9). Pearson correlation coefficient and Spearman correlation coefficient are as shown in Fig. 4.  meteorological factor and soil moisture, it can be found that (Y) has strong correlation with (X1), (X2), (X3), (X5) and (X9), which is higher than 0.8. (Y) has a weak correlation with (X4) and (X8), showing a moderate correlation, while it has a low correlation with (X6), so this factor is excluded (see Fig.4). Considering that the influence of environmental humidity and rainfall on soil moisture has a certain lag, the increase of daily precipitation and environmental humidity leads to the increase of moisture in the air, and it takes a certain time for moisture to enter the soil, so the lag is taken into account to predict. After considering its lag, the correlation coefficient has been significantly improved, and the correlation degree has increased to more than 0.5, as shown in Table 1. Considering the discreteness of field monitoring results due to few samples and many factors, the neural network algorithm optimized by GA is adopted. In the monitoring data, the meteorological data of the first 90 days are selected as training samples, and the data of the last 10 days are predicted samples. The sample data are shown in Table 2, and the GA-BP regression prediction model is established by programming with Matlab language.

Comparison of model prediction
The GA-BP regression prediction model was established, and the soil moisture of ecological slope protection s was simulated and predicted by using neural network,The monitoring data of the first 90 days were taken as the training set, and the data of 10 days were taken as the test set.
Matlab software is used for prediction simulation experiment, and the prediction results are compared, as shown in Fig. 5 .

Prediction model evaluation
The neural network optimized by GA can obtain the optimal weights and thresholds through GA. Through selection, crossover and mutation in GAs, the population is continuously optimized and the best individual is selected. The optimization of GA mainly involves the initial population size, maximum evolutionary algebra, crossover probability and mutation probability. In the prediction model, the crossover probability is 0.8, the mutation probability is 0.05, the initial population size is 100, and the maximum evolution algebra is 100. the characteristics of high computational efficiency and simple operation. Therefore, the V-fold cross-validation method is used to evaluate the prediction model. The V-fold cross-validation method refers to dividing the data into V parts, selecting one part as the test set, V-1 part as the test set, repeating v times, and finally analyzing the average error of v times as the performance index of model evaluation. In this paper, 100 groups of data are divided into 10 parts, and the GA-BP prediction model considering lag is evaluated by V-fold cross validation, as shown in the fig.8.

Discussion
Advantages of GA-BP neural network regression model. In this paper, the GA-BP prediction model is used to simulate and predict the daily average soil moisture through eight kinds of meteorological factors obtained from the monitoring of ecological slope protections in Taizhou area as independent variables, and the following conclusions are drawn. The advantages are as follows: (a) Soil moisture is closely related to the surrounding meteorological factors.
Because of the randomness and non-linearity of meteorological factors, soil moisture is uncertain.Using meteorological factors to predict soil moisture can obtain high-precision prediction results.Therefore, it is feasible to analyze and predict the change of soil moisture on ecological slope protection s by establishing related mathematical models, which can provide theoretical basis for the selection of vegetation on ecological slope protections. (b) Soil moisture is greatly affected by meteorological factors, and has a certain lag, especially rainfall and environmental humidity.This lag should be considered when using meteorological factors to predict and simulate soil humidity.Considering the lag, the prediction accuracy has greatly improved. (c) The established GA-BP neural network prediction model has high accuracy, and the deviation between soil moisture prediction results and actual values is small, which shows that the model can accurately predict the change of soil moisture with meteorological factors. (d) Comparing the prediction results of BP neural network and GA-BP neural network, it is found that GA-BP neural network is superior to BP neural network in predicting soil moisture of ecological slope protection s, and the optimization of GA plays a very important role.
Shortcomings of GA-BP neural network regression model In this paper, the artificial neural network algorithm optimized by GA is applied to the prediction of soil moisture in ecological slope protection for the first time, and a more accurate prediction result have been obtained.However, there are some defects in this paper. For example, all meteorological factors are not fully considered, and meteorological factors such as sunshine time and daily average pressure can be introduced in future research. In addition, GA is used to optimize neural network, and the optimized initial weights and thresholds are obtained. Besides GA, particle swarm optimization and ant colony algorithm can also be used to optimize the initial weights and thresholds of neural network.