Wheat yield intelligent prediction method and system
By integrating multi-source data and using an improved Attention-LSTM-CNN model, the problems of single data and poor adaptability in traditional wheat yield prediction methods are solved, achieving high-precision full-cycle dynamic prediction, supporting real-time updates and reliable agricultural decision support.
Patent Information
- Application Number
- CN202511708003.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-20
- Publication Date
- 2026-03-03
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Traditional wheat yield forecasting methods rely on a single data source, making it difficult to capture nonlinear correlations, resulting in poor adaptability and an inability to achieve dynamic updates. This leads to large forecasting errors and fails to meet the needs of refined agricultural production management.
By employing multi-source data preprocessing and feature engineering, an Attention-LSTM-CNN deep learning model based on an improved attention mechanism is constructed. Combined with a dynamic prediction update mechanism, basic geographical, climate, soil, crop physiology, and agricultural management data are integrated to achieve high-precision full-cycle dynamic prediction of wheat yield.
It achieves high-precision, full-cycle dynamic prediction of wheat yield, supports real-time data updates, provides scientific basis for agricultural production decisions, is system-integrated and easy to operate, and has data security and reliability.
Smart Images

Figure CN121599205A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the intersection of agricultural information technology and artificial intelligence technology, and in particular to a method and system for intelligent prediction of wheat yield. Background Technology
[0002] Traditional wheat yield prediction methods mainly rely on manual field surveys, statistical regression analysis, and empirical models, which have the following limitations:
[0003] 1. Limited data dimensions: The data relies heavily on climate data (such as rainfall and temperature) or single-point field data, neglecting key influencing factors such as soil fertility, crop physiological indicators (such as leaf area index and chlorophyll content), and agricultural management measures (such as fertilizer application and irrigation frequency), resulting in incomplete input features for the prediction model.
[0004] 2. Poor model adaptability: Traditional statistical models (such as linear regression and ARIMA models) are difficult to capture the nonlinear relationship between wheat yield and multiple influencing factors, and are not robust enough to regional differences and annual climate anomalies, resulting in large prediction errors in complex agricultural scenarios.
[0005] 3. Lack of dynamic prediction capability: Most methods can only make a one-time yield estimate in the early stage of wheat maturity. They cannot dynamically update the prediction results based on real-time data during the growth cycle (such as the occurrence of diseases and pests, and changes in growth in the middle stage), which makes it difficult to meet the needs of refined management in agricultural production.
[0006] With the development of Internet of Things (IoT), remote sensing (RS), and deep learning technologies, the ability to acquire multi-source agricultural data has significantly improved, making it possible to build high-precision wheat yield prediction models. Currently, some machine learning-based prediction methods exist, but they still suffer from problems such as low data fusion efficiency, high dependence on training samples, and poor interpretability of prediction results. Therefore, this invention proposes an intelligent wheat yield prediction method and system that can integrate multi-source data, adaptively learn nonlinear features, and support dynamic updates to address the shortcomings of existing technologies. Summary of the Invention
[0007] The purpose of this invention is to provide a method and system for intelligent prediction of wheat yield. Through multi-source data preprocessing and feature engineering, construction of a deep learning model based on an improved attention mechanism, and design of a dynamic prediction update mechanism, it achieves high-precision, full-cycle dynamic prediction of wheat yield, providing a scientific basis for agricultural production decisions.
[0008] A method for intelligent wheat yield prediction includes the following steps:
[0009] S1: Multi-source data acquisition and preprocessing, collecting basic geographic data, climate data, soil data, crop physiological data, and agricultural management data, and performing missing value imputation, outlier handling, and data standardization on the multi-source data; wherein, for missing value imputation, continuous data uses linear interpolation based on time series, and discrete data uses mode imputation; outlier handling uses the 3σ principle to identify outliers and replaces outliers with the median of adjacent data; for data standardization, continuous data uses Z-score standardization, and discrete data uses one-hot encoding;
[0010] S2: Feature engineering and feature selection. Based on the preprocessed multi-source data, we construct climate accumulation features, soil fertility comprehensive index, and crop growth change features. Then, by combining random forest feature importance ranking and Pearson correlation coefficient screening, we retain the top 80% of features with the highest feature importance and an absolute value of Pearson correlation coefficient with wheat yield ≥0.3 to obtain the input feature set.
[0011] S3: Construct an Attention-LSTM-CNN deep learning prediction model based on an improved attention mechanism. The model includes an input layer, a CNN feature extraction layer, an LSTM temporal modeling layer, an attention layer, and a fully connected output layer. The input layer divides the input feature set into temporal feature sequences according to the wheat growth period. The CNN feature extraction layer extracts local spatial correlation features through two convolutional layers and one max pooling layer. The LSTM temporal modeling layer models the pooled features temporal features and updates the cell state and hidden state. The attention layer calculates the attention weights of the hidden state at each time step to obtain the global temporal feature vector. The fully connected output layer outputs the predicted wheat yield.
[0012] S4: Model training and optimization. The historical multi-source data is divided into training set, validation set and test set in a 7:2:1 ratio. The root mean square error (RMSE) is used as the loss function. The Adam optimizer is used for iterative parameter optimization. The initial learning rate is set to 1e-4 and decays to 0.8 times the original rate every 10 epochs. At the same time, an early stopping strategy is adopted. Training is stopped when the validation set loss no longer decreases for 5 consecutive epochs.
[0013] S5: Dynamic prediction and result output. Real-time multi-source data is collected at preset time intervals during the wheat growth cycle. Step S1 is repeated to obtain the real-time feature vector, which is then input into the trained model to update the time series feature sequence. The predicted value is recalculated to achieve dynamic update. When the predicted yield deviates from the historical average yield by more than ±5%, an early warning message is automatically generated.
[0014] Furthermore, the basic geographic data mentioned in step S1 includes the longitude, latitude, altitude, and soil type of the planting area; climate data includes the average daily temperature, average daily rainfall, average daily sunshine duration, and average daily relative humidity during the wheat growth cycle; soil data includes soil organic matter content, soil pH value, soil nitrogen, phosphorus, and potassium content, and soil moisture content; crop physiological data includes leaf area index (LAI), normalized difference vegetation index (NDVI), and relative chlorophyll content (SPAD value) during the wheat jointing, heading, and grain-filling stages; and agricultural management data includes sowing date, sowing density, fertilizer application rate, irrigation frequency and amount, and pest and disease occurrence level.
[0015] Furthermore, the climate accumulation characteristic mentioned in step S2 refers to the accumulated temperature of ≥10℃ during each growth stage of wheat, calculated using the following formula:
[0016]
[0017] Where t1 and t2 are the start and end times of a certain reproductive period, respectively, and T t The average daily temperature at time t; the formula for calculating the comprehensive soil fertility index is:
[0018]
[0019] Where OM represents soil organic matter content, N represents soil nitrogen content, P2O5 represents soil phosphorus pentoxide content, K2O represents soil potassium oxide content, and OM represents soil nitrogen content. max N max P2O 5max K2O max These are the maximum reference values for the corresponding indicators.
[0020] Furthermore, the hidden state update formula for the LSTM temporal modeling layer in step S3 is:
[0021] i l =σ(W xi Z l +W ih h l-1 +b i )
[0022] f l =σ(W xf Z l +W hf h l-1 +b f )
[0023] o l =σ(W xo Z l +W ho h l-1 +bo )
[0024]
[0025] h l =o l ☉tanh(c l )
[0026] Where l is the time step of the LSTM layer, i l f l o l Let be the activation values of the input gate, forget gate, and output gate, respectively; σ be the sigmoid activation function; tanh be the hyperbolic tangent activation function; ⊙ be the element-wise multiplication; and W be the activation value of the output gate. xi W hi b is the weight matrix i b f Equal to the bias term, c l In cellular state, h l For the hidden state, h0 is initialized as an all-zero vector.
[0027] Furthermore, the formula for calculating the attention weights of the attention layer in step S3 is as follows:
[0028] e l =v T tanh(W h h l +b h )
[0029]
[0030] Among them, v and W h b represents the weight parameters of the attention layer. h For the bias term, e l For attention score, α l h represents the normalized attention weights. att is the attention-weighted global temporal feature vector, and L is the time step of the LSTM layer.
[0031] A system for intelligent wheat yield prediction is characterized by comprising a data acquisition module, a data storage module, a data preprocessing module, a model calculation module, a prediction output and early warning module, and a system communication module.
[0032] The data acquisition module consists of an IoT sensor, a remote sensing device, a manual input terminal, and a data transmission unit. The IoT sensor collects climate and soil data, the remote sensing device acquires crop physiological data, the manual input terminal inputs agricultural management data, and the data transmission unit uses 4G / 5G or LoRa technology to transmit data.
[0033] The data storage module adopts a distributed database architecture, including the InfluxDB time-series database for storing dynamic time-series data, the MySQL relational database for storing static data, and the HDFS file storage system for storing large files. It also has a built-in off-site disaster recovery mechanism that combines scheduled full backups and real-time incremental backups.
[0034] The data preprocessing module is deployed on a Docker containerized cloud computing node and includes a missing value filling unit for performing missing value filling, an outlier handling unit for handling outliers, a standardization unit for implementing data standardization, and a feature engineering unit for completing feature engineering.
[0035] The model computation module is built on an NVIDIA A100 GPU server cluster and includes a model building unit that provides a model visualization interface, a model training unit that performs model training, a model evaluation unit that evaluates model performance, and a dynamic prediction unit that enables dynamic prediction.
[0036] The prediction output and early warning module includes a visual interactive interface that supports access from multiple terminals and an early warning unit with configurable thresholds.
[0037] The system communication module uses the gRPC protocol to achieve inter-module communication, LoRa and 4G / 5G protocols to achieve communication with external devices, RESTful API interfaces to achieve external system integration, and token authentication and HTTPS protocol to ensure data security.
[0038] Furthermore, the model evaluation unit of the model calculation module uses the mean absolute error (MAE) and the coefficient of determination (R²). 2 The generalization performance of the model is evaluated using the following formulas:
[0039]
[0040] Where n is the number of samples, y i Let i be the actual output of the i-th sample. To predict production, The average of actual output; and the model performance is classified as excellent. good qualified Three levels.
[0041] Furthermore, the visualization interface of the prediction output and early warning module includes four display formats: predicted yield table, yield trend line graph, feature attention heatmap, and data dashboard; the RESTful API interface of the system communication module supports connection with agricultural production management system, grain supply chain scheduling system, and government agricultural supervision platform to achieve two-way data interaction.
[0042] The beneficial effects of this invention are as follows:
[0043] 1. More comprehensive data integration: Breaking through the limitations of traditional methods with their single data dimension, it integrates multi-source data from basic geography, climate, soil, crop physiology, and agricultural management, covering the core factors affecting wheat yield and laying a data foundation for accurate prediction.
[0044] 2. More accurate model prediction: The Attention-LSTM-CNN model, which integrates an improved attention mechanism, can extract local spatial features of the data and capture temporal correlations. It also highlights the contribution of key reproductive periods and features. The model's adaptability and prediction accuracy are better than traditional statistical models and single machine learning models.
[0045] 3. Supports dynamic forecasting: Breaking away from the "one-time forecasting" model, it can dynamically update forecast results based on real-time collected data throughout the entire wheat growth cycle, helping users to grasp yield change trends in a timely manner and providing a basis for adjusting mid-term agricultural management measures.
[0046] 4. Enhanced practicality: The system integrates full-process functions, features a simple visual interactive interface, supports multi-terminal access, and can be used without a professional technical background; it also provides standardized interfaces that can be integrated with existing agricultural systems, reducing application costs.
[0047] 5. Data security and reliability: Distributed storage and off-site disaster recovery mechanisms are used to ensure data security. Module communication and data transmission are protected by encryption and authentication. Model training combines overfitting prevention and generalization performance verification to ensure stable and reliable prediction results. Attached Figure Description
[0048] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0049] Figure 1 This is a flowchart of the multi-source data processing of the present invention;
[0050] Figure 2 This is a flowchart of the full-cycle dynamic prediction process of the present invention;
[0051] Figure 3 This is a flowchart of the system modules of the present invention. Detailed Implementation
[0052] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.
[0053] A method for intelligent wheat yield prediction, the method comprising the following steps:
[0054] Step S1: Multi-source data acquisition and preprocessing
[0055] Collect multi-source data affecting wheat yield, including:
[0056] Basic geographic data: longitude, latitude, altitude, and soil type (sandy soil / clay soil / loam) of the planting area;
[0057] Climate data: Daily average temperature (°C), daily average rainfall (mm), daily average sunshine duration (h), and daily average relative humidity (%) during the wheat growing season;
[0058] Soil data: Soil organic matter content (g / kg), soil pH value, soil nitrogen, phosphorus and potassium content (N: mg / kg, P2O5: mg / kg, K2O: mg / kg), soil moisture content (%);
[0059] Crop physiological data: Leaf area index (LAI), normalized difference vegetation index (NDVI), and relative chlorophyll content (SPAD value) of wheat at the jointing, heading, and grain-filling stages were obtained through remote sensing equipment.
[0060] Agricultural management data: sowing date, sowing density (plants / m²) 2 Fertilizer application rate (N / P / K: kg / hm) 2 ), number of irrigations and irrigation volume (m) 3 / hm 2 ), Pest and disease occurrence level (0-5, 0 for no pests and diseases, 5 for severe pests and diseases).
[0061] Preprocessing of the collected multi-source data includes:
[0062] 1. Missing value imputation: For continuous data (such as temperature, rainfall, and soil nitrogen content), a time-series-based linear interpolation method is used for imputation, as shown in the following formula:
[0063]
[0064] Among them, t i t represents the time point corresponding to the missing data. i-1t i+1 These are the valid time nodes before and after the missing node, x i-1 x i+1 t i-1 t i+1 The corresponding valid data, x i The missing data is filled in; for discrete data (such as soil type, pest and disease level), the mode imputation method is used, and the value with the highest frequency in the feature column is selected as the imputation value for the missing value.
[0065] 2. Outlier Handling: Outliers are identified using the 3σ principle, meaning that data values exceeding the range [μ-3σ, μ+3σ] are considered outliers (where μ is the data mean and σ is the data standard deviation). Outliers are replaced by the median of adjacent data points, as shown in the following formula:
[0066] x 异常 =median(x 异常 -2,x 异常-1 ,x 异常 +1,x 异常 +2)
[0067] Where, x 异常 For the identified anomalous data, x 异常-2 x 异常-1 x 异常 +1、x 异常 +2 represents the two adjacent valid data points before and after the outlier, and median() is the median calculation function.
[0068] 3. Data Standardization: To eliminate the differences in units of measurement between different dimensions of data, Z-score standardization is applied to the preprocessed continuous data. The formula is as follows:
[0069]
[0070] Where x is the original data, μ is the mean of the feature column, and σ is the standard deviation of the feature column; discrete data (such as soil type, pest and disease level) are converted into binary vectors using one-hot encoding.
[0071] Step S2: Feature Engineering and Feature Selection
[0072] 1. Feature Construction: Based on the preprocessed multi-source data, derived features with physical meaning are constructed, including:
[0073] Accumulated climate characteristics: cumulative temperature (≥10℃ accumulated temperature), cumulative rainfall, and cumulative sunshine duration for each growth stage of wheat (sowing-emergence stage, tillering stage, jointing stage, heading stage, grain-filling stage, and maturity stage). The formula for calculating cumulative temperature is as follows:
[0074]
[0075] Where t1 and t2 are the start and end times of a certain reproductive period, respectively, and T t Let be the average daily temperature over time t;
[0076] Comprehensive Soil Fertility Index: A comprehensive soil fertility index is constructed by combining soil organic matter content and nitrogen, phosphorus, and potassium content. The formula is:
[0077]
[0078] Where OM represents soil organic matter content, N represents soil nitrogen content, P2O5 represents soil phosphorus pentoxide content, K2O represents soil potassium oxide content, and OM represents soil nitrogen content. max N max P2O 5max K2O max These are the maximum reference values for the corresponding indicators.
[0079] Crop growth characteristics: The differences in NDVI and LAI between adjacent growth stages of wheat are calculated to reflect the dynamic changes in crop growth. The formula is as follows:
[0080] ΔNDVI=NDVI 后期 -NDVI 前期
[0081] ΔLAI=LAI 后期 -LAI 前期
[0082] 2. Feature Selection: A method combining tree-based feature importance ranking and Pearson correlation coefficient screening is used to remove redundant and noisy features. Specific steps are as follows:
[0083] Construct a Random Forest model and calculate the importance score (I) of each feature for yield prediction. f , keep I f The characteristics of the top 80%;
[0084] The Pearson correlation coefficient r between the retained characteristics and wheat yield is calculated using the following formula:
[0085]
[0086] Where n is the number of samples, x is the sample value of a certain feature, and y is the actual wheat yield of the corresponding sample; features with |r|≥0.3 are retained, and the input feature set F={f1,f2,...,fm} for model training is finally obtained (m is the number of features).
[0087] Step S3: Construction of a deep learning prediction model based on an improved attention mechanism
[0088] An improved attention model (Attention-LSTM-CNN) integrating LSTM (Long Short-Term Memory) and CNN (Convolutional Neural Network) is constructed for wheat yield prediction. The model structure includes an input layer, a CNN feature extraction layer, an LSTM temporal modeling layer, an attention layer, and a fully connected output layer, as detailed below:
[0089] 1. Input Layer: The input feature set F obtained in step S2 is divided into a time-series feature sequence X = {X1, X2, ..., X...} according to the wheat growth period. T}, where T is the time step of the wheat growth period (e.g., divided by weeks, T=24, corresponding to a 24-week wheat growth cycle), Xt∈R m (t=1,2,...,T) is the eigenvector at time step t.
[0090] 2. CNN Feature Extraction Layer: This layer uses two convolutional layers and one max-pooling layer to extract local spatial correlation features from the feature sequence. Let the first convolutional layer have C1 kernels, a kernel size of k1×m (k1 is the kernel size in the time dimension), use ReLU activation, and output a feature map Y1∈R. C1×(T-k1+1) The calculation process is as follows:
[0091]
[0092] Where c1 = 1, 2, ..., C1, t1 = 1, 2, ..., T-k1+1, W1 is the kernel weight of the first convolutional layer, and b1 is the bias term; the second convolutional layer has C2 kernels, a kernel size of k2×C1, and outputs a feature map Y2∈R. C2 ×(T-k1-k2+2) The max-pooling layer has a pooling kernel size of p×1 and outputs pooling features. in This is the floor function.
[0093] 3. LSTM Temporal Modeling Layer: Transforms the pooling feature Ypool into a temporal input sequence Z = {Z1, Z2, ..., Zn}. L (L is the number of time steps in the LSTM layer) The input is fed into an LSTM layer for temporal feature modeling. The hidden state update formula for the LSTM layer is as follows:
[0094] i l =σ(W xi Z l +W hi h l-1 +b i )
[0095] f l =σ(W xf Z l +W hf h l-1 +b f )
[0096] o l =σ(W xo Z l +W ho h l-1 +b o )
[0097]
[0098] h l =o l ☉tanh(c l )
[0099] Where l is the time step of the LSTM layer, i l f l o l Let be the activation values of the input gate, forget gate, and output gate, respectively; σ be the sigmoid activation function; tanh be the hyperbolic tangent activation function; ⊙ be the element-wise multiplication; and W be the activation value of the output gate. xi W hi b is the weight matrix i b f Equal to the bias term, c l In cellular state, h l For the hidden state, h0 is initialized as an all-zero vector.
[0100] 4. Attention Layer: The formula for calculating attention weights is:
[0101] e l =v T tanh(W h h l +b h )
[0102]
[0103] Among them, v and W h b represents the weight parameters of the attention layer. h For the bias term, e l For attention score, α l h represents the normalized attention weights. att is the attention-weighted global temporal feature vector, and L is the time step of the LSTM layer.
[0104] 5. Fully connected output layer: This layer outputs the h from the attention layer. att The input is fed into two fully connected layers, and the final output is the predicted wheat yield. The calculation process is as follows:
[0105] h fcl =ReLU(W fc1 h att +b fc1 )
[0106]
[0107] Among them, W fc1 W fc2 Let b be the weight matrix of the fully connected layer. fc1 b fc2 For the bias term, h fc1 This is the output of the first fully connected layer.
[0108] Step S4: Model Training and Optimization
[0109] 1. Dataset partitioning: The historical multi-source data (including the actual wheat yield of the corresponding year) is divided into training set, validation set and test set in a ratio of 7:2:1. The training set is used for model parameter fitting, the validation set is used for model hyperparameter tuning, and the test set is used for model generalization performance evaluation.
[0110] 2. Loss function definition: The root mean square error (RMSE) is used as the loss function for the model.
[0111] 3. Optimizer selection and training: The Adam optimizer is used to iteratively optimize the model parameters. The initial learning rate is set to 1e-4, and the learning rate decay strategy is to decay to 0.8 times the original value every 10 epochs (training rounds). During training, an early stopping strategy is adopted. When the validation set loss no longer decreases for 5 consecutive epochs, training is stopped to avoid model overfitting.
[0112] Step S5: Dynamic Prediction and Result Output
[0113] 1. Real-time data update: During the wheat growth cycle, the latest multi-source data (such as weekly climate data and crop NDVI data) is collected at preset time intervals (such as weekly), and the preprocessing process of step S1 is repeated to obtain real-time feature vectors.
[0114] 2. Dynamic prediction update: The real-time feature vector is input into the trained Attention-LSTM-CNN model to update the temporal feature sequence X, and the attention weights and yield prediction values are recalculated to achieve dynamic update prediction of wheat yield; at the same time, the time node, input features and prediction results of each prediction are recorded to form a prediction log.
[0115] 3. Results Output and Visualization: The prediction results are output in the form of tables, line graphs (showing the trend of predicted yield over time), and heatmaps (showing the attention weight distribution of each feature), and can be viewed in real time on terminal devices (such as computers and mobile phones). When the deviation between the predicted yield and the historical average yield exceeds a preset threshold (such as ±5%), an early warning message is automatically generated to remind users to pay attention to abnormal influencing factors (such as pests and diseases, extreme weather).
[0116] (II) Wheat Yield Intelligent Forecasting System
[0117] To implement the above-mentioned intelligent wheat yield prediction method, the present invention also provides an intelligent wheat yield prediction system, the system comprising:
[0118] Data acquisition module: Composed of multi-source data acquisition devices and data transmission unit. The multi-source data acquisition devices include IoT sensors (such as temperature sensors, soil moisture sensors, nitrogen, phosphorus and potassium sensors), remote sensing devices (such as multispectral cameras carried by drones), and manual input terminals (for inputting agricultural management data). The data transmission unit uses 4G / 5G or LoRa wireless communication technology to transmit the acquired multi-source data to the data storage module in real time.
[0119] Data storage module: adopts distributed architecture
[0120] It employs a distributed database architecture, including a time-series database (InfluxDB), a relational database (MySQL), and a file storage system (HDFS), each used to store different types of multi-source data.
[0121] Time-series database: Stores dynamic data with timestamp characteristics, such as daily average climate data during the wheat growth cycle, real-time monitoring data of soil moisture content, and crop NDVI time-series data. It supports fast querying by time range and data compression storage, with a compression ratio of 1:10 to 1:20, reducing storage costs.
[0122] Relational databases store static or semi-static data, such as basic geographic data of planting areas (longitude, latitude, soil type), basic agricultural management data (sowing density, fertilizer type), and historical wheat yield data. They use a master-slave replication architecture to ensure data reliability, with the master database responsible for writing data and the slave database responsible for reading data, thus avoiding single points of failure.
[0123] File storage system: Stores original remote sensing image files (such as UAV multispectral image TIFF files), intermediate parameter files during model training, and visualization charts of prediction results. It supports distributed storage and parallel access of large-scale files, with a maximum single file size of over 100GB, meeting the storage requirements of high-resolution remote sensing data.
[0124] Meanwhile, the data storage module has a built-in data backup and recovery mechanism, which combines scheduled full backup (daily at 2:00 AM) with real-time incremental backup (incremental logs are generated synchronously when data is written). The backup data is stored in an off-site disaster recovery center. When local data is damaged or lost, it can be restored within 1 hour through the backup data, ensuring data security.
[0125] Data preprocessing module: Deployed on a cloud computing node (using Docker containerization, supporting elastic scaling), used to perform multi-source data preprocessing in step S1 and feature engineering operations in step S2 of the aforementioned method, specifically including:
[0126] Missing value imputation unit: Built-in linear interpolation algorithm and mode imputation algorithm, which can automatically select the corresponding imputation strategy according to the type of input data (continuous / discrete), with a processing efficiency of up to 100,000 records / second, and supports batch data import and real-time streaming data processing;
[0127] Outlier processing unit: Implements the 3σ principle outlier identification algorithm and median replacement algorithm. The outlier judgment threshold can be configured (default 3σ, supports user-defined 2.5σ or 3.5σ), and generates outlier processing logs, recording the original value, replacement value and processing time of the outlier data;
[0128] Data standardization unit: Integrates Z-score standardization algorithm and one-hot encoding algorithm, supports simultaneous standardization of multi-dimensional features, outputs standardized feature matrix, matrix format supports CSV, JSON and TensorFlow TFRecord format, which is convenient for subsequent model calls;
[0129] Feature Engineering Unit: Includes feature construction subunit and feature selection subunit. The feature construction subunit can automatically calculate cumulative climate features (such as accumulated temperature ≥10℃), comprehensive soil fertility index, and crop growth change features. During the calculation process, users can input soil reference indicators for the planting area (such as OMmax, Nmax). The feature selection subunit has built-in random forest feature importance calculation algorithm and Pearson correlation coefficient calculation algorithm. It can filter features according to the retention ratio (default 80%) and correlation coefficient threshold (default |r|≥0.3) set by the user and output the final input feature set.
[0130] Model computation module: Built on a GPU server cluster (using NVIDIA A100 GPUs, with a single node computing power of 312 TFLOPS), it is used to perform model construction in step S3, model training in step S4, and dynamic prediction in step S5 of the aforementioned method, specifically including:
[0131] Model Building Unit: Provides a visual interface for building the Attention-LSTM-CNN model, allowing users to configure model hyperparameters, such as the number of convolutional kernels in the CNN layers (C1 default 32, C2 default 64), convolutional kernel size (k1 default 3, k2 default 2), pooling kernel size (p default 2), the number of hidden units in the LSTM layers (default 128), the number of layers (default 2), the number of heads in the attention layer (default 4), and the number of neurons in the fully connected layer (default 64). After user configuration, the system automatically generates the model structure file (.h5 format) and the model configuration file (.json format).
[0132] Model training unit: Supports importing historical datasets (formats include CSV and TFRecord), automatically divides the training set, validation set, and test set in a 7:2:1 ratio (user-defined division ratio is supported), has a built-in Adam optimizer (supports configuration of initial learning rate and decay strategy), RMSE loss function, displays the change curves of training set loss and validation set loss in real time during training, automatically stops training when the early stopping strategy is triggered (default is that the validation set loss does not decrease for 5 consecutive epochs), and outputs the trained model weight file (.ckpt format);
[0133] Model Evaluation Unit: This unit evaluates the generalization performance of the trained model using a test set, calculating the model's RMSE, mean absolute error (MAE), and coefficient of determination (R²). 2 The evaluation indicators are calculated using the following formulas:
[0134]
[0135] Where n is the number of samples, y i Let i be the actual output of the i-th sample. To predict production, The average of actual output; and the model performance is classified as excellent. good qualified Three levels.
[0136] Dynamic prediction unit: Supports real-time reception of feature vectors output by the data preprocessing module, automatic updates of time-series feature sequence X, calls the trained model to predict output, prediction response time ≤ 1 second, and records the timestamp of each prediction, input feature vector, predicted output value, attention weight distribution, and generates prediction logs, which can be exported as Excel or PDF format.
[0137] Predictive output and early warning module: Consists of a visual interactive interface and early warning units, supporting access from multiple terminals (web interface on PC, APP on mobile phone, and mini-program on tablet):
[0138] System communication module: Responsible for data transmission between modules and interface with external systems, employing multiple communication protocols to ensure the real-time performance and reliability of data transmission.
[0139] Inter-module communication: The gRPC protocol is used to realize high-speed data transmission between the data preprocessing module, model calculation module, and prediction output module. The transmission rate can reach more than 100Mbps, and data compression and streaming transmission are supported to reduce network bandwidth usage.
[0140] External device communication: Supports communication with IoT sensors and drone remote sensing devices. It uses the LoRa protocol (transmission distance up to 1-10km) to receive real-time sensor data and the 4G / 5G protocol to receive drone remote sensing image data. It supports an automatic reconnection mechanism. When communication is interrupted, the device caches data and automatically retransmits it after the connection is restored.
[0141] External System Integration: Provides a standardized API (RESTful API) interface to support integration with agricultural production management systems, grain supply chain scheduling systems, and government agricultural supervision platforms. It can push forecast results data and early warning information data to external systems, and can also receive query requests from external systems (such as querying historical wheat yield forecast data for a certain region and year). The API interface supports identity authentication (Token authentication) and data encryption (HTTPS protocol) to ensure data transmission security.
[0142] In summary, this invention solves the problems of limited data, poor model adaptability, and lack of dynamic prediction in traditional methods, achieving high-precision full-cycle prediction and providing scientific support for agricultural decision-making.
[0143] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for intelligent prediction of wheat yield, characterized in that, Includes the following steps: S1: Multi-source data acquisition and preprocessing, collecting basic geographic data, climate data, soil data, crop physiological data, and agricultural management data, and performing missing value imputation, outlier handling, and data standardization on the multi-source data; wherein, for missing value imputation, continuous data uses linear interpolation based on time series, and discrete data uses mode imputation; outlier handling uses the 3σ principle to identify outliers and replaces outliers with the median of adjacent data; for data standardization, continuous data uses Z-score standardization, and discrete data uses one-hot encoding; S2: Feature engineering and feature selection. Based on the preprocessed multi-source data, we construct climate accumulation features, soil fertility comprehensive index, and crop growth change features. Then, by combining random forest feature importance ranking and Pearson correlation coefficient screening, we retain the top 80% of features with the highest feature importance and an absolute value of Pearson correlation coefficient with wheat yield ≥0.3 to obtain the input feature set. S3: Construct an Attention-LSTM-CNN deep learning prediction model based on an improved attention mechanism. The model includes an input layer, a CNN feature extraction layer, an LSTM temporal modeling layer, an attention layer, and a fully connected output layer. The input layer divides the input feature set into temporal feature sequences according to the wheat growth period. The CNN feature extraction layer extracts local spatial correlation features through two convolutional layers and one max pooling layer. The LSTM temporal modeling layer models the pooled features temporal features and updates the cell state and hidden state. The attention layer calculates the attention weights of the hidden state at each time step to obtain the global temporal feature vector. The fully connected output layer outputs the predicted wheat yield. S4: Model training and optimization. The historical multi-source data is divided into training set, validation set and test set in a 7:2:1 ratio. The root mean square error (RMSE) is used as the loss function. The Adam optimizer is used for iterative parameter optimization. The initial learning rate is set to 1e-4 and decays to 0.8 times the original rate every 10 epochs. At the same time, an early stopping strategy is adopted. Training is stopped when the validation set loss no longer decreases for 5 consecutive epochs. S5: Dynamic prediction and result output. Real-time multi-source data is collected at preset time intervals during the wheat growth cycle. Step S1 is repeated to obtain the real-time feature vector, which is then input into the trained model to update the time series feature sequence. The predicted value is recalculated to achieve dynamic update. When the predicted yield deviates from the historical average yield by more than ±5%, an early warning message is automatically generated.
2. The intelligent wheat yield prediction method according to claim 1, characterized in that: The basic geographic data mentioned in step S1 includes the longitude, latitude, altitude, and soil type of the planting area; climate data includes the average daily temperature, average daily rainfall, average daily sunshine duration, and average daily relative humidity during the wheat growth cycle; soil data includes soil organic matter content, soil pH value, soil nitrogen, phosphorus, and potassium content, and soil moisture content; crop physiological data includes leaf area index (LAI), normalized difference vegetation index (NDVI), and relative chlorophyll content (SPAD value) during the wheat jointing, heading, and grain-filling stages; and agricultural management data includes sowing date, sowing density, fertilizer application rate, irrigation frequency and amount, and pest and disease occurrence level.
3. The intelligent wheat yield prediction method according to claim 1, characterized in that, The climate accumulation characteristic mentioned in step S2 refers to the accumulated temperature of ≥10℃ during each growth stage of wheat, calculated using the following formula: Where t1 and t2 are the start and end times of a certain reproductive period, respectively, and T t The average daily temperature at time t; the formula for calculating the comprehensive soil fertility index is: Where OM represents soil organic matter content, N represents soil nitrogen content, P2O5 represents soil phosphorus pentoxide content, K2O represents soil potassium oxide content, and OM represents soil nitrogen content. max N max P2O 5max K2O max These are the maximum reference values for the corresponding indicators.
4. The intelligent wheat yield prediction method according to claim 1, characterized in that, The hidden state update formula for the LSTM temporal modeling layer in step S3 is: i l =σ(W xi Z l +W hi h l-1 +b i ) f l =σ(W xf Z l +W hf h l-1 +b f ) about l =σ(W xo WITH l +W ho h l-1 +b o ) h l =o l ☉tanh(c l ) Where l is the time step of the LSTM layer, i l f l o l Let be the activation values of the input gate, forget gate, and output gate, respectively; σ be the sigmoid activation function; tanh be the hyperbolic tangent activation function; ⊙ be the element-wise multiplication; and W be the activation value of the output gate. xi W hi b is the weight matrix i b f Equal to the bias term, c l In cellular state, h l For the hidden state, h0 is initialized as an all-zero vector.
5. The intelligent wheat yield prediction method according to claim 1, characterized in that, The formula for calculating the attention weights of the attention layer in step S3 is as follows: e l =υ T tanh(W h h l +b h ) Among them, v and W h b represents the weight parameters of the attention layer. h For the bias term, e l For attention score, α l h represents the normalized attention weights. att is the attention-weighted global temporal feature vector, and L is the time step of the LSTM layer.
6. A system for implementing the intelligent wheat yield prediction method according to any one of claims 1-5, characterized in that, It includes a data acquisition module, a data storage module, a data preprocessing module, a model calculation module, a prediction output and early warning module, and a system communication module; The data acquisition module consists of an IoT sensor, a remote sensing device, a manual input terminal, and a data transmission unit. The IoT sensor collects climate and soil data, the remote sensing device acquires crop physiological data, the manual input terminal inputs agricultural management data, and the data transmission unit uses 4G / 5G or LoRa technology to transmit data. The data storage module adopts a distributed database architecture, including the InfluxDB time-series database for storing dynamic time-series data, the MySQL relational database for storing static data, and the HDFS file storage system for storing large files. It also has a built-in off-site disaster recovery mechanism that combines scheduled full backups and real-time incremental backups. The data preprocessing module is deployed on a Docker containerized cloud computing node and includes a missing value filling unit for performing missing value filling, an outlier handling unit for handling outliers, a standardization unit for implementing data standardization, and a feature engineering unit for completing feature engineering. The model computation module is built on an NVIDIA A100 GPU server cluster and includes a model building unit that provides a model visualization interface, a model training unit that performs model training, a model evaluation unit that evaluates model performance, and a dynamic prediction unit that enables dynamic prediction. The prediction output and early warning module includes a visual interactive interface that supports access from multiple terminals and an early warning unit with configurable thresholds. The system communication module uses the gRPC protocol to achieve inter-module communication, LoRa and 4G / 5G protocols to achieve communication with external devices, RESTful API interfaces to achieve external system integration, and token authentication and HTTPS protocol to ensure data security.
7. The intelligent wheat yield prediction system according to claim 6, characterized in that, The model evaluation unit of the model calculation module uses the mean absolute error (MAE) and the coefficient of determination (R²). 2 The generalization performance of the model is evaluated using the following formulas: Where n is the number of samples, y i Let i be the actual output of the i-th sample. To predict production, The average of actual output; and the model performance is classified as excellent. good qualified Three levels.
8. The intelligent wheat yield prediction system according to claim 6, characterized in that, The visualization interface of the prediction output and early warning module includes four display formats: predicted yield table, yield trend line chart, feature attention heatmap, and data dashboard; the RESTful API interface of the system communication module supports connection with agricultural production management system, grain supply chain scheduling system, and government agricultural supervision platform to achieve two-way data interaction.
Citation Information
Cited By
Tobacco planting soil fertility monitoring and early warning method based on multi-level data
CN121808277A
Field crop yield estimation method based on fusion of multi-time-sequence remote sensing data and machine learning
CN121999373A
Multi-temporal remote sensing data and machine learning fusion method for estimating yield of field crops
CN121999373B
Crop yield parameter inversion method and system based on mechanism constraint and data driving cooperation
CN122451428A