Nitrogen fertilizer decision-making method and device for crops, electronic equipment and storage medium

CN119417135BActive Publication Date: 2026-08-18WUHAN UNIV
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411470846.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-21
Publication Date
2026-08-18
Estimated Expiration
2044-10-21

AI Technical Summary

Technical Problem

[0005]本申请提供一种作物的氮肥决策方法、装置、电子设备及存储介质,以解决相关技术未考虑作物模拟与实际生长的偏差容易导致决策失误,未能综合考虑种植收益与环境收益,且状态变量获取的效率低的问题,可以利用数据同化减少决策误差,利用图像估测作物生长状态高效获取状态变量,并综合考虑了作物产量、经济收益和环境效益

Benefits of technology

[0049] (1) The embodiments of this application use a data assimilation algorithm to reduce the decision error of the deep reinforcement learning model. By integrating the uncertainty of observation and environmental simulation, the precise decision of crop nitrogen fertilizer is achieved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119417135B_ABST
    Figure CN119417135B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of intelligent agriculture, in particular to a crop nitrogen fertilizer decision-making method and device, an electronic device and a storage medium, wherein the method comprises the following steps: acquiring basic information of a crop to be observed, a decision-making day precipitation and a canopy image; an environment body model is constructed based on the basic information, a crop growth simulation state of the crop to be observed is obtained by using the environment body model, and the canopy image is input into a preset estimation model to obtain a basic growth state of the crop to be observed; based on a preset assimilation model, the crop growth simulation state and the basic growth state are fused to obtain an updated crop growth state, and based on a preset intelligent agent model, a fertilization decision-making time and a fertilization decision-making numerical value are generated according to the updated crop growth state and the decision-making day precipitation. Therefore, the application avoids the problem of nitrogen fertilizer decision-making errors caused by the deviation between the environment body and the application environment, has the advantages of rapidness, non-damage and high precision, and can realize real-time nitrogen fertilizer decision-making for farmland crops.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of smart agriculture technology, and in particular to a nitrogen fertilizer decision-making method, device, electronic device and storage medium for crops. Background Technology

[0002] Current nitrogen fertilizer management in farmland relies on traditional experience. During crop growth, the timing and amount of nitrogen fertilizer application are relatively fixed, and the same management model is typically used within a region (county or township). This ignores the temporal and spatial differences in crop growth and fails to ensure synchronization between fertilization and crop nitrogen requirements. Crop nitrogen fertilizer decisions require determining the optimal timing and amount of fertilization to maximize crop yield or economic benefits. Given the long-term cycle of crop growth and the large space for nitrogen application actions, dynamic programming methods have high computational complexity. Therefore, current nitrogen fertilizer optimization management still relies on fixed schedules for decision-making.

[0003] Reinforcement learning methods combine Monte Carlo sampling and dynamic programming algorithms, employing random walks to explore the environment and providing different decision-making options based on the state of the external environment. Deep reinforcement learning addresses the challenge of traditional reinforcement learning handling large numbers of states and actions by introducing deep neural networks to perceive more complex environmental states and build more sophisticated policies, thereby enhancing the capabilities of reinforcement learning algorithms.

[0004] However, in related technologies, most deep reinforcement learning environments are single crop models or their alternatives, failing to fully consider the potential discrepancies between crop simulation and actual growth. This uncertainty in the decision state is directly transmitted to the decision model, easily leading to decision errors. Furthermore, deep reinforcement learning rewards in agricultural decision-making primarily focus on yield or economic benefits, neglecting environmental pollution caused by nitrogen fertilizer emissions, and failing to comprehensively consider planting income and environmental benefits. Finally, obtaining the state variables for decision-making is costly, typically employing destructive sampling methods, which are time-consuming and labor-intensive, making it impossible to achieve low-cost, rapid, real-time crop nitrogen fertilizer decision-making. Summary of the Invention

[0005] This application provides a method, apparatus, electronic device, and storage medium for nitrogen fertilizer decision-making in crops, which solves the problems of related technologies that fail to consider the deviation between crop simulation and actual growth, which can easily lead to decision-making errors, fail to comprehensively consider planting benefits and environmental benefits, and have low efficiency in obtaining state variables. It can reduce decision-making errors by using data assimilation, efficiently obtain state variables by estimating crop growth status using images, and comprehensively consider crop yield, economic benefits, and environmental benefits.

[0006] The first aspect of this application provides a method for nitrogen fertilizer decision-making for crops, comprising the following steps:

[0007] Acquire basic information about the crop to be observed, determine daily precipitation, and obtain canopy images;

[0008] An environmental volume model is constructed based on the basic information, and the crop growth simulation state of the crop to be observed is obtained using the environmental volume model. The canopy image is then input into a preset estimation model to obtain the basic growth state of the crop to be observed.

[0009] Based on a preset assimilation model, the crop growth simulation state and the basic growth state are fused to obtain an updated crop growth state. Based on a preset intelligent agent model, the fertilization decision time and fertilization decision value are generated according to the updated crop growth state and the daily precipitation.

[0010] Optionally, in some embodiments, after generating the fertilization decision time and fertilization decision value based on the preset agent model, according to the updated crop growth status and the daily precipitation, the process includes:

[0011] Based on the environmental model, an agent reward is generated according to the fertilization decision time and fertilization decision value.

[0012] Based on the preset agent model, the fertilization decision time and fertilization decision value are updated according to the agent reward.

[0013] Optionally, in some embodiments, the agent reward is:

[0014] r t =w1×2.72×Y tarvest -w2×5.53×N t -w3×150×Labor t -w4×P t ;

[0015] Where, r t Y is the reward at time t. harvest For output, N t Let lABOR be the nitrogen application rate at time t. t Let P be the labor cost at time t. t The cost of nitrogen fertilizer loss into the environment is represented by w1, w2, w3, and w4, which are all reward coefficients.

[0016] Optionally, in some embodiments, before generating the fertilization decision time and fertilization decision value based on the preset agent model, according to the updated crop growth status and the daily precipitation, the following steps are included:

