The invention discloses a
soil humidity prediction method based on an improved
genetic algorithm optimized BP neural network. The method comprises the following steps of: 1, inputting data, dividing the collected data into two groups, taking one group as training data, and taking the other group as
test data; 2, determining a topological structure of the neural network, and setting various parameters of the neural network, including the number of neurons of an input layer, a
hidden layer and an output layer; 3, initializing the BP neural network, and obtaining an initial weight and a threshold value of the neural network; 4, initializing a
genetic algorithm, and encoding an initial weight and a threshold value; 5, setting a
fitness function of the
genetic algorithm; 6, performing selection,
crossover and
mutation operations; 7, calculating a fitness value, and judging whether a termination condition is met or not; and 8, determining to obtain an
optimal weight and an optimal threshold, and completing the prediction of the
soil humidity. The method is used for solving the problems that when a pure BP neural
network model is used for predicting the
soil humidity, errors are large, and soil
humidity prediction is not accurate.