Large-area adaptive crop yield prediction method and system based on attention mechanism

By introducing a time-feature attention network into the crop yield prediction model, the problem of difficulty in capturing spatial heterogeneity is solved, and more accurate crop yield prediction and better generalization performance are achieved.

CN118070951BActive Publication Date: 2025-06-06INST OF COMPUTING TECH CHINESE ACAD OF SCI
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410145423.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-02-01
Publication Date
2025-06-06
Estimated Expiration
2044-02-01

AI Technical Summary

Technical Problem

Existing crop yield prediction models are difficult to effectively capture spatial heterogeneity, resulting in large fluctuations in yield predictions in different regions and weak spatial and temporal mobility.

Method used

Using a time-feature attention network model based on attention mechanism, the spatial heterogeneity of crop growth over a large range is adaptively learned by simultaneously calculating the differences in contributions of different influencing factors and growth cycles to yield.

Benefits of technology

It improves the accuracy of crop yield prediction, can better capture the impact of different regions and influencing factors on yield, reduces the dependence of manual intervention, and improves the generalization performance of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118070951B_ABST
    Figure CN118070951B_ABST
Patent Text Reader

Abstract

The present invention proposes a large-area adaptive crop yield prediction method and system based on an attention mechanism, comprising: acquiring crop time series data, the crop time series data being growth environment data corresponding to each time point; constructing a crop yield prediction model comprising a long short-term memory layer, a time attention layer, a feature attention layer and a fully connected layer; inputting the crop time series data into the long short-term memory layer to obtain a two-dimensional feature matrix of crop growth, inputting the two-dimensional feature matrix of crop growth into the time attention layer and the feature attention layer along the time dimension and the feature dimension respectively, weighting the two-dimensional feature matrix of crop growth, and sending the weighted matrix into the fully connected layer to obtain predicted yield; constructing a loss function according to the predicted yield and the actual yield to train the crop yield prediction model, so that the feature attention layer learns the difference in the weight of the influence of environmental factors on crop yield; inputting the crop time series data to be predicted into the crop yield prediction model after training to obtain a crop yield prediction result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of crop yield prediction, and in particular to a large-area adaptive yield prediction method and system based on an attention mechanism. Background Art

[0002] Existing crop yield prediction technologies mainly include the following three categories:

[0003] (1) Crop yield prediction models based on crop mechanisms. Mechanistic models (or process models) for crop yield estimation predict crop yields based on a biophysical understanding of crop growth and development processes. These models use data from climate, soil, and crop management practices to simulate crop growth processes and thus predict crop yields. Because of the need to simulate each stage of crop growth and the various environmental factors that affect crop growth in detail, such models are usually very complex, require strong assumptions about management, and incur a large computational overhead.

[0004] (2) Crop yield prediction model based on traditional statistical machine learning. Unlike mechanism models, statistical machine learning models mainly rely on historical data and statistical algorithms to predict crop yield. They are usually easier to implement and applicable to large-scale data sets. For example, support vector regression (SVR) and random forest model (RF), traditional machine learning models are modeled based on data features and perform far better than mechanism models in crop yield prediction tasks. However, traditional machine learning usually relies on manual feature engineering, which means that expertise is required to determine and create features that may affect crop yield. This process can be very time-consuming and easy to miss important features. Secondly, traditional machine learning has difficulty capturing complex nonlinear relationships and processing high-dimensional data.