[0017] The preset agent model is obtained by training the SAC value function and the SAC state function, wherein the SAC value function is:

[0018]

[0019] The SAC state function is:

[0020]

[0021] Where Q(s) t ,a t ) represents the state s at time t. t Take action a t State-action value function, r(s) t ,a t ) is in state s t Take action a t The reward, where γ is the discount factor. For the next state s t+1 The expectation of the state function, p is the transition probability, π is the policy, logπ(a) t |s t () represents the policy π in state s t Choose action a t The logarithm of the probability, π new Let π′ be a new strategy to be optimized, and D be a new strategy to be optimized. KL Let KL divergence be the KL divergence. The normalization constant is For the old strategy π old Below, from state s t The initial value function, For strategy π, consider all possible actions a t The expectation of the state-action value function.

[0022] Optionally, in some embodiments, the preset assimilation model is:

[0023]

[0024] in, The updated state matrix, Let K be the state matrix of the model up to time t. t Let d be the Kalman gain at time t. obs,t For the perturbated observations, H t Let t be the operator that transforms the state matrix into the observation matrix at time t.

[0025] Optionally, in some embodiments, the crop growth status includes: crop growth period, leaf area index, aboveground biomass, leaf nitrogen content, and yield.

[0026] A second aspect of this application provides a nitrogen fertilizer decision-making device for crops, comprising:

[0027] The acquisition module is used to acquire basic information about the crop to be observed, daily precipitation for decision purposes, and canopy images;

[0028] The simulation module is used to construct an environmental volume model based on the basic information, and use the environmental volume model to obtain the crop growth simulation state of the crop to be observed, and input the canopy image into a preset estimation model to obtain the basic growth state of the crop to be observed;

[0029] The decision module is used to obtain an updated crop growth state by fusing the crop growth simulation state and the basic growth state based on a preset assimilation model, and to generate fertilization decision time and fertilization decision value based on a preset intelligent agent model, according to the updated crop growth state and the daily precipitation.

[0030] Optionally, in some embodiments, after generating fertilization decision time and fertilization decision values ​​based on the preset agent model, according to the updated crop growth status and the daily precipitation, the decision module includes:

[0031] The reward unit is used to generate agent rewards based on the environmental model and according to the fertilization decision time and fertilization decision value.

[0032] The update unit is used to update the fertilization decision time and fertilization decision value based on the preset agent model and the agent reward.

[0033] Optionally, in some embodiments, the agent reward is:

[0034] r t =w1×2.72×Y harvest -w2×5.53×N t -w3×150×Labor t -w4×P t ;

[0035] Where, r t Y is the reward at time t. harvest For output, N t Let be the nitrogen application rate at time t, Labor t Let P be the labor cost at time t. t The cost of nitrogen fertilizer loss into the environment is represented by w1, w2, w3, and w4, which are all reward coefficients.

[0036] Optionally, in some embodiments, before generating the fertilization decision time and fertilization decision value based on the preset agent model, according to the updated crop growth status and the daily precipitation, the following steps are included:

[0037] The preset agent model is obtained by training the SAC value function and the SAC state function, wherein the SAC value function is:

[0038]

[0039] The SAC state function is:

[0040]

[0041] Where Q(s) t ,a t ) represents the state s at time t. t Take action a t State-action value function, r(s) t ,a t ) is in state s t Take action a t The reward, where γ is the discount factor. For the next state s t+1 The expectation of the state function, p is the transition probability, π is the policy, logπ(a) t |s t () represents the policy π in state s t Choose action a t The logarithm of the probability, π new Let π′ be a new strategy to be optimized, and D be a new strategy to be optimized. KL Let KL divergence be the KL divergence. The normalization constant is For the old strategy π old Below, from state s t The initial value function, For strategy π, consider all possible actions a t The expectation of the state-action value function.

[0042] Optionally, in some embodiments, the preset assimilation model is:

[0043]

[0044] in, The updated state matrix, Let K be the state matrix of the model up to time t. t Let d be the Kalman gain at time t. obs,t For the perturbated observations, H t Let t be the operator that transforms the state matrix into the observation matrix at time t.

[0045] Optionally, in some embodiments, the crop growth status includes: crop growth period, leaf area index, aboveground biomass, leaf nitrogen content, and yield.

[0046] A third aspect of this application provides an electronic device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the crop nitrogen fertilizer decision method as described in the above embodiments.

[0047] A fourth aspect of this application provides a computer-readable storage medium having a computer program stored thereon, which is executed by a processor to implement the crop nitrogen fertilizer decision method as described in the above embodiments.

[0048] Therefore, this application has at least the following beneficial effects:

[0049] (1) The embodiments of this application use a data assimilation algorithm to reduce the decision error of the deep reinforcement learning model. By integrating the uncertainty of observation and environmental simulation, the precise decision of crop nitrogen fertilizer is achieved.

[0050] (2) The embodiments of this application use mobile phones to take photos of crop canopy, estimate various growth states of crops based on mobile phone images, which has the advantages of being fast and non-destructive, and assimilate the observation of mobile phone images into the deep reinforcement learning environment, enabling real-time crop nitrogen fertilizer decision-making.

[0051] (3) The embodiments of this application comprehensively consider crop yield, economic benefits and environmental benefits, and can make crop nitrogen fertilizer decisions according to the development needs of different regions, so that the deep reinforcement learning model can adapt to different application scenarios.

[0052] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description

[0053] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, wherein:

[0054] Figure 1 This is a flowchart of a crop nitrogen fertilizer decision-making method according to an embodiment of this application;

[0055] Figure 2 This is a schematic diagram illustrating the principle of a crop nitrogen fertilizer decision-making method according to an embodiment of this application;

