CN114282702A - Soil conditioning time sequence prediction method and system based on IGA-BP neural network - Google Patents

Soil conditioning time sequence prediction method and system based on IGA-BP neural network Download PDF

Info

Publication number
CN114282702A
CN114282702A CN202111338375.5A CN202111338375A CN114282702A CN 114282702 A CN114282702 A CN 114282702A CN 202111338375 A CN202111338375 A CN 202111338375A CN 114282702 A CN114282702 A CN 114282702A
Authority
CN
China
Prior art keywords
soil
neural network
iga
threshold
fitness
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111338375.5A
Other languages
Chinese (zh)
Inventor
刘艳清
蒋翠清
金政辉
车万留
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hefei University of Technology
Anhui Sierte Fertilizer Industry Co Ltd
Original Assignee
Hefei University of Technology
Anhui Sierte Fertilizer Industry Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hefei University of Technology, Anhui Sierte Fertilizer Industry Co Ltd filed Critical Hefei University of Technology
Priority to CN202111338375.5A priority Critical patent/CN114282702A/en
Publication of CN114282702A publication Critical patent/CN114282702A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention provides a soil conditioning time sequence prediction method, a soil conditioning time sequence prediction system, a storage medium and electronic equipment based on an IGA-BP neural network, and relates to the technical field of soil conditioning. Determining the weight and the threshold of the BP neural network by adopting an IGA algorithm, and taking the weight and the threshold as the optimal weight and threshold; training a BP neural network according to the optimal weight and the threshold value to obtain an IGA-BP neural network model; inputting soil moisture content data into an IGA-BP neural network model to obtain a prediction result of soil nutrients to be predicted; through selecting different target soil components, predicting to obtain a specific soil component evolution rule of the area in a period of time in the future, and meanwhile, combining specific crop growth characteristics and a local soil nutrient grade rating system to bidirectionally match a soil conditioning time sequence to finally determine the optimal nutrients required for soil conditioning.

Description