[0005] (3) Crop yield prediction model based on deep learning. In recent years, with the development of deep learning, more and more scholars have applied deep learning methods to the field of crop yield estimation and achieved remarkable results. The application of deep learning was initially based on artificial neural networks, using climate, soil and management practice data to predict corn yields, and compared with the multivariate linear regression model. The results showed that the artificial neural network was significantly better than the multivariate linear regression model. The existing technology introduces convolutional neural networks (CNN) and recurrent neural networks (RNN). CNN is used to learn the pattern information of multidimensional data, and RNN is used to capture the time dependency of sequential data. They evaluated the model on the county-level soybean yield prediction task, and the evaluation results were significantly better than other methods. The reason why the introduction of deep learning can effectively improve the accuracy of crop yield estimation is that deep learning can autonomously learn from data and extract high-dimensional deep crop growth characteristics. Therefore, it can better reveal the complex nonlinear relationship between crop yield and its spatiotemporal characteristics, and establish a long-term and dynamically changing spatiotemporal relationship between crop yield and its influencing factors. However, with the wider application of deep learning in the field of crop yield estimation, people have found that although these deep learning models have achieved certain results in the task of crop yield estimation, the crop growth models established by these research institutes are all global regression models, that is, all these models have already assumed in advance that the complex relationship between crop yield and explanatory variables is spatially constant and not affected by location. However, the present invention knows that in real life, this complex relationship between yield and explanatory variables may vary greatly in space, especially for large-scale crop yield estimation, because it is always affected by the environment (such as topography, soil type, altitude) and human factors (such as farming habits, agricultural management) in spatial heterogeneity. That is, spatial heterogeneity: spatial heterogeneity refers to the differences in crop yield estimation in different regions due to the influence of the environment (such as topography, soil type, altitude) and human factors (such as farming habits, agricultural management). There are large fluctuations in crop yield predictions in different regions, and weak spatiotemporal migration. Specifically, different regions refer to different contributions of different growth cycles of crops to the final yield. For example, in region A, the growth characteristics of crops during the germination period may have the greatest impact on the final yield; however, in region B, the growth characteristics of crops during the growth period may have the greatest impact on the final yield.

[0006] In recent years, the phenomenon that explanatory variables have different effects on model prediction of yield in space, namely spatial heterogeneity, has attracted more and more attention. Studies have shown that considering the spatial heterogeneity of crop growth in crop yield prediction tasks can effectively improve the accuracy of yield prediction.

[0007] There are two main existing methods for studying spatial heterogeneity:

[0008] (1) Establishing models by region. This method assumes that within each divided region, the relationship between the model output variable and the input variable is fixed and is a high-dimensional complex function that is independent of the location within the region. For example, a yield prediction model was established in each of multiple wheat-growing areas. The phenological alignment method uses crop phenological time series to adjust the growth cycle of each region for crop yield prediction. Multi-task learning is introduced to learn yield predictions in different regions as writing tasks. These spatial heterogeneity learning methods rely heavily on complex manual intervention (artificial geographic divisions). However, it is challenging to obtain very accurate geographic divisions over a large area, and the separation of limited data sets makes it difficult to train and achieve generalization performance of the model.

[0009] (2) A model that uses the attention mechanism to adaptively calculate spatial differences has been proposed to avoid human intervention. Using the attention mechanism, a temporal attention network model is designed to adaptively learn the changes in crop growth cycles in different regions. The difference in the contribution of crop growth cycles to final yields in different regions is directly reflected in the difference in cycle attention values. The method of using the attention mechanism to allow the model to adaptively learn and calculate the spatial heterogeneity of crop growth modeling from data successfully avoids interference from human factors and has good generalization performance.

[0010] However, the method of using attention mechanism to calculate spatial heterogeneity still has defects. The temporal attention network is used to learn the changes in the cumulative growth of crops in different regions, that is, the difference in the contribution of different growth time periods to the final yield. However, they all overlooked a more important characteristic of spatial heterogeneity, that is, the spatial heterogeneity of crop growth is not only the change in the cumulative growth of crops in different regions, but also the difference in the contribution of different influencing factors, that is, the explanatory variables, to yield. This kind of explanatory variable is more common and important for the spatial heterogeneity of the different effects of the model on predicting yield in space. Summary of the invention

[0011] The purpose of this invention is to solve the problem of spatial heterogeneity in the yield prediction task by simultaneously introducing temporal attention and feature attention networks to adaptively calculate and learn the spatial heterogeneity of crop growth over a large area.

[0012] The present invention proposes a large-area adaptive crop yield prediction method based on attention mechanism, comprising:

[0013] Step 1: Obtain a plurality of crop time series data with actual yields marked, where the crop time series data is the growth environment data corresponding to each time point; construct a crop yield prediction model including a long short-term memory layer, a temporal attention layer, a feature attention layer, and a fully connected layer;

[0014] Step 2: Input the crop time series data into the long short-term memory layer to obtain a two-dimensional feature matrix of crop growth; split the two-dimensional feature matrix of crop growth along the time dimension to obtain the growth features corresponding to each time point; split the two-dimensional feature matrix of crop growth along the feature dimension to obtain the time series features corresponding to each feature;