[0056] Figure 3 This is a schematic diagram of the training result of the SAC algorithm according to an embodiment of this application, wherein, Figure 3(a1) is a schematic diagram of the nitrogen application rate change process during 50,000 training steps of the SAC algorithm. Figure 3 (a2) is a schematic diagram of the rice yield change process after 50,000 steps of SAC algorithm training. Figure 3 (b1) is a schematic diagram of the nitrogen application rate change process during 100,000 steps of SAC algorithm training. Figure 3 (b2) is a schematic diagram of the rice yield change process after 100,000 steps of SAC algorithm training. Figure 3 (c1) is a schematic diagram of the nitrogen application rate change process during 200,000 steps of SAC algorithm training. Figure 3 (c2) is a schematic diagram of the rice yield change process after 200,000 steps of training with the SAC algorithm;

[0057] Figure 4 This is a schematic diagram of a crop canopy image taken by a mobile phone according to an embodiment of this application, wherein, Figure 4 (a) is a schematic diagram of the tillering stage. Figure 4 (b) is a schematic diagram of the jointing stage. Figure 4 (c) is a schematic diagram of the grouting period;

[0058] Figure 5 This is a schematic diagram illustrating the crop growth status estimation result based on mobile phone images according to an embodiment of this application, wherein, Figure 5 (a) is a schematic diagram of the estimated fertility period. Figure 5 (b) is a schematic diagram of the vegetation area index estimation results. Figure 5 (c) is a schematic diagram of the aboveground biomass estimation results. Figure 5 (d) is a schematic diagram of the estimated nitrogen content in leaves;

[0059] Figure 6 This is a schematic diagram illustrating the simulation results of assimilating crop states estimated from mobile phone images into the rice growth state in a gym-ORYZA environment, according to an embodiment of this application. Figure 6 (a1) is a schematic diagram of the reproductive period observations from the gym-ORYZA environmental simulation results. Figure 6 (a2) is a schematic diagram of the observed reproductive period values ​​from the ORYZA-EnKF simulation results. Figure 6 (b1) is a schematic diagram of the vegetation area index observations from the gym-ORYZA environmental volume simulation results. Figure 6 (b2) is a schematic diagram of the vegetation area index observations from the ORYZA-EnKF simulation results. Figure 6 (c1) is a schematic diagram of the aboveground biomass observations from the gym-ORYZA environmental volume simulation results. Figure 6(c2) is a schematic diagram of the aboveground biomass observations from the ORYZA-EnKF simulation results. Figure 6 (d1) is a schematic diagram of the leaf nitrogen content observations from the gym-ORYZA environmental simulation results. Figure 6 (d2) is a schematic diagram of the leaf nitrogen content observations from the ORYZA-EnKF simulation results;

[0060] Figure 7 This is a schematic diagram illustrating the application results of crop nitrogen fertilizer decision-making based on mobile phone images and deep reinforcement learning under different state estimation scenarios according to an embodiment of this application, wherein... Figure 7 (a) is a schematic diagram of nitrogen application decision-making for rice based on the SAC model under the state-unbiased scenario. Figure 7 (b) is a schematic diagram of nitrogen application decision-making for rice based on the SAC model under the state overestimation scenario. Figure 7 (c) is a schematic diagram of nitrogen application decision for rice based on the SAC model under the state underestimation scenario;

[0061] Figure 8 This is a block diagram of a crop nitrogen fertilizer decision-making device according to an embodiment of this application;

[0062] Figure 9 This is a schematic diagram of the structure of an electronic device provided according to an embodiment of this application. Detailed Implementation

[0063] The embodiments of this application are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this application, and should not be construed as limiting this application.

[0064] The following description, with reference to the accompanying drawings, outlines a crop nitrogen fertilizer decision-making method, apparatus, electronic device, and storage medium according to embodiments of this application. Addressing the issues mentioned in the background art, such as the failure to consider deviations between crop simulation and actual growth leading to decision-making errors, the inability to comprehensively consider planting and environmental benefits, and the low efficiency of state variable acquisition, this application provides a crop nitrogen fertilizer decision-making method. In this method, basic information of the crop to be observed, daily precipitation for the decision date, and canopy images are acquired. An environmental volume model is constructed based on the basic information, and the crop growth simulation state of the crop to be observed is obtained using the environmental volume model. The canopy images are input into a preset estimation model to obtain the basic growth state of the crop to be observed. Based on a preset assimilation model, the crop growth simulation state and the basic growth state are fused to obtain an updated crop growth state. Finally, based on a preset intelligent agent model, fertilization decision time and fertilization decision values ​​are generated according to the updated crop growth state and daily precipitation for the decision date. This solves the problems of related technologies failing to consider the deviation between crop simulation and actual growth, which can easily lead to decision-making errors, failing to comprehensively consider planting benefits and environmental benefits, and having low efficiency in obtaining state variables. It can reduce decision-making errors by using data assimilation, efficiently obtain state variables by estimating crop growth status using images, and comprehensively consider crop yield, economic benefits and environmental benefits.

[0065] Specifically, Figure 1 This is a flowchart illustrating a nitrogen fertilizer decision-making method for crops provided in an embodiment of this application.

[0066] like Figure 1 As shown, the nitrogen fertilizer decision-making method for this crop includes the following steps:

[0067] In step S101, basic information of the crop to be observed, daily precipitation for decision purposes, and canopy images are obtained.

[0068] It should be noted that the embodiments of this application can obtain the basic information of the crop to be observed through historical observation data of the crop to be observed. The basic information includes growth period, leaf area index, aboveground biomass, leaf nitrogen content and yield, etc. The daily precipitation can be estimated through weather forecast information, and the canopy image can be obtained by taking a photo of the canopy of the crop to be observed with a mobile phone.

[0069] In practical implementation, this embodiment of the application uses a mobile phone to collect images of the crop canopy and employs a deep convolutional neural network model to estimate the basic growth status of the crop, including growth stage, leaf area index, aboveground biomass, and leaf nitrogen content. The deep convolutional neural network model framework can be the lightweight MobileNetV3, which features fewer parameters and faster computation speed. It should be noted that the model input for estimating growth stage, leaf area index, and aboveground biomass is a distant photograph of the crop canopy, taken approximately 1.5m above the ground; the model input for estimating leaf nitrogen content is a close-up photograph of the crop canopy, taken approximately 20-30cm above the canopy.

