Optimized management method and equipment for agricultural planting and medium
By performing feature combination and optimization training of temporal recursive neural network on multi-dimensional crop planting environment data, the problem of difficulty in dealing with multi-dimensional environmental variable relationships in the existing technology is solved, and more accurate crop yield prediction and optimization management is achieved.
Patent Information
- Application Number
- CN202411643998.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-18
- Publication Date
- 2025-03-14
AI Technical Summary
The existing agricultural planting optimization system is difficult to deal with the relationship between complex multi-dimensional environmental variables, resulting in poor crop yield optimization management results.
By obtaining multi-dimensional planting environment data during a growth cycle of crops, combining features to obtain the environmental feature matrix, and inputting it into the preset time recursive neural network, calculating error loss, optimizing network parameters, and obtaining the target time recursive neural network. The network is then used to process the historical growth stage and historical environmental data of the crops to be tested, yields are predicted and optimized management.
The accuracy of the target time recursive neural network in data analysis of multi-dimensional environmental variables is improved, the effect of crop optimization management is enhanced, and yield is predicted more accurately and optimized.
Smart Images

Figure CN119623697A_ABST
Abstract
Description
Background Art
[0002] At present, with the development of agricultural technology, agricultural management is gradually moving towards intelligence and precision. In order to improve crop yield and quality, farmers and agricultural experts need to scientifically manage crops according to environmental changes at different growth stages of crops. Traditional agricultural management systems usually rely on experience for operations such as fertilization, irrigation, and temperature control, and lack systematic prediction and optimization capabilities.
[0003] Most existing agricultural planting optimization systems only focus on single-dimensional or simple data analysis, and are unable to handle the relationship between complex, multi-dimensional environmental variables. At the same time, when faced with changes in the crop growth cycle, traditional methods cannot respond to environmental changes in a timely manner, resulting in poor results in crop yield optimization management. Summary of the invention
[0004] In order to overcome the problem of poor effect of crop yield optimization management in the prior art, the present application provides an optimization management method, equipment and medium for agricultural planting.
[0005] In the first aspect, in order to solve the above technical problems, the present application provides an optimized management method for agricultural planting, comprising:
[0006] Acquire multi-dimensional planting environment data within a crop growth cycle, and combine the multi-dimensional planting environment data to obtain an environmental feature matrix;
[0007] Input the environmental feature matrix into the preset time recurrent neural network and calculate the error loss;
[0008] Calculate the gradient values of the network parameters of the preset time recurrent neural network based on the error loss;
[0009] Optimizing the network parameters of the preset time recurrent neural network based on the gradient value to obtain the target time recurrent neural network;
[0010] Obtain historical environmental data of the historical growth stages of the crops to be tested;
[0011] The target time recursive neural network is used to process the historical growth stage and historical environmental data to obtain the predicted yield of the crops to be tested, so as to optimize the management of the crops to be tested based on the predicted yield.
[0012] In a second aspect, the present application also provides an optimized management system for agricultural planting, comprising:
[0013] The feature combination module is used to obtain multi-dimensional planting environment data within a growth cycle of crops, and to perform feature combination on the multi-dimensional planting environment data to obtain an environmental feature matrix;
[0014] A first calculation module is used to input the environmental feature matrix into a preset time recursive neural network to calculate the error loss;
[0015] A second calculation module is used to calculate the gradient value of the network parameter of the preset time recurrent neural network based on the error loss;
[0016] An optimization module, used for optimizing the network parameters of the preset time recurrent neural network based on the gradient value to obtain the target time recurrent neural network;
[0017] An acquisition module, used to acquire historical environmental data of the historical growth stages of the tested crop;
[0018] The processing module is used to process the historical growth stage and historical environmental data using the target time recursive neural network to obtain the predicted yield of the crops to be tested, so as to optimize the management of the crops to be tested based on the predicted yield.
[0019] In a third aspect, the present application also provides a computing device, including a memory, a processor, and a program stored in the memory and running on the processor, and when the processor executes the program, the steps of an optimized management method for agricultural planting as described above are implemented.
[0020] In a fourth aspect, the present application also provides a computer-readable storage medium, in which instructions are stored. When the instructions are executed on a terminal device, the terminal device executes the steps of an optimized management method for agricultural planting.
[0021] The beneficial effect of the present application is: by combining the multi-dimensional planting environment data within a growth cycle of the crop to obtain an environmental feature matrix, input it into a preset time recursive neural network, calculate the error loss, and calculate the gradient value of the network parameters of the preset time recursive neural network based on the error loss, and optimize the network parameters of the preset time recursive neural network based on the gradient value to obtain a target time recursive neural network. In this way, the preset time recursive neural network is optimized and trained through the multi-dimensional planting environment data, so that the trained target time recursive neural network can handle the relationship between multi-dimensional environmental variables, and improve the accuracy of the target time recursive neural network in data analysis of multi-dimensional environmental variables. Then, the target time recursive neural network is used to process the historical growth stage and historical environmental data of the crop to be tested, and the predicted yield of the crop to be tested that meets the accuracy requirements is obtained, so as to improve the accuracy of the optimized management of the crop to be tested based on the predicted yield, thereby improving the effect of crop optimization management. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 A schematic diagram of a flow chart of an optimized management method for agricultural planting shown as an exemplary embodiment of the present application;
[0023] Figure 2 This is a schematic diagram of the network structure of a target time recursive neural network in an exemplary embodiment of the present application;
[0024] Figure 3 This is a schematic diagram of a construction process of an environmental feature matrix in an exemplary embodiment of the present application;
[0025] Figure 4 This is a schematic diagram of a network parameter optimization process in an exemplary embodiment of the present application;
[0026] Figure 5 This is a flow chart of an optimized management method for agricultural planting in an exemplary embodiment of the present application;
[0027] Figure 6 A loss curve diagram consisting of error loss and number of iterations in an exemplary embodiment of the present application;
[0028] Figure 7 A schematic structural diagram of an agricultural planting optimization management system shown as an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0029] The following examples are provided to further explain and supplement the present application and do not constitute any limitation to the present application.
[0030] The following describes an optimized management method, equipment and medium for agricultural planting according to an embodiment of the present application in conjunction with the accompanying drawings.
[0031] An optimized management method for agricultural planting in an embodiment of the present application is applied to a terminal device. In the present application scheme, the terminal device is used as the execution subject to illustrate the present application scheme. The terminal device is used to execute the steps of an optimized management method for agricultural planting.
[0032] See also Figure 1 , Figure 1 An optimized management method for agricultural planting is shown as an exemplary embodiment of the present application, such as Figure 1 As shown, the present application provides an optimized management method for agricultural planting, comprising:
[0033] Step S11, obtaining multi-dimensional planting environment data within a growth cycle of crops, and combining the multi-dimensional planting environment data to obtain an environment feature matrix;
[0034] Step S12, inputting the environmental feature matrix into a preset time recursive neural network to calculate the error loss;
[0035] Step S13, calculating the gradient value of the network parameter of the preset time recurrent neural network based on the error loss;
[0036] Step S14, optimizing the network parameters of the preset time recurrent neural network based on the gradient value to obtain a target time recurrent neural network;
[0037] Step S15, obtaining historical environmental data of the historical growth stages of the crop to be tested;
[0038] Step S16, using the target time recursive neural network to process the historical growth stage and historical environmental data to obtain the predicted yield of the crop to be tested, so as to optimize the management of the crop to be tested based on the predicted yield.
[0039] The present embodiment is an optimization management method for agricultural planting, which inputs the environmental feature matrix obtained by combining the multi-dimensional planting environment data within a growth cycle of the crop into a preset time recursive neural network, calculates the error loss, and calculates the gradient value of the network parameter of the preset time recursive neural network based on the error loss, and optimizes the network parameter of the preset time recursive neural network based on the gradient value to obtain the target time recursive neural network. In this way, the preset time recursive neural network is optimized and trained by the multi-dimensional planting environment data, so that the trained target time recursive neural network can process the relationship between the multi-dimensional environmental variables, and improves the accuracy of the target time recursive neural network in data analysis of the multi-dimensional environmental variables. Then, the target time recursive neural network is used to process the historical growth stage and historical environmental data of the crop to be tested, and the predicted yield of the crop to be tested that meets the accuracy requirements is obtained, so as to improve the accuracy of the optimization management of the crop to be tested based on the predicted yield, thereby improving the effect of crop optimization management.
[0040] In an exemplary embodiment, the multi-dimensional planting environment data includes temperature, water volume, fertilizer amount, and other environmental factors. Temperature includes air temperature and ground temperature, water volume includes humidity and precipitation at different growth stages, humidity includes air humidity and soil humidity, and other environmental factors include wind speed and light intensity, etc. Among them, the air temperature and ground temperature of the planting environment where the crops are located are detected by temperature sensors, the air humidity and soil humidity of the planting environment where the crops are located are detected by humidity sensors, the precipitation is obtained by detecting the planting environment where the crops are located by a rain gauge, the fertilizer amount is obtained by searching for fertilization operations in different historical time periods and their corresponding amounts, the wind speed is obtained by detecting the planting environment where the crops are located by an anemometer, and the light intensity is obtained by detecting the planting environment where the crops are located by a light sensor.
[0041] Taking carrots as an example, some of the multi-dimensional planting environment data of carrots are shown in the following table.
[0042]
[0043] As a deep learning algorithm widely used in time series data modeling, recurrent neural network (RNN) can effectively capture the temporal characteristics of data. However, the RNN model alone has limited performance in carrot planting optimization with multidimensional environmental variables and cannot fully consider the complex relationship between environmental variables.
[0044] Therefore, the multi-dimensional environmental variable data is feature combined by the Kronecker Product method. In the present application, the target time recurrent neural network obtained by the time recurrent neural network (RNN) and the Kronecker Product method can be referred to as the KPRNN model. The network structure of the target time recurrent neural network KPRNN is as follows: Figure 2 shown.
[0045] Kronecker Product is a mathematical operation method used to construct a higher-dimensional data feature combination, which expands the feature space of the model and can enhance the model's feature expression ability. By combining the RNN model with the Kronecker product, the model's feature learning ability can be enhanced, and the role of multidimensional environmental variables in crop cultivation can be better understood and optimized. After the multidimensional environmental variable data is combined with the Kronecker product method, an environmental feature matrix in a high-dimensional feature space is generated, which can significantly improve the ability to express the nonlinear relationship of multidimensional environmental variable data when the preset recursive neural network is trained. This feature combination effectively expands the feature space by generating all possible interaction combinations, allowing the recursive neural network to capture more information when learning input data. The generated high-dimensional environmental feature matrix can better retain and capture the complex interaction relationship between multiple variables, making feature extraction more comprehensive during subsequent model training.
[0046] See also Figure 3 , Figure 3 This is a schematic diagram of the construction process of the environment feature matrix in an exemplary embodiment of the present application, such as Figure 3 As shown, multidimensional planting environment data within a growth cycle of crops is obtained through data collection. The multidimensional planting environment data includes temperature data, water data, fertilization data and other environmental factor data. The temperature data, water data, fertilization data and other environmental factor data are respectively constructed into matrices to obtain the temperature matrix T, water data W, fertilizer matrix F and other environmental factor matrix G. The environmental feature matrix X is calculated based on the temperature matrix T, water data W, fertilizer matrix F and other environmental factor matrix G, and the expression of the environmental feature matrix X is obtained as follows: in, represents the Kronecker product.
[0047] Optionally, multi-dimensional planting environment data within a crop growth cycle is obtained, including:
[0048] During a growth cycle of the crop, the initial multi-dimensional environmental data of the planting environment of the crop is obtained at preset intervals;
[0049] The initial multi-dimensional environmental data are preprocessed to obtain multi-dimensional planting environment data.
[0050] In this embodiment, the preprocessing includes data cleaning and normalization. By preprocessing the initial multidimensional environmental data of the planting environment of the crops obtained at preset intervals during a growth cycle of the crops, the noise and abnormal data in the initial multidimensional environmental data can be eliminated, and the accuracy of the obtained multidimensional planting environment data can be improved. Not only can the interference of noise and abnormal data on the training process be reduced in the subsequent model training process, but also the accuracy of the training can be improved, and then the effect of the target time recursive neural network obtained by training on optimizing the management of crops can be improved.
[0051] Optionally, the preset time recursive neural network includes a plurality of time steps, the plurality of time steps are connected in time order, and the time step includes a hidden layer and an output layer;
[0052] The environmental feature matrix is input into the preset time recurrent neural network, and the error loss is calculated, including:
[0053] The environment feature matrix is input into a preset time recursive neural network, and the environment feature matrix is processed using hidden layers of multiple time steps to obtain the hidden layer activation value of each time step;
[0054] The calculation formula for the hidden layer activation value is as follows:
[0055] h t =tanh(W h ·X t +U h h t-1 +b h );
[0056] Among them, h t represents the hidden layer activation value at the tth time step, tanh represents the hyperbolic tangent activation function, W h represents the hidden layer weight matrix at the tth time step, X t represents the input of the environmental feature matrix at the tth time step, U h represents the hidden layer recursive weight matrix at the tth time step, h t-1 represents the hidden layer activation value at the t-1th time step, b h represents the hidden layer bias term at the tth time step;
[0057] The output layer is used to activate the hidden layer activation value of the corresponding time step to obtain the output value of the time step, and the output value of the last time step among multiple time steps is used as the network output;
[0058] The output value is calculated as follows:
[0059] y t =W y h t +b y ;
[0060] Among them, y t represents the output value of the tth time step, W y represents the output layer weight matrix at the tth time step, h t represents the hidden layer activation value at the tth time step, b y represents the output layer bias term at the tth time step;
[0061] Get the real yield of crops;
[0062] Based on the network output and the true output, the error loss is obtained.
[0063] In this embodiment, since different growth stages of agricultural planting (such as germination, seedling, growth, and maturity) have different requirements, the preset time recursive neural network stores and updates past agricultural environmental information through the hidden layer activation value obtained by the hidden layer, so that the input of each time step depends not only on the current environmental characteristics, but also on the previous time step data. Then, the error loss is calculated by comparing the network output at the last output of each time step with the actual yield of the crop, so as to facilitate the subsequent optimization of the preset time recursive neural network based on the error loss, and obtain a target time recursive neural network that can handle the relationship between multi-dimensional environmental variables.
[0064] In an exemplary embodiment, since the hidden layer in the recursive neural network depends on the hidden layer activation value of the previous time step during forward propagation, during the process of backward propagation of the error loss, the gradient of the hidden layer activation value must not only consider the influence of the current time step, but also recursively accumulate the influence from future time steps.
[0065] Then, the gradient value of the hidden layer activation value is calculated based on the error loss, and the calculation formula is as follows:
[0066]
[0067] Where L represents the error loss, h t represents the hidden layer activation value at the tth time step, represents the gradient value of the hidden layer activation value at the tth time step, y trepresents the output value of the tth time step, W y represents the output layer weight matrix at the tth time step, h t+1 represents the hidden layer activation value at the t+1th time step, U h represents the output layer bias term at the tth time step, (1-h t 2 ) is the derivative of tanh.
[0068] Optionally, based on the network output and the true output, an error loss is obtained, including:
[0069] The mean square error is calculated based on the network output and the actual output to obtain the initial error loss;
[0070] The calculation formula for the initial error loss is as follows:
[0071]
[0072] Among them, L(θ) represents the initial error loss, n represents the number of samples of the environmental feature matrix, and y ture,i represents the actual yield of crops corresponding to the i-th environmental characteristic matrix, y pred,i represents the network output predicted by the i-th environmental feature matrix in the network, y ture,i -y pred,i The expression represents the error between the i-th environmental feature matrix, that is, the gap between the actual output and the network output;
[0073] Regularize the initial error loss to obtain the error loss;
[0074] The error loss is calculated as follows:
[0075]
[0076] Among them, L reg (θ) represents the error loss, L(θ) represents the initial error loss, Represents the L2 regularization term, which is used to punish excessive network parameters, limit the unbounded growth of network parameters, prevent model overfitting, and improve generalization ability.
[0077] In this embodiment, the mean square error is calculated based on the network output and the actual output to obtain the initial error loss, and the initial error loss is regularized to obtain the error loss, which is convenient for the subsequent calculation of the regularized gradient values of the network parameters of the preset time recursive neural network based on the regularized error loss, and the network parameters of the preset time recursive neural network are optimized based on the regularized gradient values, which can prevent the model from overfitting due to excessive network parameters, thereby improving the generalization ability of the model.
[0078] Optionally, the gradient value of the network parameter of the preset time recurrent neural network is calculated based on the error loss, and the calculation formula is as follows:
[0079]
[0080] Among them, A represents the gradient value of the network parameters, L represents the error loss, and θ represents the network parameters of the preset time recurrent neural network.
[0081] In this embodiment, the network parameters of the preset time recursive neural network include a hidden layer weight matrix, a hidden layer recursive weight matrix, a hidden layer bias item of each hidden layer, and an output layer weight matrix and an output layer bias item of each output layer.
[0082] Then, the gradient value of the hidden layer weight matrix is calculated based on the error loss, and the calculation formula is as follows:
[0083]
[0084] Where L represents the error loss, W h represents the hidden layer weight matrix at the tth time step, represents the gradient value of the hidden layer weight matrix at the tth time step, h t represents the hidden layer activation value at the tth time step, Represents the transpose of the input at the t-th time step.
[0085] The gradient value of the hidden layer recursive weight matrix is calculated based on the error loss. The calculation formula is as follows:
[0086]
[0087] Among them, L represents the error loss, U h represents the hidden layer recursive weight matrix at the t-th time step, represents the gradient value of the hidden layer recursive weight matrix at the tth time step, h t represents the hidden layer activation value at the tth time step, Represents the transpose of the hidden layer activation value at the t-1th time step.
[0088] The gradient value of the hidden layer bias term is calculated based on the error loss. The calculation formula is as follows:
[0089]
[0090] Where L represents the error loss, b h represents the hidden layer bias term at the tth time step, represents the gradient value of the hidden layer bias term at the tth time step, h t represents the hidden layer activation value at the tth time step.
[0091] The gradient value of the output layer weight matrix is calculated based on the error loss. The calculation formula is as follows:
[0092]
[0093] Where L represents the error loss, W y represents the output layer weight matrix at the tth time step, represents the gradient value of the output layer weight matrix at the tth time step, y t represents the output value at the tth time step, Represents the transpose of the hidden layer activation value at the tth time step.
[0094] The gradient value of the output layer bias term is calculated based on the error loss. The calculation formula is as follows:
[0095]
[0096] Where L represents the error loss, b y represents the output layer bias term at the tth time step, represents the gradient value of the output layer bias term at the tth time step, y t Represents the output value at the tth time step.
[0097] In this implementation, the gradient value of the network parameters of the preset time recursive neural network is calculated based on the error loss, and the conjugate gradient method is used. Through the conjugate gradient method, the gradient of the error loss is transferred to the hidden layer weight matrix, the hidden layer recursive weight matrix, the hidden layer bias term, the output layer weight matrix and the output layer bias term of each time step to achieve backward optimization of the model.
[0098] Optionally, optimizing the network parameters of the preset time recurrent neural network based on the gradient value to obtain the target time recurrent neural network includes:
[0099] Based on the gradient value, the initial first-order momentum and the initial second-order momentum of the preset time recurrent neural network are updated and adjusted to obtain the target first-order momentum and the target second-order momentum;
[0100] The calculation formulas for the target first-order momentum and target second-order momentum are as follows:
[0101]
[0102] Among them, m t Represents the target first-order momentum at the tth time step, and also represents the exponential weighted average of the gradient, which is used to smooth the gradient of the network parameters to reduce the impact of noise on the optimization of network parameters. t The initial value of is biased towards 0, and deviation correction is required; β1 represents the momentum attenuation coefficient, which is usually close to 1, for example, 0.9; mt-1 represents the initial first-order momentum at the tth time step, θ t represents the network parameters at the tth time step, represents the gradient value of the network parameters at the tth time step, 2λθ t Represents θ t The regularized gradient of is used to prevent the network parameters at the t-th time step from being too large and causing overfitting; ν t It represents the target second-order momentum at the t-th time step, and also represents the exponentially weighted average of the squared gradient, which is used to calculate the magnitude of the gradient of the network parameters to adjust the learning rate; β2 represents the attenuation coefficient of the squared gradient average, which is usually close to 1, for example, 0.999;
[0103] Performing deviation correction on the target first-order momentum and the target second-order momentum to obtain a corrected first-order momentum and a corrected second-order momentum;
[0104] The calculation formulas for corrected first-order momentum and corrected second-order momentum are as follows:
[0105]
[0106] in, represents the corrected first-order momentum at the tth time step, m t represents the target first-order momentum at the t-th time step, β1 represents the momentum decay coefficient, represents the corrected second-order momentum at the tth time step, ν t represents the target second-order momentum at the t-th time step, and β2 represents the attenuation coefficient of the squared average of the gradient;
[0107] The initial learning rate of the preset time recurrent neural network is updated and adjusted based on the corrected second-order momentum to obtain a target learning rate;
[0108] The target learning rate is calculated as follows:
[0109]
[0110] Among them, η t represents the target learning rate at the tth time step, α represents the initial learning rate at the tth time step, which is used to control the step size of the network parameter update, that is, to control the amplitude of the movement of the network parameters each time they are updated; represents the corrected second-order momentum at the t-th time step, ∈ represents a very small number to prevent the denominator from being zero, usually with a value of 10 -8 ;
[0111] The network parameters of the preset time recurrent neural network are optimized and adjusted based on the target learning rate and the corrected first-order momentum to obtain the target time recurrent neural network.
[0112] In this embodiment, the initial first-order momentum and the initial second-order momentum of the preset time recurrent neural network are updated and adjusted based on the gradient value, and the deviation is corrected to obtain the corrected first-order momentum and the corrected second-order momentum, and the initial learning rate of the preset time recurrent neural network is adjusted based on the corrected second-order momentum to obtain the target learning rate. Then, the network parameters of the preset time recurrent neural network are optimized and adjusted based on the target learning rate and the corrected first-order momentum, and the gradient of the network parameters can be smoothed while being able to control the amplitude of movement each time the network parameters are updated, thereby reducing the influence of noise on the optimization of the network parameters, and obtaining the target time recurrent neural network with accuracy that meets the requirements, thereby improving the effect of the target time recurrent neural network on optimizing the management of crops.
[0113] In this embodiment, when optimizing the network parameters of the preset time recurrent neural network based on the gradient value, an adaptive optimization algorithm is adopted, such as the Adam (adaptive moment estimation) algorithm.
[0114] See also Figure 4 , Figure 4 This is a schematic diagram of a network parameter optimization process in an exemplary embodiment of the present application, such as Figure 4 In the method, forward propagation is performed in a preset time recursive neural network to predict the predicted output (network output) corresponding to the environmental feature matrix, and the loss is calculated based on the network output and the actual yield of the crop to obtain the error loss. Then, backward propagation is performed based on the error loss to calculate the gradient value of each network parameter of the preset time recursive neural network to obtain the gradient update direction of the error loss, and the Adam adaptive optimization algorithm is used to update the initial learning rate of each network parameter based on the gradient value to obtain the target learning rate and the updated time recursive neural network. Finally, the updated time recursive neural network is iteratively trained using the target learning rate and the environmental feature matrix, and the network parameters are gradually updated in the direction of reducing the error loss to achieve parameter update.
[0115] Optionally, optimizing and adjusting the network parameters of the preset time recurrent neural network based on the target learning rate and the corrected first-order momentum to obtain the target time recurrent neural network includes:
[0116] Using the target learning rate and the corrected first-order momentum to update and adjust the network parameters of the preset time recurrent neural network, the target network parameters and the corresponding updated and adjusted time recurrent neural network are obtained;
[0117] The calculation formula of the target network parameters is as follows:
[0118]
[0119] Among them, θt+1 represents the target network parameters at the t+1th time step, θ t represents the network parameters at the tth time step, η t represents the target learning rate at the tth time step, represents the corrected first-order momentum at the t-th time step;
[0120] Iteratively training the updated and adjusted time recursive neural network based on the target network parameters and the environment feature matrix to obtain a training result;
[0121] When the error loss corresponding to the training result is less than a preset value, the time recursive neural network corresponding to the training result is used as the target time recursive neural network.
[0122] In this embodiment, the network parameters of the preset time recursive neural network are updated and adjusted using the target learning rate and the corrected first-order momentum, and the updated and adjusted time recursive neural network is iteratively trained to obtain a training result. When the error loss corresponding to the training result is less than a preset value, the model converges, and the time recursive neural network corresponding to the training result is used as the target time recursive neural network. When the target time recursive neural network predicts the historical growth stages and historical environmental data of crops, it can output the predicted yield with the highest accuracy.
[0123] At the same time, the conjugate gradient method and adaptive optimization algorithm were used for model optimization and adjustment. The conjugate gradient method avoids the problem of repeated searches in traditional gradient descent by finding the conjugate direction, which can accelerate the optimization process. The adaptive optimization algorithm further ensures the stability and rapid convergence of parameter adjustment in complex data by adaptively adjusting the learning rate of each parameter. In this way, the conjugate gradient method and the adaptive optimization algorithm are combined to dynamically adjust the preset time recursive neural network. The model can dynamically adjust the optimization strategy at different training stages according to the characteristics of the data, which can achieve real-time response and rapid convergence of the model.
[0124] In an exemplary embodiment, due to the target first-order momentum Corrected first-order momentum The calculation formula of the target network parameters is It can be expressed as
[0125]
[0126] According to the calculation formula of the target network parameters, at each time step t, the iterative optimization process is to subtract the corrected first-order momentum Multiply by the adaptive learning rate η t To update the network parameters, the network parameters are gradually updated in the direction of reducing the error loss until the model converges (that is, finds a local or global optimal solution).
[0127] Optionally, the target time recurrent neural network is used to process the historical growth stage and historical environmental data to obtain the predicted yield of the crop to be tested, including:
[0128] Input the historical growth stage and historical environment data into the target time recurrent neural network, and find the target time step in the target time recurrent neural network that matches the historical growth stage;
[0129] Inputting historical environmental data into a target time step, predicting environmental data of other time steps except the target time step, and using the predicted environmental data as future environmental data of the future growth stage of the tested crop;
[0130] The future environmental data are input into other time steps to obtain the target output value of the target time recursive neural network, and the target output value is used as the predicted yield of the crop to be tested.
[0131] In this embodiment, the historical growth stage and historical environmental data of the crops to be tested are processed using the optimized target time recursive neural network to obtain the predicted yield of the crops to be tested with an accuracy that meets the requirements, so that the crops to be tested are optimized and managed with an accuracy that meets the requirements based on the predicted yield, thereby improving the effect of crop optimization management.
[0132] Optionally, the method further comprises:
[0133] Use historical environment data and historical growth stages to perform table lookup operations in the preset optimization suggestion table;
[0134] Find and obtain planting optimization suggestions for the tested crops corresponding to historical environmental data and historical growth stages.
[0135] In this embodiment, since different growth stages of agricultural planting (such as germination stage, seedling stage, growth stage, and maturity stage) have different requirements, the target time recursive time network can perform dynamic analysis on different growth stages of crops, and generate real-time planting optimization suggestions adapted to different growth stages at each time step and store them in a preset optimization suggestion table, so as to directly find the planting optimization suggestions for the current growth stage of the tested crops based on historical environmental data and historical growth stages, making the crop optimization management more accurate and efficient.
[0136] In this embodiment, the target time recursive time network searches for planting optimization suggestions based on historical environmental data and historical growth stages, which may be irrigation amount suggestions, fertilizer amount suggestions, and temperature control strategies. Among them, irrigation amount suggestions: based on the historical environmental data and historical growth stages of the crops, recommend the optimal irrigation amount for the crops in the current growth stage. Fertilizer amount suggestions: based on the fertilization history of the crops and the current environmental conditions, recommend a reasonable fertilization strategy. Temperature control strategy: if there is temperature control equipment, recommend the optimal temperature range for the crops in the current growth stage and current environmental conditions to increase crop yields. As time goes by, the target time recursive time network will adjust the planting optimization suggestions such as fertilizer amount and irrigation amount to match them with the current growth stage and current environmental conditions of the crops, so as to implement the planting optimization suggestions to optimize the management of the crops.
[0137] See also Figure 5 , Figure 5 FIG. 1 is a flow chart of an optimized management method for agricultural planting in an exemplary embodiment of the present application. Figure 5 As shown, the initial multidimensional environmental data of the planting environment of the crops in one growth cycle collected at each preset time interval is input, the initial multidimensional environmental data is preprocessed to obtain multidimensional planting environment data, the multidimensional planting environment data is feature combined to obtain an environmental feature matrix, and the environmental feature matrix is input into a preset preset time recursive neural network RNN for optimization training. In the preset time recursive neural network RNN, the network output corresponding to the environmental feature matrix is predicted by forward propagation, and the error is calculated based on the network output and the actual yield of the crops to obtain the error loss. Then, backward propagation is performed based on the error loss, and the gradient value of the network parameter of the preset time recursive neural network RNN is calculated based on the error loss, and the network parameters are iteratively updated using the gradient value to achieve iterative optimization of the preset time recursive neural network RNN, and the optimization control process and results of the iterative optimization are stored in data. If the error loss corresponding to the iteratively optimized time recursive neural network is greater than or equal to the preset value, the iteratively optimized time recursive neural network is continued to be iteratively trained using the environmental feature matrix to obtain a training result. When the error loss corresponding to the training result is less than the preset value, the time recursive neural network corresponding to the training result is used as the target time recursive neural network KPRNN.
[0138] In an exemplary embodiment, multi-dimensional planting environment data within a growth cycle of crops is obtained, and the multi-dimensional planting environment data is feature combined to obtain an environment feature matrix, and the environment feature matrix is used to train a preset time recursive neural network RNN. The corresponding code is:
[0139] from sklearn.preprocessing import StandardScaler
[0140] #Normalize the features
[0141] scaler_T = StandardScaler()
[0142] T_norm scaler_T.fit_transform(T)
[0143] scaler_W = StandardScaler()
[0144] W_norm=scaler_W.fit_transform(W)
[0145] scaler_F = StandardScaler()
[0146] F_norm=scaler-F.fit_transform(F)
[0147] #Normalize the target variable
[0148] scaler_y = StandardScaler()
[0149] y_norm=scaler_y.fit_t transform(y_true.reshape(-1, 1))
[0150] #3. Construct RNN input sequence
[0151] #Sequence length is 7 (temperature 1 + humidity and water 5 + fertilizer 1), feature dimension is 1
[0152] X_sequence=np.hstack([T_norm, W_norm, F_norm])#shape(N,7)
[0153] X_sequence=X_sequence.reshape(-1,7,1)#shape(N,7,1)
[0154] In this code, StandardScaler is used to standardize the initial multidimensional environmental data and multidimensional planting environment data. The standardization formula is: Among them, μ represents the mean and σ represents the standard deviation.
[0155] [T_norm, W_norm, F_norm] represents the normalized environment feature matrix. Normalization helps the model converge faster and avoids the impact of numerical differences between different dimensions on the model effect. The input of the preset time recurrent neural network RNN needs to be in time series format, combining the features of multiple variables into a three-dimensional tensor with a shape of (N, 7, 1).
[0156] The environmental feature matrix is input into the preset time recurrent neural network RNN, the gradient value of the network parameter is calculated using the calculated error loss, and the network parameters of the preset time recurrent neural network are optimized based on the gradient value to obtain the target time recurrent neural network KPRNN. The implementation process is as follows:
[0157] First, customize the KPRNNModel class to implement the forward propagation, training steps, and parameter update logic of the KPRNN model. The corresponding code is as follows:
[0158]
[0159] Among them, the hidden layer is the LSTM (Long Short-Term Memory) layer, which is used to extract the time series features of the input data and can solve the gradient vanishing and gradient exploding problems in ordinary hidden layers. Kronecker product calculation is used to realize feature interaction modeling by calculating the outer product of the time series and the feature matrix. Fully connected layer (Dense): It is the output layer of the time step and is used to generate the final prediction output.
[0160] Then, the RNN model is trained. The corresponding code is as follows:
[0161]
[0162]
[0163] Among them, the train_step function of the RNN model implements a custom training logic, including gradient calculation and parameter update. The mean square error (MSE) loss function is used, and L2 regularization is added to calculate the error loss of the model. The operations in the forward propagation process are recorded through GradientTape to calculate the gradient and update the network parameters of the model. At the same time, the error loss, parameter norm and gradient norm of the network parameters are monitored, that is, the error loss, parameter norm and gradient norm are printed every 100 iterations, so as to timely understand the training status of the model and ensure that the training process of the model is smooth and convergent. The total parameter norm corresponding to the parameter norm represents the sum of the L2 norms of all weights and biases. Monitoring its changes helps prevent parameter explosion. The gradient norm is used to help detect the problem of gradient disappearance or explosion, and ensure that the parameters of the model are updated normally at each time step.
[0164] When compiling the RNN model, enable the Adam optimizer to adaptively optimize the learning rate of the model, improve the convergence speed and stability of the model training, and set run_eagerly = True for step-by-step debugging. Print the model structure and training progress during training.
[0165] After the RNN model training is completed, the target time recursive neural network KPRNN is obtained, and then the test data (environmental feature matrix) is predicted and denormalized to obtain the prediction result of the original scale. The corresponding code is as follows:
[0166] #Prediction results
[0167] y_pred_norm=model.predict(X_sequence)
[0168] y_pred=scaler_y.inverse-transform(y_pred_norm).flatten()
[0169] #Result output
[0170] print(″\nActual output:″, y_true)
[0171] print("Predicted output: ", y_pred)
[0172] #Print the final model parameters
[0173] print(″\nFinal model parameters:″)
[0174] for r Var in model.trainable_variables
[0175] print(f″Parameter name: {var.name}, shape: {var.shape}, norm: {tf.norm(var).numpy()}″)
[0176] #Draw the loss function curve
[0177] plt.plot(history.history['loss'])
[0178] plt.xlabel('Number of iterations')
[0179] plt.ylabel('Loss value')
[0180] plt.title('Loss function curve')
[0181] plt.show()
[0182] The name, shape and norm of each layer parameter of the model are printed to display the parameters, and the changing trend of the error loss during training is displayed to obtain the loss curve, which is used to evaluate the convergence effect of the model. Figure 6 As shown, Figure 6 In the figure, the error loss gradually decreases with the number of iterations, showing a good trend of model training. The loss curve shows a smooth downward trend without obvious oscillation or overfitting.
[0183] The above code implements the complete process of the KPRNN model. The core lies in: the application of Kronecker product to realize the interaction of multi-dimensional features. The LSTM layer processes time series data. Customized training logic, combined with Adam optimizer and L2 regularization, efficiently optimizes the network parameters of the model. Dynamic monitoring of gradients and parameter norms to ensure the convergence and stability of model training. Through these modular processing, the model can handle complex environmental variables and generate efficient prediction results, providing strong support for subsequent optimization.
[0184] The structure of the KPRNN model of this application is analyzed as follows:
[0185] Model: ″kprnn_model″
[0186]
[0187] Total params: 1265 (4.94KB)
[0188] Trainable params:1265(4.94KB)
[0189] Non-trainable params:0(0.00Byte)
[0190] The final parameters of the model are:
[0191] Parameter name: LSTM_Layer / lstm_cell / kernel: 0, shape: (1, 64), norm: 2.551405668258667
[0192] Parameter name: LSTM_Layer / lstm_cell / recurrent_kernel: 0, shape: (16, 64), norm: 8.350337982177734
[0193] Parameter name: LSTM_Layer / lstm_cell / bias: 0, shape: (64,), norm: 4.193380832672119
[0194] Parameter name: Output_Layer / kernel: 0, shape: (112, 1), norm: 0.25289490818977356
[0195] Parameter name: Output_Layer / bias: 0, shape: (1,), norm: 0.2155233919620514
[0196] It can be seen that in the KPRNN model, the network parameters of the hidden layer LSTM are 1152, the network parameters of the flatten layer Flatten are 0, and the network parameters of the output layer Dense are 113. Therefore, the total number of parameters of the KPRNN model is 1265, and the model is relatively lightweight, which helps to improve the training speed.
[0197] Among them, the network parameters of the hidden layer LSTM include the hidden layer weight matrix (kemel), the hidden layer recurrent weight matrix (recurrent kemel), and the hidden layer bias term (bias). The hidden layer weight matrix is used to control the relationship between the input and the hidden state, and its shape is (1, 64). The hidden layer recurrent weight matrix is used to transfer information between time steps, and its shape is (16, 64). The hidden layer bias term is used to control the bias of each hidden layer, and its shape is (64,). The flattening layer Flatten is used to expand the output of the LSTM into one dimension for full connection calculation. The network parameters of the output layer Dense include the output layer weight matrix and the output layer bias term. The output layer weight matrix is used to map the Kronecker product result to the output layer, and its shape is (112, 1). The output layer bias term is used to increase the bias of the linear output, and its shape is (1,).
[0198] The error loss and parameter dynamics during the model training process are printed as follows:
[0199] Iterations: 100, error loss: 0.012787869200110435;
[0200] Total Parameter Norm:13.6683788895607;
[0201] Tota1Gradient Norm:0.04070061491802335;
[0202] …
[0203] Iterations: 1000, error loss: 0.000843685847997665;
[0204] Tota1 Parameter Norm:15.563542783260345;
[0205] TotalGradient Norm:0.1629252815619111.
[0206] It can be seen that as the number of iterations increases, the error loss gradually decreases, from the initial 0.0127 to the final 0.00084. This shows that the model is gradually approaching the real production data. The parameter norm gradually increases from 13.67 to 15.56, indicating that the model weights continue to adapt to the data during training. The change in the gradient norm indicates the amplitude of the parameter update. When the gradient is large, it means that the model is in a faster learning state, and when it gradually decreases, the model tends to converge.
[0207] The network output (i.e. predicted output) predicted by the trained KPRNN model is compared with the corresponding actual output as follows:
[0208] True output: [5.095 5.95 6.05 6.5 6.0];
[0209] Predicted output: [5.1161532 5.953672 6.052192 6.479301 6.0007763].
[0210] It can be seen that the prediction results of the trained KPRNN model are close to the true value, indicating that the model can effectively predict the output after training, and the error between the prediction result and the true value is controlled within 0.02, showing the good fitting ability of the model.
[0211] The experimental results show that the KPRNN model performs well in multiple iterations, the predicted yield is highly consistent with the actual yield, and the error loss gradually decreases. The optimized network parameters are reasonable, showing good fitting ability and stability. In addition, the KPRNN model is expected to further verify its generalization ability on larger-scale, multi-regional complex data sets, and improve performance by introducing more advanced regularization technology and model structure, providing strong technical support for smart agricultural decision-making and yield optimization.
[0212] The target time recursive neural network KPRNN obtained by the application through time recursive neural network (RNN) and Kronecker product method (Kronecker Product). By collecting and processing multidimensional planting environment data (such as temperature, humidity, soil moisture, fertilizer application, light, etc.), the Kronecker product method is used to combine the features of multidimensional data, and the time series modeling and optimization prediction of the crop growth environment are performed through the time recursive neural network. The model can predict the yield of crops according to the environmental variables of different growth stages of crops, and generate optimization suggestions (such as irrigation, fertilization, temperature control, etc.). Adaptive optimization algorithm and regularization technology are used to ensure that the model converges stably during the training process to avoid overfitting. The target time recursive neural network KPRNN of this application can be applied to a variety of crop planting scenarios, such as carrots, tomatoes, grapes, olives, onions, etc., based on the historical environmental data and historical growth stages of crops, to determine the planting optimization suggestions of crops in the current growth stage and current environmental conditions. The optimized planting suggestions are transmitted through wireless communication modules to realize automated control of agricultural equipment, ensure immediate response and adjustment to the crop growth environment, and help crops grow in the most suitable environment to improve crop yield and quality and realize intelligent agricultural management and decision-making.
[0213] See also Figure 7 , Figure 7 An optimized management method for agricultural planting is shown as an exemplary embodiment of the present application, such as Figure 7 As shown, the present application provides an optimized management method for agricultural planting, comprising:
[0214] The feature combination module is used to obtain multi-dimensional planting environment data within a growth cycle of crops, and to perform feature combination on the multi-dimensional planting environment data to obtain an environmental feature matrix;
[0215] A first calculation module is used to input the environmental feature matrix into a preset time recursive neural network to calculate the error loss;
[0216] A second calculation module is used to calculate the gradient value of the network parameter of the preset time recurrent neural network based on the error loss;
[0217] An optimization module, used for optimizing the network parameters of the preset time recurrent neural network based on the gradient value to obtain the target time recurrent neural network;
[0218] An acquisition module, used to acquire historical environmental data of the historical growth stages of the tested crop;
[0219] The processing module is used to process the historical growth stage and historical environmental data using the target time recursive neural network to obtain the predicted yield of the crops to be tested, so as to optimize the management of the crops to be tested based on the predicted yield.
[0220] In an optimization management system for agricultural planting of this embodiment, a feature combination module is used to combine multidimensional planting environment data within a growth cycle of crops to obtain an environmental feature matrix, a first calculation module is used to input the environmental feature matrix into a preset time recursive neural network, an error loss is calculated, and a second calculation module is used to calculate the gradient value of the network parameter of the preset time recursive neural network based on the error loss, and an optimization module is used to optimize the network parameter of the preset time recursive neural network based on the gradient value to obtain a target time recursive neural network. In this way, the preset time recursive neural network is optimized and trained by multidimensional planting environment data, so that the trained target time recursive neural network can process the relationship between multidimensional environmental variables, and improve the accuracy of the target time recursive neural network in data analysis of multidimensional environmental variables. Then, in the processing module, the target time recursive neural network is used to process the historical growth stage and historical environmental data of the crop to be tested obtained by the acquisition module, and the predicted yield of the crop to be tested that meets the accuracy requirement is obtained, so as to improve the accuracy of optimizing the management of the crop to be tested based on the predicted yield, thereby improving the effect of crop optimization management.
[0221] Optionally, the feature combination module is specifically used to:
[0222] During a growth cycle of the crop, the initial multi-dimensional environmental data of the planting environment of the crop is obtained at preset intervals;
[0223] The initial multi-dimensional environmental data are preprocessed to obtain multi-dimensional planting environment data.
[0224] Optionally, the preset time recursive neural network includes a plurality of time steps, the plurality of time steps are connected in time order, and the time step includes a hidden layer and an output layer;
[0225] The first computing module is specifically used for:
[0226] The environment feature matrix is input into a preset time recursive neural network, and the environment feature matrix is processed using hidden layers of multiple time steps to obtain the hidden layer activation value of each time step;
[0227] The output layer is used to activate the hidden layer activation value of the corresponding time step to obtain the output value of the time step, and the output value of the last time step among multiple time steps is used as the network output;
[0228] Get the real yield of crops;
[0229] Based on the network output and the true output, the error loss is obtained.
[0230] Optionally, the first computing module is specifically configured to:
[0231] The mean square error is calculated based on the network output and the actual output to obtain the initial error loss;
[0232] The initial error loss is regularized to obtain the error loss.
[0233] Optionally, the optimization module is specifically used to:
[0234] Based on the gradient value, the initial first-order momentum and the initial second-order momentum of the preset time recurrent neural network are updated and adjusted to obtain the target first-order momentum and the target second-order momentum;
[0235] Performing deviation correction on the target first-order momentum and the target second-order momentum to obtain a corrected first-order momentum and a corrected second-order momentum;
[0236] The initial learning rate of the preset time recurrent neural network is updated and adjusted based on the corrected second-order momentum to obtain a target learning rate;
[0237] The network parameters of the preset time recurrent neural network are optimized and adjusted based on the target learning rate and the corrected first-order momentum to obtain the target time recurrent neural network.
[0238] Optionally, the optimization module is specifically used to:
[0239] Using the target learning rate and the corrected first-order momentum to update and adjust the network parameters of the preset time recurrent neural network, the target network parameters and the corresponding updated and adjusted time recurrent neural network are obtained;
[0240] Iteratively training the updated and adjusted time recursive neural network based on the target network parameters and the environment feature matrix to obtain a training result;
[0241] When the error loss corresponding to the training result is less than a preset value, the time recursive neural network corresponding to the training result is used as the target time recursive neural network.
[0242] Optionally, the processing module is specifically configured to:
[0243] Input the historical growth stage and historical environment data into the target time recurrent neural network, and find the target time step in the target time recurrent neural network that matches the historical growth stage;
[0244] Inputting historical environmental data into a target time step, predicting environmental data of other time steps except the target time step, and using the predicted environmental data as future environmental data of the future growth stage of the tested crop;
[0245] The future environmental data are input into other time steps to obtain the target output value of the target time recursive neural network, and the target output value is used as the predicted yield of the crop to be tested.
[0246] Optionally, the system further includes a suggestion module and a modeling module, which are specifically used for:
[0247] Use historical environment data and historical growth stages to perform table lookup operations in the preset optimization suggestion table;
[0248] Find and obtain planting optimization suggestions for the tested crops corresponding to historical environmental data and historical growth stages.
[0249] It should be noted that the optimized management system for agricultural planting provided in the above embodiment and the optimized management method for agricultural planting provided in the above embodiment belong to the same concept, wherein the specific manner in which each module and unit performs operations has been described in detail in the method embodiment and will not be repeated here. In practical applications, the optimized management system for agricultural planting provided in the above embodiment can distribute the above functions to different functional modules as needed, that is, divide the internal structure of the system into different functional modules to complete all or part of the functions described above, and this is not limited here.
[0250] A computing device according to an embodiment of the present application includes a memory, a processor, and a program stored in the memory and running on the processor. When the processor executes the program, some or all steps of the above-mentioned agricultural planting optimization management method are implemented.
[0251] Among them, the computing device can be a computer, and correspondingly, its program is computer software. The above-mentioned parameters and steps in a computing device of the present application can refer to the parameters and steps in the embodiment of the optimization management method for agricultural planting above, and will not be repeated here.
[0252] In an embodiment of the present application, a computer-readable storage medium is provided, in which instructions are stored. When the instructions are executed, the steps of the above-mentioned agricultural planting optimization management method are executed.
[0253] The computer-readable storage medium may be a transient computer-readable storage medium or a non-transitory computer-readable storage medium.
[0254] The technical solution of the embodiment of the present disclosure can be embodied in the form of a software product, which is stored in a storage medium and includes one or more instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method of the embodiment of the present disclosure. The aforementioned computer-readable storage medium may be a non-transitory computer-readable storage medium, including: a USB flash drive, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a disk or an optical disk, and other media that can store program codes, or a transient computer-readable storage medium.
[0255] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0256] Those skilled in the art know that the present application can be implemented as a system, method or computer program product. Therefore, the present disclosure can be specifically implemented in the following forms, namely: it can be complete hardware, it can be complete software (including firmware, resident software, microcode, etc.), or it can be a combination of hardware and software, generally referred to as "module" or "system" herein. In addition, in some embodiments, the present application can also be implemented in the form of a computer program product in one or more computer-readable media, and the computer-readable medium contains computer-readable program code. Computer-readable storage media can be, for example, but not limited to - electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or devices, or any combination of the above.
[0257] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0258] Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limitations on the present application. Ordinary technicians in this field can change, modify, replace and modify the above embodiments within the scope of the present application.
Claims
1. An optimized management method for agricultural planting, characterized in that: include: Acquire multi-dimensional planting environment data within a growth cycle of crops, and perform feature combination on the multi-dimensional planting environment data to obtain an environment feature matrix; Inputting the environmental feature matrix into a preset time recursive neural network to calculate the error loss; Calculate the gradient value of the network parameter of the preset time recurrent neural network based on the error loss; Optimizing the network parameters of the preset time recurrent neural network based on the gradient value to obtain a target time recurrent neural network; Obtain historical environmental data of the historical growth stages of the crops to be tested; The target time recursive neural network is used to process the historical growth stage and the historical environmental data to obtain the predicted yield of the crop to be tested, so as to optimize the management of the crop to be tested based on the predicted yield.
2. The method according to claim 1, characterized in that The obtaining of multi-dimensional planting environment data within a crop growth cycle includes: During a growth cycle of the crop, initial multi-dimensional environmental data of the planting environment of the crop is obtained at preset time intervals; The initial multi-dimensional environmental data is preprocessed to obtain multi-dimensional planting environment data.
3. The method according to claim 1, characterized in that The preset time recursive neural network includes a plurality of time steps, the plurality of time steps are connected in time sequence, and the time step includes a hidden layer and an output layer; The step of inputting the environmental feature matrix into a preset time recursive neural network and calculating the error loss includes: Inputting the environmental feature matrix into a preset time recursive neural network, processing the environmental feature matrix using the hidden layers of multiple time steps, and obtaining a hidden layer activation value of each time step; Activating the hidden layer activation value of the corresponding time step by using the output layer to obtain the output value of the time step, and taking the output value of the last time step among the multiple time steps as the network output; Obtaining the actual yield of the crop; Based on the network output and the true output, an error loss is obtained.
4. The method according to claim 3, characterized in that The error loss is obtained based on the network output and the true output, including: Performing mean square error calculation based on the network output and the actual output to obtain an initial error loss; Regularization is performed on the initial error loss to obtain an error loss.
5. The method according to claim 1, characterized in that The step of optimizing the network parameters of the preset time recurrent neural network based on the gradient value to obtain a target time recurrent neural network includes: Based on the gradient value, an initial first-order momentum and an initial second-order momentum of the preset time recurrent neural network are updated and adjusted to obtain a target first-order momentum and a target second-order momentum; Performing deviation correction on the target first-order momentum and the target second-order momentum to obtain a corrected first-order momentum and a corrected second-order momentum; Based on the corrected second-order momentum, an initial learning rate of the preset time recurrent neural network is updated and adjusted to obtain a target learning rate; Based on the target learning rate and the corrected first-order momentum, the network parameters of the preset time recurrent neural network are optimized and adjusted to obtain a target time recurrent neural network.
6. The method according to claim 5, characterized in that The optimizing and adjusting the network parameters of the preset time recurrent neural network based on the target learning rate and the corrected first-order momentum to obtain the target time recurrent neural network includes: Using the target learning rate and the corrected first-order momentum to update and adjust the network parameters of the preset time recurrent neural network, to obtain target network parameters and the corresponding updated and adjusted time recurrent neural network; Iteratively training the updated and adjusted time recursive neural network based on the target network parameters and the environmental feature matrix to obtain a training result; When the error loss corresponding to the training result is less than a preset value, the time recursive neural network corresponding to the training result is used as the target time recursive neural network.
7. The method according to claim 1, characterized in that The method of using the target time recursive neural network to process the historical growth stage and the historical environmental data to obtain the predicted yield of the crop to be tested includes: Inputting the historical growth stage and the historical environment data into the target time recursive neural network, and searching the target time step in the target time recursive neural network that matches the historical growth stage; Inputting the historical environmental data into the target time step, predicting and obtaining predicted environmental data of other time steps except the target time step, and using the predicted environmental data as future environmental data of the future growth stage of the crop to be tested; The future environmental data is input into the other time steps to obtain the target output value of the target time recursive neural network, and the target output value is used as the predicted yield of the crop to be tested.
8. The method according to any one of claims 1 to 7, characterized in that: The method further comprises: Performing a table lookup operation in a preset optimization suggestion table using the historical environment data and the historical growth stage; The historical environmental data and the planting optimization suggestions for the tested crop corresponding to the historical growth stage are searched and obtained.
9. A computing device comprising a memory, a processor, and a program stored in the memory and running on the processor, characterized in that: When the processor executes the program, the steps of an agricultural planting optimization management method as described in any one of claims 1 to 8 are implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and when the instructions are executed on a terminal device, the terminal device executes the steps of an agricultural planting optimization management method as described in any one of claims 1 to 8.
Citation Information
Cited By
Rice growth image real-time acquisition method
CN120375190A