[0015] Step 3: Input the growth features corresponding to each time point into the time attention layer, multiply the weights of each time point in the crop time series data by the two-dimensional feature matrix of crop growth to obtain a first matrix; input the time series features corresponding to each feature into the feature attention layer, multiply the weights of each feature in the crop time series data by the two-dimensional feature matrix of crop growth to obtain a second matrix; concatenate the first matrix and the second matrix and send them into the fully connected layer to obtain the predicted yield; construct a loss function based on the predicted yield and the actual yield to train the crop yield prediction model, so that the feature attention layer learns the differences in the weights of the impact of environmental factors in different regions on crop yield;

[0016] Step 4: Input the crop time series data to be predicted into the trained crop yield prediction model to obtain the crop yield prediction result.

[0017] The large-area adaptive crop yield prediction method based on the attention mechanism, the growth environment data includes weather data and soil data.

[0018] The large-area adaptive crop yield prediction method based on the attention mechanism, the crop yield prediction model also includes a convolutional layer CNN; step 3 includes inputting the time series features corresponding to each feature into the convolutional layer CNN to extract the time pattern, obtaining the frequency domain features of each feature, inputting the frequency domain features into the feature attention layer, and obtaining the weights of each feature in the crop time series data.

[0019] In the large-area adaptive crop yield prediction method based on the attention mechanism, the multiple crop time series data with actual yields marked are crop time series data of the same crop in different regions, and the crop category of the crop time series data to be predicted is the same as the crop category of the crop time series data with actual yields marked.

[0020] The present invention also proposes a large-area adaptive crop yield prediction system based on an attention mechanism, comprising:

[0021] The initial module is used to obtain multiple crop time series data with actual yields marked, which are the growth environment data corresponding to each time point; and to construct a crop yield prediction model including a long short-term memory layer, a temporal attention layer, a feature attention layer, and a fully connected layer;

[0022] A splitting module is used to input the crop time series data into the long short-term memory layer to obtain a two-dimensional feature matrix of crop growth, split the two-dimensional feature matrix of crop growth along the time dimension to obtain growth features corresponding to each time point; split the two-dimensional feature matrix of crop growth along the feature dimension to obtain time series features corresponding to each feature;

[0023] A training module is used to input the growth features corresponding to each time point into the time attention layer, multiply the weight of each time point in the crop time series data by the two-dimensional feature matrix of crop growth to obtain a first matrix; input the time series features corresponding to each feature into the feature attention layer, multiply the weight of each feature in the crop time series data by the two-dimensional feature matrix of crop growth to obtain a second matrix; concatenate the first matrix and the second matrix and send them into the fully connected layer to obtain the predicted yield; construct a loss function based on the predicted yield and the actual yield to train the crop yield prediction model, so that the feature attention layer learns the differences in the weights of the impact of environmental factors in different regions on crop yield;

[0024] The prediction module is used to input the crop time series data to be predicted into the trained crop yield prediction model to obtain the crop yield prediction result.

[0025] The large-area adaptive crop yield prediction system based on the attention mechanism, the growth environment data includes weather data and soil data.

[0026] The large-area adaptive crop yield prediction system based on the attention mechanism, the crop yield prediction model also includes a convolutional layer CNN; the training module is used to input the time series features corresponding to each feature into the convolutional layer CNN to extract the time pattern, obtain the frequency domain features of each feature, input the frequency domain features into the feature attention layer, and obtain the weights of each feature in the crop time series data.

[0027] In the large-area adaptive crop yield prediction system based on the attention mechanism, the multiple crop time series data with actual yields marked are crop time series data of the same crop in different regions, and the crop category of the crop time series data to be predicted is the same as the crop category of the crop time series data with actual yields marked.

[0028] The present invention also proposes a server, including the large-area adaptive crop yield prediction device based on the attention mechanism.

[0029] The present invention also proposes a storage medium for storing a computer program of the large-area adaptive crop yield prediction method based on the attention mechanism.

[0030] It can be seen from the above scheme that the advantages of the present invention are:

