Neural network water-fertilizer ratio control method and system based on self-adaptive forgetting door mechanism
By applying a deep neural network water and fertilizer dynamic ratio control method based on the adaptive forgetting gate mechanism in the agricultural environment, and using a two-way LSTM prediction model for water and fertilizer ratio prediction and automatic adjustment, the problems of traditional methods lack flexibility, limited accuracy and difficulty in intelligent management in complex agricultural environments are solved, and efficient and accurate water and fertilizer management are achieved.
Patent Information
- Application Number
- CN202411939629.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-26
- Publication Date
- 2025-05-23
- Estimated Expiration
- 2044-12-26
AI Technical Summary
When facing a complex and changing agricultural environment, traditional water and fertilizer ratio control methods lack flexibility, limited accuracy and difficulty in intelligent management.
The deep neural network water and fertilizer dynamic ratio control method based on the adaptive forgetting gate mechanism is adopted, and environmental data is collected in real time, the water and fertilizer ratio prediction is performed using a two-way LSTM prediction model, and the water pump and fertilizer supply system are adjusted through the feedback mechanism.
The accuracy and automated adjustment of water and fertilizer demand forecasts in dynamic changes in the agricultural environment are achieved, which improves the flexibility and accuracy of the system and reduces the difficulty of operation.
Smart Images