[0070] In step S102, an environmental volume model is constructed based on basic information, and the crop growth simulation state of the crop to be observed is obtained using the environmental volume model. The canopy image is then input into a preset estimation model to obtain the basic growth state of the crop to be observed.

[0071] The crop growth status includes: crop growth period, leaf area index, aboveground biomass, leaf nitrogen content, and yield.

[0072] It should be noted that, based on the classic mechanistic crop model, this application embodiment can develop a deep reinforcement learning environment model gym-ORYZA, which includes two core modules, "reset" and "step", for simulating the crop growth and development process and its response to nitrogen fertilizer application. The "reset" module initializes the parameters of the environment, and the "step" module can adjust the amount of fertilizer and calculate the crop growth status.

[0073] Specifically, in this embodiment, the crop model can be calibrated using historical observation data. The calibrated crop model is then used to construct an environmental model, which can be a deep reinforcement learning environment model (gym-ORYZA) used to simulate the growth and development process of the crop, obtain the simulated growth state of the crop to be observed, and take photos of the crop canopy with a mobile phone. The deep learning model is then used to calculate the crop's growth period, leaf area index, aboveground biomass, and leaf nitrogen content, achieving rapid and non-destructive high-precision observation of the crop's state and obtaining the basic growth state of the crop to be observed.

[0074] In step S103, based on a preset assimilation model, the crop growth simulation state and the basic growth state are fused to obtain the updated crop growth state. Based on a preset intelligent agent model, the fertilization decision time and fertilization decision value are generated according to the updated crop growth state and the daily precipitation.

[0075] It is understood that, prior to performing this step, embodiments of this application require the construction of a preset assimilation model and a preset agent model.

[0076] The preset assimilation model is the ORYZA-EnKF data assimilation model, which requires assimilating multivariate crop observation information. The EnKF algorithm calculation formula is as follows:

[0077]

[0078] Among them, y t It is the state matrix of the model at time t, and its dimension is N. y =N m +N u +N d m t T It is the model parameter matrix, u t T It consists of model state variables, d t T It is a matrix composed of observations.

[0079] The model's observations can be transformed using an observation operator:

[0080] y t =Hy t ;

[0081] H = [0, I];

