Search

CN-116681109-B - Edible fungus growth environment prediction method and system based on optimized BP neural network

CN116681109BCN 116681109 BCN116681109 BCN 116681109BCN-116681109-B

Abstract

The application discloses an edible fungus growth environment prediction method and system based on an optimized BP neural network, wherein the weight and the threshold of the BP neural network are set as the solution space of a wild dog optimization algorithm, the fitness of each individual in the wild dog population is evaluated by calculating the error function of the BP neural network, the optimal individual is updated, and the optimal solution vector is obtained after the parameters of the wild dog optimization algorithm and the BP neural network are alternately optimized, so that the optimal weight and the threshold of the BP neural network are obtained, and a BP neural network model based on the wild dog algorithm optimization is constructed according to the final weight and the threshold. And inputting edible fungus growth environment data of a past period of time into the model, and outputting a predicted edible fungus growth environment of a future period of time. The fusion algorithm can predict the edible fungus growth environment at the future time, so that the regulation and control equipment responds to sudden environmental changes in time and provides a stable environment for edible fungus growth all the time.

Inventors

  • LI TIANHUA
  • Dong yinxing
  • SHI GUOYING
  • WU XIULAN
  • CHEN CHAO
  • SU JIANCHANG

Assignees

  • 山东农业大学

Dates

Publication Date
20260512
Application Date
20230625

