Intelligent irrigation method based on deep learning
Through the intelligent irrigation method based on deep learning, using gray correlation analysis and LSTM-Attention model, the problems of waste of water resources and low data quality in traditional irrigation methods are solved, and the precise and automated management of farmland irrigation is achieved.
Patent Information
- Application Number
- CN202510461710.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-14
- Publication Date
- 2025-07-18
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Traditional irrigation methods rely on manual experience, resulting in serious waste of water resources, difficulty in dynamically responding to environmental changes, low data quality, and insufficient model generalization capabilities.
Using a smart irrigation method based on deep learning, key meteorological factors are screened through gray correlation analysis, an LSTM-Attention model is constructed, and a smart irrigation management platform is established to realize the independent management of farmland irrigation.
It improves the accuracy of irrigation decisions, reduces water resource waste, enhances the model's response ability to environmental changes, improves data quality and model generalization capabilities, and realizes the automated management of farmland irrigation.
Smart Images

Figure CN120336966A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of agriculture, and particularly to an intelligent irrigation method based on deep learning. Background Art
[0002] At present, in most areas of our country, traditional manual labor and personal experience are still used for farmland irrigation, which causes a great deal of waste of water resources to a large extent and is not conducive to the growth of crops. With the development of related technologies such as computers and the continuous improvement of the level of agricultural informatization in our country, the traditional irrigation method can no longer meet the needs of information-based agriculture. Therefore, how to solve the formulation and reasonable application of irrigation decisions is the key to solving this problem.
[0003] The Long Short-Term Memory (LSTM) network is a special type of Recurrent Neural Network (RNN) designed to address the vanishing gradient and exploding gradient problems in traditional RNNs when dealing with long sequences. Its core idea is to enhance the modeling ability for long sequences by introducing memory cells and gating mechanisms. The memory cells, as the core information flow running through the entire network, are responsible for long-term memory, while the forget gate, input gate, and output gate respectively control the discarding, updating, and output of information. LSTM determines which old information to discard through the forget gate, determines which new information to store and updates the memory cells through the input gate, and finally generates a new hidden state through the output gate. This structure enables LSTM to effectively capture dependencies in long sequences, alleviate the gradient problem, and thus find wide applications in fields such as natural language processing, time series prediction, and speech recognition.
[0004] The attention mechanism is a technology that mimics the human visual and cognitive systems and is used to dynamically allocate weights in deep learning models to focus on important parts of the input data. Its core idea is to generate attention weights by calculating the correlation scores between queries and keys, and then perform weighted summation on the values to extract the most relevant information. The attention mechanism is widely applied in fields such as natural language processing (e.g., machine translation, text generation) and computer vision (e.g., image caption generation), and can effectively improve the model's processing ability for long sequences or complex data, enhancing the model's expressive power and interpretability.
[0005] The dynamic decay learning rate is an optimization strategy that adaptively adjusts the learning rate during the training process according to the model state or training progress. Different from fixed learning rates or predefined decay schedules, dynamic decay adjusts the learning rate through real-time feedback (such as loss changes, gradient magnitudes, etc.) to balance the model's convergence speed and stability.
[0006] Traditional irrigation methods have long faced serious problems such as severe water resource waste, reliance on manual experience judgment, and difficulty in dynamically responding to environmental changes. In today's era of continuous technological development, machine learning and deep learning are considered key technologies for irrigation decision-making. These technologies can make irrigation decisions by combining meteorological data with field soil moisture data to solve the problems of inaccurate irrigation and over-reliance on manual labor in traditional irrigation methods. However, among them, machine learning also faces problems such as high requirements for data and easy neglect of hidden correlations. Summary of the Invention
[0007] The purpose of the present invention is to overcome the defects of the prior art and provide an intelligent irrigation method based on deep learning, which can train a crop water requirement model using a network data set, thereby formulating a more accurate and scientific irrigation amount for the target farmland and realizing control in the system platform to assist in the irrigation management of the farmland.
[0008] The purpose of the present invention is achieved as follows: An intelligent irrigation method based on deep learning, comprising the following steps:
[0009] (1) Collection and collation of meteorological data and irrigation decision data, and calculation of crop water requirements using the collected relevant meteorological data;
[0010] (2) Establishment of meteorological data, crop water requirements, and irrigation decision data sets. Using the sorted meteorological data and crop water requirements, use grey relational analysis for judgment, construct a lightweight crop water requirement model, and combine with actual farm production to construct a four-class data set based on irrigation decisions, and divide the data set into a training set and a test set;
[0011] (3) Taking the LSTM model as the baseline, optimize and construct the LSTM-Attention model and construct a dynamic learning rate;
[0012] (4) Input the test set into the trained LSTM-Attention model for testing to obtain the relevant performance indicators of the model;
[0013] (5) Construct a system platform, develop an intelligent irrigation management platform on the web port, and determine irrigation judgment and irrigation amount by monitoring the real-time data of field sensors to realize the autonomous management of farmland irrigation.
[0014] As a further limitation of the present invention, the step (2) specifically includes:
[0015] Step (2.1) Select the China Meteorological Network and the actual farm as data sources, obtain the daily meteorological data of the meteorological station in the experimental area in recent years and establish a document;
[0016] Step (2.2) Calculate the crop water requirement Y using the formula, and the specific calculation formula is as follows:
[0017] Y = K c × ET0
[0018] Where Y is the theoretical water requirement of the crop, K c is the crop coefficient, and ET0 is the reference crop evapotranspiration;
[0019] The reference crop evapotranspiration ET0 is calculated by the P - M formula, and the specific formula is as follows:
[0020]
[0021] Among them, Δ is the slope of the saturated vapor pressure curve; R n is the net radiation at the earth's surface; G is the soil heat flux; r is the psychrometer constant; μ2 is the wind speed at two meters above the ground; e s is the saturated vapor pressure; e a is the actual vapor pressure; T is the average temperature;
[0022] In step (2.3), the correlation degree of meteorological data is calculated and compared for the prepared data. Finally, the influence of meteorological data with a correlation degree lower than the threshold is excluded, a dataset of meteorological data and crop water requirement is established, and a relevant training set and test set are divided for lightweight water requirement training;
[0023] In step (2.4), the trained water requirement model is combined with the actual farm meteorological data and the irrigation decision records recorded by the management personnel to construct a dataset for decision model training, and a relevant training set and test set are divided.
[0024] As a further limitation of the present invention, step (2.3) specifically includes: before constructing the training data, a grey correlation analysis of meteorological data is carried out to screen out meteorological data with a correlation degree lower than the set threshold;
[0025] Determine the reference sequence and comparison sequence, data standardization, calculate the correlation coefficient and correlation degree, and finally analyze the influence of each factor according to the correlation degree ranking;
[0026] In step (2.3.1), determine the reference sequence and comparison sequence. The crop water requirement is used as the reference sequence, denoted as X0, and the meteorological factors are used as the comparison sequence, denoted as X i ={x i (1), x i (2), …, x i (m),}(i = 1, 2, …, n), where m is the number of single meteorological factors and n is the number of types of meteorological factors;
[0027] Step (2.3.2) Data standardization: Since the physical meanings of each sequence of data are different, the data is averaged, that is, all the values of each sequence are divided by the mean value of that sequence. The averaging calculation formula is as follows:
[0028]
[0029] where k is an intermediate parameter for counting and m is the total number of data;
[0030] Step (2.3.3) Calculate the correlation coefficient: The correlation coefficient is used to measure the similarity γ between the comparison sequence and the reference sequence. The relevant calculation formula is:
[0031]
[0032] where ρ is the resolution coefficient and X0(k) is the reference sequence, which is the value of crop water requirement here;
[0033] Step (2.3.4) Calculate the correlation degree: The correlation degree is the average value of the correlation coefficients and is used to measure the overall correlation degree between the comparison sequence and the reference sequence. The relevant calculation formula is as follows:
[0034]
[0035] Step (2.3.5) Sorting and screening: Sort the comparison sequences according to the magnitude of the correlation degree. The larger the correlation degree, the higher the correlation degree between the meteorological factor and the reference crop water requirement. Screen out the factors with a correlation degree lower than the threshold, and select the top four meteorological data with a correlation higher than the threshold, denoted as {x1, x2, x3, x4}, for the construction of the subsequent data set.
[0036] As a further limitation of the present invention, the step (2.4) specifically includes:
[0037] Step (2.4.1) Collect actual irrigation decision data: Label and record the actual operations taken by managers in reality; mark as irrigation start, irrigation stop, and no adjustment. These three irrigation decisions are respectively recorded as three types of labels 0, 1, and 2;
[0038] Taking the actual farm weather station as the data source, combining the four types of meteorological data screened in step (2.3.5) and the rainfall data of the farm weather station, expand the three irrigation decisions into four irrigation decisions, denoted as irrigation start, irrigation stop, no adjustment, and abnormal;
[0039] Three types of labels are extended to four types of labels: Irrigation operation will occur, and the period that meets the irrigation requirement in relevant agricultural knowledge before the irrigation start operation is defined as irrigation start, denoted as label 0; Irrigation shutdown operation has occurred, and the period that meets the irrigation shutdown requirement in relevant agricultural knowledge before the irrigation shutdown operation is defined as irrigation shutdown, denoted as label 1; No irrigation operation occurs, which is defined as no adjustment, denoted as label 2; No irrigation operation occurs, but the sum of the crop water requirements in the next three days calculated by the model is less than the sum of the rainfall in the next three days, which is defined as an abnormal situation and denoted as label 3;
[0040] Step (2.4.2) uses the four types of meteorological data collected at the farm weather station, the water requirement data predicted based on the four types of meteorological data, and the soil humidity data, and combines with the label data in the above step (2.4.1) to establish a data set at 10-minute intervals.
[0041] As a further limitation of the present invention, the step (3) specifically includes:
[0042] Step (3.1) First, define the attenuation factor as a function of time step t:
[0043] α(t) = e -γt ·[λsin(wt + φ) + (1 - λ)cos(wt + φ)]
[0044] where γ is the attenuation rate, w is the frequency, φ is the phase, and λ is the mixing coefficient;
[0045] Step (3.2) Construct a dynamically decaying LSTM forget gate:
[0046] f t = σ(W f ·[h t-1 , x t + b f ) ⊙ α(t)
[0047] where ⊙ represents element-wise multiplication; W f is the weight matrix of the forget gate; h t-1 is the hidden state at the previous moment; b f is the bias term of the forget gate; σ is the activation function; α(t) is the constructed attenuation factor;
[0048] Step (3.3) Input the four meteorological samples, crop water requirements, and soil humidity data screened by the meteorological data correlation into the forget gate, and construct a hidden state based on periodic factors. The specific formula is as follows:
[0049] f t = σ(W f ·[h t-1 , xt +b f )⊙α(t)
[0050]
[0051] where f t is the output of the forget gate; W f is the weight matrix of the forget gate; h t-1 is the hidden state at the previous moment; x t is the input at the current moment, i.e., {x1, x2, x3, x4, x5, x6}, which are four meteorological samples, crop water requirement, and soil humidity respectively; b f is the bias term of the forget gate; A is the adjustable amplitude parameter, T is the period length; σ is the activation function; o t is the output of the output gate;
[0052] Step (3.4) generates the current context vector according to the historical hidden states {h1, h2,..., h t-1}
[0053]
[0054] where α t,i is the attention weight, Q t is the query vector, K i is the key vector, d k is the dimension of the key vector K i ; β and φ are learning parameters used to adjust the weights, c t is the final context vector, which is used to fuse historical information and input it into the subsequent network, h i is the value vector of the source position i;
[0055] Step (3.5) passes the data to the input gate, and determines the retained information i t between the current input x t-1 and the previous moment's h t through the sigmoid function, and adds the updated context vector c t to the input gate, then calculates the input value at the current moment by the tanh function and multiplies it by the previously obtained retained information i t to obtain the new cell state C t :
[0056] i t = σ(W i · [h t-1 , x t , c t + b i )
[0057]
[0058] where i t is the output of the input gate; W i is the weight matrix of the input gate; b i is the bias term of the input gate; where, is the candidate cell state; W c is the weight matrix; b c is the bias term; tanh is the hyperbolic tangent activation function; C t is the new cell state;
[0059] Step (3.6) uses the new cell state C obtained in the previous step t as the initial input of the output gate, calculates the output value through the sigmoid function, and the tanh function scales the C t value to the interval (0, 1);
[0060] The calculation formula of the output gate is as follows:
[0061] o t = σ(W o · [h t-1 , x t , C t + b o )
[0062] h t = o t · tanh(C t )
[0063] where o t is the output of the output gate; W o is the weight matrix of the output gate; b o is the bias term of the output gate; and h t is the hidden state.
[0064] As a further limitation of the present invention, the relevant performance indicators described in step (4) specifically include: mean square error MSE, absolute error MAE, and mean absolute percentage error MAPE;
[0065] The specific formulas are as follows:
[0066]
[0067] where, y i is the true value, is the predicted value.
[0068] The present invention adopts the above technical solutions. Compared with the prior art, the beneficial effects are as follows: 1) The present invention combines the meteorological data of the China Meteorological Network and the actual farm, introduces the grey relational analysis to screen the key meteorological factors, and solves the problems of strong dependence on traditional manual experience, low data quality, and data redundancy and noise interference.
[0069] 2) In terms of dataset construction, it integrates the data based on experience and actual operation, constructs a four-classification dataset based on irrigation decision-making, expands the label dimension, and solves the problems of single label of traditional datasets, limited coverage scenarios, and insufficient model generalization ability caused by the sparsity of actual farm data.
[0070] 3) In terms of lightweighting the crop water requirement model, it solves the problem of scarce types of meteorological data in actual farms.
[0071] 4) In terms of decision model construction, the present invention constructs a periodic attention mechanism and an attenuation factor, improves the model's capture of periodic data patterns, and solves the problems of gradient explosion and non-convergence that occur when training a deep learning model for classification problems.
[0072] 5) In terms of model evaluation, the present invention uses multiple indicators such as MSE, MAE, and MAPE to comprehensively evaluate the model performance, and solves the problem of one-sidedness of single-index evaluation.
[0073] 6) The present invention optimizes the data quality through grey relational analysis, enhances the time series prediction ability with the LSTM-Attention model, improves the decision coverage with the four-classification dataset, ensures the model reliability with multi-index evaluation, and realizes automated management through the Web platform, and finally solves the core problems of water resource waste, dependence on manual labor, and lagging response in traditional irrigation methods. BRIEF DESCRIPTION OF THE DRAWINGS
[0074] Figure 1 The flowchart of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0075] As Figure 1 shown, a smart irrigation method based on deep learning includes the following steps:
[0076] (1) Collection and collation of data. Taking the China Meteorological Network and Gaoyou Farm as data sources, select the daily meteorological data and actual irrigation data of Gaoyou Meteorological Station from 2014 to 2019, and calculate the crop water requirement using the collected relevant meteorological data;
[0077] The data selected is the meteorological data of the 58241st station in Gaoyou City of China Meteorological Network in the past five years. The meteorological data includes: daily maximum temperature, daily minimum temperature, pressure at 2 meters, average wind speed at 2 meters, sunshine duration, humidity, saturated water vapor pressure, and the meteorological data of the actual farm and the irrigation decision records recorded by the management personnel are sorted and filed.
[0078] (2) Establishment of meteorological data, crop water requirement, and irrigation decision data sets. Using the sorted meteorological data and crop water requirement, grey relational analysis is used for judgment, a lightweight crop water requirement model is constructed, and combined with actual farm production, a four-classification data set based on irrigation decision is constructed, and the data set is divided into a training set and a test set;
[0079] Step (2.1) Select China Meteorological Network as the data source, obtain the daily meteorological data of Gaoyou Meteorological Station for 5 years, such as average temperature, sunshine hours, etc. to establish a document, and the meteorological data of the actual farm and the irrigation decision records recorded by the management personnel;
[0080] Step (2.2) Calculate the crop water requirement Y using the formula. The specific calculation formula is as follows:
[0081] Y = K c ×ET0
[0082] In the formula, Y is the theoretical crop water requirement, K c is the crop coefficient, and ET0 is the reference crop evapotranspiration; select the annual water requirement of Gaoyou rice as the research object, so the K c value for its whole growth period is selected as follows:
[0083]
[0084] The reference crop evapotranspiration ET0 is calculated by the P-M formula, which is specifically as follows:
[0085]
[0086] Among them, Δ is the slope of the saturated water vapor pressure curve; R n is the net surface radiation; G is the soil heat flux; r is the psychrometer constant; μ2 is the wind speed at two meters; e s is the saturated water vapor pressure; e a is the actual water vapor pressure; T is the average temperature;
[0087] Step (2.3) Calculate and compare the correlation of the prepared data with meteorological data, and finally exclude the influence of meteorological data with a correlation lower than the threshold, establish a data set of meteorological data and crop water requirement, and divide the relevant training set and test set for lightweight water requirement training;
[0088] Select 635 pieces of data corresponding to the five-year growth cycle to form a dataset. Among them, 508 are used as the training set and 127 are used as the test set. The original data is screened through grey relational analysis, and meteorological data with a correlation degree lower than 0.7 is removed. The remaining meteorological data is constructed into a dataset.
[0089] Grey relational analysis is a multi-factor decision-making method based on grey system theory, which is suitable for systems with small data volume and incomplete information. It evaluates the influence degree of each factor on the system behavior by calculating the correlation degree between each factor and the reference sequence. Its basic steps include determining the reference sequence and comparison sequences, data standardization, calculating the correlation coefficient and correlation degree, and finally analyzing the influence of each factor according to the correlation degree ranking.
[0090] Before constructing the training data, grey relational analysis of meteorological data should be carried out to screen out meteorological data with a correlation degree lower than 0.7; determine the reference sequence and comparison sequences, data standardization, calculate the correlation coefficient and correlation degree, and finally analyze the influence of each factor according to the correlation degree ranking;
[0091] Step (2.3.1) Determine the reference sequence and comparison sequences. The reference sequence refers to the main target to be analyzed, and the comparison sequences refer to the factors that may affect the system; here, the correlation degree between meteorological factors and crop water requirement is studied. The crop water requirement is recorded as the reference sequence X0, and the meteorological factors are recorded as the comparison sequence X i ={x i (1),x i (2),…,x i (m),}(i = 1,2,…,n), where m is the number of single meteorological factors and n is the number of types of meteorological factors;
[0092] Step (2.3.2) Data standardization. Since the physical meanings of the data in each sequence are different, the data is mean-normalized, that is, all values of each sequence are divided by the mean value of the sequence. The mean-normalization calculation formula is as follows:
[0093]
[0094] where k is an intermediate parameter for counting and m is the total number of data;
[0095] Step (2.3.3) Calculate the correlation coefficient. The correlation coefficient is used to measure the similarity γ between the comparison sequence and the reference sequence. The relevant calculation formula is:
[0096]
[0097] where ρ is the resolution coefficient and X0(k) is the reference sequence, which is the value of crop water requirement here;
[0098] Step (2.3.4) Calculate the grey relational degree. The relational degree is the average of the correlation coefficients and is used to measure the overall correlation degree between the comparison sequence and the reference sequence. The relevant calculation formula is as follows:
[0099]
[0100] Step (2.3.5) Sorting and screening: Sort the comparison sequences according to the magnitude of the relational degree. The larger the relational degree, the higher the correlation between the meteorological factor and the reference crop water requirement. Filter out the factors with a relational degree lower than 0.7, and select the top four meteorological data with a correlation higher than 0.7, denoted as {x1, x2, x3, x4}, for the construction of the subsequent data set.
[0101] Step (2.4) Combine the trained water requirement model with the actual farm meteorological data and the irrigation decision records recorded by the management personnel to construct a data set for decision model training, and divide the relevant training set and test set.
[0102] Step (2.4.1) Collect actual irrigation decision data, label and record the actual operations taken by the management personnel in reality; mark as irrigation start, irrigation stop, and no adjustment. These three irrigation decisions are respectively denoted as three types of labels 0, 1, and 2;
[0103] Using the actual farm weather station as the data source, combine the four types of meteorological data selected in step (2.3.5) and the rainfall data of the farm weather station to expand the three irrigation decisions into four irrigation decisions, denoted as irrigation start, irrigation stop, no adjustment, and abnormal;
[0104] The three types of labels are expanded into four types of labels: The situation where irrigation operations will occur and within a period of time that conforms to the relevant agricultural knowledge and requires irrigation before the irrigation start operation is the irrigation start, denoted as label 0; The situation where irrigation stop operations have occurred and within a period of time that conforms to the relevant agricultural knowledge and requires closing irrigation before the irrigation stop operation is the irrigation stop, denoted as label 1; The situation where no irrigation operations have occurred is no adjustment, denoted as label 2; The situation where no irrigation operations have occurred, but the sum of the crop water requirements in the next three days calculated by the model is less than the sum of the rainfall in the next three days is an abnormal situation, denoted as label 3;
[0105] Step (2.4.2) Based on the four types of meteorological data collected at the farm weather station, the water requirement data predicted based on the four types of meteorological data, and the soil humidity data, combine with the label data in the above step (2.4.1) to establish a data set at ten-minute intervals.
[0106] (3) Taking the LSTM model as the baseline, optimize and construct the LSTM-Attention model and construct a dynamic learning rate to address the need to pay attention to the periodic changes in meteorological data in irrigation problems and the need to perform fine-grained discrimination of features in the later stage of model training in decision-making problems.
[0107] Step (3.1) First, define the attenuation factor as a function of time step t
[0108] α(t) = e -γt ·[λsin(wt + φ)+(1 - λ)cos(wt + φ)]
[0109] where γ is the attenuation rate, w is the frequency, φ is the phase, and λ is the mixing coefficient;
[0110] Step (3.2) Construct a dynamically decaying LSTM forget gate
[0111] f t = σ(W f ·[h t-1 , x t +b f ) ⊙ α(t)
[0112] where ⊙ represents element-wise multiplication; W f is the weight matrix of the forget gate; h t-1 is the hidden state at the previous moment; b f is the bias term of the forget gate; σ is the activation function; α(t) is the constructed attenuation factor;
[0113] Step (3.3) Pass the four meteorological samples, crop water requirements, and soil moisture data obtained by screening through meteorological data correlation into the forget gate and construct a hidden state based on periodic factors. The specific formula is as follows:
[0114] f t = σ(W f ·[h t-1 , x t +b f ) ⊙ α(t)
[0115]
[0116] where f t is the output of the forget gate; W f is the weight matrix of the forget gate; h t-1 is the hidden state at the previous moment; x t is the input at the current moment, i.e., {x1, x2, x3, x4, x5, x6}, which are the four meteorological samples, crop water requirements, and soil moisture respectively; b fis the bias term of the forget gate; A is the adjustable amplitude parameter, T is the period length; σ is the activation function; o t is the output of the output gate;
[0117] Step (3.4) generates the current context vector according to the historical hidden states {h1, h2,..., h t-1}
[0118]
[0119]
[0120] where α t,i is the attention weight, Q t is the query vector, K i is the key vector, d k is the dimension of the key vector K i β and φ are learning parameters used to adjust the weights, c t is the final context vector, used to fuse historical information and input it into the subsequent network, h i is the value vector of the source position i;
[0121] Step (3.5) passes the data to the input gate, and determines the retention information i t between the current input x t-1 and the previous h t , and adds the updated context vector c t to the input gate, then calculates the input value at the current moment by the tanh function and multiplies it by the previously obtained retention information i t to get the new cell state C t :
[0122] i t = σ(W i · [h t-1 , x t , c t + b i )
[0123]
[0124] where i t is the output of the input gate; W i is the weight matrix of the input gate; b i is the bias term of the input gate; where, is the candidate cell state; W c is the weight matrix; b c is the bias term; tanh is the hyperbolic tangent activation function; C tis the new cell state;
[0125] Step (3.6) takes the new cell state C obtained in the previous step t as the initial input and output of the output gate, calculates the output value through the sigmoid function, and the tanh function scales the C t value to the interval (0, 1);
[0126] The calculation formula of the output gate is as follows:
[0127] o t = σ(W o · [h t-1 , x t , C t + bo)
[0128] h t = o t · tanh(C t )
[0129] where o t is the output of the output gate; W o is the weight matrix of the output gate; b o is the bias term of the output gate; and h t is the hidden state.
[0130] (4) Input the test set into the trained LSTM-Attention model for testing to obtain the relevant performance indicators of the model;
[0131] The relevant performance indicators specifically include: mean squared error MSE, mean absolute error MAE, and mean absolute percentage error MAPE; the specific formulas are as follows:
[0132]
[0133] where, y i is the true value, is the predicted value;
[0134] For the prediction of the above model, the results are as follows:
[0135]
[0136] It can be learned from the training data that compared with the RNN model, the MSE is reduced by 0.0009, the MAE is reduced by 0.006, and the MAPE is reduced by 60%. Compared with the LSTM model, the MSE is reduced by 0.0007, the MAE is reduced by 0.007, and the MAPE is reduced by 17%. Thus, it can be seen that the improvement effect of combining LSTM with Attention is more obvious. Therefore, the decision-making method based on the LSTM-Attention model has advantages.
[0137] (5) Build a system platform, develop an intelligent irrigation management platform on the web port, and determine irrigation judgment and irrigation volume by monitoring the real-time data of field sensors to achieve autonomous management of farmland irrigation.
[0138] Use Python 3.8 and Django 4.3.8 for the backend, Node16, Vue3, Lucide Icons and ElementUI PLUS for the frontend, and MySQL 8.2 for the database.
[0139] Build a management system on the web side, which can realize functions such as uploading of field sensor data, control of field irrigation equipment, monitoring of field conditions, and automatic irrigation. Through this system, automatic control of field irrigation can be achieved, reducing the difficulty of field management.
[0140] The present invention is not limited to the above embodiments. Based on the technical solutions disclosed in the present invention, those skilled in the art can make some substitutions and deformations to some technical features without creative labor according to the disclosed technical content, and these substitutions and deformations are all within the protection scope of the present invention.
Claims
1. A smart irrigation method based on deep learning, characterized in that It includes the following steps: (1) Collection and collation of meteorological data and irrigation decision data, and calculation of crop water requirements using the collected relevant meteorological data; (2) Establishment of meteorological data, crop water requirements, and irrigation decision data sets. Using the sorted meteorological data and crop water requirements, gray correlation analysis is used for judgment, a lightweight crop water requirement model is constructed, and combined with actual farm production, a four-classification data set based on irrigation decision is constructed, and the data set is divided into a training set and a test set; (3) Taking the LSTM model as the baseline, optimizing to construct the LSTM-Attention model and constructing a dynamic learning rate; (4) Inputting the test set into the trained LSTM-Attention model for testing to obtain the relevant performance indicators of the model; (5) Constructing a system platform, developing an intelligent irrigation management platform on the web port, determining irrigation judgment and irrigation volume by monitoring the real-time data of field sensors, and realizing the autonomous management of farmland irrigation.
2. The intelligent irrigation method based on deep learning according to claim 1, wherein The specific steps of step (2) include: Step (2.1) Select the China Meteorological Network and the actual farm as data sources, obtain the daily meteorological data of the meteorological station in the experimental area in recent years to establish a document; Step (2.2) Calculate the crop water requirement Y using the formula. The specific calculation formula is as follows: Y = K c × ET0 where Y is the theoretical water requirement of crops, K c is the crop coefficient, and ET0 is the evapotranspiration of the reference crop; The reference crop evapotranspiration ET0 is calculated by the P-M formula, which is specifically as follows: where Δ is the slope of the saturated water vapor pressure curve; R n is the net surface radiation; G is the soil heat flux; r is the psychrometer constant; μ2 is the wind speed at two meters height; e s is the saturated water vapor pressure; e a is the actual water vapor pressure; T is the average temperature; Step (2.3) Calculate and compare the correlation of meteorological data for the prepared data. Finally, excluding the influence of meteorological data with a correlation lower than the threshold, establish a data set of meteorological data and crop water requirements, and divide the relevant training set and test set for lightweight water requirement training; Step (2.4) Combine the trained water requirement model with the actual farm meteorological data and the irrigation decision records recorded by the management personnel to construct a data set for decision model training, and divide the relevant training set and test set.
3. The intelligent irrigation method based on deep learning according to claim 2, characterized in that, The specific steps of step (2.3) include: Before constructing the training data, conduct gray correlation analysis on the meteorological data, and filter out the meteorological data with a correlation lower than the set threshold; Determine the reference sequence and comparison sequence, data standardization, calculate the correlation coefficient and correlation degree, and finally analyze the influence of each factor according to the correlation degree ranking; Step (2.3.1) determines the reference sequence and the comparison sequence. The crop water requirement is used as the reference sequence and denoted as X0, and the meteorological factors are used as the comparison sequence and denoted as X i ={x i (1),x i (2),…,x i (m)}, (i = 1, 2, …, n), where m is the number of single meteorological factors and n is the number of types of meteorological factors; Step (2.3.2) Data standardization. Since the physical meanings of the data in each sequence are different, the data is averaged, that is, all values in each sequence are divided by the mean of the sequence. The averaging calculation formula is as follows: Among them, k is an intermediate parameter for counting, and m is the total number of data; Step (2.3.3) Calculate the correlation coefficient. The correlation coefficient is used to measure the similarity γ between the comparison sequence and the reference sequence. The relevant calculation formula is: Among them, ρ is the resolution coefficient, and X0(k) is the reference sequence, which is the value of the crop water requirement here; Step (2.3.4) Calculate the correlation degree. The correlation degree is the average value of the correlation coefficients and is used to measure the overall correlation degree between the comparison sequence and the reference sequence. The relevant calculation formula is as follows: Step (2.3.5) Sorting and Screening: Sort the comparison sequences according to the degree of correlation. The greater the degree of correlation, the higher the correlation between the meteorological factor and the reference crop water requirement. Screen out the factors with a correlation lower than the threshold, and select the top four meteorological data with a correlation higher than the threshold, denoted as {x1, x2, x3, x4}, for the construction of the subsequent dataset.
4. The intelligent irrigation method based on deep learning according to claim 3, characterized in that, The specific steps of step (2.4) include: Step (2.4.1) Collect actual irrigation decision data, label and record the actual operations taken by managers in reality; mark as irrigation start, irrigation stop, and no adjustment. These three irrigation decisions are respectively recorded as three types of labels 0, 1, and 2. Using the actual farm weather station as the data source, combined with the four types of meteorological data screened in step (2.3.5) and the rainfall data of the farm weather station, expand the three irrigation decisions into four irrigation decisions, denoted as irrigation start, irrigation stop, no adjustment, and abnormal. The three types of labels are expanded into four types of labels: The situation where irrigation operations occur and within a period that conforms to the relevant agricultural knowledge and requires irrigation before the irrigation start operation is defined as irrigation start, denoted as label 0; the situation where irrigation stop operations occur and within a period that conforms to the relevant agricultural knowledge and requires irrigation stop before the irrigation stop operation is defined as irrigation stop, denoted as label 1; the situation where no irrigation operations occur is defined as no adjustment, denoted as label 2; the situation where no irrigation operations occur, but the sum of the crop water requirements in the next three days calculated by the model is less than the sum of the rainfall in the next three days is defined as an abnormal situation, denoted as label 3. Step (2.4.2) Based on the four types of meteorological data collected at the farm weather station, the water requirement data predicted based on the four types of meteorological data, and the soil humidity data, combined with the label data in step (2.4.1) above, establish a dataset at 10-minute intervals.
5. A smart irrigation method based on deep learning according to claim 1, characterized in that The specific steps of step (3) include: Step (3.1) First, define the attenuation factor as a function of the time step t: α(t) = e -γt ·[λsin(wt + φ) + (1 - λ)cos(wt + φ)] where γ is the attenuation rate, w is the frequency, φ is the phase, and λ is the mixing coefficient; Step (3.2) Construct a dynamically decaying LSTM forget gate: f t = σ(W f ·[h t-1 , x t + b f ) ⊙ α(t) where, ⊙ represents element-wise multiplication; W f is the weight matrix of the forgetting gate; h t-1 is the hidden state at the previous moment; b f is the bias term of the forgetting gate; σ is the activation function; α(t) is the constructed attenuation factor; Step (3.3) Input the four meteorological samples, crop water requirements, and soil humidity data screened through the meteorological data correlation into the forget gate, and construct a hidden state based on the periodic factor. The specific formula is as follows: f t = σ(W f · [h t-1 , x t + b f ) ⊙ α(t) Among them, f t is the output of the forget gate; W f is the weight matrix of the forget gate; h t-1 is the hidden state at the previous moment; x t is the input at the current moment, i.e., {x1, x2, x3, x4, x5, x6}, which are four meteorological samples, crop water requirement, and soil humidity respectively; b f is the bias term of the forget gate; A is the adjustable amplitude parameter, T is the period length; σ is the activation function; o t is the output of the output gate; Step (3.4) generates the current context vector based on the historical hidden states {h1, h2,..., h t-1}. Among them, α t,i is the attention weight, Q t is the query vector, K i is the key vector, d k is the dimension of the key vector K i β and φ are learning parameters used to adjust the weights, c t is the final context vector used to fuse historical information and input into the subsequent network, h i is the value vector at the source position i; Step (3.5) passes the data to the input gate, and determines the current input x through the sigmoid function t and the retained information i t-1 between the previous moment's h t , and adds the updated context vector c t to the input gate, then calculates the input value at the current moment by the tanh function and multiplies it by the previously obtained retained information i t to obtain the new cell state C t : i t = σ(W i · [h t-1 , x t , c t + b i ) where i t is the output of the input gate; W i is the weight matrix of the input gate; b i is the bias term of the input gate; where, is the candidate cell state; W c is the weight matrix; b c is the bias term; tanh is the hyperbolic tangent activation function; C t is the new cell state; Step (3.6) takes the new cell state C obtained in the previous step t as the initial input to the output gate, calculates the output value through the sigmoid function, and the tanh function scales the C t value to the interval (0, 1); The output gate calculation formula is as follows: o t = σ(W o ·[h t-1 ,x t ,C t +b o ) h t = o t ·tanh(C t ) where o t is the output of the output gate; W o is the weight matrix of the output gate; b o is the bias term of the output gate; and h t is the hidden state.
6. The intelligent irrigation method based on deep learning according to claim 1, characterized in that The specific relevant performance indicators in step (4) include: mean squared error MSE, mean absolute error MAE, and mean absolute percentage error MAPE; The specific formulas are as follows: where y i is the true value, and is the predicted value.
Citation Information
Cited By
Vegetation water demand prediction method and device based on multi-dimensional data, equipment and medium
CN121614802A