[0031] The present invention is to take into account the increase in soybean yield due to genetic improvement and improved agricultural management. The present invention considers two types of methods: (a) a single-year method that only uses the features of year t to predict the yield of the same year t, and (b) a five-year method that uses the features of a five-year sequence (year {t-4, t-3, …, t}) to estimate the yield in year t. The present invention collects a dataset of the average annual soybean yield from 1980 to 2018, and trains and estimates on this dataset. The present invention compares the proposed model with the most advanced deep learning model. The model of the present invention is significantly better than other models in three commonly used accuracy evaluation indicators RMSE, R2, and Corr (the smaller the RMSE, the larger the R2 and Corr, the better the model prediction performance). The comparison results are as follows Figure 4 shown. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] Figure 1 It is a flow chart of the present invention;

[0033] Figure 2 It is the weather information map in the input data;

[0034] Figure 3 It is the soil information map in the input data;

[0035] Figure 4 This is a comparison diagram of the technical effects of the present invention. DETAILED DESCRIPTION

[0036] The main contribution of the present invention is to introduce a feature attention network and propose a time-feature attention network model for crop yield estimation. By simultaneously calculating the difference in the contribution of different influencing factors to the final yield and the difference in the contribution of different growth cycles to the yield, the attention network can adaptively learn the spatial heterogeneity of crop growth in a large range. The present invention embeds the spatial heterogeneity of influencing factors into a deep learning model for a large-scale crop yield prediction task for the first time. In order to evaluate the performance of the model, the present invention trains and estimates the average annual yield of soybeans from 1980 to 2018. The model performance is evaluated by using three indicators: corr, R2, and RMSE. The present invention also applies convolutional neural networks (CNN), CNN-RNN networks, DACM (time attention networks), and Transformer models to the same data set for comparison. The effects are better than existing models.

[0037] In order to make the above features and effects of the present invention more clearly and understandably described, embodiments are given below and described in detail with reference to the accompanying drawings. This specification discloses one or more embodiments that include the features of the present invention. The disclosed embodiments are only for illustration. The scope of protection of the present invention is not limited to the disclosed embodiments, and the present invention is defined by the attached claims.

[0038] The method of the present invention is shown in FIG. Figure 1 As shown. Use the time + feature attention network to adaptively learn the spatial heterogeneity of crop growth. The method of the present invention is divided into three stages:

[0039] (1) Crop growth feature extraction stage.

[0040] The input data of the model is Figure 2 and Figure 3 As shown in the figure, it includes seven types of weather data and eleven types of soil data. The weather data are recorded in units of time with a spatial resolution of 1km. 2 Each soil data includes values ​​at 6 different soil depths (0-5cm, 5-15cm, 15-30cm, 30-60cm, 60-100cm, 100-200cm) with a resolution of 250m 2 .

[0041] In the model of the present invention, a long short-term memory network (LSTM) is used to extract crop growth characteristics. LSTM is an artificial neural network structure for processing sequence data, which solves the long-term dependency problem in recurrent neural networks (RNNs). By introducing three key gating mechanisms: forget gate, input gate, and output gate, LSTM is able to retain long-term dependency information in the state and selectively pass it to the next time step or update it to new information. This makes the LSTM network perform well in many sequence modeling tasks.

[0042] At this stage, the LSTM network is trained to learn key features of the crop growth process to help predict the final yield of the crop. The LSTM network captures the temporal dynamics and patterns of crop growth by processing time series data during crop growth, such as variables such as temperature, precipitation, and soil moisture. By learning from historical data, the LSTM network is able to extract features that are closely related to crop growth, such as high-dimensional features such as crop growth rate and seasonal trends. These features may include seasonal trends, growth rates, responses to environmental factors, and other temporal patterns that reflect crop performance.

[0043] In the present invention, the LSTM network is used to extract crop growth characteristics (crop growth two-dimensional feature matrix), the horizontal axis of which can be time, and the vertical axis can be growth environment data, that is, the crop growth two-dimensional feature matrix is ​​the growth environment characteristics corresponding to each time point.

[0044] Specifically, 52 weeks of input data are passed through the LSTM network to generate 52 weeks of hidden vector features. The 52 hidden vectors represent the crop growth characteristics at 52 time points. The input data is the environmental data of the same crop in different regions, such as the environmental data and soybean yield of 1,115 soybean counties in 13 states in the United States.