[0082] Here, H refers to the observation operator, and 0 is an N d ×(N m +N u I is an N-dimensional matrix, where all elements are 0. d ×N d .

[0083] Once the model reaches time t and the state matrix is ​​calculated, it can be updated using the EnKF algorithm:

[0084]

[0085] in, This represents the updated state matrix. d represents the state matrix of the model up to time t. obs,t K represents the perturbed observation. t Let be the Kalman gain at time t, where the Kalman gain can be calculated from the covariance matrix of the sample set:

[0086]

[0087] in, This refers to the prior covariance matrix of the state vector simulated by the model up to time t. It is the state matrix at time t, where i is the sample number. This represents the observation error.

[0088] This application embodiment can use the Deep Reinforcement Learning (SAC) algorithm to train a pre-defined agent model, wherein the SAC algorithm value function and the SAC algorithm state-policy function are:

[0089]

[0090] Wherein, -logπ(a t |s t ) represents the policy π in state s t The randomness of the action distribution is reduced. The policy is improved by minimizing the KL divergence of the action distribution. The improved policy is closer to the exponential action distribution of the current value function, thereby improving the overall policy performance.

[0091] The goal of the SAC algorithm is to maximize the expected sum of reward and policy entropy.

[0092]

[0093] Wherein, H(π(·|s t )) is the policy π in state s t Entropy is a factor in the algorithm's ability to explore. Regularizing the entropy can increase the exploratory power of reinforcement learning algorithms; the larger the value of α, the stronger the exploratory power, which can reduce the possibility of the policy getting stuck in local optima.

[0094] Specifically, in this embodiment, the basic growth state information observed by mobile phone images is assimilated into the gym-ORYZA environment by using the Kalman filter EnKF algorithm to construct a preset assimilation model ORYZA-EnKF, thereby reducing simulation bias caused by crop model uncertainty. The crop state updated by the preset assimilation model ORYZA-EnKF is then input into the trained deep reinforcement learning model SAC to obtain real-time crop nitrogen fertilizer decision results.

[0095] In practical implementation, the deep reinforcement learning algorithm SAC samples data through interaction between the agent and the environment during training. Considering the uncertainties in model structure, parameters, and input, the environment exhibits significant bias during simulation. The ORYZA-EnKF data assimilation system reduces simulation bias caused by uncertainties in the crop model by integrating uncertainties from mobile phone image observations and gym-ORYZA simulations. Because mobile phone image capture is low-cost and fast, inputting the updated state from the ORYZA-EnKF system into the trained SAC model enables accurate real-time decision-making regarding crop nitrogen fertilizer application.

[0096] Optionally, in some embodiments, after generating fertilization decision time and fertilization decision values ​​based on a preset agent model and the updated crop growth status and daily precipitation, the process includes: generating agent rewards based on an environmental agent model and the fertilization decision time and fertilization decision values; and updating the fertilization decision time and fertilization decision values ​​based on the preset agent model and the agent rewards.

[0097] It should be noted that the embodiments of this application can construct a reward function for reinforcement learning. The reward function consists of crop yield, fertilizer application rate, and environmental nitrogen emissions, comprehensively considering the crop growth, economic, and environmental benefits of nitrogen fertilizer application. The reward function includes crop yield, fertilizer application rate, and environmental nitrogen emissions, and the calculation formula is as follows:

[0098] r t =w1×2.72×Y harvest -w2×5.53×N t -w3×150×Labor t -w4×P t ;

[0099]

[0100] Wherein, rt is the reward at time t (unit: yuan / hectare). w1, w2, w3, and w4 refer to the corresponding reward coefficients, which default to 1 and can be adjusted according to different scenarios. Yharvest is the crop yield at harvest (unit: kg / hectare), and there is only a yield reward at crop harvest; at other times, it is 0, and is determined to be 2.72 yuan / kg based on the average market price. Nt represents the amount of nitrogen applied at time t (unit: kg nitrogen / hectare), and is determined to be 5.53 yuan / kg based on the average market price of nitrogen fertilizer. Labort is the labor cost at time t (unit: yuan / hectare), and is determined to be 150 yuan / time / hectare based on cost research; if no fertilization is performed at time t, it is 0. Pt refers to the cost of the harm caused by nitrogen fertilizer loss into the environment. and These are the emission losses of NH3 and N2O and the leaching loss of NO3- (unit: kg / ha), respectively. According to the survey, the environmental costs are determined to be 39.3 yuan / kg, 83.5 yuan / kg and 9.6 yuan / kg, respectively.

[0101] The decision space of the pre-defined agent model contains variables that are easy and inexpensive to acquire. Rainfall on the decision day can be estimated from weather forecast information. The growth stage, leaf area index, aboveground biomass, leaf nitrogen content, and yield of crops are basic information about the crop and do not require further complex observations. The state space is generated by the environment agent model gym-ORYZA. The pre-defined agent model obtains the state through reinforcement learning and gives the decision action. The environment agent model gym-ORYZA receives the decision action and feeds back the corresponding reward to the agent, guiding the agent's optimization direction.

[0102] Therefore, this application uses the deep reinforcement learning algorithm SAC to train the agent. The agent interacts with the environment and samples the nitrogen application time and amount according to the reward function until the optimal nitrogen application strategy is generated. The introduction of entropy regularization and softening strategy update can enable the agent to better explore unknown states and improve learning efficiency.

[0103] To enable those skilled in the art to further understand the crop nitrogen fertilizer decision-making method of the embodiments of this application, the following detailed description is provided in conjunction with specific embodiments.

[0104] Combination Figure 2 As shown, Figure 2 This is a schematic diagram illustrating the principle of the nitrogen fertilizer decision-making method for crops provided in the embodiments of this application.

[0105] Step 1: In order to minimize the error between the model simulation results and the observed values, this embodiment of the application uses the calibrated crop model and develops a deep reinforcement learning environment body gym-ORYZA using the Python language. It includes two core modules: "reset" and "step". The "reset" module initializes the parameters of the environment body, and the "step" module can adjust the amount of fertilizer and calculate the crop growth status. Through the environment body gym-ORYZA, the crop growth and development process and its response to nitrogen fertilizer application can be simulated.

[0106] Step 2: Construct a deep reinforcement learning agent that can interact with gym-ORYZA. A state space for reinforcement learning decision-making is built. In this embodiment, the elements in the decision space are all variables with low acquisition cost and easy access. Rainfall on the decision day can be estimated from weather forecast information. Crop growth status, such as growth stage, leaf area index, aboveground biomass, leaf nitrogen content, and yield, are basic crop information, requiring no further complex observations. The agent obtains rainfall and crop growth status, providing the timing and value for fertilization decisions. After receiving the decision action, gym-ORYZA provides the agent with corresponding rewards, guiding the agent's optimization direction.

[0107] Step 3: Construct a deep reinforcement learning reward system comprising three components: crop yield, fertilizer application rate, and environmental nitrogen emissions. The importance of each component can be adjusted based on different development needs. When the weights of the three components are considered equal, a reward calculation formula is provided in the form of monetization.

[0108] r t =2.72×Y harvest -5.53×N t -150×Labor t -P t ;

[0109]

[0110] Where, r t Y represents the reward at time t (unit: yuan / hectare). harvest This refers to the crop yield at harvest (unit: kg / hectare). Yield bonuses are only awarded at harvest time; otherwise, the yield is zero. It is set at 2.72 yuan / kg based on the average market price of rice. N t The nitrogen application rate at time t (unit: kg nitrogen / ha) is determined to be 5.53 yuan / kg based on the average market price of nitrogen fertilizer. Labor t This represents the labor cost at time t (unit: yuan / hectare), determined to be 150 yuan / time / hectare based on cost research; if no fertilization is performed at time t, then the cost is 0. P t This refers to the cost of the damage caused by nitrogen fertilizer being lost into the environment. and These are the emission losses of NH3 and N2O and NO3, respectively. - The leaching losses (unit: kg / ha) and environmental costs were RMB 39.3 / kg, RMB 83.5 / kg and RMB 9.6 / kg, respectively.

[0111] Step 4: Train the reinforcement learning agent using the deep reinforcement learning algorithm SAC. The value function and state-policy function of the SAC algorithm are as follows:

[0112]

[0113]

[0114] Wherein, -logπ(a t |s t ) represents the policy π in state s t The randomness of the action distribution is reduced. The policy is improved by minimizing the KL divergence of the action distribution. The improved policy is closer to the exponential action distribution of the current value function, thereby improving the overall policy performance.

[0115] The goal of the SAC algorithm is to maximize the expected sum of reward and policy entropy.

[0116]

[0117] Among them, (π(·|s t )) is the policy π in state s t Entropy is denoted by α. Regularizing entropy can increase the exploratory power of reinforcement learning algorithms. The larger the value of α, the stronger the exploratory power, which can reduce the possibility of the policy getting stuck in local optima.

[0118] like Figure 3 As shown, in the early stages of training the SAC model, the training trajectory jumps significantly, gradually stabilizing after about 1000 rounds of training, and finally converging. The trained SAC model can then be used to make decisions regarding crop nitrogen fertilizer application, and the resulting nitrogen application rate and rice yield both conform to normal agricultural production practices.

[0119] Step 5: Use your mobile phone to take images of the crop canopy, such as... Figure 4 As shown, crop canopy images were acquired via mobile phone, and a deep convolutional neural network model was used to estimate the basic growth status of the crops, including growth stage, leaf area index, aboveground biomass, and leaf nitrogen content. The input to the models used for estimating growth stage, leaf area index, and aboveground biomass was a distant photograph of the crop canopy, taken approximately 1.5m above the ground; the input to the model used for estimating leaf nitrogen content was a close-up photograph of the crop canopy, taken approximately 20-30cm above the canopy. The shooting angles were typically 0° and 60° to the horizontal. The lightweight MobileNetV3 model was chosen for its low parameter count and fast computation speed.

[0120] like Figure 5 As shown, the crop growth status estimated using mobile phone images in this application embodiment has high accuracy, with the estimated RRMSE between 16% and 30%, indicating that mobile phone images can be used to achieve fast, non-destructive, and highly accurate crop status monitoring.

[0121] Step 6: Construct an ORYZA-EnKF data assimilation system that can assimilate multivariate crop observations, including crop growth period, leaf area index, aboveground biomass, and leaf nitrogen content. The ensemble Kalman filter (EnKF) algorithm is used to assimilate mobile phone image observations into the gym-ORYZA environment.

[0122]

[0123] in, This represents the updated state matrix; d represents the state matrix of the model up to time t; obs,tK represents the perturbed observation; t This is the Kalman gain at time t. The Kalman gain can be calculated from the covariance matrix of the sample set.

[0124]

[0125]

[0126] in, This refers to the prior covariance matrix of the state vector simulated by the model up to time t; is the state matrix at time t; i is the sample number; This represents the observation error.

[0127] like Figure 6 As shown, by fusing mobile phone image observations into the gym-ORYZA environment, the accuracy of crop growth state simulation in the environment is further improved, and the RRMSE is reduced to 9%-29%.

[0128] This application embodiment continues to provide the updated state of the ORYZA-EnKF data assimilation system to the trained SAC deep reinforcement learning model, such as Figure 7 As shown. Figure 7 (a) shows the nitrogen application decision made by the SAC model based on the calibrated gym-ORYZA environment, assuming unbiased state estimation. Figure 7 In (b), the open-loop simulation based on an overestimation of growth status involved three nitrogen applications, concentrated in the early stages of rice growth, with a total nitrogen application rate of 188 kg N ha. -1 The final yield was 6574 kg ha -1 Because the rice leaf area index, aboveground biomass, and leaf nitrogen content are all high in the overestimated scenario, rice seems to require little nitrogen application, leading to an underestimation of its nitrogen demand under this overestimated state. Despite the uncertainties, the EnKF algorithm can improve the simulation of rice growth status, thus providing a more accurate nitrogen application decision process. The final nitrogen application rate is 258 kg N ha. -1 The final yield was 6980 kg ha -1 From the perspective of rice yield and the economic benefits of nitrogen fertilizer, the benefit of the decision made in the Open-loop simulation under the overestimation state was 16,392 yuan / hectare, while the benefit of the nitrogen application decision based on ORYZA-EnKF was 17,109 yuan / hectare, avoiding a loss of 717 yuan / hectare. Figure 7 In (c), due to an underestimation of the rice's growth status, the number of nitrogen applications based on the open-loop simulation was 5, resulting in a very high total nitrogen application rate of 456 kg Nha. -1This could be interpreted as the rice growing poorly and requiring more fertilizer, but the actual situation is not so, leading to an overestimation of nitrogen application. Similarly, the nitrogen application based on ORYZA-EnKF is more reasonable, with three applications in the early growth stage and one supplement during the booting stage, for a total nitrogen application of 293 kg N·m³. -1 The yield was 7002 kg ha -1 It can be observed that, under the underestimated state, the decision-making in the open-loop simulation increased by 136 kg N ha. -1 The amount of nitrogen fertilizer applied resulted in only a slight increase in yield (31 kg ha). -1 The total economic benefit was 15,893 yuan / hectare; while the benefit of nitrogen application decision based on ORYZA-EnKF was 16,825 yuan / hectare, which was 932 yuan / hectare more than the benefit of Open-loop simulation.

[0129] In summary, this application's embodiments develop a deep reinforcement learning environment based on a calibrated crop model; construct a reinforcement learning agent for crop nitrogen fertilizer decision-making, building the state space and reward function for reinforcement learning decisions; train the agent using the deep reinforcement learning algorithm SAC, introducing entropy regularization and softening policy updates; calculate the crop's growth period, leaf area index, aboveground biomass, and leaf nitrogen content using a deep learning model based on crop canopy photos taken with a mobile phone; assimilate the crop growth state observed from mobile phone images into the gym-ORYZA environment using the ensemble Kalman filter algorithm EnKF, constructing the ORYZA-EnKF data assimilation system; and input the updated crop state into the trained deep reinforcement learning model SAC to obtain the crop nitrogen fertilizer decision results. This avoids the problem of nitrogen fertilizer decision errors caused by deviations between the environment and the application environment, offering advantages of speed, losslessness, and high accuracy, enabling real-time nitrogen fertilizer decision-making for farmland crops.

[0130] The nitrogen fertilizer decision-making method for crops proposed in this application involves acquiring basic information of the crop to be observed, the daily precipitation for the decision date, and canopy images. An environmental volume model is constructed based on the basic information, and the simulated crop growth state is obtained using this model. The canopy images are then input into a preset estimation model to obtain the basic growth state of the crop. Based on a preset assimilation model, the simulated crop growth state and the basic growth state are fused to obtain an updated crop growth state. Finally, based on a preset intelligent agent model, fertilization decision time and fertilization decision values ​​are generated according to the updated crop growth state and the daily precipitation for the decision date. This solves the problems of related technologies that fail to consider the deviation between crop simulation and actual growth, leading to decision errors, fail to comprehensively consider planting and environmental benefits, and have low efficiency in acquiring state variables. The method utilizes data assimilation to reduce decision errors, uses image estimation to efficiently acquire state variables, and comprehensively considers crop yield, economic benefits, and environmental benefits.

[0131] Next, the nitrogen fertilizer decision-making device for crops according to the embodiments of this application is described with reference to the accompanying drawings.

[0132] Figure 8 This is a block diagram of a crop nitrogen fertilizer decision-making device according to an embodiment of this application.

[0133] like Figure 8 As shown, the nitrogen fertilizer decision-making device 10 for this crop includes: an acquisition module 100, a simulation module 200, and a decision-making module 300.

[0134] The acquisition module is used to acquire basic information about the crop to be observed, daily precipitation for decision purposes, and canopy images.

[0135] The simulation module is used to construct an environmental volume model based on basic information, and use the environmental volume model to obtain the crop growth simulation state of the crop to be observed. The canopy image is input into the preset estimation model to obtain the basic growth state of the crop to be observed.

[0136] The decision-making module is used to obtain the updated crop growth status by fusing the crop growth simulation status and the basic growth status based on the preset assimilation model, and to generate the fertilization decision time and fertilization decision value based on the preset intelligent agent model, according to the updated crop growth status and the daily precipitation.

[0137] Optionally, in some embodiments, after generating fertilization decision time and fertilization decision values ​​based on a preset intelligent agent model, according to the updated crop growth status and the daily precipitation, the decision module includes:

[0138] The reward unit is used to generate agent rewards based on the environmental model, according to the fertilization decision time and fertilization decision value.

[0139] The update unit is used to update the fertilization decision time and fertilization decision value based on the preset agent model and the agent reward.

[0140] Optionally, in some embodiments, the agent reward is:

[0141] r t =w1×2.72×Y harvest -w2×5.53×N t -w3×150×Labor t -w4×P t ;

[0142] Where, r t Y is the reward at time t. harvest For output, N t Let Labort be the amount of nitrogen applied at time t. t Let P be the labor cost at time t. t The cost of nitrogen fertilizer loss into the environment is represented by w1, w2, w3, and w4, which are all reward coefficients.

[0143] Optionally, in some embodiments, before generating the fertilization decision time and fertilization decision value based on the updated crop growth status and the daily precipitation based on the preset agent model, the following steps are included:

[0144] The pre-defined agent model is trained using the SAC value function and the SAC state function. The SAC value function is:

[0145]

[0146]

[0147] The SAC state function is:

[0148]

[0149] Where Q(s) t ,a t ) represents the state s at time t. t Take action a t State-action value function, r(s) t ,a t ) is in state s t Take action a t The reward, where γ is the discount factor. For the next state s t+1 The expectation of the state function, p is the transition probability, π is the policy, logπ(a) t |s t () represents the policy π in state s t Choose action at The logarithm of the probability, π new Let π′ be a new strategy to be optimized, and D be a new strategy to be optimized. KL Let KL divergence be the KL divergence. The normalization constant is For the old strategy π old Below, from state s t The initial value function, For strategy π, consider all possible actions a t The expectation of the state-action value function.

