A reference crop evapotranspiration prediction method, storage medium and device
By constructing a seasonal trend decomposition and periodic feature prediction module, combined with the self-attention mechanism and multi-layer perceptron, the problem that the ET0 prediction model is difficult to capture the periodic characteristics of irrigation area data is solved, and a more accurate ET0 prediction is achieved.
Patent Information
- Application Number
- CN202411350498.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-26
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2044-09-26
AI Technical Summary
The existing ET0 prediction model is difficult to capture the periodic characteristics of irrigation district data, resulting in insufficient prediction accuracy and inability to meet the needs of irrigation district management.
A reference crop evapotranspiration prediction model was constructed, including a seasonal trend decomposition module, a seasonal cycle feature prediction module, and a long-term trend feature prediction module. The Pearson correlation coefficient was used to screen key meteorological factors. The self-attention mechanism and multi-layer perceptron were combined to capture the periodic characteristics and time dependence of the data through frequency domain data embedding and multi-head self-attention layer.
The accuracy and stability of ET0 prediction are improved, and the periodic characteristics of the data can be better extracted, making it suitable for accurate prediction of evapotranspiration of reference crops.
Smart Images

Figure CN119202666B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of reference crop evapotranspiration prediction, and in particular to a reference crop evapotranspiration prediction method, storage medium, and equipment. Background Art
[0002] Reference crop evapotranspiration (ET0) refers to the evapotranspiration of 8-15 cm tall, green, dwarf crops that are uniform in height, vigorous in growth, and fully cover the ground without water shortages. Accurate ET0 prediction is crucial for water-saving agriculture and efficient use of agricultural water resources in various regions. ET0 prediction is a multivariate time series forecasting problem. The general steps involve collecting historical meteorological data, calculating historical ET0 data using the Penman-Monteith formula, and then using artificial intelligence models to analyze the relationships between the historical meteorological and ET0 data to predict future ET0 data. However, the accuracy of previously used forecasting models has been insufficient to meet the needs of irrigation district management.
[0003] Accurate prediction of ET0 can provide scientific guidance for managers to formulate water resource scheduling plans in advance, thereby saving a large amount of water resources. In earlier studies, scholars usually used artificial intelligence models such as machine learning models and deep learning models to predict ET0. However, these models have some defects that make it difficult to meet the needs of irrigation district management. For example, the widely used machine learning models support vector regression and random forest models have difficulty capturing the complex dependencies between historical data in irrigation districts, resulting in their accuracy failing to meet the needs of irrigation district management. Deep learning models, including long short-term memory networks and gated recurrent units, have memory leakage effects. When the prediction time becomes longer, the prediction accuracy will drop rapidly, which has limitations in practical applications.
[0004] With the introduction of the Transformer architecture, the self-attention mechanism has gradually been applied to time series forecasting tasks. Unlike methods based on long-short-term memory networks, the self-attention mechanism allows the model to access any part of the historical data, regardless of distance. This gives it a significant advantage in capturing complex time-dependent features and relationships between different variables. However, self-attention models the dependencies of each position on all other positions equally. While this global attention approach is useful for capturing long-range dependencies, it struggles to capture the cyclical nature of irrigation data. Summary of the Invention
[0005] The purpose of the present invention is to solve the problem that the periodic characteristics of irrigation area data are difficult to capture, and to propose a reference crop evapotranspiration prediction method, comprising the following steps:
[0006] S1. Obtain historical meteorological data of the irrigation area and calculate historical reference crop evapotranspiration based on the historical meteorological data of the irrigation area;
[0007] S2. Use the Pearson correlation coefficient to determine the correlation between historical reference crop evapotranspiration and different meteorological factors, and select the top k meteorological factors with the greatest correlation with historical reference crop evapotranspiration;
[0008] S3. Build a reference crop evapotranspiration prediction model, which consists of three modules: seasonal trend decomposition module, seasonal cycle feature prediction module, and long-term trend feature prediction module;
[0009] The seasonal cycle feature prediction module includes a frequency domain data embedding unit, a time-step self-attention layer unit, a cross-dimensional channel attention layer unit, and a linear layer unit; the time-step self-attention layer unit includes a transformer encoder, and the cross-dimensional channel attention layer unit includes a channel attention mechanism;
[0010] The input of the seasonal cycle feature prediction module is input into the frequency domain data embedding unit after discrete cosine transformation. The input of the frequency domain data embedding unit also includes the position information of the input of the seasonal cycle feature prediction module after discrete cosine transformation. The output of the frequency domain data embedding unit is input into the time step self-attention layer unit. The output of the time step self-attention layer unit is input into the cross-dimensional channel attention layer unit. The output of the cross-dimensional channel attention layer unit and the output of the frequency domain data embedding unit are multiplied and input into the linear layer unit to obtain the output of the seasonal cycle feature prediction module.
[0011] The long-term trend feature prediction module includes a multi-layer perceptron;
[0012] The historical reference crop evapotranspiration and the time series of the top k meteorological factors with the greatest correlation with the historical reference crop evapotranspiration are used as the model input X;
[0013] The seasonal trend decomposition module decomposes the time series of the model input into the seasonal cycle sequence X s and the long-term trend series X t ;
[0014] The seasonal cycle sequence X s Input the seasonal cycle feature prediction module to obtain the predicted seasonal cycle feature Y s ; The long-term trend sequence X t Input the long-term trend feature prediction module to obtain the predicted long-term trend feature Y t ;
[0015] Y s and Y tThe model output reference crop evaporation and transpiration prediction Y is obtained by splicing.
[0016] Furthermore, meteorological factors include: average air pressure, daily maximum temperature, daily minimum temperature, average wind speed, sunshine duration and average relative humidity.
[0017] Furthermore, the historical reference crop evapotranspiration expression is calculated based on the historical meteorological data of the irrigation area:
[0018]
[0019] Where ET0 represents the historical reference crop evapotranspiration, Δ represents the slope of the saturated water vapor pressure curve, and R n represents the net radiation on the crop surface, G represents the soil heat flux, r represents the hygrometer constant, T represents the daily average temperature at a height of 2 meters, u2 represents the wind speed at a height of 2 meters, and e s Expressed as saturated water vapor pressure, e a Indicates the actual water vapor pressure.
[0020] Furthermore, the principle of the seasonal trend decomposition module is:
[0021] X t =Avgpool(Padding(X)),
[0022] X s =XX t .
[0023] Furthermore, the discrete cosine transform is expressed as:
[0024]
[0025] in, Represents a sequence segment The representation in the frequency domain is, Represents a sequence segment The discrete cosine transform of , d represents the dimension index, i represents the segment index, Represents X s The sequence segment with the d-th dimension index i, L represents the sequence X s Length, L s Indicates the length of the segment, n indicates the sample index within the segment, n=[0,1...L s -1], express The sample with index n in the sequence X is represented by D. s The total dimensions of Represents the cosine function, l represents the index of different frequency components, and ∪ represents the concatenation operation.
[0026] The expression of the frequency domain data embedding unit is:
[0027]
[0028] in, Represents the sequence X d Frequency domain embedding representation, E(Fred d ) d Embed, Fred d Represents the sequence X d The representation in the frequency domain is, Fred d Position embedding.
[0029] Furthermore, when the current number of layers of the self-attention layer of the time step is 1, the attention weight of the self-attention layer unit of the time step is expressed as:
[0030]
[0031] Among them, Tatt d Indicates H d The attention weight at the time step, H d Represents the frequency domain embedding vector of dimension d output by the frequency domain data embedding unit, 1≤d≤D, D represents the sequence X s The dimension of , layerNorm represents the normalization operation, MSA represents the multi-head self-attention mechanism of the self-attention layer unit of the time step, Indicates about H d The query vector of Indicates about H d The key vector of Indicates about H d The value vector of h = {1, 2, 3...H} represents the number of heads of multi-head attention. Respectively express about The weight parameter of ; among them, Indicates Tatt d Regarding the attention weight feature map after the feedforward layer and the normalization layer, Tatt all Representing the attention weight feature map of each dimension The feature map after splicing along the channel, Feedforward represents the feedforward network layer, and Concat represents the splicing operation.
[0032] Furthermore, the attention weight of the cross-dimensional channel attention layer unit is expressed as:
[0033] Fatt=softmax(W1ReLU(W2Tatt all )
[0034] wherein Fatt represents the attention weight of the channel of the cross-dimension channel attention layer, W1 and W2 are two full connection layers, softmax represents a softmax activation function, and ReLU represents a ReLU activation function.
[0035] Further, the difference between the model prediction value and the true value is measured using an MSE loss function:
[0036]
[0037] wherein L represents a loss function, represents the i-th true value, Y i represents the i-th model prediction value, and O represents the length of the prediction data.
[0038] The application further provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the reference crop evapotranspiration prediction method.
[0039] The application further provides an electronic device, which comprises a processor and a memory, the processor and the memory are connected to each other, the memory is used for storing a computer program, the computer program comprises computer readable instructions, the processor is configured to call the computer readable instructions, and the reference crop evapotranspiration prediction method is executed.
[0040] The application provides the technical scheme, and the beneficial effects are as follows:
[0041] The application provides a reference crop evapotranspiration prediction method, which transforms ET0 data of an irrigation area into a frequency domain by using discrete cosine transform, then embeds frequency domain data and position information into a vector, so that the attention layer can better discover the periodic characteristics of data and the relationship between variables, uses an attention layer on a time step and an attention layer across variables to sequentially model time-dependent characteristics in a single variable and relationship characteristics between multiple variables, and finally projects a feature map to obtain an ET0 prediction result of a target time step. The scheme can better extract periodic characteristics of data, and provides a method reference for applying a self-attention-based model to a reference crop evapotranspiration prediction task. BRIEF DESCRIPTION OF DRAWINGS
[0042] Figure 1 is a flowchart of the reference crop evapotranspiration prediction method of the embodiment of the application;
[0043] Figure 2 is a reference crop evapotranspiration prediction model structure diagram constructed by the embodiment of the application;
[0044] Figure 3: is a time domain diagram and a frequency domain diagram of the ETO data of the observation area from 2000 to 2016 according to an embodiment of the present invention, wherein: Figure 3 (a) is the time domain diagram, Figure 3 (b) is the frequency domain diagram;
[0045] Figure 4 This is a structural diagram of a seasonal cycle feature prediction module according to an embodiment of the present invention;
[0046] Figure 5 It is a block diagram of an electronic device in an exemplary embodiment of the present invention. DETAILED DESCRIPTION
[0047] To make the objectives, technical solutions and advantages of the present invention more clear, the embodiments of the present invention will be further described below with reference to the accompanying drawings.
[0048] The flowchart of the reference crop evapotranspiration prediction method according to the embodiment of the present invention is as follows: Figure 1 , specifically including the following steps:
[0049] S1. Obtain historical meteorological data for the irrigation area and calculate the historical reference crop evapotranspiration (ET0) based on the historical meteorological data. The reference crop evapotranspiration (ET0) is obtained by substituting the historical meteorological data into the Penman-Monteith formula officially proposed by the Food and Agriculture Organization of the United Nations (FAO). The calculation formula for ET0 is as follows:
[0050]
[0051] Among them, ET0 represents the historical reference crop evapotranspiration, unit: mm / day; Δ represents the slope of the saturated water vapor pressure curve, R n Indicates the net radiation on the crop surface, unit: MJ / (m 2 / day); G represents soil heat flux, unit: MJ / (m 2 / day); r represents the hygrometer constant, unit: kPa / ℃; T represents the daily average temperature at a height of 2 meters, unit: ℃; u2 represents the wind speed at a height of 2 meters, unit: m / s; e s Expressed as saturated water vapor pressure, unit: kPa; e a Indicates the actual water vapor pressure, unit: kPa.
[0052] S2. Determine the correlation between historical reference crop evapotranspiration and different meteorological factors using the Pearson correlation coefficient, where the meteorological factors include average air pressure, daily maximum temperature, daily minimum temperature, average wind speed, sunshine duration, and average relative humidity, and determine the top k meteorological factors that have the greatest impact on the historical reference crop evapotranspiration. Specifically, the embodiment of the present invention selects the meteorological factors that have the greatest impact on evapotranspiration as daily maximum temperature, daily minimum temperature, and sunshine duration.
[0053] Selecting appropriate predictors can not only reduce the dimensionality of the data and the amount of computation required for the model, but also improve the accuracy of the model's predictions. Pearson correlation can test the correlation between different variables. This test quantifies the statistically significant correlation or association between two continuous factors. It is considered an excellent method to measure the correlation between the parameters under study. Two variables can be positively or negatively correlated. If the correlation coefficient is equal to 0, the relationship between the two variables cannot be determined. This can determine the relationship between different meteorological factors and ET0 to determine the best input scheme. The Pearson correlation calculation formula is as follows:
[0054]
[0055] Among them, R(X,Y) represents the correlation between variables X and Y, X i represents the i-th observation value in variable X, represents the mean of variable X, Y i represents the i-th observation value in variable Y, represents the mean of the variable Y.
[0056] S3. Construct a reference crop evapotranspiration prediction model, refer to Figure 2 , Figure 2 This is a diagram of the reference crop evapotranspiration prediction model structure constructed in an embodiment of the present invention. The model consists of three modules: seasonal trend decomposition module, seasonal cycle feature prediction module, and long-term trend feature prediction module.
[0057] In combination with the characteristics of irrigation area data, the time series is divided into long-term trends and seasonal changes for separate predictions. This allows for the use of appropriate models based on the characteristics of the data. For monotonous long-term trend series, a multi-layer perceptron model is used for prediction; for complex seasonal cycle series, the series is transformed from the time domain to the frequency domain, and the proposed frequency domain enhanced dual self-attention based reference crop evaporation and transpiration is used for modeling and prediction. Figure 3 As shown, Figure 3 : is a time domain diagram and a frequency domain diagram of the ETO data of the observation area from 2000 to 2016 according to an embodiment of the present invention, wherein: Figure 3 (a) is the time domain diagram, Figure 3The middle (b) is a frequency domain graph. The main frequency of the ET0 data from 2000 to 2016 in the frequency domain is This shows that the ET0 data has strong annual periodicity, and the attention layer in the frequency domain can better discover the periodic characteristics of the data and the relationship between variables, and the self-attention layer in the time step and the self-attention layer across variables are introduced to model the time-dependent characteristics in the single variable and the relationship between multiple variables in turn, so as to make more accurate prediction.
[0058] The seasonal periodicity feature prediction module comprises a frequency domain data embedding unit, a time step self-attention layer unit, a cross-dimension channel attention layer unit, and a linear layer unit; the time step self-attention layer unit comprises a transformer encoder, the transformer encoder comprises a multi-head self-attention mechanism, a residual link and a layer normalization layer, a feedforward network and a residual link and a layer normalization layer, and reference is made to Figure 4 , Figure 4 is a structural diagram of the seasonal periodicity feature prediction module of the embodiment of the application. The cross-dimension channel attention layer unit comprises a channel attention mechanism.
[0059] The time series of the historical reference crop evapotranspiration and the first k meteorological factors having a greater correlation with the historical reference crop evapotranspiration are taken as the model input X, wherein X is in R L×D , L represents the length of the input data, D represents the total number of input variables, i represents a specific variable, and 0
[0060] In the embodiment of the application, before the input model, the data related to the specific prediction factor needs to be normalized in the range of [-3, 3] to eliminate variance, and the specific normalization formula is as follows:
[0061]
[0062] The processed data conforms to the standard normal distribution, that is, the mean is 0 and the standard deviation is 1. Wherein mu is the mean of all sample data, sigma is the standard deviation of all sample data, x represents an observed value, and x normalization is the normalized value.
[0063] The seasonal trend decomposition module decomposes the time series X input by the model into a seasonal periodicity sequence X s (X s ∈R L×D ) and a long-term trend sequence X t (X t ∈R L×D). The long-term trend describes the long-term trend of change in time series data, that is, the overall trend of the data over a longer time range. The seasonal cycle describes the recurring seasonal changes in time series data. It reflects the cyclical fluctuations of the data. The model uses a moving average to smooth out cyclical fluctuations. Specifically, the moving average pool is adjusted to smooth out cyclical fluctuations and highlight long-term trends. For an input sequence X∈R of length L L×D , the process is:
[0064] X t =Avgpool(Padding(X)),
[0065] X s =XX t .
[0066] Where L represents the length of sequence X and D represents the dimension of sequence X.
[0067] The seasonal cycle sequence X s Input the seasonal cycle feature prediction module to obtain the predicted seasonal cycle feature Y s ; The long-term trend sequence X t Input the long-term trend feature prediction module to obtain the predicted long-term trend feature Y t .
[0068] The purpose of the frequency domain data embedding unit is to transform the time domain sequence into the frequency domain so that the model can more easily discover the periodic characteristics of the data. The periodicity is reflected on the scale of years. For the seasonal periodic sequence X s ∈R L×D , split it into sequence segments by year: i represents the segment number in a single variable sequence, and d represents the variable dimension to which the segment belongs. For each segment, a discrete cosine transform is used to transform it into the frequency domain to obtain frequency domain data. The basic idea of the discrete cosine transform is to decompose the input signal into a set of cosine functions, and then calculate the product of each cosine function and the input signal within a certain time range to obtain the coefficients of each cosine function. These coefficients represent the energy of the input signal at the corresponding frequency, that is, the amplitude spectrum in the frequency domain. The specific formula is as follows:
[0069]
[0070] in, Represents a sequence segment The representation in the frequency domain is, Represents a sequence segment The discrete cosine transform of , d represents the dimension index, i represents the segment index, Represents X s The sequence segment with the d-th dimension index i, L represents the sequence X s Length, L s Indicates the length of the segment, n indicates the sample index within the segment, n=[0,1...L s -1], express The sample with index n in the sequence X is represented by D. s The total dimensions of Represents the cosine function, l represents the index of different frequency components, and ∪ represents the concatenation operation.
[0071] The expression of the frequency domain data embedding unit is:
[0072]
[0073] in, Represents the sequence X d Frequency domain embedding representation, E(Fred d ) d Embed, Fred d Represents the sequence X d The representation in the frequency domain is, Fred d Position embedding.
[0074] Finally, the periodic sequence X s The frequency domain embedding representations of all sequence segments are concatenated to obtain the periodic sequence X s The frequency domain embedding representation H is
[0075] After transforming the sequence from the time domain to the frequency domain, the model can more easily model the periodic characteristics of the data. First, we need to capture the impact of historical data on future data, that is, the relationship in time steps. The self-attention mechanism has an advantage in capturing long-term dependencies in time, so multi-head self-attention is used here to capture the periodic feature relationship in the time steps of frequency domain data in different years. Since there are n layers of attention layers in the time step, l represents the current number of layers. When l = 1, the input data is H. Use H d (1≤d≤D) represents the frequency domain embedding vector of all years in dimension d. Multi-head self-attention is then used to model the seasonal cycle sequence. The frequency domain embedding of the seasonal cycle sequence is input to the self-attention layer unit of the time step, and the attention weight of the self-attention layer unit of the time step is obtained, which is expressed as:
[0076]
[0077] Among them, Tatt d Indicates H d The attention weight at the time step, H dRepresents the frequency domain embedding vector of dimension d output by the frequency domain data embedding unit, 1≤d≤D, D represents the sequence X s The dimension of , layerNorm represents the normalization operation, MSA represents the multi-head self-attention mechanism of the self-attention layer unit of the time step, Indicates about H d The query vector of Indicates about H d The key vector of Indicates about H d The value vector of h = {1, 2, 3...H} represents the number of heads of multi-head attention. Respectively express about The multi-head model here adaptively weights the periodic feature relationships across different time steps in the frequency domain data. It does this by mapping the input sequence multiple times, generating an attention head for each mapping. Each attention head focuses on the periodic features of a different year, and then their weighted representations are fused to obtain a more comprehensive feature representation.
[0078] Then the attention weights Tatt on all dimensions d Integrated into Tatt all , The attention weight representing the periodic feature relationship of all dimensions at different time steps in different years is as follows:
[0079]
[0080] in, Indicates Tatt d Regarding the attention weight feature map after the feedforward layer and the normalization layer, Tatt all Representing the attention weight feature map of each dimension The feature map after splicing along the channel, Feedforward represents the feedforward network layer, and Concat represents the splicing operation.
[0081] When l>1, two adjacent vectors H in dimension d are 2i-1,d and H 21,d Merge to further capture richer periodic dependencies on time steps. The specific formula is as follows:
[0082]
[0083] Among them, l represents the current number of layers, “⊕” represents the connection operation, and M is the learnable matrix used for segment merging. Represents the sequence X of the l-1 layer s The frequency domain embedding representation of the 2i-1th sequence segment with dimension d, Xl-1denotes the sequence X of the (l-1)-th layer s The frequency domain embedding of the d-th dimension of the 2i-th sequence segment.
[0084] The attention weights of the self-attention layer unit of the time step are input into the cross-dimension channel attention layer unit to obtain the attention weights of the cross-dimension channel attention layer unit. Specifically, a channel attention is used to capture the relationship of different variables, and the channel here represents the features of different variables. For the feature map Tatt all , it is first sent into the first fully connected layer, which maps the input data to a lower dimensional space called the bottleneck representation, and then the bottleneck representation is sent into a nonlinear activation function to introduce a nonlinear transformation. The transformed bottleneck representation is sent into the second fully connected layer, which maps it back to the original space. The output of the second fully connected layer is then passed through a softmax operation to obtain the attention weights of each channel. The channel attention formula is as follows:
[0085] Fatt = softmax(W1 ReLU (W2 Tatt all )
[0086] Where Fatt represents the attention weights of the channels of the cross-dimension channel attention layer, W1 and W2 are two fully connected layers, softmax represents the softmax activation function, and ReLU represents the ReLU activation function.
[0087] The result of multiplying the attention weights of the cross-dimension channel attention layer unit and the output of the frequency domain data embedding unit is input into the linear layer unit, and the output Y s of the seasonal cycle feature prediction module is obtained through a flattening linear projection layer.
[0088] Y s = f (H Fatt)
[0089] Where H represents the output of the frequency domain data embedding unit, Y s ∈ R O×1 represents the predicted seasonal feature prediction sequence, and f represents the flattening linear projection layer.
[0090] The long-term trend feature prediction module includes a multi-layer perceptron, and the long-term trend sequence X t is input into the long-term trend feature prediction module to obtain the long-term trend sequence:
[0091] Y t = MLP (X t )
[0092] Where Y t ∈ R O×1Represents the long-term trend sequence for predicting ET0, O is the length of the sequence to be predicted, and the MLP layer is represented as follows: the input is a vector x, the weight matrix is W, the bias vector is b, and the activation function is σ, then the output y of this MLP layer can be expressed as follows:
[0093] y=σ(Wx+b)
[0094] For the MLP model with multiple layers, the output of each layer is used as the input of the next layer. This layer stacking method enables the MLP layer to better learn and represent long-term trend time series.
[0095] Y s and Y t The model output reference crop evapotranspiration prediction Y is obtained by splicing. The final prediction result is Y = Y s +Y t , Y∈R o×1 .
[0096] The MSE loss function is used to measure the difference between the model's predicted values and the true values, allowing for efficient model training and optimization. The goal is to minimize the MSE loss function by adjusting the model's parameters to minimize the difference between the predicted and true values. This allows the model to more accurately learn the patterns and features of the input data, thereby improving prediction performance.
[0097] The MSE loss function is expressed as:
[0098]
[0099] Where L represents the loss function, represents the i-th true value, Y i represents the predicted value of the i-th model, and O represents the length of the predicted data.
[0100] In an exemplary embodiment, a computer-readable storage medium is included, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the above-mentioned reference crop evapotranspiration prediction method is implemented.
[0101] See also Figure 5 In an exemplary embodiment, an electronic device is also included, including at least one processor, at least one memory, and at least one communication bus.
[0102] Wherein, a computer program is stored in the memory, and the computer program includes computer-readable instructions. The processor calls the computer-readable instructions stored in the memory through the communication bus to execute the above-mentioned reference crop evaporation and transpiration prediction method.
[0103] The foregoing description of the disclosed embodiments enables a person skilled in the art to make or use the application. Modifications of these embodiments will occur to persons of skill in the art, and that the appended claims are intended to cover all such modifications that do not depart from the true spirit and scope of the application. Therefore, the application is not limited to the embodiments shown but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A reference crop evapotranspiration prediction method, characterized in that: The following steps are involved: S1. Obtain historical meteorological data of the irrigation area and calculate historical reference crop evapotranspiration based on the historical meteorological data of the irrigation area; S2. Use the Pearson correlation coefficient to determine the correlation between historical reference crop evapotranspiration and different meteorological factors, and select the top k meteorological factors with the greatest correlation with historical reference crop evapotranspiration; S3. Build a reference crop evapotranspiration prediction model, which consists of three modules: seasonal trend decomposition module, seasonal cycle feature prediction module, and long-term trend feature prediction module; The seasonal cycle feature prediction module includes a frequency domain data embedding unit, a time-step self-attention layer unit, a cross-dimensional channel attention layer unit, and a linear layer unit; the time-step self-attention layer unit includes a transformer encoder, and the cross-dimensional channel attention layer unit includes a channel attention mechanism; The input of the seasonal cycle feature prediction module is input into the frequency domain data embedding unit after discrete cosine transformation. The input of the frequency domain data embedding unit also includes the position information of the input of the seasonal cycle feature prediction module after discrete cosine transformation. The output of the frequency domain data embedding unit is input into the time step self-attention layer unit. The output of the time step self-attention layer unit is input into the cross-dimensional channel attention layer unit. The output of the cross-dimensional channel attention layer unit and the output of the frequency domain data embedding unit are multiplied and input into the linear layer unit to obtain the output of the seasonal cycle feature prediction module. The long-term trend feature prediction module includes a multi-layer perceptron; The historical reference crop evapotranspiration and the time series of the top k meteorological factors with the greatest correlation with the historical reference crop evapotranspiration are used as the model input X; The seasonal trend decomposition module decomposes the time series of the model input into the seasonal cycle sequence X s and the long-term trend series X t ; The seasonal cycle sequence X s Input the seasonal cycle feature prediction module to obtain the predicted seasonal cycle feature Y s ; The long-term trend sequence X t Input the long-term trend feature prediction module to obtain the predicted long-term trend feature Y t ; Y s and Y t The model output reference crop evaporation and transpiration prediction Y is obtained by splicing.
2. A reference crop evapotranspiration prediction method according to claim 1, characterized in that: Meteorological factors include: average air pressure, daily maximum temperature, daily minimum temperature, average wind speed, sunshine duration and average relative humidity.
3. A reference crop evapotranspiration prediction method according to claim 1, characterized in that: The expression for historical reference crop evapotranspiration calculated based on historical meteorological data of the irrigation area is: Where ET0 represents the historical reference crop evapotranspiration, Δ represents the slope of the saturated water vapor pressure curve, and R n represents the net radiation on the crop surface, G represents the soil heat flux, r represents the hygrometer constant, T represents the daily average temperature at a height of 2 meters, u2 represents the wind speed at a height of 2 meters, and e s Expressed as saturated water vapor pressure, e a Indicates the actual water vapor pressure.
4. A reference crop evapotranspiration prediction method according to claim 1, characterized in that: The principle of the seasonal trend decomposition module is: X t =Avgpool(Padding(X)), X s =X-X t 。 5. The reference crop evapotranspiration prediction method according to claim 1, characterized in that: The discrete cosine transform is expressed as: in, Represents a sequence segment The representation in the frequency domain is, Represents a sequence segment The discrete cosine transform of , d represents the dimension index, i represents the segment index, Represents X s The sequence segment with the d-th dimension index i, 1≤d≤D, L represents the sequence X s Length, L s Indicates the length of the segment, n indicates the sample index within the segment, n=[0,1...L s -1], express The sample with index n in the sequence X is represented by D. s The total dimensions of Represents the cosine function, l represents the index of different frequency components, and ∪ represents the concatenation operation; The expression of the frequency domain data embedding unit is: in, Represents the sequence X d The frequency domain embedding representation, E(Fred d ) d Embed, Fred d Represents the sequence X d The representation in the frequency domain is, Fred d Position embedding.
6. A reference crop evapotranspiration prediction method according to claim 1, characterized in that: When the current number of layers of the self-attention layer of the time step is 1, the attention weight of the self-attention layer unit of the time step is expressed as: Among them, Tatt d Indicates H d The attention weight at the time step, H d Represents the frequency domain embedding vector of dimension d output by the frequency domain data embedding unit, 1≤d≤D, D represents the sequence X s The dimension of , layerNorm represents the normalization operation, MSA represents the multi-head self-attention mechanism of the self-attention layer unit of the time step, Indicates about H d The query vector of Indicates about H d The key vector of Indicates about H d The value vector of h = {1, 2, 3...H} represents the number of heads of multi-head attention. Respectively express about The weight parameter of Indicates Tatt d Attention weight feature map after the feedforward layer and normalization layer, Tatt all Representing the attention weight feature map of each dimension The feature map after splicing along the channel, Feedforward represents the feedforward network layer, and Concat represents the splicing operation.
7. A reference crop evapotranspiration prediction method according to claim 6, characterized in that: The attention weight of the cross-dimensional channel attention layer unit is expressed as: Fact=softmax(W1ReLU(W2Tatt all ), Among them, Fatt represents the attention weight of the channel of the cross-dimensional channel attention layer, W1 and W2 are two fully connected layers, softmax represents the softmax activation function, and ReLU represents the ReLU activation function.
8. A reference crop evapotranspiration prediction method according to claim 1, characterized in that: The MSE loss function is used to measure the difference between the model's predicted value and the true value: Where L represents the loss function, represents the i-th true value, Y i represents the predicted value of the i-th model, and O represents the length of the predicted data.
9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.
10. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the processor and the memory are interconnected, wherein the memory is used to store a computer program, the computer program includes computer-readable instructions, and the processor is configured to call the computer-readable instructions to execute the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Crop water demand prediction method and device, electronic equipment and storage medium
CN116306794A
Convolutional sparse self-attention-based irrigation area water demand estimation method, equipment and medium
CN118395108A