[0045] Specifically, 52 weeks of input data share one LSTM. There are 52 weeks in a year, and 52 is the sequence length of the input data. In LSTM, the time dimension refers to the sequence length of the input data, that is, the number of time steps. LSTM is designed to process sequence data, where each time step corresponds to a data point in the sequence. In deep learning, three-dimensional tensors are usually used to represent sequence data. For LSTM, the dimensions of this three-dimensional tensor are usually (batch_size, time_steps, input_features), where: batch_size represents the number of samples in each training batch; time_steps represents the length of the sequence, that is, the number of time steps; input_features represents the number of features input at each time step. For example, if you have a text sequence, each time step represents a word, and each word is represented by a vector, then input_features is the dimension of the word vector.

[0046] (2) Heterogeneous learning stage

[0047] This stage mainly Figure 1 The Attention block 1 and Attention block 2 in the graph are composed of the Attention block 1 and Attention block 2. Attention block 1 is the temporal attention module. It directly acts on the growth features extracted by the 52 LSTMs and assigns a weight to the extracted growth features at each time point, indicating the contribution of the growth features at that time to the final yield. A total of 52 weights are generated.

[0048] Attentionblock2 is the feature attention module. The traditional attention mechanism selects information at each time step to help generate the output, but it cannot capture the temporal pattern across multiple time steps. Therefore, the present invention proposes to use a set of filter CNN networks to extract temporal patterns, similar to converting time series data to its "frequency domain" to obtain frequency domain features. Then, we propose a new attention mechanism to select relevant time series and use its frequency domain information for prediction. Figure 1 As shown, the data H11, H12, ..., Hmk input to Attentionblock2 are the frequency domain features generated by the CNN network, and the CNN network acts on the two-dimensional feature matrix of crop growth generated by the LSTM network.

[0049] For example, crude oil prices have a large impact on gasoline prices, but a smaller impact on lumber prices. To predict the value of gasoline, the machine must learn to focus on "crude oil" and ignore "lumber". In our Attentionblock2 feature attention, machine learning selects relevant time series instead of selecting relevant time steps as in the typical attention mechanism Attention block1. In addition, time series data often contain obvious periodic temporal patterns, which are crucial for prediction, however, typical attention mechanisms usually only focus on a few time steps and have difficulty identifying periodic patterns spanning multiple time steps. In our attention, we introduce a convolutional neural network (CNN) to extract temporal pattern information from each individual variable. This is a new concept of attention that selects relevant variables instead of relevant time steps.

[0050] This stage is mainly about studying the spatial heterogeneity of crop growth, which is divided into two parts:

[0051] ① Temporal Attention Module:

[0052] The temporal attention network is used to weight and focus on important time steps or moments in time series data. It allows the network to focus on time points that have a greater impact on the task or problem, thereby improving the performance and effect of the model. The network learns weights to determine the importance of each time step in the time series. These weights can be adaptively adjusted according to task requirements, allowing the network to better focus on and utilize time points that are critical to the task. Figure 1 b represents the learned weight of each time step, b1+b2+...+bt=1. The weight b learned by the time attention module through the attention mechanism represents the relative importance of each time point in the input sequence. Multiplying these weights with the original time series features can make the model focus more on time points with high weights, thereby strengthening the influence of these key features. Therefore, in the model of the present invention, Attention block1 aims to identify the spatial heterogeneity of the contribution of different growth cycles in different regions to soybean yield.

[0053] Attentionblock1 is a temporal attention module, and its output b1, b2, ..., bt weights are dynamically learned based on the input data. Therefore, after the model is trained, the values ​​and distributions of b1, b2, ..., bt are different for different regions, so the different weight values ​​in different regions reflect the differences between different regions, that is, the spatial heterogeneity.

[0054] ②Feature Attention Module:

[0055] Feature Attention Networks are used to focus on or highlight specific features in a data sequence. It enables the network to selectively emphasize or weighted consideration of features that are considered critical to the task. The network learns to assign attention or importance to different elements in the sequence. This attention mechanism enables the network to capture and utilize meaningful elements that are relevant to the task at hand. For example, to predict the value of gasoline, the machine must learn to focus on "Crude Oil" and ignore "Wood". In this attention network, instead of selecting relevant time steps as a typical temporal attention mechanism does, the model learns to select relevant influential features.