[0150] Optionally, in some embodiments, the preset assimilation model is:

[0151]

[0152] in, The updated state matrix, Let K be the state matrix of the model up to time t. t Let d be the Kalman gain at time t. obs,t For the perturbated observations, H t Let t be the operator that transforms the state matrix into the observation matrix at time t.

[0153] Optionally, in some embodiments, crop growth status includes: crop growth stage, leaf area index, aboveground biomass, leaf nitrogen content, and yield.

[0154] It should be noted that the explanation of the above-mentioned embodiment of the nitrogen fertilizer decision method for crops also applies to the nitrogen fertilizer decision device for crops in this embodiment, and will not be repeated here.

[0155] The nitrogen fertilizer decision-making device for crops proposed in this application acquires basic information of the crop to be observed, daily precipitation for the decision day, and canopy images. An environmental volume model is constructed based on the basic information, and the simulated crop growth state is obtained using the environmental volume model. The canopy images are input into a preset estimation model to obtain the basic growth state of the crop. Based on a preset assimilation model, the simulated crop growth state and the basic growth state are fused to obtain an updated crop growth state. Based on a preset intelligent agent model, fertilization decision time and fertilization decision values ​​are generated according to the updated crop growth state and daily precipitation for the decision day. This solves the problems of related technologies that fail to consider the deviation between crop simulation and actual growth, leading to decision errors, fail to comprehensively consider planting and environmental benefits, and have low efficiency in acquiring state variables. It can reduce decision errors by using data assimilation, efficiently acquire state variables by estimating crop growth state using images, and comprehensively consider crop yield, economic benefits, and environmental benefits.

