A genetic algorithm optimized wavelet neural network greenhouse temperature prediction modeling method
By optimizing wavelet neural networks using genetic algorithms, the problems of insufficient accuracy and speed in data modeling for greenhouse temperature control are solved, enabling efficient greenhouse temperature prediction and management. This model is applicable to research on different types of greenhouses and prediction models in other fields.
Patent Information
- Application Number
- CN202210059832.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-19
- Publication Date
- 2026-01-02
- Estimated Expiration
- 2042-01-19
AI Technical Summary
In existing greenhouse temperature control and management, data modeling accuracy and speed are poor, the modeling process is simple, and its versatility is poor, making it difficult to meet different types of current needs.
A greenhouse temperature prediction modeling method using a wavelet neural network optimized by a genetic algorithm and a wavelet neural network optimized by a genetic algorithm is proposed. The method includes obtaining multiple greenhouse temperature-related variables at the current time, optimizing the initial weight parameters of the wavelet neural network using a genetic algorithm, constructing the fitness function of the genetic algorithm, selecting the optimal weight parameters generation by generation, constructing the wavelet neural network greenhouse temperature prediction model, and training it using the gradient descent method.
It improves the accuracy and speed of greenhouse temperature prediction, simplifies the modeling process, has good versatility, and is suitable for research on different types of greenhouses and prediction model research in other fields.
Smart Images