[0056] The a in the figure learns the weight of each influencing factor, a1+a2+...+am=1. Multiplying these weights by the features can make the model focus more on the features with high weights, thereby strengthening the influence of these key features. And because different regions are affected by different environments, this module can also identify spatial heterogeneity. For example, in warm areas, crop growth may be more sensitive to changes in soil conditions, while in cold areas it may be more sensitive to changes in climatic conditions such as temperature; even under the same climatic conditions, due to differences in geographical location, altitude, etc., the degree of response of crop growth in different regions to climate change may vary. Therefore, the weights a1, a2,..., am learned by Attentionblock2 are the weights of these influencing factors. The values ​​and distributions of a1, a2,..., am generated by different regions are different, reflecting the spatial differences, that is, learning spatial heterogeneity.

[0057] In this model, Attentionblock2 is used to learn the spatial heterogeneity of the contribution of different influencing factors to soybean yield in different regions.

[0058] (3) Production forecast stage

[0059] In stage 2, feature v1 with time weight and feature v2 with impact factor weight are generated respectively. The two extracted features are merged and then calculated through a fully connected layer to obtain the predicted yield value output.

[0060] The following is a system embodiment corresponding to the above method embodiment. This embodiment can be implemented in conjunction with the above embodiment. The relevant technical details mentioned in the above embodiment are still valid in this embodiment. In order to reduce repetition, they are not repeated here. Accordingly, the relevant technical details mentioned in this embodiment can also be applied in the above embodiment.

[0061] The present invention also proposes a large-area adaptive crop yield prediction system based on an attention mechanism, comprising:

[0062] The initial module is used to obtain multiple crop time series data with actual yields marked, which are the growth environment data corresponding to each time point; and to construct a crop yield prediction model including a long short-term memory layer, a temporal attention layer, a feature attention layer, and a fully connected layer;

[0063] A splitting module is used to input the crop time series data into the long short-term memory layer to obtain a two-dimensional feature matrix of crop growth, split the two-dimensional feature matrix of crop growth along the time dimension to obtain growth features corresponding to each time point; split the two-dimensional feature matrix of crop growth along the feature dimension to obtain time series features corresponding to each feature;

[0064] A training module is used to input the growth features corresponding to each time point into the time attention layer, multiply the weight of each time point in the crop time series data by the two-dimensional feature matrix of crop growth to obtain a first matrix; input the time series features corresponding to each feature into the feature attention layer, multiply the weight of each feature in the crop time series data by the two-dimensional feature matrix of crop growth to obtain a second matrix; concatenate the first matrix and the second matrix and send them into the fully connected layer to obtain the predicted yield; construct a loss function based on the predicted yield and the actual yield to train the crop yield prediction model, so that the feature attention layer learns the differences in the weights of the impact of environmental factors in different regions on crop yield;

[0065] The prediction module is used to input the crop time series data to be predicted into the trained crop yield prediction model to obtain the crop yield prediction result.

[0066] The large-area adaptive crop yield prediction system based on the attention mechanism, the growth environment data includes weather data and soil data.

[0067] The large-area adaptive crop yield prediction system based on the attention mechanism, the crop yield prediction model also includes a convolutional layer CNN; the training module is used to input the time series features corresponding to each feature into the convolutional layer CNN to extract the time pattern, obtain the frequency domain features of each feature, input the frequency domain features into the feature attention layer, and obtain the weights of each feature in the crop time series data.

[0068] In the large-area adaptive crop yield prediction system based on the attention mechanism, the multiple crop time series data with actual yields marked are crop time series data of the same crop in different regions, and the crop category of the crop time series data to be predicted is the same as the crop category of the crop time series data with actual yields marked.

[0069] The present invention also proposes a server, including the large-area adaptive crop yield prediction device based on the attention mechanism.

[0070] The present invention also proposes a storage medium for storing a computer program of the large-area adaptive crop yield prediction method based on the attention mechanism.

[0071] Although the embodiments of the present invention have been disclosed as above, they are not limited to the applications listed in the specification and the implementation modes, and they can be fully applied to various fields suitable for the present invention. For those familiar with the art, additional modifications can be easily implemented. Therefore, without departing from the general concept defined by the claims and the scope of equivalents, the present invention is not limited to the specific details and the illustrations shown and described herein.

Claims