Claims (7)

  1. 1. An edible fungus growth environment prediction method based on an optimized BP neural network is characterized by comprising the following steps: Acquiring and preprocessing edible fungus growth environment parameters in real time, wherein the edible fungus growth environment parameters comprise air temperature, humidity, CO 2 concentration, culture bed temperature and humidity; selecting a BP neural network model structure, and determining BP neural network model parameters; Setting the weight and the threshold of the BP neural network model as a solution space of a wild dog optimization algorithm, and initializing the wild dog optimization algorithm; the setting of the weight and the threshold of the BP neural network model as the solution space of the wild dog optimization algorithm comprises the following steps: The weight and the threshold value of the BP neural network are expressed as a column vector; After the weight and the threshold are expressed as a column vector, initializing a wild dog optimization algorithm population, wherein each individual in the population is a solution vector; the initializing wild dog optimization algorithm comprises the following steps: The population size is set to 200, p=0.5, q=0.7, where P is the probability of hunting or perishable strategy, Q is the probability of a population attack or a forced attack, Is that Random numbers in between; optimizing step one, if population attack And is also provided with Then execution is performed: representing movement of the wild dog for searching for a new location of the agent; Is that Random integer generated by the inverse of (1), wherein Total number of wild dogs; Is a subset of search agents representing wild dogs that will attack, where , Is a randomly generated wild dog population; Is the current search agent; the best search agent found for the previous iteration, Is a region A random number which is uniformly generated in the wild dog, which is a scale factor and changes the size of the wild dog motion trail; the second step of optimizing is that the forced injury, Then execution is performed: is a random number uniformly generated in the area [ -1,1], Is at the slave side A random number generated in the interior of the container, Is randomly selected of The number of search agents that are involved in the search, ; And step three, eating the rotten, if range > P, executing: When obtained Wherein Is a lower survival search agent that will be updated, And Is that Internally generated random numbers, an , Is the best search agent found in the last iteration, Random numbers uniformly generated in the area [0,1]; optimizing the wild dog survival rate: And The worst and best fitness values in the current generation respectively The current fitness value of the ith search agent is used as the individual fitness value by taking the absolute value of the training data error; performing repeated iterative training on the BP neural network model by using the preprocessed edible fungus growth environment data to acquire a test error; Taking a test error function of the BP neural network as an adaptability function of a wild dog optimization algorithm; Taking the model test error as a new fitness value of each individual, updating the optimal individual, and judging whether a stopping criterion is met; after alternately optimizing network parameters through a wild dog optimization algorithm and a BP neural network, obtaining an optimal weight and a threshold of the BP neural network, and constructing a BP neural network model optimized based on the wild dog algorithm according to the final weight and the threshold; And (3) inputting edible fungus growth environment data of a preset time period in the past to the BP neural network model optimized based on the wild dog algorithm, and outputting predicted edible fungus growth environment data at a future moment.
  2. 2. The method for predicting the growth environment of edible fungi based on the optimized BP neural network according to claim 1, wherein the steps of acquiring the growth environment parameters of the edible fungi in real time and preprocessing comprise: Processing the collected original data by using a Dixon criterion to remove abnormal values, wherein the method comprises the following steps: sorting sample data from small to large , For the number of repeated observations; Calculating And Of (2), wherein Is to check for residual low-end outliers, Is to check the residual error high-end outlier by giving the significance level Is to find the critical value in the probability statistics table Wherein: , When (1) > And is also provided with > Then Is abnormal value when > And is also provided with < Then If the value is abnormal, otherwise, the value is not abnormal; The collected air temperature and humidity, the culture bed temperature and humidity and the concentration of air CO 2 form a sample data set X= { X1, X2, X3, X4 and X5}; The data is normalized, and the process is as follows: Wherein, the For sample data sets Environmental data in; And For the minimum value and the maximum value before normalization, the normalization operation on the sample data set is completed, and the normalized data sample set Directly used for inputting and outputting data required by the establishment of a subsequent model, wherein the air temperature is The air humidity is The temperature of the culture bed is The temperature of the culture bed is The concentration of CO2 in the air is 。
  3. 3. The method for predicting the growth environment of edible fungi based on the optimized BP neural network according to claim 1, wherein the selecting the BP neural network model structure and determining the BP neural network model parameters comprises: The selected BP neural network model comprises three layers of feedforward networks, namely an input layer, a middle layer and an output layer, wherein the input layer is provided with 5 nodes, the output layer is provided with 5 nodes, and the selection of the hidden layer nodes has an empirical formula: Where h is the number of hidden layer nodes, m is the number of input layer nodes, n is the number of output layer nodes, Is that An adjustment constant therebetween; Adding sample sets at the input layer Let the input sum of the i-neurons of the k-th layer be expressed as The output is The weight coefficient from the jth neuron of the kth-1 layer to the ith neuron of the kth layer is Threshold value is The activation function of each neuron is The relationship of the variables can be expressed by the following relational expression: Defining a test error function: Weight value Updating Threshold value Updating The output calculated for the training samples is calculated, In order to train the true value of the sample, Is a learning rate, wherein ; Determining BP neural network model parameters according to the BP neural network model structure, wherein the training times are set to 200 times, and the learning rate is set to 200 times Set to 0.01 and the training target minimum error set to 0.00001.
  4. 4. The method for predicting the growth environment of edible fungi based on the optimized BP neural network according to claim 1, wherein the fitness function is used for evaluating wild dog strains group of individuals, and the smaller the individual fitness value is, the more advantageous the individual is.
  5. 5. The method for predicting the growth environment of edible fungi based on the optimized BP neural network according to claim 1, wherein the stopping criterion of the optimal individual is updated as an error function threshold or a maximum iteration number.
  6. 6. The method for predicting the growth environment of edible fungi based on the optimized BP neural network of claim 2, wherein the step of inputting the growth environment data of the edible fungi for a preset period of time into the BP neural network model optimized based on the wild dog algorithm comprises the steps of As input data.
  7. 7. An edible fungus growth environment prediction system based on an optimized BP neural network is characterized by comprising: The pretreatment module is used for acquiring the growth environment parameters of the edible fungi in real time and carrying out pretreatment, wherein the growth environment parameters of the edible fungi comprise air temperature, humidity, CO 2 concentration, culture bed temperature and humidity; The determining module is used for selecting a BP neural network model structure and determining BP neural network model parameters; The algorithm initialization module is used for setting the weight and the threshold value of the BP neural network model as the solution space of the wild dog optimization algorithm and initializing the wild dog optimization algorithm; the setting of the weight and the threshold of the BP neural network model as the solution space of the wild dog optimization algorithm comprises the following steps: The weight and the threshold value of the BP neural network are expressed as a column vector; After the weight and the threshold are expressed as a column vector, initializing a wild dog optimization algorithm population, wherein each individual in the population is a solution vector; the initializing wild dog optimization algorithm comprises the following steps: The population size is set to 200, p=0.5, q=0.7, where P is the probability of hunting or perishable strategy, Q is the probability of a population attack or a forced attack, Is that Random numbers in between; optimizing step one, if population attack And is also provided with Then execution is performed: representing movement of the wild dog for searching for a new location of the agent; Is that Random integer generated by the inverse of (1), wherein Total number of wild dogs; Is a subset of search agents representing wild dogs that will attack, where , Is a randomly generated wild dog population; Is the current search agent; the best search agent found for the previous iteration, Is a region A random number which is uniformly generated in the wild dog, which is a scale factor and changes the size of the wild dog motion trail; the second step of optimizing is that the forced injury, Then execution is performed: is a random number uniformly generated in the area [ -1,1], Is at the slave side A random number generated in the interior of the container, Is randomly selected of The number of search agents that are involved in the search, ; And step three, eating the rotten, if range > P, executing: When obtained Wherein Is a lower survival search agent that will be updated, And Is that Internally generated random numbers, an , Is the best search agent found in the last iteration, Random numbers uniformly generated in the area [0,1]; optimizing the wild dog survival rate: And The worst and best fitness values in the current generation respectively The current fitness value of the ith search agent is used as the individual fitness value by taking the absolute value of the training data error; The training module is used for carrying out repeated iterative training on the BP neural network model by utilizing the preprocessed edible fungus growth environment data to acquire a test error; the fitness function construction module is used for taking a test error function of the BP neural network as a fitness function of the wild dog optimization algorithm; the judging module is used for taking the model test error as a new fitness value of each individual, updating the optimal individual and judging whether the stopping criterion is met or not; the model construction module is used for obtaining the optimal weight and the threshold value of the BP neural network after alternately optimizing the network parameters through the wild dog optimization algorithm and the BP neural network, and constructing a BP neural network model based on the wild dog algorithm optimization according to the final weight and the threshold value; the environment data prediction module is used for inputting edible fungus growth environment data of a preset time period in the past to the BP neural network model optimized based on the wild dog algorithm and outputting predicted edible fungus growth environment data at a future time.

Description

Edible fungus growth environment prediction method and system based on optimized BP neural network Technical Field The application relates to the technical field of edible fungus culture, in particular to an edible fungus growth environment prediction method and system based on an optimized BP neural network. Background The edible fungi culture in the prior art is a modern agricultural production mode of artificially simulating the growth environment of fungi by using advanced scientific and technical equipment, including growth conditions such as illumination, temperature, ventilation, humidity and the like, and cultivating by using standardized production flow and automatic mechanical equipment. The industrial edible fungi culture can effectively improve the culture efficiency and increase the production income, and compared with the traditional artificial greenhouse culture mode, the industrial edible fungi culture has the advantages of high efficiency, high yield, stress resistance and the like, combines intelligent control, high-tech automation and biotechnology into a whole, can effectively reduce the restriction of natural conditions such as climate, season and the like, and reduces the occurrence rate of plant diseases and insect pests to cultivate foods in an industrial mode. In the whole edible fungus culture process, the growth environment regulation is one of the most main edible fungus culture technologies, and strict environmental control is required from the configuration culture to fruiting throughout the whole edible fungus production process. The edible fungus growth environment control system is a nonlinear, multi-coupling and large-lag complex dynamic system, and the unreasonable environment can cause the growth failure and slow growth of the edible fungus, so that the change trend of the edible fungus growth environment is accurately predicted, an ideal environment which is beneficial to the growth of the edible fungus is obtained, and the crop yield can be increased, the quality can be improved, the growth period can be regulated, and the economic benefit can be improved. Therefore, how to realize accurate control of the growth environment of the edible fungi in the edible fungi culture process is a technical problem to be solved in the field. Disclosure of Invention In order to solve the technical problems, the application provides the following technical scheme: In a first aspect, an embodiment of the present application provides a method for predicting an edible fungus growth environment based on an optimized BP neural network, including: Acquiring and preprocessing edible fungus growth environment parameters in real time, wherein the edible fungus growth environment parameters comprise air temperature, humidity, CO2 concentration, culture bed temperature and humidity; selecting a BP neural network model structure, and determining BP neural network model parameters; Setting the weight and the threshold of the BP neural network model as a solution space of a wild dog optimization algorithm, and initializing the wild dog optimization algorithm; performing repeated iterative training on the BP neural network model by using the preprocessed edible fungus growth environment data to acquire a test error; Taking a test error function of the BP neural network as an adaptability function of a wild dog optimization algorithm; Taking the model test error as a new fitness value of each individual, updating the optimal individual, and judging whether a stopping criterion is met; after alternately optimizing network parameters through a wild dog optimization algorithm and a BP neural network, obtaining an optimal weight and a threshold of the BP neural network, and constructing a BP neural network model optimized based on the wild dog algorithm according to the final weight and the threshold; And (3) inputting edible fungus growth environment data of a preset time period in the past to the BP neural network model optimized based on the wild dog algorithm, and outputting predicted edible fungus growth environment data at a future moment. In one possible implementation manner, the acquiring and preprocessing the edible fungi growth environment parameters in real time includes: Processing the collected original data by using a Dixon criterion to remove abnormal values, wherein the method comprises the following steps: Sequencing sample data from small to large to x (1)≤x(2)≤x(3)≤…≤x(n), wherein n is the number of repeated observation; The values of r 10 and r '10 are calculated, where r 10 is the test residual low-end outlier and r' 10 is the test residual high-end outlier. The threshold D (n, a) is found in the probabilistic statistics by a condition given the significance level a, wherein: When r 10 > D (n, a) and r 10>r′10, then x (n) is an outlier, when r 10 > D (n, a) and r 10<r′10, then x (1) is an outlier, otherwise there is no outlier; The collected air temperature and humidity, the culture