[0156] Figure 9A schematic diagram of the structure of an electronic device provided in an embodiment of this application. The electronic device may include:

[0157] The memory 901, the processor 902, and the computer program stored on the memory 901 and capable of running on the processor 902.

[0158] When the processor 902 executes the program, it implements the crop nitrogen fertilizer decision method provided in the above embodiments.

[0159] Furthermore, electronic devices also include:

[0160] Communication interface 903 is used for communication between memory 901 and processor 902.

[0161] The memory 901 is used to store computer programs that can run on the processor 902.

[0162] The memory 901 may include high-speed RAM (Random Access Memory) memory, and may also include non-volatile memory, such as at least one disk storage.

[0163] If the memory 901, processor 902, and communication interface 903 are implemented independently, then the communication interface 903, memory 901, and processor 902 can be interconnected via a bus to complete communication between them. The bus can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 9 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0164] Optionally, in a specific implementation, if the memory 901, processor 902, and communication interface 903 are integrated on a single chip, then the memory 901, processor 902, and communication interface 903 can communicate with each other through an internal interface.

[0165] The processor 902 may be a CPU (Central Processing Unit), an ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of this application.

[0166] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described crop nitrogen fertilizer decision-making method.

[0167] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.

[0168] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "N" means at least two, such as two, three, etc., unless otherwise explicitly specified.

[0169] Any process or method described in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more N executable instructions for implementing custom logic functions or processes, and the scope of the preferred embodiments of this application includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as should be understood by those skilled in the art to which embodiments of this application pertain.