1. A large-area adaptive crop yield prediction method based on attention mechanism, characterized in that: include: Step 1, obtaining a plurality of crop time series data with actual yields marked, the plurality of crop time series data with actual yields marked are crop time series data of the same crop in different regions, and the crop category of the crop time series data to be predicted is the same as the crop category of the crop time series data with actual yields marked, and the crop time series data is the growth environment data corresponding to each time point; constructing a crop yield prediction model including a long short-term memory layer, a temporal attention layer, a feature attention layer and a fully connected layer; Step 2: Input the crop time series data into the long short-term memory layer to obtain a two-dimensional feature matrix of crop growth, and split the two-dimensional feature matrix of crop growth along the time dimension to obtain the growth characteristics corresponding to each time point; The crop growth two-dimensional feature matrix is ​​split along the feature dimension to obtain the time series features corresponding to each feature; Step 3: Input the growth features corresponding to each time point into the time attention layer, multiply the weights of each time point in the crop time series data by the two-dimensional feature matrix of crop growth to obtain a first matrix; input the time series features corresponding to each feature into the feature attention layer, multiply the weights of each feature in the crop time series data by the two-dimensional feature matrix of crop growth to obtain a second matrix; concatenate the first matrix and the second matrix and send them into the fully connected layer to obtain the predicted yield; construct a loss function based on the predicted yield and the actual yield to train the crop yield prediction model, so that the feature attention layer learns the differences in the weights of the impact of environmental factors in different regions on crop yield; Step 4: Input the crop time series data to be predicted into the trained crop yield prediction model to obtain the crop yield prediction result.

2. The large-area adaptive crop yield prediction method based on attention mechanism as claimed in claim 1, characterized in that: The growing environment data includes weather data and soil data.

3. The large-area adaptive crop yield prediction method based on attention mechanism as claimed in claim 1, characterized in that: The crop yield prediction model also includes a convolution layer; step 3 includes inputting the time series features corresponding to each feature into the convolution layer to extract the time pattern, obtaining the frequency domain features of each feature, inputting the frequency domain features into the feature attention layer, and obtaining the weights of each feature in the crop time series data.

4. A large-area adaptive crop yield prediction system based on attention mechanism, characterized in that: include: An initial module is used to obtain a plurality of crop time series data with actual yields marked, wherein the plurality of crop time series data with actual yields marked are crop time series data of the same crop in different regions, and the crop category of the crop time series data to be predicted is the same as the crop category of the crop time series data with actual yields marked, and the crop time series data are growth environment data corresponding to each time point; and construct a crop yield prediction model including a long short-term memory layer, a temporal attention layer, a feature attention layer, and a fully connected layer; A splitting module is used to input the crop time series data into the long short-term memory layer to obtain a two-dimensional feature matrix of crop growth, and split the two-dimensional feature matrix of crop growth along the time dimension to obtain growth characteristics corresponding to each time point; The crop growth two-dimensional feature matrix is ​​split along the feature dimension to obtain the time series features corresponding to each feature; A training module is used to input the growth features corresponding to each time point into the time attention layer, multiply the weight of each time point in the crop time series data by the two-dimensional feature matrix of crop growth to obtain a first matrix; input the time series features corresponding to each feature into the feature attention layer, multiply the weight of each feature in the crop time series data by the two-dimensional feature matrix of crop growth to obtain a second matrix; concatenate the first matrix and the second matrix and send them into the fully connected layer to obtain the predicted yield; construct a loss function based on the predicted yield and the actual yield to train the crop yield prediction model, so that the feature attention layer learns the differences in the weights of the impact of environmental factors in different regions on crop yield; The prediction module is used to input the crop time series data to be predicted into the trained crop yield prediction model to obtain the crop yield prediction result.

5. The large-area adaptive crop yield prediction system based on attention mechanism as claimed in claim 4, characterized in that: The growing environment data includes weather data and soil data.

6. The large-area adaptive crop yield prediction system based on attention mechanism as claimed in claim 4, characterized in that: The crop yield prediction model also includes a convolution layer; the training module is used to input the time series features corresponding to each feature into the convolution layer to extract the time pattern, obtain the frequency domain features of each feature, input the frequency domain features into the feature attention layer, and obtain the weights of each feature in the crop time series data.

7. A server, characterized in that: A large-area adaptive crop yield prediction system based on the attention mechanism as described in any one of claims 4-6.

8. A storage medium comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the large-area adaptive crop yield prediction method based on the attention mechanism described in any one of claims 1 to 3 are implemented.

Citation Information

Patent Citations

  • An agricultural yield prediction method based on meteorological information

    CN109886496A

  • Cotton yield prediction method of neural network based on attention mechanism

    CN115861254A