Figure CN120029050A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of agricultural production, and in particular relates to a neural network water-fertilizer ratio control method and system based on an adaptive forget gate mechanism. Background Art
[0002] In modern agricultural production, precise irrigation and fertilization are of great significance for improving crop yield and quality, saving resources and protecting the environment. At present, traditional water-fertilizer ratio control methods mostly rely on experience or fixed control strategies, such as PID controller-based solutions. However, these methods have the following shortcomings in the face of complex and changing agricultural environments, especially in response to different weather and seasonal changes: 1. Lack of flexibility: Traditional methods usually use preset programs or manual adjustments, which are difficult to respond to soil moisture, plant growth status and environmental changes in real time. Traditional PID controllers rely on manual adjustments and fixed parameter settings, and cannot flexibly respond to dynamic changes in environmental conditions such as temperature, humidity, and conductivity; 2. Limited accuracy: Fixed ratio strategies cannot accurately adapt to the specific requirements of different soil types, crop needs and growth stages, resulting in uneven fertilization or low water and fertilizer utilization, thus affecting the healthy growth of crops and resource utilization efficiency; 3. Difficulties in intelligent management: Traditional systems rely on the operator’s experience for adjustment. For non-professionals, the operation is difficult and prone to misoperation, which affects the stability and effectiveness of the system.
[0003] Although existing technologies can achieve automatic water-fertilizer ratio to a certain extent, they still face significant challenges in terms of response speed, control accuracy and system robustness. For example, existing systems often cannot respond to rapidly changing environmental conditions, such as rainfall and temperature fluctuations; in addition, the debugging process of traditional PID control is complicated, and its nonlinear control accuracy is low, which is easily disturbed by external factors, and has poor stability and robustness. Summary of the invention
[0004] The purpose of the present invention is to solve the problems of insufficient flexibility, limited accuracy and difficulty in intelligent management of traditional water-fertilizer ratio control methods in the face of complex and changeable agricultural environments. A neural network water-fertilizer dynamic ratio control method and system with an adaptive forget gate mechanism are proposed.
[0005] The technical solution of the present invention is: a deep neural network water-fertilizer dynamic ratio control method based on an adaptive forget gate mechanism, comprising the following steps: S1. Collect the original environmental data of the planting area using sensors; S2. Perform standardization and feature processing on the original environmental data to obtain processed environmental data; S3. construct a bidirectional LSTM prediction model based on an adaptive forget gate adjustment mechanism, input the processed environmental data into the bidirectional LSTM prediction model based on an adaptive forget gate adjustment mechanism for processing, and output the predicted value of the optimal water-fertilizer ratio; S4. Convert the predicted value of the optimal water-fertilizer ratio into an operation instruction, adjust the working state of the water pump and the fertilizer supply system according to the operation instruction and the feedback mechanism, and complete the dynamic water-fertilizer ratio control.
[0006] The beneficial effects of the present invention are: The present invention adopts a bidirectional LSTM prediction model based on adaptive forgetting gate adjustment. It reflects the dynamic changes of crop demand and environmental conditions through real-time collected environmental data, inputs these environmental data into the bidirectional LSTM model, and performs prediction in combination with the adaptive forgetting gate mechanism. It can flexibly respond to complex nonlinear relationships and ensure that the system can always maintain the accuracy of water and fertilizer demand prediction in the dynamic changes of the agricultural environment, thereby realizing automatic prediction and precise adjustment of the water-fertilizer ratio.
[0007] Preferably, the formula for the standardization process in step S2 is:
[0008] in, represents the standardized environmental data, Represents the original environment data, represents the mean of the original environmental data, Represents the standard deviation of the original environmental data; The feature processing includes interactive feature extraction and personalized feature generation; the personalized features are automatically generated according to the crop type and growth stage.
[0009] Preferably, the bidirectional LSTM prediction model based on the adaptive forget gate adjustment mechanism in step S3 includes two independent LSTM layers, namely a forward LSTM layer and a backward LSTM layer; the forward LSTM layer and the backward LSTM layer are both composed of a plurality of LSTM units connected in sequence; The forward LSTM layer is used to process the environmental data from the starting point of the time series forward; The backward LSTM layer is used to process the environmental data backward from the end of the time series; At each time step, the output of the bidirectional LSTM prediction model is a combination of the output of the forward LSTM layer and the output layer of the backward LSTM, and its recursive formula is:
[0010] in, express The hidden state of the forward LSTM layer at that moment, express The hidden state of the backward LSTM layer at time t, express The hidden state of the moment, express The hidden state of the forward LSTM layer at that moment, express The hidden state of the backward LSTM layer at time t, express The environmental data that is input into the LSTM unit at all times, represents the propagation calculation of the LSTM unit, Represents a concatenation operation.
[0011] Preferably, the LSTM unit includes a memory update unit, an input gate, a forget gate and an output gate; The memory unit is used to store information; the information is the relationship between environmental data and water-fertilizer ratio requirements; The input gate is used to determine the impact of the environmental data input at the current moment on the current information; The forget gate is used to decide how much historical information to discard. The forget gate in the adaptive forget gate adjustment mechanism is adjusted according to the real-time environmental data. The output gate is used to determine the hidden state of the current time step; The LSTM unit specifically includes the following formula:
[0012] in, represents the output parameter of the input gate, represents the output parameter of the forget gate, represents the output parameter of the output gate, Indicates that the LSTM unit is The memory unit of time, represents the sigmoid activation function, represents the weight of the input gate, express The hidden state of the moment, represents the bias of the input gate, represents the weight of the forget gate, represents the bias of the forget gate, Represents the adjustment factor dynamically calculated according to the current environmental conditions, represents the weight of the output gate, represents the bias of the output gate, represents element-wise multiplication, Indicates that the LSTM unit is The memory unit of time, express The memory representation corresponding to the input information at each moment, represents the hyperbolic tangent activation function.
[0013] Preferably, the expression formula of the predicted value of the optimal water-fertilizer ratio in step S3 is:
[0014] in, represents the predicted value of the optimal water-fertilizer ratio, represents the weight matrix from the hidden state to the output layer, Represents the bias term of the output layer.
[0015] Preferably, the bidirectional LSTM prediction model based on the adaptive forget gate adjustment mechanism in step S3 is trained by minimizing the loss function The relationship between learning environmental data and water-fertilizer ratio requirements; the loss function The expression formula is:
[0016] in, Indicates the actual value of water-fertilizer ratio. Represents the predicted value output by the bidirectional LSTM prediction model based on the adaptive forget gate adjustment mechanism. represents the number of training samples, Indicates the current moment.
[0017] Preferably, the feedback mechanism in step S4 is specifically as follows: real-time monitoring of the actual working status of the water pump and fertilizer supply, and comparison with the predicted value of the optimal water-fertilizer ratio; if there is a deviation between the actual working status and the predicted value, adjusting the control parameters of the water pump and fertilizer supply; if there is a deviation between the actual working status and the predicted value, normal operation is performed.
[0018] The beneficial effects of the above preferred solution are: 1. Through interactive feature extraction and personalized feature generation, the prediction ability of the bidirectional LSTM prediction model based on the adaptive forgetting gate adjustment mechanism can be effectively improved.
[0019] 2. Through the adaptive forgetting gate adjustment mechanism, the forgetting rate is automatically adjusted according to the real-time changes in the environment (such as temperature, humidity, rainfall and other factors), to achieve intelligent adaptation to different environmental conditions and provide a more automated, flexible and accurate water and fertilizer management solution.
[0020] 3. The feedback control mechanism monitors the supply system status in real time and applies the feedback data to the adaptive forget gate adjustment to automatically adjust the water pump and fertilizer supply strategy, which can effectively improve the supply accuracy and system adaptability.
[0021] In the second aspect, a deep neural network water-fertilizer dynamic ratio control system based on an adaptive forget gate mechanism includes: Data collection module, used to collect original environmental data of the planting area; A data standardization and feature engineering module, used for receiving the original environmental data, and performing standardization processing and feature processing on the original environmental data to obtain processed environmental data; An adaptive forget gate adjustment bidirectional LSTM prediction module is used to receive the processed environmental data, build a bidirectional LSTM prediction model based on an adaptive forget gate adjustment mechanism, and input the processed environmental data into the bidirectional LSTM prediction model based on the adaptive forget gate adjustment mechanism for processing, and output a predicted value of the optimal water-fertilizer ratio; The control execution module is used to receive the optimal water-fertilizer ratio scheme, convert the predicted value of the optimal water-fertilizer ratio into an operation instruction, and adjust the working state of the water pump and the fertilizer supply system according to the operation instruction and the feedback mechanism to complete the dynamic water-fertilizer ratio control.
[0022] In a third aspect, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to cause a computer to execute the method of the first aspect.
[0023] According to a fourth aspect, a computer program product comprises a computer program, wherein the computer program implements the method according to the first aspect when executed by a processor. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 The figure shows a flow chart of a method for dynamic water-fertilizer ratio control using a deep neural network based on an adaptive forget gate mechanism provided in Example 1 of the present invention.
[0025] Figure 2 The figure shows the comparison result between the bidirectional LSTM (i.e., the bidirectional LSTM prediction model based on the adaptive forget gate adjustment mechanism) and the PID prediction provided in Example 3 of the present invention. DETAILED DESCRIPTION
[0026] Now, exemplary embodiments of the present invention will be described in detail with reference to the accompanying drawings. It should be understood that the embodiments shown and described in the accompanying drawings are only exemplary and are intended to explain the principles and spirit of the present invention, rather than to limit the scope of the present invention.
[0027] Embodiment 1: like Figure 1As shown, a method for dynamic water-fertilizer ratio control based on a deep neural network with an adaptive forget gate mechanism includes the following steps: S1. Use sensors to collect raw environmental data of the planting area. In order to accurately predict the water-fertilizer ratio, various types of sensors are deployed in the agricultural planting area, including temperature sensors, humidity sensors and conductivity sensors. The sensors collect raw environmental data in real time at a fixed frequency. These raw environmental data reflect the dynamic changes in the crop growth environment, such as temperature increase, humidity decrease or soil conductivity change. All collected data will be transmitted to the data processing center through wireless transmission modules or wired networks. The layout and number of sensors can be flexibly adjusted according to the scale of the planting area, crop type and environmental conditions to ensure the comprehensiveness and accuracy of the collected data. S2. Perform standardization and feature processing on the original environmental data to obtain processed environmental data; S3. construct a bidirectional LSTM prediction model based on an adaptive forget gate adjustment mechanism, input the processed environmental data into the bidirectional LSTM prediction model based on an adaptive forget gate adjustment mechanism for processing, and output the predicted value of the optimal water-fertilizer ratio; S4. Convert the predicted value of the optimal water-fertilizer ratio into an operation instruction, adjust the working state of the water pump and the fertilizer supply system according to the operation instruction and the feedback mechanism, and complete the dynamic water-fertilizer ratio control.
[0028] Each time the predicted value of the optimal water-fertilizer ratio generated by the bidirectional LSTM prediction model based on the adaptive forget gate mechanism is converted into operation instructions, which will control the flow rate of the water pump and the working state of the fertilizer supply system. The adjustment mechanism of the adaptive forget gate enables the bidirectional LSTM prediction model to be flexibly adjusted under different environmental conditions. When the environment changes rapidly (such as rainfall or temperature changes), the adaptive forget gate mechanism retains key environmental information by adjusting the parameters of the forget gate in real time, thereby adapting to these changes more accurately. For example, when the temperature rises sharply, by reducing unimportant historical information (such as humidity information from a distant time), it can quickly adapt to new water and fertilizer needs to ensure that the irrigation and fertilization needs of crops are met in a timely manner.
[0029] In this embodiment, since different types of data (such as temperature, humidity and conductivity) collected by the sensor have different units and dimensions, directly inputting the bidirectional LSTM neural network may lead to poor training results. Therefore, data standardization technology is used in step S2 to adjust all original environmental data to the same scale; the formula for the standardization process is:
[0030] in, represents the standardized environmental data, Represents the original environment data, represents the mean of the original environmental data, Represents the standard deviation of the original environmental data; The feature processing includes interactive feature extraction and personalized feature generation; considering that the interaction between temperature and humidity has an important impact on water and fertilizer demand, the interactive feature of temperature and humidity is obtained by calculating the product of temperature and humidity; the personalized feature is automatically generated according to the crop type and growth stage.
[0031] In this embodiment, the bidirectional LSTM prediction model based on the adaptive forget gate adjustment mechanism in step S3 includes two independent LSTM layers, namely a forward LSTM layer and a backward LSTM layer. The forward LSTM layer and the backward LSTM layer simultaneously process the forward (past to present) and backward (future to present) information of the time series, so as to better capture the global dependency in the time series; the forward LSTM layer and the backward LSTM layer are both composed of a plurality of LSTM units connected in sequence, and the LSTM unit can selectively retain or forget historical information by introducing a memory unit; The forward LSTM layer is used to process the environmental data from the starting point of the time series forward; The backward LSTM layer is used to process the environmental data backward from the end of the time series; At each time step, the output of the bidirectional LSTM prediction model is a combination of the output of the forward LSTM layer and the output layer of the backward LSTM, and its recursive formula is:
[0032] in, express The hidden state of the forward LSTM layer at that moment, express The hidden state of the backward LSTM layer at time t, express The hidden state of the moment, express The hidden state of the forward LSTM layer at that moment, express The hidden state of the backward LSTM layer at time t, express The environmental data that is input into the LSTM unit at all times, represents the propagation calculation of the LSTM unit, Represents a concatenation operation, which is used to and Merging is to connect the hidden states obtained by the forward LSTM layer and the backward LSTM layer into a complete output. The LSTM unit is a recurrent neural network unit used to process time series data. and To actually represent the forward or backward propagation calculation of an LSTM unit, the formula shows the complete structure of the bidirectional LSTM prediction model, which mainly captures the context information in the input sequence through the forward LSTM layer and the backward LSTM layer respectively.
[0033] In this embodiment, the LSTM unit includes a memory update unit, an input gate, a forget gate and an output gate; The memory unit is used to store information; the information is the relationship between environmental data and water-fertilizer ratio requirements; The input gate is used to determine the impact of the environmental data input at the current moment on the current information; The forget gate is used to decide how much historical information to discard. In order to further enhance the adaptability of the model to environmental changes, an adaptive forget gate adjustment mechanism is introduced. In the original LSTM model, the forget gate fixedly controls the forgetting rate of historical information. However, in an agricultural environment, different environmental conditions (such as rainfall, temperature changes, etc.) will affect the dynamic changes in water and fertilizer demand, so it is necessary to dynamically adjust the forgetting rate of the forget gate. By introducing the adaptive forget gate adjustment mechanism, the bidirectional LSTM prediction model can automatically adjust the forgetting rate according to changes in current environmental conditions, so that more historical information is retained at certain critical moments (such as when extreme weather occurs), while in other cases, irrelevant historical information is forgotten more quickly. In the adaptive forget gate adjustment mechanism, the forget gate is adjusted according to real-time environmental data. The adaptive forget gate adjustment mechanism can ensure that the bidirectional LSTM prediction model has better adaptability to the prediction of water-fertilizer ratio in different periods and environments. The output gate is used to determine the hidden state of the current time step; The LSTM unit specifically includes the following formula:
[0034] in, represents the output parameter of the input gate, represents the output parameter of the forget gate, represents the output parameter of the output gate, Indicates that the LSTM unit is The memory unit of time, represents the sigmoid activation function, represents the weight of the input gate, express The hidden state of the moment, represents the bias of the input gate, represents the weight of the forget gate, represents the bias of the forget gate, Represents the adjustment factor dynamically calculated according to the current environmental conditions, represents the weight of the output gate, represents the bias of the output gate, represents element-wise multiplication, Indicates that the LSTM unit is The memory unit of time, express The memory representation corresponding to the input information at each moment, represents the hyperbolic tangent activation function.
[0035] In this embodiment, the bidirectional LSTM prediction model based on the adaptive forget gate adjustment mechanism minimizes the loss function during the training process. The relationship between learning environmental data and water-fertilizer ratio requirements, the training data includes historical environmental data of different crops and different growth stages and the corresponding optimal water-fertilizer ratio; the loss function The expression formula is:
[0036] in, Indicates the actual value of water-fertilizer ratio. Represents the predicted value output by the bidirectional LSTM prediction model based on the adaptive forget gate adjustment mechanism. represents the number of training samples, Indicates the current moment.
[0037] The bidirectional LSTM prediction model based on the adaptive forget gate adjustment mechanism also has a self-learning function. By continuously introducing new environmental data, the bidirectional LSTM prediction model parameters are dynamically updated to optimize the prediction accuracy of the bidirectional LSTM prediction model parameters. The new data will further help the bidirectional LSTM prediction model parameters understand the long-term impact of environmental changes on crop water and fertilizer requirements.
[0038] In this embodiment, the input environmental data is processed step by step through multiple LSTM units, and the environmental data of each time step (such as temperature T, humidity H, and conductivity EC) is used as input, and the corresponding hidden state and output are generated through the bidirectional LSTM layer, and finally the optimal water-fertilizer ratio of the current time step is predicted, and then the expression formula of the predicted value of the optimal water-fertilizer ratio in step S3 is:
[0039] in, represents the predicted value of the optimal water-fertilizer ratio, represents the weight matrix from the hidden state to the output layer, Represents the bias term of the output layer.
[0040] In this embodiment, the feedback mechanism described in step S4 is specifically: real-time monitoring of the actual working status of the water pump and fertilizer supply, and comparison with the predicted value of the optimal water-fertilizer ratio; if there is a deviation between the actual working status and the predicted value, the control parameters of the water pump and fertilizer supply are adjusted; if there is no deviation between the actual working status and the predicted value, normal operation is performed. This feedback mechanism can not only adjust the water-fertilizer ratio in real time, but also further optimize the adjustment mechanism of the adaptive forget gate according to the feedback data. The historical feedback data will be used to further adjust and train the dynamic adjustment rules of the adaptive forget gate, thereby improving the long-term prediction ability and adaptability of the bidirectional LSTM prediction model.
[0041] In this embodiment, Embodiment 2: On the basis of Example 1, this embodiment provides a deep neural network water-fertilizer dynamic control ratio system based on an adaptive forget gate mechanism, which is used to configure and execute the deep neural network water-fertilizer dynamic control ratio method based on an adaptive forget gate mechanism in Example 1, and the system includes: The data acquisition module is used to collect the original environmental data of the planting area; the data acquisition module has built-in sensor fault detection and data recovery functions to ensure the continuity and robustness of data acquisition.
[0042] A data standardization and feature engineering module, used for receiving the original environmental data, and performing standardization processing and feature processing on the original environmental data to obtain processed environmental data; An adaptive forget gate adjustment bidirectional LSTM prediction module is used to receive the processed environmental data, build a bidirectional LSTM prediction model based on an adaptive forget gate adjustment mechanism, and input the processed environmental data into the bidirectional LSTM prediction model based on the adaptive forget gate adjustment mechanism for processing, and output a predicted value of the optimal water-fertilizer ratio; The control execution module is used to receive the optimal water-fertilizer ratio scheme, convert the predicted value of the optimal water-fertilizer ratio into an operation instruction, and adjust the working state of the water pump and the fertilizer supply system according to the operation instruction and the feedback mechanism to complete the dynamic water-fertilizer ratio control.
[0043] In this embodiment, a readable storage medium and a computer program product are also provided.
[0044] In this embodiment, the readable storage medium may be a non-transitory computer-readable storage medium storing computer instructions, and the computer instructions are used to enable a computer to execute part or all of the steps of the deep neural network water-fertilizer dynamic control ratio method based on the adaptive forgetting gate mechanism provided in the aforementioned embodiment 1 of the present application.
[0045] In this embodiment, the computer program product includes a computer program, which, when executed by a processor, implements some or all of the steps of the deep neural network water-fertilizer dynamic control ratio method based on the adaptive forgetting gate mechanism provided in the aforementioned embodiment 1 of the present application.
[0046] The program code for implementing the method of the present invention can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code can be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0047] In the context of the present invention, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0048] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0049] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0050] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.
[0051] Embodiment 3: On the basis of Example 1, Matlab R2021a's Simulink is used for virtual simulation. As a powerful system modeling and simulation tool, Simulink can efficiently simulate complex dynamic systems. In this embodiment, a bidirectional LSTM model and a PID controller model based on an adaptive forget gate mechanism are established using Simulink to perform virtual simulation of water-fertilizer ratio control.
[0052] In Simulink, the bidirectional LSTM model based on the adaptive forget gate mechanism is trained and simulated through time series data, combined with real-time environmental sensor data to predict and adjust the water-fertilizer ratio. The Simulink model uses the standard LSTM module and integrates the adaptive forget gate adjustment mechanism to dynamically optimize the water-fertilizer ratio.
[0053] The PID controller model is adjusted based on the traditional proportional (Kp), integral (Ki), and differential parameters (Kd), and the irrigation water and fertilizer application amount are adjusted through real-time feedback. During the simulation process, the parameter settings of the PID controller are based on the empirical values of conventional agricultural irrigation practices.
[0054] In this embodiment, the same environmental conditions were tested on the bidirectional LSTM control method and the PID control method. By comparing the water-fertilizer ratio responses of the two methods under the same dynamic environment, the control accuracy, response speed and stability of the two methods were evaluated. Finally, we compared the performance of the bidirectional LSTM neural network with the adaptive forget gate adjustment mechanism and the PID controller in the water-fertilizer ratio prediction. Figure 2 As shown in the figure, the three curves represent the actual water-fertilizer ratio, the bidirectional LSTM prediction value of the adaptive forget gate adjustment mechanism, and the PID prediction value, respectively.
[0055] from Figure 2 It can be seen that the prediction results of the adaptive forget gate adjustment mechanism bidirectional LSTM (red dotted line) and the true value (blue solid line) are almost completely coincident, which shows that the adaptive forget gate adjustment mechanism bidirectional LSTM model can accurately capture the complex dependencies and nonlinear changes in the time series, showing strong fitting ability. In particular, in most time steps, the prediction results of the adaptive forget gate adjustment mechanism bidirectional LSTM can well track the actual water and fertilizer requirements, showing extremely high prediction accuracy and time series dependency capture ability.
[0056] In contrast, the prediction results of the PID controller (green dashed line) deviate significantly from the true value in most time steps. Although the PID controller can provide predictions close to the true value in a specific time step, it relies on fixed control parameters and is difficult to adapt to complex nonlinear changes, resulting in large deviations when environmental variables fluctuate violently. The PID controller is difficult to adapt to rapid changes in the environment in real time, so it is obviously inferior to the adaptive forget gate adjustment mechanism bidirectional LSTM in terms of control accuracy.
[0057] In general, the performance of the bidirectional LSTM with adaptive forget gate adjustment mechanism in this water-fertilizer ratio prediction task is significantly better than that of the PID controller. Its powerful nonlinear processing capability and adaptability enable it to provide a more accurate and stable solution for intelligent water-fertilizer management in agricultural environments. This result proves that the bidirectional LSTM combined with the adaptive forget gate adjustment mechanism can achieve efficient prediction and control in dynamic agricultural environments, which is better than the traditional PID method.
[0058] Those skilled in the art will appreciate that the embodiments described herein are intended to help readers understand the principles of the present invention, and should be understood that the protection scope of the present invention is not limited to such specific statements and embodiments. Those skilled in the art can make various other specific variations and combinations that do not deviate from the essence of the present invention based on the technical revelations disclosed by the present invention, and these variations and combinations are still within the protection scope of the present invention.
Claims
1. A method for dynamic water-fertilizer ratio control based on a deep neural network with an adaptive forget gate mechanism, characterized in that: The following steps are involved: S1. Collect the original environmental data of the planting area using sensors; S2. Perform standardization and feature processing on the original environmental data to obtain processed environmental data; S3. Construct a bidirectional LSTM prediction model based on an adaptive forget gate adjustment mechanism and compare it with the PID prediction. Input the processed environmental data into the bidirectional LSTM prediction model based on an adaptive forget gate adjustment mechanism for processing, and output the predicted value of the optimal water-fertilizer ratio. S4. Convert the predicted value of the optimal water-fertilizer ratio into an operation instruction, adjust the working state of the water pump and the fertilizer supply system according to the operation instruction and the feedback mechanism, and complete the dynamic water-fertilizer ratio control.
2. The method for dynamic water-fertilizer ratio control based on a deep neural network with an adaptive forget gate mechanism according to claim 1 is characterized in that: The formula for the standardization process in step S2 is: in, represents the standardized environmental data, Represents the original environment data, represents the mean of the original environmental data, Represents the standard deviation of the original environmental data; The feature processing includes interactive feature extraction and personalized feature generation; the personalized features are automatically generated according to the crop type and growth stage.
3. The method for dynamic water-fertilizer ratio control based on a deep neural network with an adaptive forget gate mechanism according to claim 1 is characterized in that: The bidirectional LSTM prediction model based on the adaptive forget gate adjustment mechanism in step S3 includes two independent LSTM layers, namely a forward LSTM layer and a backward LSTM layer; the forward LSTM layer and the backward LSTM layer are both composed of a plurality of LSTM units connected in sequence; The forward LSTM layer is used to process the environmental data from the starting point of the time series forward; The backward LSTM layer is used to process the environmental data backward from the end of the time series; At each time step, the output of the bidirectional LSTM prediction model is a combination of the output of the forward LSTM layer and the output layer of the backward LSTM layer, and its recursive formula is: in, express The hidden state of the forward LSTM layer at that moment, express The hidden state of the backward LSTM layer at time t, express The hidden state of the moment, express The hidden state of the forward LSTM layer at that moment, express The hidden state of the backward LSTM layer at time t, express The environmental data that is input into the LSTM unit at all times, represents the propagation calculation of the LSTM unit, Represents a concatenation operation.
4. The method for dynamic water-fertilizer ratio control based on a deep neural network with an adaptive forget gate mechanism according to claim 3 is characterized in that: The LSTM unit includes a memory update unit, an input gate, a forget gate and an output gate; The memory unit is used to store information; the information is the relationship between environmental data and water-fertilizer ratio requirements; The input gate is used to determine the impact of the environmental data input at the current moment on the current information; The forget gate is used to decide how much historical information to discard. The forget gate in the adaptive forget gate adjustment mechanism is adjusted according to the real-time environmental data. The output gate is used to determine the hidden state of the current time step; The LSTM unit specifically includes the following formula: in, represents the output parameter of the input gate, represents the output parameter of the forget gate, represents the output parameter of the output gate, Indicates that the LSTM unit is The memory unit of time, represents the sigmoid activation function, represents the weight of the input gate, express The hidden state of the moment, represents the bias of the input gate, represents the weight of the forget gate, represents the bias of the forget gate, Represents the adjustment factor dynamically calculated according to the current environmental conditions, represents the weight of the output gate, represents the bias of the output gate, represents element-wise multiplication, Indicates that the LSTM unit is The memory unit of time, express The memory representation corresponding to the input information at each moment, represents the hyperbolic tangent activation function.
5. The method for dynamic water-fertilizer ratio control based on a deep neural network with an adaptive forget gate mechanism according to claim 4 is characterized in that: The expression formula of the predicted value of the optimal water-fertilizer ratio in step S3 is: in, represents the predicted value of the optimal water-fertilizer ratio, represents the weight matrix from the hidden state to the output layer, Represents the bias term of the output layer.
6. The method for dynamic water-fertilizer ratio control based on a deep neural network with an adaptive forget gate mechanism according to claim 1 is characterized in that: The bidirectional LSTM prediction model based on the adaptive forget gate adjustment mechanism described in step S3 is trained by minimizing the loss function The relationship between learning environmental data and water-fertilizer ratio requirements; the loss function The expression formula is: in, Indicates the actual value of water-fertilizer ratio. Represents the predicted value output by the bidirectional LSTM prediction model based on the adaptive forget gate adjustment mechanism. represents the number of training samples, Indicates the current moment.
7. The method for dynamic water-fertilizer ratio control based on a deep neural network with an adaptive forget gate mechanism according to claim 1 is characterized in that: The feedback mechanism described in step S4 is specifically: real-time monitoring of the actual working status of the water pump and fertilizer supply, and comparison with the predicted value of the optimal water-fertilizer ratio; if there is a deviation between the actual working status and the predicted value, adjusting the control parameters of the water pump and fertilizer supply; if there is a deviation between the actual working status and the predicted value, normal operation is performed.
8. A deep neural network water-fertilizer dynamic ratio control system based on an adaptive forget gate mechanism, characterized in that: include: Data collection module, used to collect original environmental data of the planting area; A data standardization and feature engineering module, used for receiving the original environmental data, and performing standardization processing and feature processing on the original environmental data to obtain processed environmental data; An adaptive forget gate adjustment bidirectional LSTM prediction module is used to receive the processed environmental data, build a bidirectional LSTM prediction model based on an adaptive forget gate adjustment mechanism, and input the processed environmental data into the bidirectional LSTM prediction model based on the adaptive forget gate adjustment mechanism for processing, and output a predicted value of the optimal water-fertilizer ratio; The control execution module is used to receive the optimal water-fertilizer ratio scheme, convert the predicted value of the optimal water-fertilizer ratio into an operation instruction, and adjust the working state of the water pump and the fertilizer supply system according to the operation instruction and the feedback mechanism to complete the dynamic water-fertilizer ratio control.
9. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to enable a computer to execute the method according to any one of claims 1-7.
10. A computer program product, characterized in that The invention comprises a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Hydroponic fertilizer applicator
CN112470907A
Method for predicting water demand of winter wheat
CN117252297A
Meteorological disaster prediction method based on AI
CN119167036A