[0170] It should be understood that the various parts of this application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, the N steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (FPGAs), field-programmable gate arrays (FPGAs), etc.

[0171] Those skilled in the art will understand that all or part of the steps of the methods in the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, the program includes one or a combination of the steps of the method embodiments.

[0172] Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of this application.

Claims

1. A nitrogen fertilizer decision-making method for crops, characterized in that, Includes the following steps: Acquire basic information about the crop to be observed, determine daily precipitation, and obtain canopy images; An environmental volume model is constructed based on the basic information, and the crop growth simulation state of the crop to be observed is obtained using the environmental volume model. The canopy image is then input into a preset estimation model to obtain the basic growth state of the crop to be observed. Based on a preset assimilation model, the crop growth simulation state and the basic growth state are fused to obtain an updated crop growth state. Based on a preset intelligent agent model, the fertilization decision time and fertilization decision value are generated according to the updated crop growth state and the daily precipitation. The crop growth status includes: crop growth stage, leaf area index, aboveground biomass, leaf nitrogen content, and yield. The canopy image is a canopy image of the crop taken with a mobile phone. The model input for estimating growth stage, leaf area index, and aboveground biomass is a distant photo of the crop canopy, taken at a distance of 1.5m from the ground. The model input for estimating leaf nitrogen content is a close-up photo of the crop canopy, taken at a distance of 20-30cm from the crop canopy. The environmental model is gym-ORYZA, which contains two core modules: reset and step. The reset module is used to initialize the parameters of the environmental body, and the step module is used to adjust the amount of fertilizer and calculate the crop growth status. After generating fertilization decision time and fertilization decision values ​​based on the preset agent model, according to the updated crop growth status and the daily precipitation, the process includes: generating agent rewards based on the environmental agent model, according to the fertilization decision time and fertilization decision values; and updating the fertilization decision time and fertilization decision values ​​based on the preset agent model and the agent rewards. The reward for the intelligent agent is: ; ; ; ; ; in, for The reward for each moment, in yuan per hectare. The crop yield at harvest, in kilograms per hectare. for Nitrogen application rate at any time, kg / ha. for Labor cost per hour, yuan / hectare The cost of nitrogen fertilizer loss into the environment, expressed in yuan per hectare. , , and All are reward coefficients. , and These are the emission losses of NH3 and N2O and NO3, respectively. - Leaching loss, kg / ha.

2. The method according to claim 1, characterized in that, Before generating fertilization decision time and fertilization decision values ​​based on the preset intelligent agent model, according to the updated crop growth status and the daily precipitation, the process includes: The preset agent model is trained using the SAC value function and the SAC state function, wherein the SAC value function is: ; The SAC state function is: ; in, State at time t Take action below State-action value function In the state Take action below The reward As a discount factor, For the next state The expectation of the state function, For the transition probability, As a strategy, For strategy In state Select action The logarithm of the probability, For the new strategy, For a new strategy that needs optimization, Let KL divergence be the KL divergence. The normalization constant is In the old strategy Below, from the state The initial value function, For strategy For all possible actions The expectation of the state-action value function.

3. The method according to claim 1, characterized in that, The preset assimilation model is: ; in, The updated state matrix, The state matrix of the model up to time t. Let be the Kalman gain at time t. These are the perturbed observations. Let t be the operator that transforms the state matrix into the observation matrix at time t.

4. A nitrogen fertilizer decision-making device for crops, characterized in that, include: The acquisition module is used to acquire basic information about the crop to be observed, daily precipitation for decision purposes, and canopy images; The simulation module is used to construct an environmental volume model based on the basic information, and use the environmental volume model to obtain the crop growth simulation state of the crop to be observed, and input the canopy image into a preset estimation model to obtain the basic growth state of the crop to be observed; The decision module is used to obtain an updated crop growth state by fusing the crop growth simulation state and the basic growth state based on a preset assimilation model, and to generate fertilization decision time and fertilization decision value based on a preset intelligent agent model, according to the updated crop growth state and the decision day precipitation. The crop growth status includes: crop growth stage, leaf area index, aboveground biomass, leaf nitrogen content, and yield. The canopy image is a canopy image of the crop taken with a mobile phone. The model input for estimating growth stage, leaf area index, and aboveground biomass is a distant photo of the crop canopy, taken at a distance of 1.5m from the ground. The model input for estimating leaf nitrogen content is a close-up photo of the crop canopy, taken at a distance of 20-30cm from the crop canopy. The environmental model is gym-ORYZA, which contains two core modules: reset and step. The reset module is used to initialize the parameters of the environmental body, and the step module is used to adjust the amount of fertilizer and calculate the crop growth status. After generating fertilization decision time and fertilization decision values ​​based on the preset agent model, according to the updated crop growth status and the daily precipitation, the process includes: generating agent rewards based on the environmental agent model, according to the fertilization decision time and fertilization decision values; and updating the fertilization decision time and fertilization decision values ​​based on the preset agent model and the agent rewards. The reward for the intelligent agent is: ; ; ; ; ; in, for The reward for each moment, in yuan per hectare. The crop yield at harvest, in kilograms per hectare. for Nitrogen application rate at any time, kg / ha. for Labor cost per hour, yuan / hectare The cost of nitrogen fertilizer loss into the environment, expressed in yuan per hectare. , , and All are reward coefficients. , and These are the emission losses of NH3 and N2O and NO3, respectively. - Leaching loss, kg / ha.

5. An electronic device, characterized in that, include: A memory, a processor, and a computer program stored in the memory and executable on the processor, the processor executing the program to implement the crop nitrogen fertilizer decision method as described in any one of claims 1-3.

6. A computer-readable storage medium having a computer program stored thereon, characterized in that, The program is executed by a processor to implement the nitrogen fertilizer decision-making method for crops as described in any one of claims 1-3.

Citation Information

Patent Citations

  • Dynamic decision-making method and device for field irrigation and fertilization system

    CN114662742A