CN110084367B - Soil moisture content prediction method based on LSTM deep learning model - Google Patents

Soil moisture content prediction method based on LSTM deep learning model Download PDF

Info

Publication number
CN110084367B
CN110084367B CN201910317820.6A CN201910317820A CN110084367B CN 110084367 B CN110084367 B CN 110084367B CN 201910317820 A CN201910317820 A CN 201910317820A CN 110084367 B CN110084367 B CN 110084367B
Authority
CN
China
Prior art keywords
data
moisture content
deep learning
soil moisture
learning model
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910317820.6A
Other languages
Chinese (zh)
Other versions
CN110084367A (en
Inventor
张武
洪汛
李蒙
张嫚嫚
宋一帆
韩勇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Anhui Agricultural University AHAU
Original Assignee
Anhui Agricultural University AHAU
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Anhui Agricultural University AHAU filed Critical Anhui Agricultural University AHAU
Priority to CN201910317820.6A priority Critical patent/CN110084367B/en
Publication of CN110084367A publication Critical patent/CN110084367A/en
Application granted granted Critical
Publication of CN110084367B publication Critical patent/CN110084367B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • AHUMAN NECESSITIES
    • A01AGRICULTURE; FORESTRY; ANIMAL HUSBANDRY; HUNTING; TRAPPING; FISHING
    • A01GHORTICULTURE; CULTIVATION OF VEGETABLES, FLOWERS, RICE, FRUIT, VINES, HOPS OR SEAWEED; FORESTRY; WATERING
    • A01G25/00Watering gardens, fields, sports grounds or the like
    • A01G25/16Control of watering
    • A01G25/167Control by humidity of the soil itself or of devices simulating soil or of the atmosphere; Soil humidity sensors
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/048Activation functions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/084Backpropagation, e.g. using gradient descent
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/04Forecasting or optimisation specially adapted for administrative or management purposes, e.g. linear programming or "cutting stock problem"
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q50/00Systems or methods specially adapted for specific business sectors, e.g. utilities or tourism
    • G06Q50/02Agriculture; Fishing; Mining

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Economics (AREA)
  • Strategic Management (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Human Resources & Organizations (AREA)
  • General Engineering & Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • Software Systems (AREA)
  • Mathematical Physics (AREA)
  • General Business, Economics & Management (AREA)
  • Tourism & Hospitality (AREA)
  • Molecular Biology (AREA)
  • Computational Linguistics (AREA)
  • Marketing (AREA)
  • Biophysics (AREA)
  • Biomedical Technology (AREA)
  • Environmental Sciences (AREA)
  • Game Theory and Decision Science (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Development Economics (AREA)
  • Operations Research (AREA)
  • Quality & Reliability (AREA)
  • Water Supply & Treatment (AREA)
  • Soil Sciences (AREA)
  • Agronomy & Crop Science (AREA)
  • Animal Husbandry (AREA)
  • Marine Sciences & Fisheries (AREA)
  • Mining & Mineral Resources (AREA)
  • Primary Health Care (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)

Abstract

The invention discloses a soil moisture content prediction method based on an LSTM deep learning model, which comprises the steps of firstly collecting soil physicochemical and meteorological data of a target farmland within a period of time; preprocessing collected data and dividing the preprocessed data into a training sample set and a testing sample set; constructing an LSTM deep learning model, training the LSTM deep learning model through a training sample set to obtain a parameter-adjusted LSTM deep learning model, verifying the parameter-adjusted LSTM deep learning model through a testing sample set, and finally taking the verified LSTM deep learning model as a soil moisture content prediction model; and inputting the collected data into a soil moisture content prediction model, and finally outputting a soil moisture content prediction result at a future moment by the soil moisture content prediction model. According to the method, the soil moisture content is forecasted by using a deep learning method, so that manpower and material resources are saved, the influence of early-stage data on later-stage results can be truly reflected, and the time sequence characteristics are fully embodied.

Description

Soil moisture content prediction method based on LSTM deep learning model
Technical Field
The invention relates to the field of soil moisture content prediction methods, in particular to a soil moisture content prediction method based on an LSTM deep learning model.
Background
China is a country with serious drought and water shortage, the per-capita water resource amount is only 1/4 of the average level of the world, and the method is one of countries with the lowest per-capita water resource in the world. Accurate irrigation is implemented in the agricultural production process, so that water resources can be effectively saved, and the growth of crops is promoted. However, insufficient irrigation and excessive irrigation often exist in farmland irrigation, so that the growth of crops is blocked and the yield is low due to the insufficient irrigation, and the root system of the crops is poor and the crops die due to the excessive irrigation, so that the utilization rate of water resources is reduced, and the purpose of high yield cannot be achieved. Therefore, the method establishes a soil moisture content prediction model, develops the prediction of the soil moisture content, can effectively solve the problems of insufficient irrigation and excessive irrigation, and is a main technical means for realizing accurate irrigation of farmlands. The soil moisture content prediction model predicts the soil moisture content at a future moment according to farmland meteorological data, soil physicochemical data and the past soil moisture content so as to determine the irrigation water quantity, thereby achieving the effects of high yield and stable yield. At present, no mature technical method is available for effectively predicting the soil moisture content, a soil moisture content prediction model with strong generalization capability and high prediction accuracy is established, and the accurate prediction of the soil moisture content is implemented, which is one of the important problems to be solved in agricultural accurate production. 2016 (agricultural science of Anhui province, 2016,44 (34): 174-176) proposes that the correlation between the soil moisture on the surface and bottom of 2011-2014 in the east city and meteorological factors (precipitation, temperature, humidity, sunlight and wind) in the same period are analyzed by a stepwise regression method, key meteorological factors influencing the soil moisture are screened out, and a soil moisture forecasting model is established by combining an empirical formula method. The results show that the meteorological factors influencing the soil moisture content of the east China are mainly rainfall, sunlight and air temperature, the average relative error of the soil moisture content of the soil in the future 30 days of the forecast model established by the method is within 5%, the inspection effect is ideal, and the soil moisture content of the soil in the future 30 days of the forecast model can be accurately forecasted by the model and used for guiding agricultural production.
In 2017, the document entitled "research on prediction accuracy of soil moisture content based on BP neural network" in Feidong county (soil report, 2017,48 (02): 292-297). The method adopts a BP neural network for predicting soil moisture content, and the main idea is to select the average temperature, the average humidity, the radiant quantity and the rainfall which have obvious influence on soil moisture as model input samples to establish a network model. In addition, the soil moisture content at the beginning of the period has great influence on the soil moisture content at the end of the period, so the soil moisture content at the beginning of the period can also be used as an input sample of the model.
In the patent of soil moisture content prediction method based on soil moisture content index (application number: N201810457976. X), a model used in the method is a semi-empirical semi-theoretical model which is proposed through field experimental research for many years, and the method has the characteristics of simple and easily-obtained parameters and convenience for practical application. The method provides that the soil moisture content index of a crop root development layer is calculated by actually measured soil moisture content of a soil moisture loss sensitive layer, the actually measured water content of 20cm and 50cm soil layers is calculated, the soil moisture content index of 50cm soil layers is predicted, the water content of 20cm soil layers is predicted, the water content of 50cm soil layers is predicted, the water filling time is predicted, and the water filling quota is predicted in sequence, so that the standardization of soil moisture content monitoring, prediction, updating, water filling time and water filling quota prediction technologies is realized, a soil moisture content monitoring and prediction information system is constructed, the soil moisture content information query, drought assessment and risk control are facilitated, and the method is suitable for the soil moisture content prediction of wide farmland in plain areas.
The methods can predict the soil moisture content change curve at the next moment according to the soil moisture content change condition in the past period. But they have problems in common: the time sequence characteristics of data are not fully considered when the model is built, and the generalization capability and the prediction accuracy rate are to be improved.
Disclosure of Invention
The invention aims to provide a soil moisture content prediction method based on an LSTM deep learning model, and the soil moisture content prediction method is used for solving the problem that data time sequence characteristics are not considered in the soil moisture content prediction method in the prior art.
In order to achieve the purpose, the technical scheme adopted by the invention is as follows:
a soil moisture content prediction method based on an LSTM deep learning model is characterized by comprising the following steps: the method comprises the following steps:
(1) Collecting soil physicochemical and meteorological data of a target farmland within a period of time;
(2) Preprocessing the soil physical, chemical and meteorological data collected in the step (1), and then dividing the preprocessed data into a training sample set and a test sample set according to a proportion;
(3) The LSTM deep learning model is constructed and provided with an input layer, twenty-five hidden layers and an output layer, the LSTM deep learning model is trained through a training sample set to obtain a parameter-adjusted LSTM deep learning model, the parameter-adjusted LSTM deep learning model is verified through a testing sample set, and finally the verified LSTM deep learning model is used as a soil moisture content prediction model;
(4) And (2) taking the soil physicochemical and meteorological data collected in the step (1) as input of a soil moisture content prediction model, processing the soil physicochemical and meteorological data through the soil moisture content prediction model, and finally outputting a soil moisture content prediction result at a future time through the soil moisture content prediction model.
The soil moisture content prediction method based on the LSTM deep learning model is characterized by comprising the following steps of: in the step (1), missing data of the collected soil physical and chemical data and meteorological data are repaired by adopting a linear interpolation method, wherein the formula of the linear interpolation method is as follows:
Figure BDA0002033693540000031
in the formula (1), i and j respectively represent the value of the ith time and the jth time, and 0 < i < j is required. x is a radical of a fluorine atom k And x k+j The soil physical, chemical and meteorological data, x, collected at the time k and the time k + j respectively k+i The data are soil physicochemical and meteorological data lost at k + i moment.
The soil moisture content prediction method based on the LSTM deep learning model is characterized by comprising the following steps of: the pretreatment in the step (2) is normalization pretreatment, 85% of data in the pretreatment is used as a training sample set and 15% of data is used as a test sample set after the normalization pretreatment, and the formula of the normalization pretreatment is
Figure BDA0002033693540000032
The collected data is normalized to obtain a mapping interval of [0,1] for the collected data values]In the formula of normalized preprocessing, x is the original data and x max ,x min Respectively the maximum and minimum values in the raw data,x now the result data after normalization processing;
the dimension influence among the indexes is eliminated through normalization preprocessing, the comparability among the data indexes is solved, and after the raw data are preprocessed, all the indexes are in the same order of magnitude, so that the model construction is facilitated.
The soil moisture content prediction method based on the LSTM deep learning model is characterized by comprising the following steps of: in the step (3), the network structure of the constructed LSTM deep learning model is (7, 25, 1), each hidden layer in the LSTM deep learning model adopts an LSTM unit with three gates, the three gates of the LSTM unit are a forgetting gate, an input gate and an output gate, the updating of the state and the output of the target value are completed through the three gate structures, and the data processing process of the hidden layer is as follows:
the forgetting door determines the degree of forgetting information and reads h first (t-1) And x (t) To screen the data, wherein h (t-1) Indicates the output of the last memory cell, x (t) Represents the current cell input as shown in equation (2):
f (t) =σ(W f ·[h (t-1) ,x (t) ]+b f ) (2),
in the formula (2), W f Is a weight term, b f Is an offset term, f (t) Is the forgetting degree of the information, sigma is sigmoid function, and the value is [0, 1')]In between. The sigmoid function outputs a value between 0 and 1 for the cell state C (t) Wherein 1 represents complete reservation information and 0 represents complete discarding of the node data;
the input gate determines that new information is added to the hidden node, where C (t-1) Is the cellular state at the previous moment, defines i (t) To determine updated information, completing the information addition needs to include two steps: firstly, determining which information needs to be updated through a sigmoid function of an input gate; secondly, a vector is generated through a tanh layer, namely, the content a which is selected as the candidate for updating is generated (t) Combining the two parts to carry out a renewal of the state of the cell, e.g.Formulas (3) and (4):
i (t) =σ(W i ·[h (t-1) ,x (t) ]+b i ) (3),
a (t) =tanh(W c ·[h (t-1) ,x (t) ]+b a ) (4),
in formula 3, σ is sigmoid function, W i As weight term, h (t-1) Is the last output part, x (t) Is the input of the current cell. b i Is the bias term.
In equation 4, tan h is a tan h function, W c Is a weight term, h (t-1) Is the last output part, x (t) Is the input of the current cell. b a Is the bias term.
When the old cell state is updated in the formula (4), the content a updated at the previous time is (t-1) Updated to content a updated at this moment (t) . The state of the cells at the previous moment C (t-1) And f in forgetting door (t) Multiply by and add i (t) *a (t) And the effect of updating the cell state is achieved, as shown in formula (5):
C (t) =f (t) *C (t-1) +i (t) *a (t) (5),
in formula (5), a denotes a Hadamard product, that is, a product of corresponding positions of the matrix. C (t-1) The cellular state at the previous moment, a (t) Is new content. C (t) Is a new memory state.
The output gate determines an output item, and firstly, based on the state of the memory cell, a sigmoid function is operated to determine which information of the memory cell is to be output; next, the memory cell state is processed by tanh to obtain a value between-1 and 1, and this value is multiplied by the output of the output gate, as shown in equations (6) and (7):
Figure BDA0002033693540000051
in the formula (6), o (t) To output which information, h (t-1) ,x (t) The output indicated as the previous time and the input at that time. W o As weight term, b o Is the bias term.
H in equation (7) (t) O obtained in formula (6) is used as part of the final output (t) And multiplying the current new memory state by the value of the tanh function to achieve the effect of memorizing the information of the long-term dependence of the sequence.
Compared with the prior art, the invention has the advantages that: the invention utilizes a deep learning algorithm and adopts a soil moisture content prediction method based on a long-term and short-term memory model. Compared with the traditional method, the soil moisture content is forecasted by using the deep learning method, the real-time measurement by adopting a manual method is not needed, and the manpower and material resources are saved. In addition, the LSTM unit can truly reflect the influence of early-stage data on later-stage results, fully embody the time-sequence characteristics, improve the prediction efficiency and accuracy and have higher generalization capability. The soil moisture content prediction method based on the LSTM deep learning model has good application value.
Drawings
FIG. 1 is a flow chart of the present invention.
Fig. 2 is a schematic diagram of an LSTM unit used in the present invention.
FIG. 3 is a schematic diagram of an activation function.
FIG. 4 is a diagram of an activation function.
FIG. 5 is a graph of the prediction of the test set (soil moisture content).
Detailed Description
The invention is further illustrated with reference to the following figures and examples.
As shown in fig. 1, the specific implementation process of the present invention is as follows:
1. and monitoring meteorological data and soil physicochemical data of a farmland. Data were collected every 30 minutes. The data volume of about 3 months is collected, the total number of the data records is 4000, and the partially missing data is repaired by adopting the linear interpolation method, as shown in the formula (1):
Figure BDA0002033693540000061
in the formula (1), i and j represent the ith and jth time values, respectively, and 0 is required<i<j。x k And x k+j The soil physical, chemical and meteorological data, x, collected at the time k and the time k + j respectively k+i The data are the physical, chemical and meteorological data of the soil lost at the moment k + i.
2. Data preprocessing: before model training, normalization processing needs to be carried out on collected farmland meteorological data and soil physicochemical data. By normalization, the data is mapped to [0,1]]Or [ -1,1 [)]An interval. Ensuring that input data of different data ranges perform the same function. The normalization processing formula adopted in the invention is
Figure BDA0002033693540000062
Wherein x is the original data to be normalized max ,x min Maximum and minimum values, x, respectively, in the raw data now Is the data after the normalization process.
And dividing the data after the normalization processing into a training sample set and a test sample set. The data accounts for 85% and 15% respectively, and the method is used for training and testing the LSTM deep learning model.
3. Model structure: as shown in FIG. 2, the LSTM deep learning model with 7 input layers, 25 hidden layers and 1 output layer is adopted, and the hidden layer units of the LSTM deep learning model all adopt LSTM (long-short-term memory) units, so that the problem that the perception capability of subsequent nodes to previous time nodes is reduced is well solved, the defects of a conventional time series model structure are overcome, and time series data can be well processed. LSTM is a unit called a memory cell, which has a 3-gate structure.
The forgetting gate determines the degree of forgetting information. Reading h (t-1) And x (t) ,h (t-1) The output, x, of the last memory cell is shown (t) Showing the input of the current cell and completing the screening process of the data, as shown in formula (2):
f (t) =σ(W f ·[h (t-1) ,x (t) ]+b f ) (2),
in the formula (2), W f Is a weight term, b f Is an offset term, f (t) Is the forgetting degree of the information, sigma is sigmoid function, and the value is [0, 1')]In the meantime. The sigmoid function outputs a value between 0 and 1 for the cell state C (t) Wherein 1 represents complete reservation information and 0 represents complete discarding of the node data;
the input gate determines that new information is added to the hidden node. C (t-1) Is the cellular state at the previous moment i (t) Is part of determining an information update. Completing the information addition needs to include two steps: firstly, determining which information needs to be updated through a sigmoid function of an input gate; secondly, a tanh layer generates a vector, i.e. the content a for updating is selected as the candidate (t) . The two parts are combined to update the cell state, as shown in formula (3) and formula (4):
i (t) =σ(W i ·[h (t-1) ,x (t) ]+b i ) (3),
a (t) =tanh(W c ·[h (t-1) ,x (t) ]+b a ) (4),
in formula 3, σ is sigmoid function, W i As weight term, h (t-1) Is the last output part of the last time, x (t) Is the input of the current cell. b is a mixture of i Is the bias term.
In equation 4, tan h is a tan h function, W c As weight term, h (t-1) Is the last output part of the last time, x (t) Is the input of the current cell. b a Is a bias term.
When the old cell state is updated in the formula (4), the content a updated at the previous time is (t-1) Updated to content a updated at this moment (t) . The state of the cells at the previous moment C (t-1) And f in forgetting door (t) Multiply and add i (t) *a (t) And the effect of updating the cell state is achieved, as shown in formula (5):
C (t) =f (t) *C (t-1) +i (t) *a (t) (5),
in formula (5), a denotes a Hadamard product, that is, a product of corresponding positions of the matrix. C (t-1) The cellular state at the previous moment, a (t) Is new content. C (t) It is a new memory state.
The output gate determines an output item. Firstly, based on the state of the memory cells, a sigmoid layer is operated to determine which information of the memory cells is to be output; next, the memory cell state is processed through tanh (to obtain a value between-1 and 1) and multiplied by the output of the output gate. The output items are calculated according to the expressions (6) and (7).
Figure BDA0002033693540000071
In the formula (6), o (t) To output which information, h (t-1) ,x (t) The output indicated as the previous time and the input at that time. W is a group of o As weight terms, b o Is a bias term.
H in the formula (7) (t) O obtained in formula (6) is used as part of the final output (t) And multiplying the current new memory state by the value of the tanh function to achieve the effect of memorizing the information of the long-term dependence of the sequence.
The gate structure uses a sigmoid activation function (as shown in FIG. 3):
Figure BDA0002033693540000081
in the above equation (8), x is input data, and the data vector value is 'compressed' to [0,1] by the sigmoid function, and if the input value is negative and very large, the value is 0, and if the input value is positive, the value is 1.
In updating the state of the cell, the tanh activation function (as shown in fig. 4) was used:
Figure BDA0002033693540000082
in the above equation (9), x is mapped between [ -1,1] as input data by the function f (x).
In the network training, the final hidden layer state of the current batch (batch) is used as the subsequent initial hidden state (traversing the whole training set in sequence). The size of batch is set to 72. The network structure adopted by the LSTM deep learning model used by the invention is (7, 25, 1). The learning rate (learning rate) is set to 0.01. During training, the error is calculated as the mean absolute error (MeanAbsoluteError) and used to update the weights according to a back-propagation algorithm.
Figure BDA0002033693540000083
In the above formula (11), m is the total number of training data, x (i) Representing the data input value, k (x) (i) ) Is the predicted output value, y (i) Is the actual output value. An error value obtained according to the above equation. And taking a sequence in the training sample data as training input, continuously training the network model and adjusting parameters, and ending when the iteration times reach 300 times. And obtaining a stable prediction model, and using the model as a prediction model of soil moisture content.
The LSTM model has two hidden states h (t) ,C (t) The model has more parameters.
(1) The forward propagation process at each sequence index position is as follows:
(1) updating forgotten gate output
f (t) =σ(W f ·[h (t-1) ,x (t) ]+b f ),
(2) Updating two-part outputs of an input gate
i (t) =σ(W i ·[h (t-1) ,x (t) ]+b i ),
a (t) =tanh(W c ·[h (t-1) ,x (t) ]+b a ),
(3) Renewal of cell state
C (t) =f (t) *C (t-1) +i (t) *a (t)
(4) Updating the output of an output gate
Figure BDA0002033693540000091
(5) Updating current sequence index prediction output
y(t)=σ(W y h (t) +c)
(2) And (3) a back propagation algorithm: for back propagation of errors, by hiding state h (t) Gradient delta of (t) Gradually propagating forward. Back propagation of LSTM with two hidden states h (t) And C (t) . Two δ are defined, namely:
Figure BDA0002033693540000092
and
Figure BDA0002033693540000093
for the purpose of derivation, the loss function is divided into two blocks, one for the loss l at time t (t) The other block is the loss L after time t (t+1) Namely:
Figure BDA0002033693540000094
and at the last sequence index position τ, which
Figure BDA0002033693540000095
And
Figure BDA0002033693540000096
respectively as follows:
Figure BDA0002033693540000097
Figure BDA0002033693540000098
then is made of
Figure BDA0002033693540000099
Reverse derivation
Figure BDA00020336935400000910
Figure BDA00020336935400000911
The gradient of (a) is determined by an output gradient error at the t moment of the layer and an error greater than the t moment, namely:
Figure BDA0002033693540000101
the key to the back propagation of LSTM is that
Figure BDA0002033693540000102
And (4) calculating. Due to h (t) =o (t) *tanh(C (t) ) In the first item o (t) Comprising a recurrence relation of h such that the second term tanh (C) (t) ) Becoming more complex, the tanh function variable can be expressed as:
C (t) =C (t-1) *f (t) +i (t) *a (t)
Figure BDA0002033693540000103
and then
Figure BDA0002033693540000104
The inverse gradient error of (2) is composed of two parts, i.e. the previous layer
Figure BDA0002033693540000105
Gradient error of (2) and the slave h of the layer (t) The gradient error that is transmitted back.
Figure BDA0002033693540000106
It is known that
Figure BDA0002033693540000107
And
Figure BDA0002033693540000108
i.e. can obtain W f The other parameters are the same as above.
Figure BDA0002033693540000109
4. Network testing (tuning and optimization). Inputting the preprocessed training set data into the constructed LSTM deep learning model, continuously optimizing parameters, gradually improving prediction precision, and performing regularization to prevent overfitting. Finally, a model is obtained, the soil moisture content prediction result at a certain time in the future is output, the average relative error of prediction is less than 0.25%, the prediction result is shown in figure 5, and the prediction result is better.
The method disclosed by the invention utilizes and integrates the relation among historical data to a great extent, fully considers the time sequence characteristics of the data, constructs a reasonable time series model, and has good application value for improving the prediction capability of soil moisture content and enhancing the generalization capability of the model.

Claims (4)

1. A soil moisture content prediction method based on an LSTM deep learning model is characterized by comprising the following steps: the method comprises the following steps:
(1) Collecting soil physicochemical and meteorological data of a target farmland within a period of time;
(2) Preprocessing the soil physical, chemical and meteorological data collected in the step (1), and then dividing the preprocessed data into a training sample set and a test sample set according to a proportion;
(3) The LSTM deep learning model is constructed and provided with an input layer, twenty-five hidden layers and an output layer, the LSTM deep learning model is trained through a training sample set to obtain a parameter-adjusted LSTM deep learning model, the parameter-adjusted LSTM deep learning model is verified through a testing sample set, and finally the verified LSTM deep learning model is used as a soil moisture content prediction model;
(4) And (2) taking the soil physicochemical and meteorological data collected in the step (1) as the input of a soil moisture content prediction model, processing the soil physicochemical and meteorological data through the soil moisture content prediction model, and finally outputting a soil moisture content prediction result at a future moment through the soil moisture content prediction model.
2. The soil moisture content prediction method based on the LSTM deep learning model as claimed in claim 1, characterized in that: in the step (1), the missing data of the collected soil physical and chemical data and meteorological data is repaired by adopting a linear interpolation method, wherein the formula of the linear interpolation method is as follows:
Figure FDA0002033693530000011
in the formula (1), i and j represent the ith and jth time values, respectively, and 0 is required<i<j;x k And x k+j The soil physicochemical and meteorological data, x, collected at the time k and the time k + j, respectively k+i The data are soil physicochemical and meteorological data lost at the moment of k + i.
3. The soil moisture content prediction method based on the LSTM deep learning model as claimed in claim 1, wherein: the pretreatment in the step (2) is normalization pretreatment, 85% of data in the pretreatment is used as a training sample set and 15% of data is used as a test sample set after the normalization pretreatment, and the formula of the normalization pretreatment is
Figure FDA0002033693530000012
The collected data is normalized to obtain a mapping interval of [0,1] for the collected data value]In the formula of normalized preprocessing, x is the original data and x max ,x min Maximum and minimum values, x, respectively, in the raw data now The result data after normalization processing;
the dimension influence among the indexes is eliminated through normalization preprocessing, the comparability among the data indexes is solved, and after the raw data are preprocessed, all the indexes are in the same order of magnitude, so that the model construction is facilitated.
4. The soil moisture content prediction method based on the LSTM deep learning model as claimed in claim 1, wherein: in the step (3), the network structure of the constructed LSTM deep learning model is (7, 25, 1), each hidden layer in the LSTM deep learning model adopts an LSTM unit with three gates, the three gates of the LSTM unit are a forgetting gate, an input gate and an output gate, the updating of the state and the output of the target value are completed through the three gate structures, and the data processing process of the hidden layer is as follows:
the forgetting door determines the degree of forgetting information and reads h first (t-1) And x (t) To screen the data, wherein h (t-1) Indicates the output of the last memory cell, x (t) The input to the current cell is represented as shown in equation (2):
f (t) =σ(W f ·[h (t-1) ,x (t) ]+b f ) (2),
in the formula (2), W f Is a weight term, b f Is an offset term, f (t) Is the forgetting degree of the information, sigma is sigmoid function, and the value is [0, 1' ]]In between, the sigmoid function outputs a value between 0 and 1 for the cell state C (t) Wherein 1 represents complete reservation information and 0 represents complete discarding of the node data;
the input gate determines that new information is added to the hidden node, where C (t-1) Is the cellular state of the last momentDefinition of i (t) To determine updated information, completing the information addition needs to include two steps: firstly, determining which information needs to be updated through a sigmoid function of an input gate; secondly, a vector is generated through a tanh layer, namely, the content a which is selected as the candidate for updating is generated (t) Combining the two parts to update the state of the cell, as shown in formulas (3) and (4):
i (t) =σ(W i ·[h (t-1) ,x (t) ]+b i ) (3),
a (t) =tanh(W c ·[h (t-1) ,x (t) ]+b a ) (4),
in formula 3, σ is sigmoid function, W i Is a weight term, h (t-1) Is the last output part of the last time, x (t) As input of the current cell, b i Is a bias term;
in equation 4, tan h is a tan h function, W c Is a weight term, h (t-1) Is the last output part, x (t) For the input of the current cell, b a Is a bias term;
when the old cell state is updated in the formula (4), the content a updated at the previous time is (t-1) Updated to content a updated at this time (t) The state of the cell at the previous time C (t-1) And f in forgetting door (t) Multiply by and add i (t) *a (t) And the effect of updating the cell state is achieved, as shown in formula (5):
C (t) =f (t) *C (t-1) +i (t) *a (t) (5),
in the formula (5), the product of Hadamard product, i.e. the product of corresponding positions of the matrix, C (t-1) The cellular state at the previous moment, a (t) As new content, C (t) A new memory state;
the output gate determines an output item, and firstly, based on the state of the memory cell, a sigmoid function is operated to determine which information of the memory cell is to be output; next, the memory cell state is processed by tanh to obtain a value between-1 and 1, and this value is multiplied by the output of the output gate, as shown in equations (6) and (7):
Figure FDA0002033693530000031
in the formula (6), o (t) To output which information, h (t-1) ,x (t) Output represented as last time instant and input at that time instant, W o As weight terms, b o Is a bias term;
h in equation (7) (t) O obtained in formula (6) is used as part of the final output (t) And multiplying the current new memory state by the value of the tanh function to achieve the effect of memorizing the information of the long-term dependence of the sequence.
CN201910317820.6A 2019-04-19 2019-04-19 Soil moisture content prediction method based on LSTM deep learning model Active CN110084367B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910317820.6A CN110084367B (en) 2019-04-19 2019-04-19 Soil moisture content prediction method based on LSTM deep learning model

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910317820.6A CN110084367B (en) 2019-04-19 2019-04-19 Soil moisture content prediction method based on LSTM deep learning model

Publications (2)

Publication Number Publication Date
CN110084367A CN110084367A (en) 2019-08-02
CN110084367B true CN110084367B (en) 2022-10-25

Family

ID=67415755

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910317820.6A Active CN110084367B (en) 2019-04-19 2019-04-19 Soil moisture content prediction method based on LSTM deep learning model

Country Status (1)

Country Link
CN (1) CN110084367B (en)

Families Citing this family (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110456026B (en) * 2019-08-13 2022-05-03 北京农业信息技术研究中心 Soil moisture content monitoring method and device
CN110567534B (en) * 2019-09-10 2021-08-13 广东工业大学 Method for predicting flow of combustion air outlet in glass melting furnace and related device
CN111610406A (en) * 2020-04-24 2020-09-01 国网河北省电力有限公司电力科学研究院 Grounding grid corrosion prediction method based on deep learning
CN111561972A (en) * 2020-06-18 2020-08-21 华南农业大学 Soil water content prediction system and method based on time sequence
CN111859814B (en) * 2020-07-30 2023-07-28 中国电建集团昆明勘测设计研究院有限公司 Rock aging deformation prediction method and system based on LSTM deep learning
CN112115984A (en) * 2020-08-28 2020-12-22 安徽农业大学 Tea garden abnormal data correction method and system based on deep learning and storage medium
CN112287294B (en) * 2020-09-10 2024-02-27 河海大学 Space-time bidirectional soil water content interpolation method based on deep learning
CN112255095B (en) * 2020-09-25 2023-12-01 汕头大学 Soil stress-strain relation determination method
CN112784331B (en) * 2020-09-25 2022-09-13 汕头大学 Soil stress-strain relation determination method based on improved LSTM deep learning method
CN113257008B (en) * 2021-05-12 2022-06-21 兰州交通大学 Pedestrian flow dynamic control system and method based on deep learning
WO2022245312A1 (en) * 2021-05-18 2022-11-24 Hi̇t Bi̇li̇şi̇m Danişmanlik Turi̇zm Hi̇zmetleri̇ Sanayi̇ Ve Ti̇caret Li̇mi̇ted Şi̇rketi̇ A method for estimating soil moisture and a system operating according to said method
CN113323676B (en) * 2021-06-03 2024-03-22 上海市隧道工程轨道交通设计研究院 Method for determining cutter torque of shield machine by using principal component analysis-long and short memory model
CN113435707B (en) * 2021-06-03 2023-11-10 大连钜智信息科技有限公司 Soil testing formula fertilization method based on deep learning and weighting multi-factor evaluation
CN113435649B (en) * 2021-06-29 2022-09-16 布瑞克农业大数据科技集团有限公司 Global agricultural data sorting method, system, device and medium
CN113468810A (en) * 2021-07-01 2021-10-01 天行智控(成都)科技有限公司 Intelligent floor sensing indoor tumble prediction model and establishment method thereof
CN113796228B (en) * 2021-09-26 2022-08-23 南京邮电大学 Plant cultivation system and method based on digital twinning
CN114080953B (en) * 2021-11-05 2023-12-15 山东省农业机械科学研究院 Mushroom house illumination management method and system
CN114451257B (en) * 2021-12-23 2023-04-07 珠海格力电器股份有限公司 Irrigation method and device based on neural network, storage medium and electronic equipment
CN117494902B (en) * 2023-11-22 2024-04-16 山东大学 Soil moisture content prediction method and system based on soil moisture correlation analysis

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3564863B1 (en) * 2016-12-30 2024-03-13 Shanghai Cambricon Information Technology Co., Ltd Apparatus for executing lstm neural network operation, and operational method
CN108738444B (en) * 2018-03-01 2021-10-08 洛阳中科龙网创新科技有限公司 Deep learning system-based tractor farming method

Also Published As

Publication number Publication date
CN110084367A (en) 2019-08-02

Similar Documents

Publication Publication Date Title
CN110084367B (en) Soil moisture content prediction method based on LSTM deep learning model
CN111222698B (en) Internet of things-oriented ponding water level prediction method based on long-time and short-time memory network
CN109214592B (en) Multi-model-fused deep learning air quality prediction method
CN111639748B (en) Watershed pollutant flux prediction method based on LSTM-BP space-time combination model
CN101480143B (en) Method for predicating single yield of crops in irrigated area
CN112288164B (en) Wind power combined prediction method considering spatial correlation and correcting numerical weather forecast
CN110705743B (en) New energy consumption electric quantity prediction method based on long-term and short-term memory neural network
CN108009674A (en) Air PM2.5 concentration prediction methods based on CNN and LSTM fused neural networks
CN112287294B (en) Space-time bidirectional soil water content interpolation method based on deep learning
CN113554466B (en) Short-term electricity consumption prediction model construction method, prediction method and device
CN113705877B (en) Real-time moon runoff forecasting method based on deep learning model
CN108399470B (en) Indoor PM2.5 prediction method based on multi-example genetic neural network
CN114970377B (en) Method and system for field flood forecasting based on Xinanjiang and deep learning coupling model
CN110969282A (en) Runoff stability prediction method based on LSTM composite network
CN115495991A (en) Rainfall interval prediction method based on time convolution network
CN109816167A (en) Runoff Forecast method and Runoff Forecast device
CN114357737B (en) Agent optimization calibration method for time-varying parameters of large-scale hydrologic model
CN113033081A (en) Runoff simulation method and system based on SOM-BPNN model
CN114692981A (en) Medium-and-long-term runoff forecasting method and system based on Seq2Seq model
CN115329930A (en) Flood process probability forecasting method based on mixed deep learning model
Shang et al. Research on intelligent pest prediction of based on improved artificial neural network
CN109272144A (en) The prediction technique of grassland in northern China area NDVI based on BPNN
CN109447843B (en) Photovoltaic output prediction method and device
CN115271186B (en) Reservoir water level prediction and early warning method based on delay factor and PSO RNN Attention model
CN110009132A (en) A kind of short-term electric load fining prediction technique based on LSTM deep neural network

Legal Events

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