Soil conditioning time sequence prediction method and system based on IGA-BP neural network
Technical Field
The invention relates to the technical field of soil conditioning, in particular to a soil conditioning time sequence prediction method, a soil conditioning time sequence prediction system, a storage medium and electronic equipment based on an IGA-BP neural network.
Background
The whole growth and development process of any crop can be divided into a plurality of sub-periods, for example, the full growth period of strawberry can be divided into a growth start period, a flowering and fruiting period, a vigorous growth period and a flower bud differentiation period. Because the nutrient substances needed by crops in each period are different, the evolution rule of the soil time sequence is predicted by combining the current specific planted crops and soil moisture content according to massive crop growth and development data, the method has important values in researching the soil evolution rate and direction and establishing a soil nutrient evolution model, and can provide valuable information for the verification of the soil genesis theory. For example, the trend of the soil conditioning time sequence of the crop planting area can be clarified by optimizing the BP neural network by means of a genetic algorithm. The soil conditioning time sequence is used for predicting the evolution law of soil nutrients in a period of time in the future on the basis of massive soil data, and is combined with specific crop growth characteristics and a local soil nutrient grade rating system to bidirectionally match out an optimal soil conditioning component, so that a scientific scheme is provided for further realizing accurate fertilization of crops.
The BP neural network (BP) is a neural network which is widely applied at present, the minimization of an error function is realized on the basis of a steepest descent method, and the gradual correction of an algorithm result is realized through the reverse transfer of an error, so that the accurate prediction of soil nutrients is realized.
Genetic Algorithm (GA) is a kind of randomized search method evolved by the evolution law of the biology world for reference, and is mainly characterized in that a structural object is directly operated without the limitation of derivation and function continuity; the method has the advantages of inherent hidden parallelism and better global optimization capability; by adopting a probabilistic optimization method, the optimized search space can be automatically acquired and guided, the search direction can be adaptively adjusted, and a determined rule is not needed.
However, the common genetic algorithm optimizes the BP neural network to strip the hidden layer ganglion points from the corresponding weights and thresholds, so that the prediction result of the soil conditioning time sequence is inaccurate.
Disclosure of Invention
Technical problem to be solved
Aiming at the defects of the prior art, the invention provides a soil conditioning time sequence prediction method and system based on an IGA-BP neural network, and solves the technical problem that the prediction result of the soil conditioning time sequence is inaccurate.
(II) technical scheme
In order to achieve the purpose, the invention is realized by the following technical scheme:
a soil conditioning time sequence prediction method based on an IGA-BP neural network comprises the following steps:
s1, acquiring and preprocessing soil moisture content data related to soil nutrients to be predicted;
s2, constructing a BP neural network;
s3, determining the weight and the threshold of the BP neural network by adopting an IGA algorithm, and taking the weight and the threshold as the optimal weight and threshold;
s4, training the BP neural network according to the optimal weight and the threshold value to obtain an IGA-BP neural network model;
s5, inputting the soil moisture content data into the IGA-BP neural network model to obtain a prediction result of the soil nutrients to be predicted;
and S6, obtaining an optimal soil conditioning time sequence according to the prediction result of each soil nutrient to be predicted, the crop growth characteristics and the soil nutrient grade rating system.
Preferably, in S1, a correlation test method is used to obtain soil moisture content data related to soil nutrients to be predicted, where the soil nutrients to be predicted include organic matter, calcium, magnesium, or sulfur.
Preferably, the construction process of the BP neural network in S2 specifically includes:
taking the soil moisture content data related to the soil nutrients to be predicted as input parameters; determining the number of nodes of an input layer and the number of nodes of an output layer of the BP neural network by taking the soil nutrients to be predicted as output parameters;
determining the number of hidden layer nodes of the BP neural network according to the number of the input layer nodes and the number of the output layer nodes;
initializing the hidden layer threshold value, the output layer threshold value and the connection weight value from the hidden layer to the input layer and the output layer of the BP neural network.
Preferably, the S3 specifically includes:
s31, acquiring an initial population by adopting real number coding according to the hidden layer threshold value, the output layer threshold value and the connection weight values from the hidden layer to the input layer and the output layer of the BP neural network;
s32, determining a fitness function, and calculating the fitness values of all individuals in the current population;
s33, judging whether the iteration termination condition is met, if yes, turning to S37; otherwise, go to S34;
s34, randomly selecting a parent chromosome from the current population by adopting a sorting selection method;
s35, according to a preset crossover probability, combining a multipoint crossover operator, carrying out crossover operation on the two parent chromosomes to obtain corresponding child chromosomes, wherein the multipoint crossover operator is constructed by combining linear crossover and convex crossover;
s36, performing mutation operation on the two offspring chromosomes according to a preset mutation probability and by combining a mutation operator, updating the current population, and then switching to S32;
s37, selecting the optimal individual from the current population, and taking the weight and the threshold corresponding to the optimal individual as the optimal weight and the threshold.
Preferably, the fitness function in S32 is a relative fitness function, and is determined by a first fitness function;
the first fitness function:
Figure BDA0003351371870000041
Figure BDA0003351371870000042
the relative fitness function:
Figure BDA0003351371870000043
wherein E represents that each sample corresponds to each individual in the current population and is based on the learning error of the BP neural network; m represents the capacity of a training sample comprising the soil nutrients to be predicted and soil moisture data related to the soil nutrients; ol represents the number of output nodes;
Figure BDA0003351371870000044
indicates an error between the tag value of the kth sample with respect to the output of the ith output unit; fitnesslRepresents a first fitness value for the l-th individual, l ═ 1,2, …, popNum; fitnessmax、fitnessminRespectively representing the maximum first fitness value and the minimum first fitness value in the current population.
Preferably, the S35 specifically includes:
defining the cross probability as pcConstructing a cross-selection individual X with the same effective length as the parent chromosomersSaid cross-selecting of individuals XrsRandomly taking the value of 0 or 1 as the gene position xrscAt 0, the parent chromosomes do not cross;
when taking out the gene site xrscWhen 1, the parent chromosome Xr、XsCrossing occurs, the selected crossing site is c, and the corresponding crossing genes are x respectivelyrcAnd xscThe corresponding genes after crossing are respectively xrc' and xsc′;
(1) If the individual XrIs superior to individual XsI.e. fitness'r>fitnesss′s
Figure BDA0003351371870000051
xsc′=xsc+d*(xrc-xsc) (5)
Figure BDA0003351371870000052
(2) If the individual XrIs not superior to individual XsI.e. fitness'r≤fitness′s
Figure BDA0003351371870000053
Figure BDA0003351371870000054
Wherein, 0<d<1 is a constant; rand1Represents a random number between (0, 1); t represents an evolution algebra; t represents the maximum evolution algebra; mc、NcTo represent the gene x of any individual in the constraintcThe upper and lower limits of the value range;
and performing the cross operation on the two parent chromosomes to obtain corresponding child chromosomes.
Preferably, the S36 specifically includes:
defining the mutation probability as pm,xjeRepresents the e-th gene in the jth individual in the parent, lenchrom is the effective length, xje' represents the e gene in the jth individual in the filial generation, j is more than or equal to 1 and less than or equal to popNum, and e is more than or equal to 1 and less than or equal to lenchrom;
Figure BDA0003351371870000061
wherein, rand2To representRandom number between (0,1), when rand2<pmIndicating actual occurrence of a mutation, Me、NeTo represent the gene x of any individual in the constrainteThe upper and lower limits of the range.
A soil conditioning time series prediction system based on an IGA-BP neural network comprises:
the preprocessing module is used for acquiring and preprocessing soil moisture content data related to soil nutrients to be predicted;
the building module is used for building a BP neural network;
the optimization module is used for determining the weight and the threshold of the BP neural network by adopting an IGA algorithm and taking the weight and the threshold as the optimal weight and threshold;
the first obtaining module is used for training the BP neural network according to the optimal weight and the threshold value to obtain an IGA-BP neural network model;
the prediction module is used for inputting the soil moisture content data into the IGA-BP neural network model to obtain a prediction result of the soil nutrients to be predicted;
and the second obtaining module is used for obtaining an optimal soil conditioning time sequence according to the prediction result of each soil nutrient to be predicted, the crop growth characteristics and the soil nutrient grade rating system.
A storage medium storing a computer program for soil conditioning time series prediction based on an IGA-BP neural network, wherein the computer program causes a computer to execute the soil conditioning time series prediction method as described above.
An electronic device, comprising:
one or more processors;
a memory; and
one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the programs comprising instructions for performing a soil conditioning time series prediction method as described above.
(III) advantageous effects
The invention provides a soil conditioning time sequence prediction method, a soil conditioning time sequence prediction system, a storage medium and electronic equipment based on an IGA-BP neural network. Compared with the prior art, the method has the following beneficial effects:
determining the weight and the threshold of the BP neural network by adopting an IGA algorithm, and taking the weight and the threshold as the optimal weight and threshold; training a BP neural network according to the optimal weight and the threshold value to obtain an IGA-BP neural network model; inputting soil moisture content data into an IGA-BP neural network model to obtain a prediction result of soil nutrients to be predicted; through selecting different target soil components, predicting to obtain a specific soil component evolution rule of the area in a period of time in the future, and meanwhile, combining specific crop growth characteristics and a local soil nutrient grade rating system to bidirectionally match a soil conditioning time sequence to finally determine the optimal nutrients required for soil conditioning.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a schematic flow chart of a soil conditioning time series prediction method based on an IGA-BP neural network according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart of another soil conditioning time series prediction method based on an IGA-BP neural network according to an embodiment of the present invention;
fig. 3 is an IGA coding scheme according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of a multi-point intersection provided in accordance with an embodiment of the present invention;
fig. 5 is a schematic diagram illustrating a result of determining a weight and a threshold of a BP neural network by using an IGA algorithm according to an embodiment of the present invention;
fig. 6 is a schematic diagram of a result of training a BP neural network based on optimal weights and thresholds according to an embodiment of the present invention;
FIG. 7 is a graph comparing the effect of the IGA-BP neural network model and the general BP neural network model provided by the embodiment of the present invention;
fig. 8 is a block diagram of another soil conditioning time series prediction system based on an IGA-BP neural network according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention are clearly and completely described, and it is obvious that the described embodiments are a part of the embodiments of the present invention, but not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The embodiment of the application solves the technical problem that the prediction result of the soil conditioning time sequence is inaccurate by providing the soil conditioning time sequence prediction method, the soil conditioning time sequence prediction system, the storage medium and the electronic equipment based on the IGA-BP neural network.
In order to solve the technical problems, the general idea of the embodiment of the application is as follows:
in the embodiment of the invention, the weight and the threshold of the BP neural network are determined by adopting an IGA algorithm and are used as the optimal weight and threshold; training a BP neural network according to the optimal weight and the threshold value to obtain an IGA-BP neural network model; inputting soil moisture content data into an IGA-BP neural network model to obtain a prediction result of soil nutrients to be predicted; through selecting different target soil components, predicting to obtain a specific soil component evolution rule of the area in a period of time in the future, and meanwhile, combining specific crop growth characteristics and a local soil nutrient grade rating system to bidirectionally match a soil conditioning time sequence to finally determine the optimal nutrients required for soil conditioning.
In order to better understand the technical solution, the technical solution will be described in detail with reference to the drawings and the specific embodiments.
Example (b):
in a first aspect, as shown in fig. 1, an embodiment of the present invention provides a soil conditioning time series prediction method based on an IGA-BP neural network, including:
s1, acquiring and preprocessing soil moisture content data related to soil nutrients to be predicted;
s2, constructing a BP neural network;
s3, determining the weight and the threshold of the BP neural network by adopting an IGA algorithm, and taking the weight and the threshold as the optimal weight and threshold;
s4, training the BP neural network according to the optimal weight and the threshold value to obtain an IGA-BP neural network model;
s5, inputting the soil moisture content data into the IGA-BP neural network model to obtain a prediction result of the soil nutrients to be predicted;
and S6, obtaining an optimal soil conditioning time sequence according to the prediction result of each soil nutrient to be predicted, the crop growth characteristics and the soil nutrient grade rating system.
According to the method and the device, different target soil components are selected, the evolution law of the specific soil components in the area in a period of time in the future is predicted, meanwhile, the soil conditioning time sequence is matched in a two-way mode by combining the specific crop growth characteristics and a local soil nutrient grade rating system, and finally the optimal nutrients required for soil conditioning are determined.
The following will specifically describe each step of the above scheme:
and S1, acquiring and preprocessing soil moisture content data related to soil nutrients to be predicted.
In the face of mass soil nutrient data, specific nutrients are selected as output parameters by combining the current growth and development situation of crops, soil components strongly related to the output parameters are selected as input parameters of a model by means of correlation test, namely soil moisture content data related to soil nutrients to be predicted are obtained, and the soil nutrients to be predicted comprise organic matters, calcium, magnesium or sulfur elements and the like.
Because the data units have magnitude difference, for example, the unit of total nitrogen and organic matters is g/kg, and the unit of available phosphorus, available potassium and the like is mg/kg, in order to eliminate the magnitude difference and effectively improve the speed of solving the optimal solution by the gradient descent method, the soil moisture content data is subjected to Min-max normalized pretreatment.
S2, constructing a BP neural network, specifically comprising:
it is first clear that, under reasonable structure and appropriate weighting, a 3-layer BP network can approximate a bounded nonlinear function with arbitrary accuracy, as known by Kolmogarav's theorem. Therefore, the IGA-BP neural network model provided in the embodiment of the present invention selects a layer-3 network structure, i.e., an input layer, a hidden layer, and an output layer, and all adopt a layer-1 network result.
Taking the soil moisture content data related to the soil nutrients to be predicted as input parameters; and determining the number of nodes of an input layer and the number of nodes of an output layer of the BP neural network by taking the soil nutrients to be predicted as output parameters.
Determining the number of hidden layer nodes of the BP neural network according to the number of the input layer nodes and the number of the output layer nodes:
Figure BDA0003351371870000111
wherein hl is the number of hidden layer nodes; il is the number of nodes of the input layer; ol is the number of nodes of the output layer; a is any constant between 0 and 10. Thus, hl is determined by the number of input and output parameters, and the number of nodes in the input layer and the output layer is il and ol, respectively. After the value range of the number of the hidden layer nodes is determined by the empirical formula, the number of the hidden layer nodes is finally determined through continuous training, comparison and selection.
Initializing the hidden layer threshold value, the output layer threshold value and the connection weight value from the hidden layer to the input layer and the output layer of the BP neural network.
S3, determining the weight and the threshold of the BP neural network by using an IGA algorithm, and using the weight and the threshold as an optimal weight and threshold, as shown in fig. 2, specifically including:
and S31, acquiring an initial population by adopting real number coding according to the hidden layer threshold, the output layer threshold and the connection weight from the hidden layer to the input layer and the output layer of the BP neural network.
The weight and the threshold of the BP neural network are optimized by adopting a real number coding mode, namely, a real number is directly used as a gene locus of a chromosome, so that the length of the chromosome is greatly shortened, the complexity of coding and decoding back and forth is avoided, and the genetic operation is simplified. The hybrid coding of the BP neural network parameters can obtain an IGA coding scheme, as shown in fig. 3:
first is the threshold b of the output layer neuronsiFollowed by a threshold B for hidden layer neuronsiAnd the connection weight W with the input layer and output layer neuroni. Wherein, the threshold value and the connection weight value of the hidden layer neuron are shared by (1+ s)i+so)*shAnd (4) respectively.
Thus, the effective length of an individual in an IGA protocol, lenchrom ═ so+(1+si+so)*sh. In the initialization process of the initial weight and the threshold of the genetic algorithm optimization neural network, each individual is a real number string which is formed by the threshold b of the neuron of the output layeriThreshold B of hidden layer neuronsiAnd the connection weight w with the neuron of the output layer of the input layeriAnd each weight value and threshold value adopt real number codes, and the codes of all the weight values and the threshold values are connected to form an individual code. Filling each parameter to be optimized of the BP network into a corresponding position of an individual code according to a coding mode shown in figure 3; and when decoding, taking out corresponding parameters such as the weight and the threshold according to the corresponding position. The real number coding mode associates the hidden layer node with the connection weight to a certain extent, improves the convergence speed of the algorithm, and effectively reduces the calculated amount and the quantization error compared with the traditional binary coding.
And S32, determining a fitness function, and calculating the fitness values of all individuals in the current population.
The fitness function in the step S32 is a relative fitness function, and is determined by a first fitness function;
the first fitness function:
Figure BDA0003351371870000121
Figure BDA0003351371870000122
the relative fitness function:
Figure BDA0003351371870000123
wherein E represents that each sample corresponds to each individual in the current population and is based on the learning error of the BP neural network; m represents the capacity of a training sample comprising the soil nutrients to be predicted and soil moisture data related to the soil nutrients; ol represents the number of output nodes;
Figure BDA0003351371870000124
indicates an error between the tag value of the kth sample with respect to the output of the ith output unit; fitnesslRepresents a first fitness value for the l-th individual, l ═ 1,2, …, popNum; fitnessmax、fitnessminRespectively representing the maximum first fitness value and the minimum first fitness value in the current population.
S33, judging whether the iteration termination condition is met, if yes, turning to S37; otherwise, the process proceeds to S34.
Specifically, the learning error and the relative fitness value of each individual in the current group are calculated, the individual with the optimal fitness value is found out, and if the learning error and the relative fitness value are smaller than the minimum value specified in advance, the calculation is terminated; otherwise, iterating again until the condition is met, and if the condition is not met, taking the designated genetic algebra T as a termination calculation criterion.
S34, randomly selecting a parent chromosome from the current population by adopting a sorting selection method; specifically, the selection probability of each individual is calculated according to the relative fitness value of each individual and the fitness proportion, and the larger the fitness is, the smaller the overall error is, the larger the selection probability is.
And S35, according to the preset crossover probability, combining a multipoint crossover operator, carrying out crossover operation on the two parent chromosomes to obtain corresponding child chromosomes, wherein the multipoint crossover operator is constructed by combining linear crossover and convex crossover.
The crossover operator suitable for the real number coding genetic algorithm mainly comprises an arithmetic crossover operator and a discrete crossover operator, but the variation range of the filial generation individuals generated by using the discrete crossover operator is large, the individual excellent mode is easy to damage, the probability of the arithmetic crossover operator for damaging the individual excellent mode is low, and the operation is simple, so that the arithmetic crossover operator is selected and adopted, but the crossover result of the arithmetic crossover operator has certain randomness, and the searching speed of the genetic algorithm is slowed down.
Linear and convex intersections are common arithmetic intersection methods, linear intersections have the possibility of exceeding a value range, and offspring generated by convex intersections are located between parents and keep effective.
In order to realize excellent crossing results, namely, to ensure that the crossing results meet constraint conditions quickly, linear crossing and convex crossing are combined together to construct a novel multipoint crossing operator. The embodiment of the invention combines linear intersection and convex intersection to construct a novel multipoint intersection operator, thereby not only increasing the search speed of the genetic algorithm, but also effectively avoiding the phenomenon of local convergence or precocity to a great extent, and ensuring that filial generations are positioned in a solution space.
The S35 specifically includes:
defining the cross probability as pcConstructing a cross-selected individual X with the same effective length as the parent chromosome, as shown in FIG. 4rsSaid cross-selecting of individuals XrsRandomly taking the value of 0 or 1 as the gene position xrscAt 0, the parent chromosomes do not cross;
when taking out the gene site xrscWhen 1, the parent chromosome Xr、XsCrossing occurs, the selected crossing site is c, and the corresponding crossing genes are x respectivelyrcAnd xscAnd { xrc,xsc|xrc,xsc∈[Nc,Mc]The corresponding genes after crossing are respectivelyxrc' and xsc′;
(1) If the individual XrIs superior to individual XsI.e. fitness'r>fitness′s
Figure BDA0003351371870000141
xsc′=xsc+d*(xrc-xsc) (6)
Figure BDA0003351371870000142
(2) If the individual XrIs not superior to individual XsI.e. fintess'r≤fitness′s
Figure BDA0003351371870000143
Figure BDA0003351371870000144
Wherein, 0<d<1 is constant, d is 0.5; rand1Represents a random number between (0, 1); t represents an evolution algebra; t represents the maximum evolution algebra; mc、NcTo represent the gene x of any individual in the constraintcThe upper and lower limits of the value range;
and performing the cross operation on the two parent chromosomes to obtain corresponding child chromosomes.
S36, performing mutation operation on the two offspring chromosomes according to a preset mutation probability and by combining a mutation operator, updating the current population, and then switching to S32, wherein the method specifically comprises the following steps:
defining the mutation probability as pm,xjeRepresents the e-th gene in the jth individual in the parent, lenchrom is the effective length, xje' denotes the e-th group in the j-th individual in the childTherefore, j is more than or equal to 1 and less than or equal to popNum, and e is more than or equal to 1 and less than or equal to lenchrom;
Figure BDA0003351371870000151
wherein, rand2Represents a random number between (0,1) when rand2<pmIndicating actual occurrence of a mutation, Me、NeTo represent the gene x of any individual in the constrainteThe upper and lower limits of the range.
By adopting the mutation operator, individuals in the population are mutated according to probability, the mutation range is controllable, and each individual is possibly mutated, so that the diversity of offspring individuals is increased.
S37, selecting the optimal individual from the current population, and taking the weight and the threshold corresponding to the optimal individual as the optimal weight and the threshold.
And S4, training the BP neural network according to the optimal weight and the threshold value, and acquiring an IGA-BP neural network model.
The IGA-BP neural network model is established by optimizing the weight and the threshold of the BP network through the IGA, so that the defects that the BP network is low in convergence speed and easy to fall into local extremum and the like can be overcome, and the global search capability of the IGA is exerted.
And S5, inputting the soil moisture content data into the IGA-BP neural network model to obtain a prediction result of the soil nutrients to be predicted.
And S6, obtaining an optimal soil conditioning time sequence according to the prediction result of each soil nutrient to be predicted, the crop growth characteristics and the soil nutrient grade rating system.
According to the method and the device, the specific soil component evolution law of the area in a future period of time is predicted through the time series trend of the soil nutrients to be predicted based on different targets, and meanwhile, a bidirectional matching soil conditioning mode is designed by combining specific crop growth characteristics and a local soil nutrient grade rating system.
In addition, in order to explain the above technical solutions more clearly, the embodiment of the present invention further provides a specific embodiment:
a certain planting farmer in the fertile Changfeng area has 50 mu of strawberry planting area, and a Changfeng strawberry full growth period soil nutrient historical evolution data set is formed after years of accumulation. In order to expand a planting area and achieve yield increase, the IGA-BP neural network model provided by the embodiment of the invention is adopted to improve another strawberry planting field in a production area to achieve time series prediction of soil conditioning.
The growth process of the strawberries is divided into a growth start period, a flowering and fruiting period, a vigorous growth period and a flower bud differentiation period, and soil moisture content data corresponding to different periods are respectively obtained. The period with larger influence on strawberry fruits, namely the growth period of the strawberries about 11 months per year, is selected as a main research period, and the soil moisture content of the strawberries can be predicted in the same way in other growth periods. Soil organic matters are used as a main source of nutrients required by growth and development of strawberries, contain various nutrient elements required by growth and development of strawberries, and have important effects on promoting growth and development of strawberries, improving soil structure and improving water and fertilizer retention capacity of soil, so that Soil Organic Matters (SOM) are used as prediction objects at first.
The soil moisture content data of the area in 2000-year-2020 Changfeng strawberry is obtained, and the soil moisture content data is checked and identified, the time sequence obeys a 13-order autoregressive model AR (13), and the number of neurons in the input layer of the time sequence BP neural network prediction model determined by the time sequence model is 13. And (3) setting total nitrogen (g/kg), available phosphorus (mg/kg), available potassium (mg/kg), available copper (mg/kg), available zinc (mg/kg), available iron (mg/kg), available manganese (mg/kg), available boron (mg/kg), available molybdenum (mg/kg), available sulfur (mg/kg), available silicon (mg/kg), temperature (DEG C), rainfall (mm) and the like in soil in the strawberry growth period of the area as input layer parameters, taking organic matters (g/kg) as output layer parameters, calculating the correlation between each input variable and each output variable, and finally obtaining 13 strongly correlated factors as each neuron of the input layer of the final network.
Initializing a BP neural network topological structure; sixteen groups of the twenty pre-acquired groups of data are used for training the network, and the other four groups are used for verifying the error of the training network.
Because the data units have magnitude difference, for example, the unit of total nitrogen and organic matter is g/kg, and the unit of available phosphorus, available potassium and the like is mg/kg, in order to eliminate the magnitude difference and effectively improve the speed of solving the optimal solution by the gradient descent method, the data Min-max is normalized:
Figure BDA0003351371870000171
and extracting basic information of the BP neural network. By means of the empirical formula, the number of hidden layers is continuously adjusted by adopting a trial and error method, and finally, the network is better when the hidden layers are 9. From this, the numbers of nodes of the input layer (inputnum), the hidden layer (hidden layer), and the output layer (outputnum) of the BP neural network are 13, 9, and 1, respectively. The hidden layer activation function is logsig, the output layer activation function is tansig, the training function is trainlm, and the expected error is the mean square error function MSE.
The chromosome coding length lenchrom of the Improved Genetic Algorithm (IGA) is
lenchrom=13×9+9+9×1+1=136 (12)
And training the optimal weight value and the threshold value according to an Improved Genetic Algorithm (IGA). The program design is carried out in the MATLAB environment, the length of the adopted real number code string is 136, the initialization number popNum of the population is set to be 50, the evolution time T is set to be 200, and the precision is 0.01. The selecting operation uses a sorting selection method; the cross operation uses the novel multi-point cross operator which is constructed by combining the linear cross and the convex cross; the mutation operation uses the mutation operator. Cross probability Pc0.1, probability of mutation PmWhen training sample data is input and the network is trained, the algorithm has the best fitness after 142 generations as the average fitness, and the accuracy is achieved, as shown in fig. 5.
At this time, each weight and threshold are obtained, and as shown in table 1, a connection weight matrix W of the input layer and the hidden layer13×9Comprises the following steps:
TABLE 1
Figure BDA0003351371870000181
Figure BDA0003351371870000191
Connection weight matrix W between hidden layer and output layer9×1' is:
[-0.7217 0.3002 0.7006 -0.6084 -0.9595 1.4529 -0.1636 -1.5121 0.6445]
threshold matrix B for hidden layer neurons9×1' is:
[-0.9939 -1.1896 1.1738 -0.8124 1.9539 -0.3322 0.8916 1.8106 0.1242]
threshold of output neuron is b1×1′=[-0.9601]。
And (3) carrying out IGA-BP neural network model training, substituting the optimized initial weight and threshold into a BP neural network, setting the cycle number to be 500, the training speed to be 0.01 and the network target error to be 0.00001. After 11 training passes, the network error reaches the set accuracy, as shown in fig. 6.
And (5) judging network errors. Taking the data of nitrogen, phosphorus, potassium and the like in the year 2020 of 2017 plus as input values of the network, carrying out normalization processing on the soil moisture content data in the region in the year 2020 of 2017 plus, and introducing the processing result into the IGA-BP neural network model after training.
Secondly, a general BP neural network is adopted to predict soil organic matters in the same region, and the results of the IGA-BP neural network and the general BP neural network are shown in figure 7 and table 2.
TABLE 2
Index (I) IGA-BP neural network General BP neural network
Mean absolute error MEA 2.2696 3.3629
Mean square error MSE 7.8284 16.379
Root mean square error RMSE 2.7979 4.0471
From the above table, it can be seen that the neural network after optimization has higher precision, and therefore, the organic matter content of the region is predicted to be about 22.54g/kg in 2021 years.
In soil conditioning, calcium (CaO), magnesium (MgO) and sulfur (S) also play a great role, calcium is a structural component of cell wall pectin and chromosomes, forms calcium salt with phospholipid molecules, maintains the structure and function of the membrane, and plays a role in regulating the physiological balance of the medium; while sulfur is not only involved in redox reactions but also is a constituent of proteins and enzymes.
Therefore, the embodiment of the invention also carries out time series prediction on a plurality of target nutrients to be predicted of calcium, magnesium and sulfur respectively by means of the IGA-BP neural network prediction model, and the contents of calcium, magnesium and sulfur in the region in 2021 are obtained to be about 387.69mg/kg, 203.58mg/kg and 31.64 mg/kg.
And obtaining an optimal soil conditioning time sequence according to the prediction result of each soil nutrient to be predicted, the crop growth characteristics and the soil nutrient grade rating system.
Specifically, according to the prediction results of organic matters, calcium, magnesium or sulfur and the soil nutrient grade division standard of the farmland in Anhui province, the grades of the organic matters, calcium, magnesium and sulfur nutrients in the soil are respectively found to be medium, scarce, medium and rich.
Considering that the Changfeng strawberry grows optimally in weak acid soil, the pH (the range is about 5.5-6.5) is adjusted in the soil conditioning process, so that the strawberry growing environment in the area is in a weak acid range, and a proper amount of organic matters (7.64g/kg), magnesium (96.42mg/kg) and a large amount of calcium (812.31mg/kg) are added to realize soil improvement and promote the growth and development of crops.
In a second aspect, as shown in fig. 8, an embodiment of the present invention provides a soil conditioning time series prediction system based on an IGA-BP neural network, including:
the preprocessing module is used for acquiring and preprocessing soil moisture content data related to soil nutrients to be predicted;
the building module is used for building a BP neural network;
the optimization module is used for determining the weight and the threshold of the BP neural network by adopting an IGA algorithm and taking the weight and the threshold as the optimal weight and threshold;
the first obtaining module is used for training the BP neural network according to the optimal weight and the threshold value to obtain an IGA-BP neural network model;
the prediction module is used for inputting the soil moisture content data into the IGA-BP neural network model to obtain a prediction result of the soil nutrients to be predicted;
and the second obtaining module is used for obtaining an optimal soil conditioning time sequence according to the prediction result of each soil nutrient to be predicted, the crop growth characteristics and the soil nutrient grade rating system.
In a third aspect, the present invention provides a storage medium storing a computer program for predicting a soil conditioning time series based on an IGA-BP neural network, wherein the computer program causes a computer to execute the method for predicting a soil conditioning time series as described above.
In a fourth aspect, an embodiment of the present invention provides an electronic device, including:
one or more processors;
a memory; and
one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the programs comprising instructions for performing a soil conditioning time series prediction method as described above.
It can be understood that the soil conditioning time series prediction system, the storage medium, and the electronic device based on the IGA-BP neural network provided in the embodiment of the present invention correspond to the soil conditioning time series prediction method based on the IGA-BP neural network provided in the embodiment of the present invention, and for the explanation, the example, and the beneficial effects of the present invention, reference may be made to corresponding parts in the soil conditioning time series prediction method based on the IGA-BP neural network, and details are not repeated here.
In summary, compared with the prior art, the method has the following beneficial effects:
1. in the embodiment of the invention, the weight and the threshold of the BP neural network are determined by adopting an IGA algorithm and are used as the optimal weight and threshold; training a BP neural network according to the optimal weight and the threshold value to obtain an IGA-BP neural network model; inputting soil moisture content data into an IGA-BP neural network model to obtain a prediction result of soil nutrients to be predicted; through selecting different target soil components, predicting to obtain a specific soil component evolution rule of the area in a period of time in the future, and meanwhile, combining specific crop growth characteristics and a local soil nutrient grade rating system to bidirectionally match a soil conditioning time sequence to finally determine the optimal nutrients required for soil conditioning.
2. The genetic algorithm coding mode designed by the invention consists of three parts, namely the threshold value of the neuron of the output layer, the threshold value of the neuron of the hidden layer and the connection weight value of the neuron of the input layer, wherein each weight value and the threshold value adopt real number coding, the real number coding mode associates the node of the hidden layer with the connection weight value, the convergence speed of the algorithm is improved to a certain extent, and compared with the traditional binary coding, the calculation amount is effectively reduced, and the quantization error is reduced.
3. In order to realize a good intersection result, namely, to quickly and guarantee that the intersection result meets the constraint condition, the embodiment of the invention combines linear intersection and convex intersection together to construct a novel multipoint intersection operator. The embodiment of the invention combines linear intersection and convex intersection to construct a novel multipoint intersection operator, thereby not only increasing the search speed of the genetic algorithm, but also effectively avoiding the phenomenon of local convergence or precocity to a great extent, and ensuring that filial generations are positioned in a solution space.
4. According to the embodiment of the invention, the mutation operator is adopted, individuals in the population are mutated according to probability, the mutation range is controllable, each individual is possibly mutated, and the diversity of offspring individuals is increased.
5. According to the method and the device, the specific soil component evolution law of the area in a future period of time is predicted through the time series trend of the soil nutrients to be predicted based on different targets, and meanwhile, a bidirectional matching soil conditioning mode is designed by combining specific crop growth characteristics and a local soil nutrient grade rating system.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (10)

1. A soil conditioning time series prediction method based on an IGA-BP neural network is characterized by comprising the following steps:
s1, acquiring and preprocessing soil moisture content data related to soil nutrients to be predicted;
s2, constructing a BP neural network;
s3, determining the weight and the threshold of the BP neural network by adopting an IGA algorithm, and taking the weight and the threshold as the optimal weight and threshold;
s4, training the BP neural network according to the optimal weight and the threshold value to obtain an IGA-BP neural network model;
s5, inputting the soil moisture content data into the IGA-BP neural network model to obtain a prediction result of the soil nutrients to be predicted;
and S6, obtaining an optimal soil conditioning time sequence according to the prediction result of each soil nutrient to be predicted, the crop growth characteristics and the soil nutrient grade rating system.
2. The method for predicting soil conditioning time series as claimed in claim 1, wherein in S1, a correlation test method is used to obtain soil moisture content data related to soil nutrients to be predicted, wherein the soil nutrients to be predicted include organic matters, calcium, magnesium or sulfur elements.
3. The soil conditioning time series prediction method as claimed in claim 1, wherein the construction process of the BP neural network in S2 specifically includes:
taking the soil moisture content data related to the soil nutrients to be predicted as input parameters; determining the number of nodes of an input layer and the number of nodes of an output layer of the BP neural network by taking the soil nutrients to be predicted as output parameters;
determining the number of hidden layer nodes of the BP neural network according to the number of the input layer nodes and the number of the output layer nodes;
initializing the hidden layer threshold value, the output layer threshold value and the connection weight value from the hidden layer to the input layer and the output layer of the BP neural network.
4. The method for predicting soil conditioning time series as claimed in claim 3, wherein the S3 specifically comprises:
s31, acquiring an initial population by adopting real number coding according to the hidden layer threshold value, the output layer threshold value and the connection weight values from the hidden layer to the input layer and the output layer of the BP neural network;
s32, determining a fitness function, and calculating the fitness values of all individuals in the current population;
s33, judging whether the iteration termination condition is met, if yes, turning to S37; otherwise, go to S34;
s34, randomly selecting a parent chromosome from the current population by adopting a sorting selection method;
s35, according to a preset crossover probability, combining a multipoint crossover operator, carrying out crossover operation on the two parent chromosomes to obtain corresponding child chromosomes, wherein the multipoint crossover operator is constructed by combining linear crossover and convex crossover;
s36, performing mutation operation on the two offspring chromosomes according to a preset mutation probability and by combining a mutation operator, updating the current population, and then switching to S32;
s37, selecting the optimal individual from the current population, and taking the weight and the threshold corresponding to the optimal individual as the optimal weight and the threshold.
5. The soil conditioning time series prediction method as claimed in claim 4, wherein the fitness function in S32 is a relative fitness function determined by a first fitness function;
the first fitness function:
Figure FDA0003351371860000021
Figure FDA0003351371860000031
the relative fitness function:
Figure FDA0003351371860000032
wherein E represents that each sample corresponds to each individual in the current population and is based on the learning error of the BP neural network; m represents the capacity of a training sample comprising the soil nutrients to be predicted and soil moisture data related to the soil nutrients; ol represents the number of output nodes;
Figure FDA0003351371860000033
indicates an error between the tag value of the kth sample with respect to the output of the ith output unit; fitnesslRepresents a first fitness value for the l-th individual, l ═ 1,2, …, popNum; fitnessmax、fitnessminRespectively representing the maximum first fitness value and the minimum first fitness value in the current population.
6. The method for predicting soil conditioning time series as claimed in claim 5, wherein the S35 specifically comprises:
defining the cross probability as pc, and constructing a cross selection individual X with the same effective length as the parent chromosomersSaid cross-selecting of individuals XrsRandomly taking the value of 0 or 1 as the gene position xrscAt 0, the parent chromosomes do not cross;
when taking out the gene site xrscWhen 1, the parent chromosome Xr、XsCrossing occurs, the selected crossing site is c, and the corresponding crossing genes are x respectivelyrcAnd xscThe corresponding genes after crossing are respectively xrc' and xsc′;
(1) If the individual XrIs superior to individual XsI.e. fitness'r>fitness′s
Figure FDA0003351371860000034
xsc′=xsc+d*(xrc-xsc) (5)
Figure FDA0003351371860000041
(2) If the individual XrIs not superior to individual XsI.e. fitness'r≤fitness′s
Figure FDA0003351371860000042
Figure FDA0003351371860000043
Wherein d is more than 0 and less than 1 and is a constant; rand1Represents a random number between (0, 1); t represents an evolution algebra; t represents the maximum evolution algebra; mc、NcTo represent the gene x of any individual in the constraintcThe upper and lower limits of the value range;
and performing the cross operation on the two parent chromosomes to obtain corresponding child chromosomes.
7. The method for predicting soil conditioning time series as claimed in claim 6, wherein the S36 specifically comprises:
defining the mutation probability as pm,xjeRepresents the e-th gene in the jth individual in the parent, lenchrom is the effective length, xje' represents the e gene in the jth individual in the filial generation, j is more than or equal to 1 and less than or equal to popNum, and e is more than or equal to 1 and less than or equal to lenchrom;
Figure FDA0003351371860000044
wherein, rand2Represents a random number between (0,1) when rand2<pmIndicating actual occurrence of a mutation, Me、NeTo represent the gene x of any individual in the constrainteThe upper and lower limits of the range.
8. A soil conditioning time series prediction system based on an IGA-BP neural network is characterized by comprising the following components:
the preprocessing module is used for acquiring and preprocessing soil moisture content data related to soil nutrients to be predicted;
the building module is used for building a BP neural network;
the optimization module is used for determining the weight and the threshold of the BP neural network by adopting an IGA algorithm and taking the weight and the threshold as the optimal weight and threshold;
the first obtaining module is used for training the BP neural network according to the optimal weight and the threshold value to obtain an IGA-BP neural network model;
the prediction module is used for inputting the soil moisture content data into the IGA-BP neural network model to obtain a prediction result of the soil nutrients to be predicted;
and the second obtaining module is used for obtaining an optimal soil conditioning time sequence according to the prediction result of each soil nutrient to be predicted, the crop growth characteristics and the soil nutrient grade rating system.
9. A storage medium storing a computer program for predicting a soil conditioning time series based on an IGA-BP neural network, wherein the computer program causes a computer to execute the method for predicting a soil conditioning time series according to any one of claims 1 to 7.
10. An electronic device, comprising:
one or more processors;
a memory; and
one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the programs comprising instructions for performing the soil conditioning time series prediction method of any of claims 1-7.
CN202111338375.5A 2021-11-12 2021-11-12 Soil conditioning time sequence prediction method and system based on IGA-BP neural network Pending CN114282702A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111338375.5A CN114282702A (en) 2021-11-12 2021-11-12 Soil conditioning time sequence prediction method and system based on IGA-BP neural network

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111338375.5A CN114282702A (en) 2021-11-12 2021-11-12 Soil conditioning time sequence prediction method and system based on IGA-BP neural network

Publications (1)

Publication Number Publication Date
CN114282702A true CN114282702A (en) 2022-04-05

Family

ID=80869040

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111338375.5A Pending CN114282702A (en) 2021-11-12 2021-11-12 Soil conditioning time sequence prediction method and system based on IGA-BP neural network

Country Status (1)

Country Link
CN (1) CN114282702A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115035512A (en) * 2022-05-24 2022-09-09 合肥工业大学 Crop nutrition state diagnosis method and system based on multi-mode deep learning
CN117688835A (en) * 2023-12-11 2024-03-12 哈尔滨航天恒星数据系统科技有限公司 Soil nutrient inversion method, electronic equipment and storage medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115035512A (en) * 2022-05-24 2022-09-09 合肥工业大学 Crop nutrition state diagnosis method and system based on multi-mode deep learning
CN117688835A (en) * 2023-12-11 2024-03-12 哈尔滨航天恒星数据系统科技有限公司 Soil nutrient inversion method, electronic equipment and storage medium
CN117688835B (en) * 2023-12-11 2024-06-04 哈尔滨航天恒星数据系统科技有限公司 Soil nutrient inversion method, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN114282702A (en) Soil conditioning time sequence prediction method and system based on IGA-BP neural network
CN105913151A (en) Photovoltaic power station power generation amount predication method based on adaptive mutation particle swarm and BP network
CN110751318A (en) IPSO-LSTM-based ultra-short-term power load prediction method
CN109635495B (en) Arterial road phase difference simulation optimization method based on neural network and genetic algorithm
CN104636985A (en) Method for predicting radio disturbance of electric transmission line by using improved BP (back propagation) neural network
CN113282122A (en) Commercial building energy consumption prediction optimization method and system
CN106373022A (en) BP-GA-based greenhouse crop plantation efficiency condition optimization method and system
CN110414115B (en) Wavelet neural network tomato yield prediction method based on genetic algorithm
CN110472840A (en) A kind of agricultural water conservancy dispatching method and system based on nerual network technique
CN105069220A (en) Back-propagation (BP) neural network immune genetic algorithm based microbial fermentation optimization method
CN107909221A (en) Power-system short-term load forecasting method based on combination neural net
CN115986728A (en) Power grid situation prediction method considering uncertainty factors and terminal
CN113361761A (en) Short-term wind power integration prediction method and system based on error correction
CN114859734B (en) Greenhouse environment parameter optimization decision method based on improved SAC algorithm
CN113657937A (en) Day-ahead electricity price prediction method based on EEMD-CNN + SAE-RFR hybrid algorithm
CN116993000A (en) Fruit tree pest control prediction method based on random forest and cellular automaton
CN105913326B (en) Constrain the Crop growing stage model Cultivar parameter optimization method of sex knowledge and the tactful Genetic Algorithm Fusion of elite individual
CN109408896B (en) Multi-element intelligent real-time monitoring method for anaerobic sewage treatment gas production
CN114580762A (en) Hydrological forecast error correction method based on XGboost
CN113221447A (en) Soil humidity prediction method for optimizing BP neural network based on improved genetic algorithm
CN105956715A (en) Soil moisture status prediction method and device
CN106503793B (en) A kind of neural network short-term wind speed forecasting method based on improvement difference algorithm
Chen et al. A water-saving irrigation decision-making model for greenhouse tomatoes based on genetic optimization TS fuzzy neural network
CN113743003B (en) Method for calculating intensity of high-voltage line to ground electric field by considering influence of temperature and humidity
CN114202063A (en) Fuzzy neural network greenhouse temperature prediction method based on genetic algorithm optimization

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination