Edible mushroom growth environment prediction method and system based on optimized BP neural network
By optimizing the BP neural network and combining it with the Dixon criterion and the wild dog optimization algorithm, accurate prediction of the growth environment of edible fungi was achieved, solving the problem of inaccurate environmental control in existing technologies and improving yield and quality.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHANDONG AGRICULTURAL UNIVERSITY
- Filing Date
- 2023-06-25
- Publication Date
- 2026-05-12
AI Technical Summary
In existing technologies, it is difficult to accurately predict the growth environment of edible fungi, resulting in poor development, slow growth, and affecting yield and quality.
A method based on optimized BP neural network, combined with Dixon criterion and wild dog optimization algorithm, is used to obtain environmental parameters of edible fungi growth in real time. By training the BP neural network through multiple iterations, the weights and thresholds are optimized to predict future environmental changes.
It improves the accuracy and efficiency of predicting the growth environment of edible fungi, reduces the risk of falling into local minima, and increases yield and quality.
Smart Images

Figure CN116681109B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of edible fungi cultivation technology, specifically to a method and system for predicting the growth environment of edible fungi based on an optimized BP neural network. Background Technology
[0002] Current edible mushroom cultivation technology utilizes advanced scientific and technological equipment to artificially simulate the growth environment of fungi, including growth conditions such as light, temperature, ventilation, and humidity. It is a modern agricultural production method that employs standardized production processes and automated machinery. Factory-style edible mushroom cultivation effectively improves cultivation efficiency and increases production profits. Compared with traditional artificial greenhouse cultivation, factory-style cultivation has advantages such as high efficiency, high yield, and resilience. It integrates intelligent control, high-tech automation, and biotechnology, effectively reducing the constraints of natural conditions such as climate and season, and lowering the incidence of pests and diseases.
[0003] In the entire process of edible mushroom cultivation, the regulation of the growth environment is one of the most crucial technologies, permeating the entire production process. From preparing the substrate to fruiting, strict environmental control is required. The edible mushroom growth environment control system is a complex dynamic system characterized by nonlinearity, multiple couplings, and significant lag. An unsuitable environment can lead to poor development and slow growth of edible mushrooms. Accurately predicting the changing trends of the edible mushroom growth environment and obtaining an ideal environment conducive to mushroom growth can increase crop yield, improve quality, regulate the growth cycle, and enhance economic benefits.
[0004] Therefore, how to accurately control the growth environment of edible fungi during the cultivation process is a technical problem that urgently needs to be solved in this field. Summary of the Invention
[0005] In order to solve the above-mentioned technical problems, this application proposes the following technical solution:
[0006] In a first aspect, embodiments of this application provide a method for predicting the growth environment of edible fungi based on an optimized BP neural network, including:
[0007] Real-time acquisition and preprocessing of edible fungi growth environment parameters, including: air temperature, humidity, CO2 concentration, culture bed temperature and humidity;
[0008] Select the BP neural network model structure and determine the BP neural network model parameters;
[0009] Set the weights and thresholds of the BP neural network model to the solution space of the Wild Dog optimization algorithm, and initialize the Wild Dog optimization algorithm.
[0010] The BP neural network model was trained iteratively multiple times using preprocessed edible fungi growth environment data to obtain the test error.
[0011] The test error function of the BP neural network is used as the fitness function of the Wild Dog optimization algorithm;
[0012] The model test error is used as the new fitness value for each individual to update the best individual, and it is then determined whether the stopping criterion is met.
[0013] After alternately optimizing the network parameters using the Wild Dog optimization algorithm and the BP neural network, the optimal weights and thresholds of the BP neural network are obtained. Based on the final weights and thresholds, a BP neural network model optimized by the Wild Dog algorithm is constructed.
[0014] Input past edible fungus growth environment data for a preset time period into a BP neural network model optimized by the Wild Dog algorithm, and output predicted edible fungus growth environment data for future time periods.
[0015] In one possible implementation, the real-time acquisition and preprocessing of edible fungi growth environment parameters includes:
[0016] The Dixon criterion is used to process the collected raw data to remove outliers, including:
[0017] Sort the sample data in ascending order as x (1) ≤x (2) ≤x (3) ≤…≤x (n) , where n is the number of repeated observations;
[0018] Calculate r 10 and r′ 10 The value of r, where r 10 It is used to detect low-end outliers in the residuals, r′ 10 This involves detecting high-order outliers in the residuals. Given a significance level α, the critical value D(n, a) is found in the probability statistics table, where: When r 10 >D(n, a) and r 10 >r′ 10 If r is an outlier, then x(n) is an outlier; when r 10 >D(n, a) and r 10 <r′ 10 If x(1) is an outlier, then x(1) is an outlier; otherwise, there is no outlier.
[0019] The collected air temperature and humidity, culture bed temperature and humidity, and air CO2 concentration form a sample dataset X = {X1, X2, X3, X4, X5};
[0020] The data is normalized as follows:
[0021]
[0022] Among them, X i The environmental data in the sample dataset X; x imin and x imax The minimum and maximum values before normalization are used to complete the normalization operation on the sample dataset. The normalized data sample set X′={X′1,X′2,X′3,X′4,X′5} is directly used as the input and output data required for subsequent model building, where air temperature is X′1, air humidity is X′2, culture bed temperature is X′3, culture bed temperature is X′4, and air CO2 concentration is X′5.
[0023] In one possible implementation, selecting the BP neural network model structure and determining the BP neural network model parameters includes:
[0024] The selected BP neural network model contains three feedforward layers: an input layer, an intermediate layer, and an output layer. The input layer has 5 nodes, the output layer has 5 nodes, and there is an empirical formula for selecting the hidden layer nodes:
[0025]
[0026] 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, and a is an adjustment constant between 1 and 10;
[0027] Add a sample set X′ to the input layer, and let the sum of the inputs to neuron i in the k-th layer be expressed as... The output is The weight coefficients from the j-th neuron in the (k-1)-th layer to the i-th neuron in the k-th layer are W. ij Threshold is The activation function for each neuron is the sigmoid function: The relationship between the variables can be expressed by the following mathematical formula:
[0028]
[0029]
[0030] Define the error function:
[0031]
[0032] Weight W ij renew
[0033]
[0034] threshold renew
[0035]
[0036] The output calculated for the training samples, Yi is the true value of the training samples, and ε is the learning rate, where ε∈(0.1];
[0037] Based on the BP neural network model structure, the BP neural network model parameters are determined as follows: the number of training iterations is set to 200, the learning rate ε is set to 0.01, and the minimum training error is set to 0.00001.
[0038] In one possible implementation, setting the weights and thresholds of the BP neural network model as the solution space of the Wild Dog optimization algorithm includes:
[0039] The weights and thresholds of the BP neural network are represented as a column vector;
[0040] After representing the weights and thresholds as a column vector, the population of the Wild Dog optimization algorithm is initialized, and each individual in the population is a solution vector.
[0041] In one possible implementation, the initialization of the wild dog optimization algorithm includes:
[0042] Set the population size to 200, P = 0.5, Q = 0.7, where P is the probability of hunting or scavenging strategy, Q is the probability of group attack or persecution attack, and random is a random number between [0, 1].
[0043] Optimization Step 1: Mass Attack. If random < P and random < Q, then execute:
[0044]
[0045] The new location of the search agent is represented by the movement of the wild dogs; na is a random integer generated from the reciprocal of [2, sizepop / 2], where sizepop is the total number of wild dogs; It is a subset of the search agent, representing the wild dogs that will attack, where X is a randomly generated population of wild dogs; It is the current search agent; The best search agent found in the previous iteration is β1, which is a uniformly generated random number in the region [-2,2]. This is a scaling factor that changes the size of the wild dog's movement trajectory.
[0046] Optimization Step Two: Persecution, if random < P, then execute:
[0047]
[0048] β2 is a uniformly generated random number within the region [-1, 1], and r1 is a random number generated from the region [1, sizepop]. It is the r1th search agent selected randomly, i≠r1;
[0049] Optimization Step 3: Carrion Consumption. If random > P, then execute:
[0050]
[0051]
[0052] When the obtained survival(i) ≤ 0.3, where This is the search agent with a lower survival rate that will be updated. r1 and r2 are random numbers generated within [1, sizepop]. It is the best search agent found in the previous iteration, and σ is a uniformly generated random number in the region [0, 1].
[0053] Optimization Step 4: Stray Dog Survival Rate
[0054]
[0055] fitness max and fitness min These are the worst and best fitness values in the current generation, respectively, while fitness(i) is the current fitness value of the i-th search agent. The absolute value of the training data error is used as the individual fitness value.
[0056] In one possible implementation, the fitness function is used to evaluate individuals in a wild dog population; the smaller the fitness value of an individual, the more superior that individual is.
[0057] In one possible implementation, the stopping criterion for updating the optimal individual is either an error function threshold or the maximum number of iterations.
[0058] In one possible implementation, the step of inputting past edible fungi growth environment data for a preset time period into a BP neural network model optimized by the Wild Dog algorithm includes: using a normalized data sample set X′={X′1,X′2,X′3,X′4,X′5} as input data.
[0059] Secondly, embodiments of this application provide a prediction system for the growth environment of edible fungi based on an optimized BP neural network, comprising:
[0060] The pretreatment module is used to acquire and preprocess environmental parameters of edible fungi in real time. These environmental parameters include air temperature, humidity, CO2 concentration, and culture bed temperature and humidity.
[0061] The determination module is used to select the BP neural network model structure and determine the BP neural network model parameters.
[0062] The algorithm initialization module is used to set the weights and thresholds of the BP neural network model to the solution space of the Wild Dog optimization algorithm, and to initialize the Wild Dog optimization algorithm.
[0063] The training module is used to iteratively train the BP neural network model using preprocessed edible fungi growth environment data to obtain the test error.
[0064] The fitness function construction module is used to use the test error function of the BP neural network as the fitness function of the Wild Dog optimization algorithm;
[0065] The decision module is used to use the model test error as the new fitness value for each individual, update the best individual, and determine whether the stopping criterion is met.
[0066] The model building module is used to obtain the optimal weights and thresholds of the BP neural network after alternately optimizing the network parameters using the Wild Dog optimization algorithm and the BP neural network, and to build a BP neural network model based on the final weights and thresholds.
[0067] The environmental data prediction module is used to input past edible fungus growth environment data for a preset time period into a BP neural network model optimized based on the Wild Dog algorithm, and output predicted edible fungus growth environment data for future time periods.
[0068] In this embodiment, the weights and thresholds of the BP neural network are used as the solution vectors of the wild dog optimization algorithm, and the prediction error of the BP neural network is used as the individual fitness value for the next iteration. The wild dog optimization algorithm quickly searches for the optimal weights and thresholds, effectively avoiding the disadvantage of the BP neural network being prone to getting trapped in local minima, accelerating the network convergence speed, improving the performance of the neural network, and making it better suited for predicting data on the growth environment of edible fungi. Attached Figure Description
[0069] Figure 1 A flowchart illustrating a method for predicting the growth environment of edible fungi based on an optimized BP neural network, provided in an embodiment of this application;
[0070] Figure 2 This is a schematic diagram of an edible fungus growth environment prediction system based on an optimized BP neural network, provided as an embodiment of this application. Detailed Implementation
[0071] The present solution will now be described in conjunction with the accompanying drawings and specific embodiments.
[0072] Figure 1 A flowchart illustrating a method for predicting the growth environment of edible fungi based on an optimized BP neural network, as provided in this application embodiment, is shown below. Figure 1 The method for predicting the growth environment of edible fungi based on an optimized BP neural network in this embodiment includes:
[0073] S101, real-time acquisition and preprocessing of edible fungi growth environment parameters, including: air temperature, humidity, CO2 concentration, culture bed temperature and humidity.
[0074] The obtained environmental parameters for edible fungi growth are used as input to the prediction model, and the environmental parameters for edible fungi growth 10 minutes later are output, allowing for advance adjustment of the environmental parameters. Before being input into the prediction model, the acquired edible fungi growth environment data undergoes data preprocessing to remove outliers, standardize data range and units, and reduce the impact of the data on the model's convergence and prediction performance.
[0075] Specifically, the Dixon criterion is used to process the collected raw data to remove outliers. The process is as follows:
[0076] Sort the sample data in ascending order as x (1) ≤x (2) ≤x (3) ≤…≤x (n) Where n is the number of repeated observations, and since each environmental parameter is observed 4 times, n = 4; the formula is defined as follows when n = 3 to 7:
[0077]
[0078]
[0079] Calculate r 10 and r′ 10 The value of r, where r 10 It is used to detect low-end outliers in the residuals, r′ 10 This involves detecting high-end outliers in the residuals. Given a significance level α, the critical value D(n, a) is found in a probability statistics table. When r... 10 >D(n, a), r 10 >r′ 10 If r is an outlier, then x(n) is an outlier; when r 10 >D(n, a), r 10 <r′ 10 If x(1) is an outlier, then x(1) is an outlier; otherwise, there is no outlier.
[0080] The collected air temperature and humidity, culture bed temperature and humidity, and air CO2 concentration data form a sample dataset X = {X1, X2, X3, X4, X5}. The process is as follows:
[0081]
[0082] Among them, X i The environmental data in the sample dataset X; x imin and x imax These represent the minimum and maximum values of the data before normalization. Formula (2.3) is used to normalize the sample dataset, resulting in the normalized data sample set X′={X′1, X′2, X′3, X′4, X′5}, which can be directly used as the input and output data required for subsequent model building. Here, air temperature is X′1, air humidity is X′2, culture bed temperature is X′3, culture bed temperature is X′4, and air CO2 concentration is X′5.
[0083] S102, Select the BP neural network model structure and determine the BP neural network model parameters.
[0084] The selected BP neural network model contains three feedforward layers: an input layer, an intermediate layer, and an output layer. The input layer has 5 nodes, the output layer has 5 nodes, and there is an empirical formula for selecting the hidden layer nodes:
[0085]
[0086] 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, and a is an adjustment constant between 1 and 10. When a = 9, the number of hidden layer nodes is 12.
[0087] Add a sample set X′ to the input layer, and let the sum of the inputs to neuron i in the k-th layer be expressed as... The output is The weight coefficients from the j-th neuron in the (k-1)-th layer to the i-th neuron in the k-th layer are W. ij Threshold is The activation function for each neuron is the sigmoid function: The relationship between the variables can be expressed by the following mathematical formula:
[0088]
[0089]
[0090] Backpropagation: Gradient Descent
[0091] Define the error function:
[0092]
[0093] Weight W ij renew
[0094]
[0095] threshold renew
[0096]
[0097] The output calculated for the training samples, Yi is the true value of the training samples, and ε is the learning rate, where ε∈(0.1];
[0098] Based on the BP neural network model structure, the BP neural network model parameters are determined as follows: the number of training iterations is set to 200, the learning rate ε is set to 0.01, and the minimum training error is set to 0.00001.
[0099] S103 sets the weights and thresholds of the BP neural network model to the solution space of the Wild Dog optimization algorithm and initializes the Wild Dog optimization algorithm.
[0100] The weights and thresholds of a BP neural network can be represented as a column vector, which can be represented by a one-dimensional array.
[0101] After representing the weights and thresholds as a column vector, the population of the Wild Dog optimization algorithm is initialized, and each individual in the population is a solution vector.
[0102] Set the population size to 200, P = 0.5, Q = 0.7, where P is the probability of hunting or scavenging strategy, Q is the probability of group attack or persecution attack, and random is a random number between [0, 1].
[0103] Optimization Step 1: Mass Attack. If random < P and random < Q, then execute:
[0104]
[0105] The new location of the search agent is represented by the movement of the wild dogs; na is a random integer generated from the reciprocal of [2, sizepop / 2], where sizepop is the total number of wild dogs; It is a subset of the search agent, representing the wild dogs that will attack, where X is a randomly generated population of wild dogs; It is the current search agent; The best search agent found in the previous iteration is β1, which is a uniformly generated random number in the region [-2,2]. This is a scaling factor that changes the size of the wild dog's movement trajectory.
[0106] Optimization Step Two: Persecution, if random < P, then execute:
[0107]
[0108] β2 is a uniformly generated random number within the region [-1, 1], and r1 is a random number generated from the region [1, sizepop]. It is the r1th search agent selected randomly, i≠r1;
[0109] Optimization Step 3: Consume carrion; if random > P, then execute:
[0110]
[0111]
[0112] When the obtained survival(i) ≤ 0.3, where The search agent with a lower survival rate will be updated. r1 and r2 are random numbers generated within [1, sizepop], and r1 ≠ r2. It is the best search agent found in the previous iteration, and σ is a uniformly generated random number in the region [0, 1].
[0113] Optimization Step 4: Stray Dog Survival Rate
[0114]
[0115] fitness max and fitness min These are the worst and best fitness values in the current generation, respectively, while fitness(i) is the current fitness value of the i-th search agent. The absolute value of the training data error is used as the individual fitness value.
[0116] S104. The BP neural network model was trained iteratively multiple times using the pre-processed edible fungus growth environment data to obtain the test error.
[0117] S105 uses the test error function of the BP neural network as the fitness function of the Wild Dog optimization algorithm.
[0118] S106, use the model test error as the new fitness value for each individual, update the optimal individual, and determine whether the stopping criterion is met.
[0119] S107. After alternately optimizing the network parameters using the Wild Dog optimization algorithm and the BP neural network, the optimal weights and thresholds of the BP neural network are obtained. Based on the final weights and thresholds, a BP neural network model optimized by the Wild Dog algorithm is constructed.
[0120] First, the backpropagation (BP) neural network is initialized, and its weights and thresholds are set as the solution space of the wild dog optimization algorithm. The fitness function of the wild dog optimization algorithm is constructed based on the test error of the BP neural network. The population size and individual positions (i.e., weights and thresholds) of the wild dog optimization algorithm are initialized. By calculating the error function of the BP neural network, the fitness of each individual in the wild dog population is evaluated. If the stopping criterion is met, the optimal weights and biases are output; otherwise, the wild dog optimization algorithm randomly adopts methods such as group attack, persecution, and carrion cannibalism based on random values to perform a new round of individual and position updates, calculates the new fitness of each individual, updates the optimal individual, and repeats the process until the stopping criterion is met. The stopping criterion is set as the error function threshold or the maximum number of iterations. The BP neural network is trained using gradient descent.
[0121] S108: Input the edible fungus growth environment data of the past preset time period into the BP neural network model optimized by the Wild Dog algorithm, and output the predicted edible fungus growth environment data for the future time.
[0122] Normalized data sample set X ′ ={X ′ 1,X ′ 2,X ′ 3,X ′ 4,X ′ 5} As input data, the difference between the predicted results and the actual results is compared using an evaluation function to judge the model's performance. The evaluation metrics include: Mean Squared Error (MSE) – a larger MSE indicates a higher degree of prediction error dispersion and a higher error, and vice versa; Mean Absolute Error (MAE) – a larger MAE indicates a higher prediction error and vice versa; and the Fit Coefficient R0. 2 The closer the result is to 1, the better the prediction fit.
[0123] Corresponding to the above embodiment of the method for predicting the growth environment of edible fungi based on an optimized BP neural network, this application also provides an embodiment of an edible fungi growth environment prediction system based on an optimized BP neural network.
[0124] See Figure 2 A mushroom growth environment prediction system 20 based on an optimized BP neural network includes:
[0125] The pretreatment module 201 is used to acquire and preprocess the growth environment parameters of edible fungi in real time. The growth environment parameters of edible fungi include: air temperature, humidity, CO2 concentration, culture bed temperature and humidity.
[0126] The determination module 202 is used to select the BP neural network model structure and determine the BP neural network model parameters.
[0127] The algorithm initialization module 203 is used to set the weights and thresholds of the BP neural network model to the solution space of the Wild Dog optimization algorithm and initialize the Wild Dog optimization algorithm.
[0128] Training module 204 is used to perform multiple iterations of training on the BP neural network model using preprocessed edible fungus growth environment data to obtain test error.
[0129] The fitness function construction module 205 is used to use the test error function of the BP neural network as the fitness function of the Wild Dog optimization algorithm.
[0130] The judgment module 206 is used to use the model test error as the new fitness value for each individual, update the optimal individual, and determine whether the stopping criterion is met.
[0131] The model building module 207 is used to obtain the optimal weights and thresholds of the BP neural network after the network parameters are alternately optimized by the Wild Dog optimization algorithm and the BP neural network, and to build a BP neural network model optimized by the Wild Dog algorithm based on the final weights and thresholds.
[0132] The environmental data prediction module 208 is used to input past edible fungi growth environment data for a preset time period into a BP neural network model optimized based on the Wild Dog algorithm, and output predicted edible fungi growth environment data for future time periods.
[0133] In this application embodiment, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent the existence of A alone, the simultaneous existence of A and B, or the existence of B alone. A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one of the following" and similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, and c can represent: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple.
[0134] The above description is merely a specific embodiment of this application. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the protection scope of this application. The protection scope of this application should be determined by the protection scope of the claims.
Claims
1. A method for predicting the growth environment of edible fungi based on an optimized BP neural network, characterized in that, include: Real-time acquisition and preprocessing of edible fungi growth environment parameters, including: air temperature, humidity, CO2 concentration, culture bed temperature and humidity; Select the BP neural network model structure and determine the BP neural network model parameters; Set the weights and thresholds of the BP neural network model to the solution space of the Wild Dog optimization algorithm, and initialize the Wild Dog optimization algorithm. Setting the weights and thresholds of the BP neural network model as the solution space of the Wild Dog optimization algorithm includes: The weights and thresholds of the BP neural network are represented as a column vector; After representing the weights and thresholds as a column vector, the population of the Wild Dog optimization algorithm is initialized, and each individual in the population is a solution vector; The initialization wild dog optimization algorithm includes: The population size is set to 200, P=0.5, and Q=0.7, where P is the probability of hunting or scavenging strategies, and Q is the probability of group attacks or persecution attacks. for Random numbers between; Optimization Step 1: Group Attack, if and Then execute: To search for the agent's new location, we can represent the movement of the wild dog; yes The random integer generated by the reciprocal of , where This represents the total number of stray dogs; It is a subset of the search agent, representing the wild dogs that will attack, where , It is a randomly generated population of wild dogs; It is the current search agent; The best search agent found in the previous iteration. For the region The uniformly generated random numbers are a scaling factor that changes the size of the wild dog's movement trajectory; Optimization Step Two: Persecution Then execute: The random numbers are uniformly generated within the region [-1, 1]. It is from Internally generated random numbers, It is a randomly selected number. A search agent, ; Optimization Step 3: Consume carrion; if random > P, then execute: When obtained ,in These are search proxies with low survival rates that will be updated. and yes Internally generated random numbers, and , It is the best search agent found in the last iteration. A random number uniformly generated within the region [0,1]. Optimization Step 4: Stray Dog Survival Rate and These are the worst and best fitness values in the current generation, respectively. It is the current fitness value of the i-th search agent, and the absolute value of the training data error is used as the individual fitness value; The BP neural network model was trained iteratively multiple times using preprocessed edible fungi growth environment data to obtain the test error. The test error function of the BP neural network is used as the fitness function of the Wild Dog optimization algorithm; The model test error is used as the new fitness value for each individual to update the best individual, and it is then determined whether the stopping criterion is met. After alternately optimizing the network parameters using the Wild Dog optimization algorithm and the BP neural network, the optimal weights and thresholds of the BP neural network are obtained. Based on the final weights and thresholds, a BP neural network model optimized by the Wild Dog algorithm is constructed. Input past edible fungus growth environment data for a preset time period into a BP neural network model optimized by the Wild Dog algorithm, and output predicted edible fungus growth environment data for future time periods.
2. The method for predicting the growth environment of edible fungi based on an optimized BP neural network according to claim 1, characterized in that, The real-time acquisition and preprocessing of edible fungi growth environment parameters includes: The Dixon criterion is used to process the collected raw data to remove outliers, including: Sort the sample data from smallest to largest as follows: , The number of repeated observations; Calculate and The value of , where It is to detect low-end outliers in the residuals. It is used to detect high-end outliers in residuals, by giving a significance level. Find the critical value in the probability statistics table based on the given conditions. ,in: , ;when > and > ,but It is an outlier; when > and < ,but It is an outlier; otherwise, there is no outlier. The collected air temperature and humidity, culture bed temperature and humidity, and air CO2 concentration form a sample dataset X={X1, X2, X3, X4, X5}; The data is normalized as follows: in, For sample dataset Environmental data; and To find the minimum and maximum values before normalization, perform a normalization operation on the sample dataset. The normalized data sample set will then be generated. This data is directly used as input and output data for subsequent model building, where the air temperature is... 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. The method for predicting the growth environment of edible fungi based on an optimized BP neural network according to claim 1, characterized in that, The selection of the BP neural network model structure and the determination of the BP neural network model parameters include: The selected BP neural network model contains three feedforward layers: an input layer, an intermediate layer, and an output layer. The input layer has 5 nodes, the output layer has 5 nodes, and there is an empirical formula for selecting the hidden layer nodes: Where h is the number of hidden layer nodes, m is the number of input layer nodes, and n is the number of output layer nodes. for The adjustment constant between them; Add a sample set to the input layer. Let the sum of the inputs to neuron i in the k-th layer be expressed as... The output is The weight coefficients from the j-th neuron in layer (k-1) to the i-th neuron in layer k are: Threshold is The activation function of each neuron is The relationship between the variables can be expressed by the following mathematical formula: Define the test error function: weight renew threshold renew The output calculated for the training samples. For the true values of the training samples, Let be the learning rate, where ; Based on the BP neural network model structure, the BP neural network model parameters are determined: the number of training iterations is set to 200, and the learning rate is set to... Set it to 0.01, and set the minimum training error to 0.00001.
4. The method for predicting the growth environment of edible fungi based on an optimized BP neural network according to claim 1, characterized in that, The fitness function is used to evaluate individuals in a wild dog population; the lower the fitness value of an individual, the more superior that individual is.
5. The method for predicting the growth environment of edible fungi based on an optimized BP neural network according to claim 1, characterized in that, The stopping criterion for updating the optimal individual is either the error function threshold or the maximum number of iterations.
6. The method for predicting the growth environment of edible fungi based on an optimized BP neural network according to claim 2, characterized in that, The step of inputting edible fungus growth environment data from a preset time period into the BP neural network model optimized by the Wild Dog algorithm includes: normalizing the data sample set... Data as input.
7. A system for predicting the growth environment of edible fungi based on an optimized BP neural network, characterized in that, include: The pretreatment module is used to acquire and preprocess environmental parameters of edible fungi in real time. These environmental parameters include air temperature, humidity, CO2 concentration, and culture bed temperature and humidity. The determination module is used to select the BP neural network model structure and determine the BP neural network model parameters. The algorithm initialization module is used to set the weights and thresholds of the BP neural network model to the solution space of the Wild Dog optimization algorithm, and to initialize the Wild Dog optimization algorithm. Setting the weights and thresholds of the BP neural network model as the solution space of the Wild Dog optimization algorithm includes: The weights and thresholds of the BP neural network are represented as a column vector; After representing the weights and thresholds as a column vector, the population of the Wild Dog optimization algorithm is initialized, where each individual in the population is a solution vector; The initialization wild dog optimization algorithm includes: The population size is set to 200, P=0.5, and Q=0.7, where P is the probability of hunting or scavenging strategies, and Q is the probability of group attacks or persecution attacks. for Random numbers between; Optimization Step 1: Group Attack, if and Then execute: To search for the agent's new location, we can represent the movement of the wild dog; yes The random integer generated by the reciprocal of , where This represents the total number of stray dogs; It is a subset of the search agent, representing the wild dogs that will attack, where , It is a randomly generated population of wild dogs; It is the current search agent; The best search agent found in the previous iteration. For the region The uniformly generated random numbers are a scaling factor that changes the size of the wild dog's movement trajectory; Optimization Step Two: Persecution Then execute: The random numbers are uniformly generated within the region [-1, 1]. It is from Internally generated random numbers, It is a randomly selected number. A search agent, ; Optimization Step 3: Consume carrion; if random > P, then execute: When obtained ,in These are search proxies with low survival rates that will be updated. and yes Internally generated random numbers, and , It is the best search agent found in the last iteration. A random number uniformly generated within the region [0,1]. Optimization Step 4: Stray Dog Survival Rate and These are the worst and best fitness values in the current generation, respectively. It is the current fitness value of the i-th search agent, and the absolute value of the training data error is used as the individual fitness value; The training module is used to iteratively train the BP neural network model using preprocessed edible fungi growth environment data to obtain the test error. The fitness function construction module is used to use the test error function of the BP neural network as the fitness function of the Wild Dog optimization algorithm; The decision module is used to use the model test error as the new fitness value for each individual, update the best individual, and determine whether the stopping criterion is met. The model building module is used to obtain the optimal weights and thresholds of the BP neural network after alternately optimizing the network parameters using the Wild Dog optimization algorithm and the BP neural network, and to build a BP neural network model based on the final weights and thresholds. The environmental data prediction module is used to input past edible fungus growth environment data for a preset time period into a BP neural network model optimized based on the Wild Dog algorithm, and output predicted edible fungus growth environment data for future time periods.