Figure CN115169214B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of intelligent agriculture, and more particularly to a genetic algorithm optimized wavelet neural network greenhouse temperature prediction modeling method. BACKGROUND
[0002] Temperature has a direct impact on the growth of crops in agricultural production. Inappropriate temperature environment or drastic temperature changes will cause crops to suffer irreparable losses. Accurate prediction of greenhouse trends is a direction for promoting greenhouse research.
[0003] Artificial neural networks, as a class of mathematical model structures simulating the biological mechanism of the human brain, have certain learning ability and adaptability compared with traditional modeling methods, and can be widely applied to different mathematical modeling. In recent years, with the development of machine learning and deep learning, greenhouses have also received more and more attention and development. In the control problem of the greenhouse, it has more development and application due to its flexible adaptability to nonlinear systems and high control accuracy.
[0004] Wavelet transform is a common signal processing method, which improves the problem that the signal frequency cannot be well expressed in the Fourier transform. It adopts multiple wavelet basis functions to shift and stretch and then superimposes them to realize multi-scale refinement of the signal and automatically adapt to the requirements of time-frequency signal analysis. Wavelet neural network is evolved from wavelet transform. Combined with wavelet basis function and feedforward neural network, the network form can obtain higher learning ability and better prediction results. Wavelet neural network has realized fitting and prediction of the required object by means of other related variables in other fields, and has shown excellent fitting ability, faster learning speed and better prediction effect.
[0005] At present, the precision and speed of data modeling of the control problem of the greenhouse are poor, the control and management of the greenhouse temperature are not ideal, the modeling process is simple, and the general performance is poor. SUMMARY
[0006] The purpose of the present application is to provide a greenhouse environment temperature adaptive method based on parameter identification, which estimates the parameters and states of the model online to achieve effective control of the greenhouse temperature.
[0007] The genetic algorithm optimized wavelet neural network greenhouse temperature prediction modeling method provided by the embodiment of the present application comprises:
[0008] A genetic algorithm optimized wavelet neural network greenhouse temperature prediction modeling method, characterized by comprising:
[0009] Obtaining a plurality of greenhouse temperature related variables at the current time;
[0010] According to the initial weight parameters of the multiple wavelet neural networks WNN, an initial genetic population of the genetic algorithm is generated;
[0011] According to the prediction results and the actual output results of the wavelet neural network WNN, a fitness function of the genetic algorithm is constructed to evaluate the individuals of the genetic population;
[0012] The optimal initial weight parameters are screened out by the genetic algorithm generation by generation;
[0013] The optimal initial weight parameters are screened out by the genetic algorithm generation by generation;
[0014] In the wavelet neural network WNN-based greenhouse temperature prediction model, the current time multiple greenhouse temperature related variables are input, and the future time greenhouse temperature prediction value is output.
[0015] Further, the current time multiple greenhouse temperature related variables include:
[0016] The greenhouse external temperature, the greenhouse external humidity, the greenhouse external wind speed, the greenhouse internal temperature, the greenhouse internal CO2 concentration and the greenhouse internal light intensity.
[0017] Further, the genetic algorithm is configured with an initial population of 50, a crossover probability of 0.8, a mutation probability of 0.6, and a total of 50 population evolutions.
[0018] Further, the fitness function of the genetic algorithm includes the following calculation formula:
[0019]
[0020] Where y i is the actual output result of the predicted sample i, is the output result of the model prediction of sample i, and n is the total number of samples tested.
[0021] Further, it also includes training of the wavelet neural network WNN-based greenhouse temperature prediction model:
[0022] The training of the wavelet neural network WNN-based greenhouse temperature prediction model includes multiple forward and backward propagation processes, error calculation of network training output and actual output, and multiple iterations to correct the wavelet neural network connection weight and wavelet basis function parameters.
[0023] Further, the forward propagation of the wavelet neural network WNN-based greenhouse temperature prediction model includes:
[0024] The input layer setting includes 8 input nodes;
[0025] The hidden layer includes 10 nodes, the activation function is Morlet wavelet base function, and the forward transfer equation includes:
[0026]
[0027] The output layer includes an output node, the activation function is Purelin, and the forward transfer equation includes:
[0028]
[0029] wherein,
[0030] h(j) is the jth hidden layer node output of the hidden layer; x i represents the ith input of the neural network; h j (x) is the Morlet wavelet base function adopted therein; ω ij is the weight value of the input node i and the hidden node; a j is a scaling variable; b j is a translation variable. y(k) is the kth node output of the output layer; ω jk is the weight value of the connected hidden node j and the output node k.
[0031] Further, the greenhouse temperature prediction model based on the wavelet neural network WNN adopts the gradient descent method for the reverse transfer, takes the partial derivative or total derivative of the input error and output error e, calculates the gradient of each weight value p, and gradually updates the weight value parameters of each node, wherein the error e and the weight value update equation include:
[0032]
[0033]
[0034] wherein yn(k) is the actual output of sample k, y(k) is the predicted output of sample k, p is various weight value parameters (such as ω ij , ω jk , a j , b j ), Δp is the gradient error of the calculation of each weight value parameter. t represents the tth reverse transfer process.
[0035] Further, it further includes:
[0036] The mean square error MSE, the mean absolute error MAE, and the fitting coefficient R 2 evaluation function method is used to compare the performance of the greenhouse temperature prediction model.
[0037] The embodiment of the present application provides a genetic algorithm optimized wavelet neural network greenhouse temperature prediction modeling method, compared with the prior art, the beneficial effects are as follows:
[0038] The method introduces a wavelet neural network and a genetic algorithm, greatly improves the precision and speed of data modeling, can quickly utilize a large amount of measured data to model and predict the greenhouse in the greenhouse scene, and is beneficial to future greenhouse temperature control and management. Meanwhile, the modeling process of the method is simple, has good general performance, and has good significance and prospect for different types of greenhouse research and other field prediction model research. BRIEF DESCRIPTION OF DRAWINGS
[0039] Figure 1 A genetic algorithm optimized wavelet neural network greenhouse temperature prediction modeling method provided by the embodiment of the present application has a training flowchart;
[0040] Figure 2 The genetic algorithm optimized wavelet neural network greenhouse temperature prediction modeling method provided by the embodiment of the present application has a three-network MSE distribution after testing;
[0041] Figure 3 The genetic algorithm optimized wavelet neural network greenhouse temperature prediction modeling method provided by the embodiment of the present application has a three-network MAE distribution;
[0042] Figure 4 The genetic algorithm optimized wavelet neural network greenhouse temperature prediction modeling method provided by the embodiment of the present application has a three-network R 2 The distribution of results;
[0043] Figure 5 The genetic algorithm optimized wavelet neural network greenhouse temperature prediction modeling method provided by the embodiment of the present application has a comparison between three kinds of neural network prediction and actual results under continuous time;
[0044] Figure 6 The genetic algorithm optimized wavelet neural network greenhouse temperature prediction modeling method provided by the embodiment of the present application has a change of a loss function in a network training process. DETAILED DESCRIPTION
[0045] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the protection scope of the present application.
[0046] Reference Figures 1-6The embodiment of the present application provides a wavelet neural network greenhouse temperature prediction modeling method optimized by a genetic algorithm, which comprises the following steps:
[0047] Obtaining a plurality of greenhouse temperature related variables at the current time;
[0048] Constructing a greenhouse temperature prediction model based on a wavelet neural network (WNN);
[0049] Introducing a genetic algorithm before the greenhouse temperature prediction model based on the wavelet neural network (WNN);
[0050] Generating an initial genetic population according to the wavelet neural network (WNN) weight value;
[0051] Substituting the genetic population individuals into the wavelet neural network (WNN) to predict the greenhouse temperature prediction result;
[0052] Constructing a fitness function of the genetic algorithm according to the prediction result and the actual output result, and using the fitness function to evaluate the genetic population individuals;
[0053] Using the genetic algorithm to screen the optimal initial weight value parameter of the wavelet neural network (WNN) generation by generation;
[0054] Inputting the plurality of greenhouse temperature related variables at the current time into the greenhouse temperature prediction model based on the wavelet neural network (WNN), and outputting a greenhouse temperature prediction value at a future time.
[0055] Referring to Figure 1 The genetic algorithm and the wavelet neural network training flowchart. Considering the coupling relationship of the variables in the greenhouse, the input of the model is: the current time greenhouse external temperature, the current time greenhouse external humidity, the current time greenhouse external wind speed, the current time greenhouse internal temperature, the current time greenhouse internal concentration and the current time greenhouse internal light intensity. The output of the model is: the greenhouse internal temperature after 15 minutes. The model training process is as follows:
[0056] The genetic algorithm part is configured with an initial population of 50, a crossover probability of 0.8, a mutation probability of 0.6, and a total of 50 population evolutions. First, the population is initialized according to the weight value parameter of the neural network, and the characteristics of the individuals are evaluated by the fitness function to determine whether the characteristics meet the requirements of the neural network. Then, the genetic algorithm converts the problem optimization solution process into a biological evolution process through probability operation. The optimal solution is searched from a plurality of iteration population solutions by selection, crossover, mutation and other methods. Then the optimal individual is returned for neural network training.
[0057] The fitness function of the genetic algorithm, the calculation formula of which comprises:
[0058]
[0059] Wherein y ithe actual output result of the predicted sample i, the model predicted output result of sample i, n is the total number of samples tested.
[0060] The wavelet neural network part, the input layer of the neural network structure is set to 8 input nodes. The output layer consists of one output node, and the activation function is Purelin. The hidden layer has 10 nodes, and the activation function is the Morlet wavelet basis function. Gradient descent method is used for network training. In the forward transmission process, the input data is connected to the wavelet basis function in the hidden layer through the input layer weight value. After multiple different translation stretching operations, the output wavelet sequence is output. Multiple wavelet sequences are connected with the weight value of the output node, and are superimposed to realize the forward output of the network. The gradient descent method is used in the backward transmission process. The partial derivative or total derivative of the input error and output error e is calculated to calculate the gradient of each weight value p. The weight parameters of each node are updated step by step to approach the true output of the network. The training of the entire neural network includes multiple forward transmission and backward transmission processes, and the weight parameters of the wavelet neural network are adjusted through multiple iterations.
[0061] The training of the neural network in this application adopts the gradient descent method. Gradient descent method is the most commonly used algorithm for neural network optimization. It calculates the gradient of the difference between the predicted output and the actual output through the setting of the target cost function, so as to feedback the difference between the actual and the target. However, considering the multi-dimensional gradient change is not a simple smooth descent process, the learning rate method is introduced, and the step-by-step method is used to approach the optimal solution.
[0062] The other design principle is to construct a target function with adjustable function and generalized error, which can be regarded as a hyper surface in the adjustable parameter space. The parameter optimization method is used to gradually reduce the target function. The consistency between the adjustable system and the reference model is met until the target function reaches the minimum value or the vicinity of the minimum value. The error e and the weight update equation are:
[0063]
[0064]
[0065] where yn(k) is the actual output of sample k, y(k) is the predicted output of sample k, p is various weight parameters (such as ω ij ,ω jk ,a j ,b j), Δp is the gradient error of each weight parameter calculation, e represents the prediction error of the sample, η is the learning rate. t represents the tth back propagation process. Partial or total differential is taken on the input error and output error e to calculate the gradient of each weight value p. The weight parameters of each node are updated in turn to approximate the true output of the network.
[0066] The method for verifying the greenhouse temperature prediction model is:
[0067] The performance of the model is judged by comparing the actual gap between the model results and the actual gap by taking the evaluation function method. The main evaluation function indicators include: MSE, MAE, R 2 , the correlation formula is:
[0068]
[0069]
[0070]
[0071] where y i is the actual output result of sample i, is the output result of sample i predicted by the model, and n is the total number of samples tested. The mean square error (MSE) is the square sum of the difference between the actual output and the predicted output divided by the total number. It can reflect the mean square sum of the distance between the predicted value and the true value of the data, and show the dispersion degree and error size of each prediction result. The larger the MSE, the higher the dispersion degree of the prediction error, and the higher the error; on the contrary, the smaller the dispersion degree, and the smaller the error. The mean absolute error (MAE) is the mean of the absolute value of the difference between the actual output and the predicted output, and more focuses on the error size of the entire sample. When MAE is larger, it means that the prediction error is larger, and vice versa. The fitting coefficient (R 2 ), indicates the fitting degree between two variables, generally taking the interval (1, 0). The closer to 1, the better the prediction fitting degree, and the closer to 0, the worse the fitting effect.
[0072] Table 1 is a list of neural network parameters used. Through Matlab simulation, the current common forward feedback neural network (BPNN), wavelet neural network (WNN) and wavelet neural network based on genetic algorithm (GA-WNN) are compared. The entire process uses 20540 data, uses 16432 groups of 80% data as the training set, and uses 4108 groups of remaining 20% data as the test set. Under the same conditions, 200 training tests are carried out, and the results are as follows:
[0073] Table 1 BPNN, WNN and GA-WNN parameters
[0074]
[0075] Figure 2 The MSE distribution of the three networks after testing. The sample MSE result distribution range of BPNN is mainly concentrated in 0.364-0.432, and the average value is 0.4012. The MSE result range of WNN sample is 0.320-0.394, and the average value is 0.3590. The MSE range of GA-WMM is 0.312-0.382, and the average value is 0.3491. The results show that the wavelet neural network has better prediction stability than the back propagation neural network. Under the genetic algorithm, the prediction dispersion of the wavelet neural network can be further reduced, and the prediction accuracy can be improved.
[0076] Figure 3 The MAE distribution of the three networks. MSE focuses on the error size of the entire sample. The larger the MAE, the larger the prediction error, and vice versa. The sample MAE result of BPNN is mainly distributed in the range of 0.349-0.377, and the average value is 0.3654. The MAE range of WNN sample is 0.339-0.376, and the average is 0.3620. The MAE range of GA-WMM is 0.335-0.372, and the average is 0.3563. The results show that the prediction error of GA-WNN is generally lower than that of BPNN and wavelet neural network, but in some samples, the MAE of wavelet neural network is higher than that of BPNN, making the prediction error of wavelet neural network larger. Under the optimization of genetic algorithm, the overall MAE error of wavelet neural network is well improved, and the stability is better than that of BP.
[0077] Figure 4 The R 2 distribution of the results, R 2 represents the fitting degree between two samples. Generally, R2 is between 0 and 1. The closer to 1, the better the fitting degree; otherwise, the worse the fitting effect. The calculation results show that the sample results of BPNN are mainly distributed in the range of 0.976-0.980, and the average value is 0.9779. The sample result distribution of WNN is between 0.978 and 0.982, and the average value is 0.9802. The distribution range of G-WNN is 0.979-0.983, and the average is 0.9807. G-WNN is also better than WNN and BP, and the R 2 distribution result is more concentrated in the higher interval.
[0078] Figure 5 The three kinds of neural network prediction and actual results are compared under continuous time, and the GA-WNN shows strong prediction ability and small error. Figure 6The graph shows the change in the loss function during network training. As can be seen from the figure, GA-WNN has the fastest convergence speed, achieving convergence within 8 cycles, compared to BPNN and WNN (which converge in approximately 15 cycles). This also verifies the optimization effect of the genetic algorithm on network training speed.
[0079] Table 2. MSE, MAE, and R under three neural networks 2 mean
[0080]
[0081] Table 2 presents the MSE, MAE, and R of the test and training results for the three neural networks. 2 The average value is calculated. Compared to backpropagation (BP), wavelet neural networks have a greater advantage in prediction accuracy, maintaining most results at a good prediction level. Genetic algorithms further improve the stability of wavelet neural network prediction performance, increase convergence accuracy during training, and accelerate training speed. In conclusion, wavelet neural networks demonstrate good performance in greenhouse temperature prediction and are highly feasible for greenhouse control applications.
[0082] The above-disclosed embodiments are merely a few specific examples of the present invention. Those skilled in the art can make various modifications and variations to the embodiments of the present invention without departing from the spirit and scope of the present invention. However, the embodiments of the present invention are not limited thereto, and any changes that those skilled in the art can conceive of should fall within the protection scope of the present invention.
Claims
1. A genetic algorithm optimized wavelet neural network greenhouse temperature prediction modeling method, characterized in that, The method comprises the following steps: acquiring a plurality of greenhouse temperature related variables at the current time; generating an initial genetic population of a genetic algorithm according to initial weight parameters of a wavelet neural network (WNN); constructing a fitness function of the genetic algorithm according to a prediction result of the wavelet neural network (WNN) and an actual output result, and using the fitness function to evaluate individuals of the genetic population; screening the optimal initial weight parameters through the genetic algorithm; constructing a greenhouse temperature prediction model based on the wavelet neural network (WNN) by using the optimal initial weight parameters; inputting the plurality of greenhouse temperature related variables at the current time into the greenhouse temperature prediction model based on the wavelet neural network (WNN), and outputting a prediction value of the greenhouse temperature at a future time; the plurality of greenhouse temperature related variables at the current time comprise: Greenhouse exterior temperature, greenhouse exterior humidity, greenhouse exterior wind speed, greenhouse interior temperature, greenhouse interior concentration and greenhouse interior light intensity.
2. The genetic algorithm optimized wavelet neural network greenhouse temperature prediction modeling method according to claim 1, characterized in that, the genetic algorithm is configured with an initial population of 50, a crossover probability of 0.8, a mutation probability of 0.6, and a total of 50 population evolutions.
3. The genetic algorithm optimized wavelet neural network greenhouse temperature prediction modeling method according to claim 1, characterized in that, The fitness function of the genetic algorithm, whose calculation formula includes: wherein is the actual output result of the wavelet neural network (WNN) sample i, is the predicted output result of sample i, and n is the total number of samples being tested.
4. The genetic algorithm optimized wavelet neural network greenhouse temperature prediction modeling method according to claim 1, characterized in that, The method further comprises training the greenhouse temperature prediction model based on the wavelet neural network (WNN), which comprises the following steps: a plurality of forward transmission and reverse transmission processes, error calculation between a network training output and an actual output, and a plurality of iterations to correct wavelet neural network connection weight values and wavelet base function parameters.
5. The genetic algorithm optimized wavelet neural network greenhouse temperature prediction modeling method according to claim 4, characterized in that, the forward transmission of the greenhouse temperature prediction model based on the wavelet neural network (WNN) comprises the following steps: the input layer is configured with 8 input nodes; the hidden layer is configured with 10 nodes, and the activation function is a Morlet wavelet base function, and the forward transmission equation comprises: the output layer is configured with one output node, and the activation function is Purelin, and the forward transmission equation comprises: wherein , ; ; ; is the output of the jth hidden layer node of the hidden layer; represents the ith input to the neural network; is the Molet wavelet basis function taken at is the weight of input node i to hidden node j; is the scaling variable; is the translation variable; is the output of the kth node of the output layer; is the weight of connected hidden node j to output node k.
6. The genetic algorithm optimized wavelet neural network greenhouse temperature prediction modeling method according to claim 4, characterized in that, the plurality of forward transmission and reverse transmission processes, error calculation between a network training output and an actual output, and a plurality of iterations to correct wavelet neural network connection weight values and wavelet base function parameters, specifically comprise the following steps: a gradient descent method is used to perform reverse transmission on the greenhouse temperature prediction model based on the wavelet neural network (WNN), partial differentiation or total differentiation is performed on input error and output error e, the gradient of each weight value p is calculated, and the weight parameters of each node are updated step by step, wherein the error e and the weight update equation comprise: ; ; ; wherein, is the actual output of sample k, is the predicted output of sample k, p denotes each class weight parameter (e.g. ), is the gradient error calculated for each weight parameter; t denotes the t-th backpropagation process.
7. The genetic algorithm optimized wavelet neural network greenhouse temperature prediction modeling method according to claim 1, characterized in that, the method further comprises the following steps: The mean square error (MSE), mean absolute error (MAE), and coefficient of determination (R 2 The performance of the greenhouse temperature prediction models was compared using the evaluation function method.
Citation Information
Patent Citations
Thermal Error Prediction Method of Machine Tool Spindle Based on Genetic Algorithm and Wavelet Neural Network
CN109146209A
Intelligent detection system for eggplant greenhouse environment based on wavelet neural network
CN110069032A
Wavelet neural network tomato yield prediction method based on genetic algorithm
CN110414115A