A method, system, device and storage medium for predicting the photosynthetic rate of greenhouse grapes
Through the multi-model fusion method, combined with the advantages of multiple machine learning models, the accuracy and robustness of the existing photosynthetic rate prediction methods under complex environmental conditions are solved, and more efficient photosynthetic rate prediction is achieved.
Patent Information
- Application Number
- CN202510271840.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-10
- Publication Date
- 2025-05-30
- Estimated Expiration
- 2045-03-10
AI Technical Summary
The existing photosynthetic rate prediction methods are difficult to cope with complex and variable environmental conditions, the prediction accuracy is insufficient, and the model is poorly robust.
The multi-model fusion method is adopted to input the multi-dimensional data features of the facility grape production environment into the multi-model fusion model. The model includes a base learner group and a meta-learner, which is integrated through grid search optimization K nearest neighbor model, Kalman filter optimization Gaussian process regression model, long and short-term memory network model, support vector machine and extreme gradient enhancement tree model.
The photosynthetic rate prediction accuracy is significantly improved, the robustness and adaptability of the model are enhanced, and the problem of insufficient adaptability of a single model in complex data scenarios is reduced.
Smart Images

Figure CN119760668B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of artificial intelligence and agricultural technology, and particularly to a method, system, device and storage medium for predicting the photosynthetic rate of greenhouse grapes. Background Art
[0002] The photosynthetic rate of greenhouse grapes is an important indicator for measuring the growth status and yield of grapes. Accurately predicting the photosynthetic rate in real time is of great significance for optimizing cultivation management and improving resource utilization efficiency. However, most of the existing photosynthetic rate prediction methods rely on a single model, making it difficult to cope with complex and variable environmental conditions, and there are problems such as insufficient prediction accuracy and poor model robustness.
[0003] At present, the application of various machine learning algorithms in the field of photosynthetic rate prediction is gradually increasing, including support vector machine (SVM), long short-term memory network (LSTM), Gaussian process regression (GPR), etc. However, single models generally have problems such as single input feature selection and insufficient capture of non-linear and time-series characteristics. Summary of the Invention
[0004] Based on the technical problems existing in the background art, the present invention proposes a method, system, device and storage medium for predicting the photosynthetic rate of greenhouse grapes, which improves the prediction accuracy of the photosynthetic rate.
[0005] The method, system, device and storage medium for predicting the photosynthetic rate of greenhouse grapes proposed by the present invention include:
[0006] Input the multi-dimensional data features of the greenhouse grape production environment into a multi-model fusion model, where the multi-model fusion model includes a base learner group and a meta-learner. The grid search optimized K-nearest neighbor model, the Kalman filter optimized Gaussian process regression model, the long short-term memory network model, and the support vector machine are used as base learners to form the base learner group, and the extreme gradient boosting tree model is used as the meta-learner;
[0007] Each base learner in the base learner group outputs a temporary photosynthetic rate prediction value;
[0008] Taking the superposition of all temporary photosynthetic rate prediction values as the input of the meta-learner, so as to output the final photosynthetic rate prediction value.
[0009] Furthermore, the multi-model fusion model fuses the base learner and the meta-learner through the stacking Stacking framework. The training process of the multi-model fusion model is as follows:
[0010] S1. Obtain the multi-dimensional data features of the greenhouse grape production environment to construct an original data set, and the multi-dimensional data features include temperature, relative humidity, photosynthetically active radiation, and CO 2 concentration;
[0011] S2. Perform K-fold cross-validation on the current base learner in the base learner group based on the original dataset, average and combine the obtained K prediction sets to construct a dataset;
[0012] S3. Take the next base learner in the base learner group as the current base learner and loop step S2 until all base learners are traversed, thereby constructing M datasets, where M is the total number of base learners;
[0013] S4. Vertically merge the M datasets and input them into the meta-learner for training and prediction to obtain the photosynthetic rate prediction result.
[0014] Furthermore, the construction process of the grid search optimized K-nearest neighbor model is as follows:
[0015] Divide the obtained first dataset into a first training set and a first test set;
[0016] Determine the basic structure of the K-nearest neighbor model, the relevant parameters for hyperparameter optimization, and define the cross-validation strategy;
[0017] Perform hyperparameter optimization on the first training set: traverse each hyperparameter combination in the hyperparameter search grid, evaluate the performance of each group of hyperparameters through the cross-validation strategy, and select the optimal hyperparameter combination;
[0018] Train the K-nearest neighbor model using the optimal hyperparameter combination, verify the performance of the K-nearest neighbor model on the first test set, and use the verified K-nearest neighbor model as the grid search optimized K-nearest neighbor model.
[0019] Furthermore, the construction process of the Kalman filter optimized Gaussian process regression model is as follows:
[0020] Divide the obtained second dataset into a second training set and a second test set;
[0021] Use the Kalman filter to smooth the second training set to obtain the state prediction result and the covariance prediction result;
[0022] Use the second training set to optimize the kernel function hyperparameters of the Gaussian process regression model;
[0023] Take the state prediction result and the covariance prediction result as the input of the optimized Gaussian process regression model for non-parametric regression modeling;
[0024] Use the Gaussian process regression model after non-parametric regression modeling as the Kalman filter optimized Gaussian process regression model.
[0025] Furthermore, the calculation formulas for the state prediction result and the covariance prediction result are as follows:
[0026] ;
[0027] ;
[0028] wherein, is the time step, is the current time step the predicted photosynthetic rate, is the previous time step the estimated value of the photosynthetic rate, is the state transition matrix, is the transpose of is the control matrix, is the multi-dimensional data feature vector at the current time step, is the current time step the covariance matrix of the state prediction, is the previous time step the covariance matrix of the state estimation, is the process noise covariance matrix.
[0029] Furthermore, during the training process of each base learner in the base learner group, there is an implicit crossover in the data preprocessing stage of the Stacking framework, specifically:
[0030] The original data set is smoothed using Kalman filtering, and the obtained state prediction value is used as the input feature of the Kalman filter optimized Gaussian process regression model, and is also shared as the input feature to the long short-term memory network model;
[0031] The local neighborhood features extracted by the grid search optimized K-nearest neighbor model and the temporal features extracted by the long short-term memory network model are concatenated into composite features, and the composite features are used as the input features of the support vector machine.
[0032] Furthermore, during the training process of the base learner group, a joint regularization term is introduced to construct a combined loss function to constrain the parameter update direction of each base learner. The combined loss function has the following formula:
[0033] ;
[0034] wherein, is the independent loss function of each base learner, is the index of the base learner, is the divergence, used to constrain the distribution consistency of the prediction of the grid search optimized K-nearest neighbor model and the prediction of the support vector machine, is the balance coefficient.
[0035] Further, calculate the correlation between each model in the multi-model fusion model, specifically as follows:
[0036] Based on grid search to optimize the Pearson correlation coefficient between the K-nearest neighbor model and the support vector machine, it is obtained that there is a positive correlation between the two;
[0037] Based on the Pearson correlation coefficient between the long short-term memory network model and the support vector machine, it is obtained that there is a negative correlation between the two;
[0038] Based on the fact that the Pearson correlation coefficient between the extreme gradient boosting tree model and other models in the multi-model fusion model tends to zero, it is obtained that the error independence of the extreme gradient boosting tree model is the strongest, which is used to enhance the diversity of the multi-model fusion model.
[0039] A photosynthetic rate prediction system for greenhouse grapes uses a multi-model fusion model to obtain the final photosynthetic rate prediction value;
[0040] The multi-model fusion model includes a base learner group and a meta-learner. The grid search optimized K-nearest neighbor model, the Kalman filter optimized Gaussian process regression model, the long short-term memory network model, and the support vector machine form the base learner group, and the extreme gradient boosting tree model serves as the meta-learner;
[0041] Each model in the base learner group takes the multi-dimensional data features of the greenhouse grape production environment as input and outputs a temporary photosynthetic rate prediction value;
[0042] Taking the superposition of all temporary photosynthetic rate prediction values as the input of the meta-learner, so as to output the final photosynthetic rate prediction value.
[0043] A computer device includes a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, it implements the above-mentioned photosynthetic rate prediction method for greenhouse grapes.
[0044] A computer-readable storage medium stores a number of classification programs, and the number of classification programs is used to be called by a processor and execute the above-mentioned photosynthetic rate prediction method for greenhouse grapes.
[0045] Those of ordinary skill in the art can understand that all or part of the steps to implement the above method embodiments can be completed by hardware related to program instructions. The foregoing program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps including the above method embodiments; and the foregoing storage medium includes: various media such as ROM, RAM, magnetic disk, or optical disc that can store program codes.
[0046] The advantages of a method, system, device and storage medium for predicting the photosynthetic rate of facility grapes provided by the present invention are as follows: The diversity and complementarity of multiple learners are the key to improving the performance of the multi-model fusion model. GridSearch-KNN reflects microscopic characteristics by capturing local changes, KF-GPR uses non-linear modeling ability to depict environmental complexity, LSTM effectively processes time series dependencies, SVM shows strong performance in high-dimensional non-linear problems, and XGBoost has the ability to improve generalization ability. The multi-model fusion model not only significantly improves the robustness of the model but also effectively reduces the problem of insufficient adaptability of a single model in complex data scenarios. Description of the Drawings
[0047] Figure 1 It is a schematic structural flowchart of the present invention;
[0048] Figure 2 It is a modeling flowchart of the grid search optimized K-nearest neighbor model;
[0049] Figure 3 It is a modeling flowchart of the Kalman filter optimized Gaussian process regression model;
[0050] Figure 4 It is a schematic diagram of the correlation analysis of the prediction errors of each learner;
[0051] Figure 5a It is a comparison curve graph of the predicted value and the true value of the photosynthetic rate of the grid search optimized K-nearest neighbor model;
[0052] Figure 5b It is a comparison curve graph of the predicted value and the true value of the photosynthetic rate of the Kalman filter optimized Gaussian process regression model;
[0053] Figure 5c It is a comparison curve graph of the predicted value and the true value of the photosynthetic rate of the long short-term memory network model;
[0054] Figure 5d It is a comparison curve graph of the predicted value and the true value of the photosynthetic rate of the support vector machine;
[0055] Figure 5e It is a comparison curve graph of the predicted value and the true value of the photosynthetic rate of the extreme gradient boosting tree model;
[0056] Figure 5f It is a comparison curve graph of the predicted value and the true value of the photosynthetic rate of the multi-model fusion model, where the SPM model corresponds to the multi-model fusion model;
[0057] Figure 6a It is a comparison curve graph of the absolute error of the multi-model fusion model and the absolute error of the grid search optimized K-nearest neighbor model;
[0058] Figure 6b It is a comparison curve graph of the absolute error of the multi - model fusion model and the absolute error of the Kalman - filter - optimized Gaussian process regression model;
[0059] Figure 6c It is a comparison curve graph of the absolute error of the multi - model fusion model and the absolute error of the long - short - term memory network model;
[0060] Figure 6d It is a comparison curve graph of the absolute error of the multi - model fusion model and the absolute error of the support vector machine;
[0061] Figure 6e It is a comparison curve graph of the absolute error of the multi - model fusion model and the absolute error of the extreme gradient boosting tree model. Specific implementation manners
[0062] Next, the technical solutions of the present invention will be described in detail through specific embodiments. Many specific details are set forth in the following description in order to fully understand the present invention. However, the present invention can be implemented in many other ways different from those described herein, and those skilled in the art can make similar improvements without departing from the connotation of the present invention. Therefore, the present invention is not limited by the specific implementations disclosed below.
[0063] As Figures 1 to 6e shown, a method for predicting the photosynthetic rate of greenhouse grapes proposed by the present invention inputs multi - dimensional data features of the greenhouse grape production environment into a multi - model fusion model. The multi - model fusion model includes a base learner group and a meta - learner. The grid - search - optimized K - nearest - neighbor model, the Kalman - filter - optimized Gaussian process regression model, the long - short - term memory network model, and the support vector machine are used as base learners to form the base learner group, and the extreme gradient boosting tree model is used as the meta - learner. Each base learner in the base learner group outputs a temporary photosynthetic rate prediction value. The sum of all temporary photosynthetic rate prediction values is used as the input of the meta - learner, so as to output the final photosynthetic rate prediction value.
[0064] In this embodiment, multi - dimensional data features are obtained from the greenhouse grape production environment, including key indicators such as temperature, relative humidity, photosynthetically active radiation, and CO 2 concentration. Secondly, a Stacking framework is constructed based on multiple machine - learning models. Finally, the effectiveness and superiority of this method in photosynthetic rate prediction are verified through experiments, which are specifically described below.
[0065] (A) Multi - model fusion model;
[0066] The multi-model fusion model set in this embodiment is a technology that improves the overall prediction performance by combining the prediction results of multiple basic models. Multiple basic models are fused through Stacking. As a classic multi-model fusion method, Stacking can utilize the complementary characteristics of different models and further optimize the prediction accuracy by constructing a meta-learner. In the context of high agricultural data complexity and significant non-linear feature correlations, the Stacking method has significant advantages and can more comprehensively mine the potential patterns in the data.
[0067] In this embodiment, the grid search optimized K-nearest neighbor model, the Kalman filter optimized Gaussian process regression model, the long short-term memory network model, the support vector machine, and the extreme gradient boosting tree model are selected from numerous basic models to form the multi-model fusion model.
[0068] In the multi-model fusion model, the grid search optimized K-nearest neighbor model (GridSearch-KNN), the Kalman filter optimized Gaussian process regression model (KF-GPR), the long short-term memory network model (LSTM), and the support vector machine (SVM) are respectively selected as the base learners to form a group of base learners. This is based on a comprehensive consideration of diversity and problem characteristics. GridSearch-KNN captures local patterns through neighboring samples and is suitable for describing the local change characteristics of photosynthetic rate; KF-GPR utilizes the non-linear modeling ability and probability of the Gaussian process, can handle the influence of complex environmental factors and provide prediction uncertainty; LSTM is good at processing time series data and can effectively capture the dynamic dependence between photosynthetic rate and historical conditions; while SVM maps complex non-linear relationships through kernel methods and is applicable to high-dimensional and non-linear problems. These base learners each have their own advantages and can describe the change law of photosynthetic rate from different perspectives, ensuring the diversity and robustness of the model.
[0069] The extreme gradient boosting tree model (XGBoost) is selected as the meta-learner because of its powerful ensemble learning ability and the advantage of handling non-linear relationships. XGBoost effectively integrates the prediction results of the base learners through gradient boosting decision trees, further extracts the deep interaction relationships between features, and at the same time has high computational performance and good generalization ability. The built-in regularization function can prevent the model from overfitting, making it perform stably in complex tasks. As the meta-learner of Stacking, XGBoost performs outstandingly in comprehensively optimizing the output of multiple base learners and can significantly improve the prediction performance of the final model.
[0070] In this embodiment, the GridSearch-KNN model is constructed based on the K-Nearest Neighbors (KNN) algorithm and the Grid Search method. The K-Nearest Neighbors (KNN) algorithm is a simple and commonly used supervised learning method, which is widely applied to classification and regression tasks. The KNN algorithm determines the nearest neighbors by calculating the distances between samples. Commonly used distance metrics include the Euclidean distance and the Manhattan distance. Since the collected sample data is continuous variables, the Euclidean distance is selected. In a dataset where the input features of each sample are temperature, relative humidity, photosynthetically active radiation, and CO 2 concentration, and the target value is the photosynthetic rate, the calculation formula for the weighted average of the nearest neighbor samples is:
[0071] ;
[0072] In the formula is the predicted value of the photosynthetic rate; is the number of neighbors, that is, the number of samples selected from the first training set that are the closest to the input sample (test point); is the weight of the th neighbor; is the th neighbor's target value.
[0073] Since the performance of KNN highly depends on the selection of parameters, such as the number of neighbors, the distance metric method, and the weight function, etc. To address this problem, this embodiment uses the Grid Search method for hyperparameter tuning to find the best parameter combination and construct the Grid Search-KNN model. The modeling flowchart is as Figure 2 shown. The specific construction process of the Grid Search-KNN model is from (a1) to (a4):
[0074] (a1) Divide the obtained first dataset into a first training set and a first test set;
[0075] (a2) Determine the basic structure of the K-Nearest Neighbors model (including the number of neighbors, the distance metric method, and the weight type), the relevant parameters for hyperparameter optimization (including the hyperparameter search grid, defining all possible parameter combinations), define the cross-validation strategy, and the evaluation metrics;
[0076] (a3) Perform hyperparameter optimization on the first training set: traverse each hyperparameter combination in the hyperparameter search grid, evaluate the performance of each group of hyperparameters through the cross-validation strategy, and select the optimal hyperparameter combination; among them, the cross-validation strategy can be K-fold cross-validation.
[0077] (a4) Train the K-Nearest Neighbor model using the optimal hyperparameter combination and verify the performance of the K-Nearest Neighbor model on the first test set. Use the verified K-Nearest Neighbor model as the grid search optimized K-Nearest Neighbor model.
[0078] In this embodiment, the Kalman Filter optimized Gaussian Process Regression model (KF-GPR model) is constructed based on Gaussian Process Regression and Kalman Filter. Gaussian Process Regression (GPR) is a non-parametric model based on Bayesian inference that uses kernel functions to handle non-linear relationships. The regression equation is:
[0079] ;
[0080] Where, is the predicted photosynthetic rate; is the input multi-dimensional data feature, including temperature, relative humidity, effective radiation of light, and carbon dioxide concentration; is the mean function, describing the prior average of; is the covariance function (kernel function).
[0081] Kalman Filter (KF) is a recursive algorithm for estimating the state of a linear dynamic system. It is mainly used to process signals with noise and can provide the optimal estimate of the system state under noise and uncertainty conditions, which makes it perform particularly well when dealing with observed data with Gaussian noise. Kalman Filter also has good robustness and can effectively handle noise and model errors, providing accurate estimation results even when there is noise in the observed values. It is applicable to the processing of multi-dimensional state variables and can therefore be widely used in the state estimation of complex systems. The Kalman Filter algorithm assumes that the true state at the current time evolves from the state at the previous time. The state prediction formula and covariance prediction formula are as follows:
[0082] ;
[0083] ;
[0084] Where, is the time step, is the photosynthetic rate predicted at the current time step , is the estimated value of the photosynthetic rate at the previous time step , is the state transition matrix, is the transpose of, is the control matrix, is the multi-dimensional data feature vector at the current time step, For the current time step The covariance matrix of state prediction For the previous time step The covariance matrix of state estimation Is the process noise covariance matrix
[0085] This embodiment combines the noise processing ability of Kalman filtering and the non - linear fitting ability of Gaussian process regression to propose the KF - GPR model. The modeling flow chart is as Figure 3 Shown. The construction process of the KF - GPR model is as follows (b1) to (b5):
[0086] (b1) Divide the obtained second data set into a second training set and a second test set;
[0087] (b2) Use Kalman filtering to smooth the second training set to obtain the state prediction result and the covariance prediction result;
[0088] The specific smoothing process is as described in the above Kalman filtering record; Determine the basic framework of Kalman filtering (KF) and Gaussian process regression (GPR), including determining the state transition matrix, control matrix, process noise covariance matrix, selecting the kernel function and setting the hyperparameters of the kernel function. Initialize the state variables (predicted photosynthetic rate) and covariance matrix of Kalman filtering. For each time step, perform state prediction and covariance prediction of KF according to the input features.
[0089] (b3) Use the second training set to optimize the hyperparameters of the kernel function of the Gaussian process regression model;
[0090] Perform hyperparameter optimization on the second training set: Traverse each hyperparameter in the Gaussian process regression model, evaluate the performance of each hyperparameter through the cross - validation strategy, select the optimal hyperparameters, and use the optimal hyperparameters to train the Gaussian process regression model to obtain the optimized Gaussian process regression model.
[0091] (b4) Use the state prediction result and the covariance prediction result as the input of the optimized Gaussian process regression model for non - parametric regression modeling;
[0092] (b5) Use the Gaussian process regression model after non - parametric regression modeling as the Kalman filtering optimized Gaussian process regression model.
[0093] This embodiment improves the stability, generalization performance and accuracy of the multi - model fusion model by constructing a grid - search - optimized K - nearest - neighbor model and a Kalman - filtering - optimized Gaussian process regression model.
[0094] (B) The training process of the multi - model fusion model is as follows:
[0095] S1. Obtain the multi-dimensional data characteristics of the production environment of greenhouse grapes to construct the original dataset;
[0096] Due to uncontrollable factors such as equipment failures, human operation errors, and transmission errors that may occur during the experiment, there will be missing values and outliers. Therefore, in this embodiment, the corresponding leaf photosynthetic rate of the grapes after planting is measured 5 times, and the data of the 5 repeated measurements are averaged. After removing the missing and abnormal data, 1000 groups of data are finally obtained. In the research on the prediction of the photosynthetic rate of greenhouse grapes, the multi-model fusion model takes temperature, relative humidity, photosynthetically active radiation, and CO 2 concentration as input features and the photosynthetic rate as the output target value.
[0097] Considering that the numerical ranges of temperature, relative humidity, photosynthetically active radiation, and CO 2 concentration vary greatly, and the Z-score normalization (standardization) method is applicable to scenarios where the eigenvalue ranges vary greatly. Especially in algorithms involving gradient descent (such as neural networks and support vector machines), it can significantly improve the convergence speed and prediction performance of the model. Therefore, in this embodiment, the above 1000 groups of data are processed by Z-score normalization to construct the original dataset; the number of data obtained is selected according to the actual situation, and 1000 groups are not restricted.
[0098] S2. Perform K-fold cross-validation on the current base learner in the base learner group based on the original dataset, average and combine the obtained K prediction sets to construct a dataset;
[0099] In order to make full use of the data, reduce the risk of overfitting, and generate robust prediction results as the input of the meta-learner, thereby improving the generalization ability and fusion effect of the multi-model fusion model, this embodiment uses K-fold cross-validation to train each base learner.
[0100] K-fold cross-validation is an important method in machine learning for evaluating the generalization performance of a model, which can effectively reduce the variance of the evaluation results by making full use of the data.
[0101] Steps of K-fold cross-validation: Data partitioning: Randomly divide the original dataset into K subsets of similar sizes;
[0102] Loop training and validation: For each fold ( = 1 to K): Training set: Use the K-1 folds of data except the th fold to train the model, and the validation set: Evaluate the model performance on the th fold of data;
[0103] Result summary: Calculate the average of the K evaluation results as the final performance metric.
[0104] K is often set to 5 or 10 to balance the calculation cost and evaluation stability. In this embodiment, K = 5 is used to illustrate steps (c1) to (c4):
[0105] (c1) The original dataset D is randomly and evenly divided into 5 subsets D1, D2, D3, D4, and D5 of basically the same size through 5-fold cross-validation;
[0106] (c2) Select subset Dn (n = 1, 2,..., 5) as the test set, and the remaining 4 subsets as the training set. Train the base learner GridSearch-KNN model, and then use the trained GridSearch-KNN model to predict the test set to obtain 1 prediction set. Repeat this process until all combinations are traversed. Finally, obtain 5 prediction sets, and calculate the average and combination of the 5 prediction sets to construct a new dataset P1.
[0107] (c3) Adopt different base learners including KF-GPR, LSTM, and SVM, and repeat step (c2) to obtain datasets P2, P3, and P4 respectively.
[0108] (c4) Horizontally merge datasets P1, P2, P3, and P4 to obtain the new overall dataset P = {P1, P 2 , P 3 , P 4}.
[0109] S3. Take the next base learner in the base learner group as the current base learner and loop step S2 until all base learners are traversed, thereby constructing M datasets, where M is the total number of base learners;
[0110] During the training process of each base learner in the base learner group, there is an implicit cross in the data preprocessing stage of the stacking Stacking framework. Specifically: Smooth the original dataset, and use the obtained state prediction values as the input features of the Kalman filter optimized Gaussian process regression model, and at the same time share them as input features to the long short-term memory network model; The local neighborhood features extracted by the grid search optimized K-nearest neighbor model and the temporal features extracted by the long short-term memory network model are concatenated into composite features, and the composite features are used as the input features of the support vector machine.
[0111] The core mechanisms of the existing Stacking framework are as follows: ① Independent training of base learners: Each base learner (such as KNN, SVM) independently learns from the original data without data or feature interaction with each other; ② The meta-learner integrates prediction results: The outputs (predicted values) of the base learners are used as input features for the meta-learner. The meta-learner (such as XGBoost) generates the final output by integrating these prediction results; ③ No preprocessing collaboration or feature sharing: The training processes of the base learners are completely independent. Data preprocessing and feature engineering are only optimized for individual base learners and are not shared across base learners.
[0112] Based on the traditional Stacking framework, the following implicit cross mechanisms (1-1) to (1-2) are introduced in this embodiment:
[0113] (1-1) Collaboration in the data preprocessing stage;
[0114] Kalman filter sharing of KF-GPR: KF-GPR smooths the original data (such as denoising), eliminates noise interference, and shares the processed data (such as state prediction values) with other base learners (such as LSTM). The state prediction values are smooth sequences of temperature, CO 2 concentration, etc.
[0115] Differences from the traditional Stacking framework: In the traditional Stacking framework, base learners directly use the original data and do not rely on the preprocessing results of other base learners; Effect: LSTM receives cleaner time-series data, improving its ability to capture historical dependency relationships.
[0116] (1-2) Feature sharing mechanism;
[0117] Composite feature splicing: The time-series features extracted by LSTM and the local neighborhood features of GridSearch-KNN (such as the neighborhood mean of the photosynthetic rate at a certain moment) are spliced into composite features. The composite features are used as additional inputs to SVM to help SVM more accurately divide the non-linear boundary in the high-dimensional space, forming a more comprehensive feature representation. Example: The input of SVM = [LSTM time-series features, KNN neighborhood features] and the original dataset for K-fold cross-validation; Differences from the traditional Stacking framework: In the traditional Stacking framework, the output of the base learner is only the predicted value, not the intermediate feature.
[0118] During the training process of the base learner group, a joint regularization term is introduced to construct a combined loss function to constrain the parameter update directions of each base learner. The combined loss function is as follows:
[0119] ;
[0120] wherein, is the independent loss function of each base learner, is the index of the base learner, is the divergence, which is used to constrain the prediction of the grid search to optimize the K-nearest neighbor model and the prediction of the support vector machine for distribution consistency, is the balance coefficient.
[0121] The difference between the Stacking framework of this embodiment and the traditional Stacking framework: In the traditional Stacking framework, the training of the base learners is completely independent and there is no joint optimization objective.
[0122] This embodiment extends the scope of Stacking through data preprocessing collaboration, feature sharing, and joint regularization, making it not only rely on the prediction integration of the meta-learner, but also improve performance through the collaborative optimization among the base learners.
[0123] S4. Merge the M data sets and input them into the meta-learner for training and prediction to obtain the photosynthetic rate prediction result.
[0124] It should be noted that the original data set, the first data set, and the second data set involved in this embodiment have the same data source. The difference lies in the difference in the number of data in the data sets. The first data set and the second data set are data sets randomly selected from part of the data in the original data set; it can also be that the data of the three are all data sets randomly selected from part of the data in a large data set. Among them, the large data set is to obtain the data in the facility grape production environment, and normalize the data through Z-score, store the large data set, and the data set used for training in this embodiment is extracted from this large data.
[0125] Indirect association of model output: The prediction results (temporary photosynthetic rate prediction values) of each base learner will be aggregated into the meta-learner (XGBoost). When the meta-learner integrates these results, it actually utilizes the error complementarity between different base learners. For example: GridSearch-KNN may perform better on local samples; KF-GPR is more stable in a noisy environment; the meta-learner indirectly realizes the collaborative optimization among the base learners by weighting these results.
[0126] In the training stage of the meta-learner (XGBoost), define the weighted mean square error-diversity loss : ;
[0127] wherein, is the weighted mean square error, which is used to measure the final photosynthetic rate prediction result The error from the true value , is the weight coefficient (default is 0.7, which can be adjusted according to the actual situation), is the predicted photosynthetic rate of the th sample, is the set of predicted photosynthetic rate results for all samples, is the diversity loss function, used to measure the correlation of the predicted results of the base learners, where is the Pearson correlation coefficient, is the predicted photosynthetic rate of the th sample.
[0128] This loss function forces the meta-learner to maximize the diversity of the base learners while optimizing the prediction accuracy, further improving the generalization ability of the fusion model.
[0129] (C) Construction description of the multi-model fusion model;
[0130] The key of this embodiment is: select 5 sub-models of this embodiment (grid search optimized K-nearest neighbor model, Kalman filter optimized Gaussian process regression model, long short-term memory network model, support vector machine, and extreme gradient boosting tree model) from numerous basic models, and divide these 5 sub-models into base learners and meta-learner based on certain rules, finally obtaining the multi-model fusion model.
[0131] Further explain the reason for selecting 5 sub-models to form the multi-model fusion model in this embodiment:
[0132] In this embodiment, hyperparameter setting and correlation analysis are performed on the 5 sub-models in the multi-model fusion model. Through reasonable hyperparameter setting, the performance of the model can be maximized; through correlation analysis, the complementarity between models can be understood and the integration strategy can be optimized. The combination of these two can significantly improve the prediction accuracy, stability, and computational efficiency of the multi-model fusion model, providing more reliable support for practical applications. The prediction performance results of the 5 sub-models under hyperparameter conditions are shown in Table 1;
[0133] Table 1
[0134]
[0135] As can be seen from Table 1, the Extreme Gradient Boosting tree model XGBoost performs best in terms of the coefficient of determination R², root mean square error RMSE, and mean absolute error MAE. Followed by the Grid Search Optimized K-Nearest Neighbor model GridSearch-KNN, the Kalman Filter Optimized Gaussian Process Regression model KF-GPR, and the Long Short-Term Memory network model SVM. Among them, the Kalman Filter Optimized Gaussian Process Regression model KF-GPR performs well in terms of the average error, while the performance of the Long Short-Term Memory network model LSTM is relatively poor, with a lower coefficient of determination R², higher root mean square error RMSE, and mean absolute error MAE, indicating that its prediction performance is inferior to other sub-models. Generally speaking, the Extreme Gradient Boosting tree model XGBoost is the best choice for tasks that pursue high precision; the Grid Search Optimized K-Nearest Neighbor model GridSearch-KNN and the Long Short-Term Memory network model SVM are better choices for balancing performance and computational complexity; the Kalman Filter Optimized Gaussian Process Regression model KF-GPR is suitable for tasks that are sensitive to the average error.
[0136] The core of the construction process of the multi-model fusion model lies in the diversity design of the base learners and the feature integration ability of the meta-learner. It is required that different base learners have differences to reduce error correlation. Now, explore the correlation between different learners, calculate the Pearson correlation coefficient between the prediction errors of 5 sub-models, and through analysis, it can provide a scientific basis for sub-model selection and integration strategies. The results are as Figure 4 shown.
[0137] As Figure 4 can be seen, the correlation coefficient between GridSearch-KNN and SVM is 0.3305, indicating a moderate positive correlation between the two, meaning that when an error occurs in one sub-model, a similar error may also occur in the other sub-model. The correlation coefficient between LSTM and SVM is -0.04369, indicating a slight negative correlation between their errors, that is, when the error of one sub-model increases, the error of the other sub-model may decrease, and this relationship helps to cancel out the errors. The error correlation between XGBoost and other models is close to zero, indicating that its error independence is strong and it is suitable for increasing the diversity of the integrated model. Generally speaking, the correlation of prediction errors between most learners is low, and some even show a slight negative correlation, which indicates that the errors of these sub-models are inconsistent during prediction and have different performances at different data points.
[0138] In summary, the 5 sub-models selected in this embodiment have good diversity and complementarity, meeting the conditions for sub-model fusion. Additionally, considering that XGBoost is essentially an ensemble learning algorithm, XGBoost is more suitable as the meta-learner, and other models as the base learners, to construct a multi-model fusion model based on Stacking.
[0139] The diversity and complementarity of multiple learners are the key to improving the performance of multi-model fusion models. GridSearch-KNN reflects microscopic characteristics by capturing local changes. KF-GPR uses its non-linear modeling ability to characterize environmental complexity. LSTM effectively processes time series dependencies. SVM demonstrates strong performance in high-dimensional non-linear problems, and XGBoost has the ability to improve generalization ability. The multi-model fusion model not only significantly improves the robustness of the model but also effectively reduces the problem of insufficient adaptability of a single model in complex data scenarios.
[0140] (D) Experiments on multi-model fusion models;
[0141] The first experimental comparison:
[0142] As Figures 5a to 5f shown, by comparing the photosynthetic rate prediction results of the multi-model fusion model with those of individual sub-models respectively, it can be seen that the predicted values of the photosynthetic rate of the multi-model fusion model are highly consistent with the true values, and the prediction performance is better than that of other models. The predicted values of GridSearch-KNN, KF-GPR, SVM, and XGBoost are relatively close to the true values for most samples, indicating that these models show relatively high prediction accuracy in the photosynthetic rate prediction task. Specifically, the KF-GPR and SVM models have relatively small prediction errors for most samples and show good stability. In contrast, the prediction performance of the LSTM model fluctuates greatly, and the prediction errors for some samples are large, indicating that its prediction ability for some samples is poor. To more intuitively display the prediction accuracy of each model, the comparison results of the absolute error curves of the multi-model fusion model and other models are as Figures 6a to 6e shown. Compared with other single models, the multi-model fusion model has a lower mean absolute error, avoids the extreme error points of other models, and the error curve is smoother with a smaller error fluctuation range.
[0143] The second experimental comparison:
[0144] To verify the superiority of the multi-model fusion model (SPM) proposed in this embodiment compared with conventional hybrid models, two model hybrids in the field of regression prediction were selected: SVM-GMM (Support Vector Machine - Gaussian Mixture Model), CNN-LSTM (Convolutional Neural Network - Long Short-Term Memory Network Hybrid Model), and CNN-SVR (Convolutional Neural Network - Support Vector Regression Hybrid Model) as the control group for prediction. The prediction performance results are shown in Table 2;
[0145] Table 2
[0146]
[0147] Combining Table 1 and Table 2, it can be seen that compared with the GridSearch-KNN, KF-GPR, LSTM, SVM, and XGBoost models, the multi-model fusion model proposed in this embodiment increases the coefficient of determination R² by 0.004 - 0.193, and reduces the root mean square error RMSE and the mean absolute error MAE by 0.254 - 1.670 and 0.072 - 1.168 respectively. Additionally, among the 5 learners in this embodiment, the XGBoost model has the highest prediction accuracy, with the root mean square error RMSE and the mean absolute error MAE being 0.382 and 0.160 respectively.
[0148] For the three hybrid models such as SVM-GMM, CNN-LSTM, and CNN-SVR, although the multi-model fusion model increases the coefficient of determination R² by less than 0.035, the RMSE and MAE are reduced by 0.303 - 0.578 and 0.147 - 0.392 respectively. It is worth mentioning that the prediction performance of hybrid models is generally better than that of single models. However, in this embodiment, the mean absolute error of SVM-GMM is higher than that of the KF-GPR model, and the prediction accuracy of CNN-SVR is inferior to that of the GridSearch-KNN model, indicating that hybrid models are not always better than single models, which depends on various factors, including the model selection, the effectiveness of the hybrid strategy, the characteristics and scale of the dataset, the tuning of hyperparameters, and the nature of the problem itself. Therefore, when selecting a model for use in this embodiment, these factors are comprehensively considered, and sufficient experiments and verifications are carried out.
[0149] Third experimental comparison example:
[0150] To verify the superiority of the multi-model fusion model (SPM), it is further compared with three hybrid models and four hybrid models. The hybrid models are composed of sub-models in the multi-model fusion model combined with other models, specifically as follows:
[0151] Three-model hybrid: GridSearch-KNN + KF-GPR + Random Forest (RF), reason for selection: GridSearch-KNN (local pattern capture), KF-GPR (nonlinear modeling), Random Forest (high robustness) form a complement.
[0152] Three-model hybrid: LSTM + SVM + Gradient Boosting Decision Tree (GBDT), reason for selection: LSTM (temporal dependence), SVM (high-dimensional classification), GBDT (gradient boosting) cover different modeling directions.
[0153] Three-model hybrid: KF-GPR + SVM + Decision Tree (DT), reason for selection: KF-GPR (noise robustness), SVM (nonlinearity), Decision Tree (interpretability) combination.
[0154] Hybrid of 4 models: GridSearch-KNN + KF-GPR + LSTM + Deep Neural Network (DNN). Reason for selection: Integrate local features, non-linear modeling, temporal dependence, and deep feature extraction.
[0155] Hybrid of 4 models: LSTM + SVM + GridSearch-KNN + Bayesian Linear Regression (BLR). Reason for selection: Combine temporal, high-dimensional, local features, and probabilistic modeling.
[0156] Hybrid of 4 models: KF-GPR + SVM + XGBoost + Adaptive Boosting (AdaBoost). Reason for selection: Integrate non-linearity, classification, gradient boosting, and adaptive weighting strategy.
[0157] By experimentally comparing the prediction performance of the multi-model fusion model and the newly added hybrid models, the results are shown in Table 3 as follows:
[0158] Table 3
[0159]
[0160] Conclusion analysis: The R² of GridSearch-KNN + KF-GPR + RF is 0.982. Although it is close to SPM, the RMSE (0.155) and MAE (0.105) are still significantly higher than SPM. The R² of KF-GPR + SVM + DT is only 0.965, indicating that simple model combinations may lead to performance degradation due to feature conflicts. The R² of KF-GPR + SVM + XGBoost + AdaBoost reaches 0.985, but it is still lower than SPM, and the MAE (0.097) is relatively high, suggesting that an increase in the number of models may introduce redundant noise. The RMSE (0.173) of GridSearch-KNN + KF-GPR + LSTM + DNN is 35% higher than SPM, verifying the non-linear relationship between the complexity and performance of multi-models.
[0161] Therefore, in this embodiment, by comparing the multi-model fusion model (SPM) with the above three- and four-model hybrids, as shown in Table 3, the prediction accuracy (R² = 0.991) of SPM is significantly better than all hybrid models, and the error metrics (RMSE = 0.128, MAE = 0.088) reach the optimal. Experiments show that the performance of hybrid models highly depends on the effectiveness of the integration strategy, while SPM achieves the optimal balance through the Stacking framework and the diversity loss function (DivLoss).
[0162] In summary, the prediction results of the multi-model fusion model in this embodiment show extremely high precision and stability. The coefficient of determination (R²) reaches 0.991, and the root mean square error (RMSE) and mean absolute error (MAE) are 0.128 and 0.088 respectively, which are better than all single models and traditional hybrid models proposed in this embodiment. By effectively integrating the advantages of the base learners, the multi-model fusion model significantly reduces the occurrence probability of extreme error points and realizes more accurate photosynthetic rate prediction.
[0163] The multi-factor coupling and data complexity in the facility agriculture scenario require the model to have high robustness and generalization ability. When dealing with complex and changeable environmental conditions, the multi-model fusion model shows low error fluctuations and extremely high stability, and its predicted values are closer to the true values, making it suitable for application in agricultural scenarios with significant interactions of multi-dimensional variables.
[0164] This embodiment makes full use of the complementarity of different algorithms, which not only reflects the depth of algorithm development but also reveals the multi-dimensionality of agricultural data analysis. The multi-model fusion model based on Stacking ensemble learning proposed in this embodiment is not only applicable to photosynthetic rate prediction but also can be extended to other problems in facility agriculture (such as transpiration rate prediction, crop growth modeling, etc.). At the same time, this embodiment verifies the potential of multi-model fusion in processing non-linear and multi-dimensional coupled data, providing a reference path for other researchers to explore more complex agricultural problems.
[0165] The above is only a preferred specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present invention, according to the technical solution of the present invention and its inventive concept, makes equivalent substitutions or changes, and should be covered by the protection scope of the present invention.
Claims
1. A method for predicting the photosynthetic rate of greenhouse grapes, characterized in that: include: Inputting the multidimensional data features of the facility grape production environment into a multi-model fusion model, wherein the multi-model fusion model includes a base learner group and a meta-learner, a grid search optimized K nearest neighbor model, a Kalman filter optimized Gaussian process regression model, a long short-term memory network model, and a support vector machine as base learners to form a base learner group, and an extreme gradient boosting tree model as a meta-learner; Each base learner in the base learner group outputs a temporary photosynthetic rate prediction value; All temporary photosynthetic rate prediction values are superimposed as the input of the meta-learner to output the final photosynthetic rate prediction value; The multi-model fusion model fuses the base learner and the meta learner through the stacking framework. During the training process of each base learner in the base learner group, the stacking framework has implicit crossover in the data preprocessing stage, specifically: The original data set is smoothed using Kalman filtering, and the obtained state prediction value is used as the input feature of the Kalman filter optimized Gaussian process regression model, and is also shared with the long short-term memory network model as an input feature; The local neighborhood features extracted by the grid search optimized K nearest neighbor model and the temporal features extracted by the long short-term memory network model are spliced into composite features, and the composite features are used as the input features of the support vector machine.
2. The method for predicting photosynthetic rate of greenhouse grapes according to claim 1, characterized in that: The training process of the multi-model fusion model is as follows: S1. Acquire multidimensional data characteristics of the facility grape production environment to construct an original data set, wherein the multidimensional data characteristics include temperature, relative humidity, photosynthetically active radiation, and CO2 concentration; S2, based on the original data set, perform K-fold cross validation on the current base learner in the base learner group, average and combine the obtained K prediction sets to construct a data set; S3, taking the next base learner in the base learner group as the current base learner and repeating step S2 until all base learners are traversed, thereby constructing M data sets, where M is the total number of base learners; S4. Merge the M data sets and input them into the meta-learner for training and prediction to obtain the photosynthetic rate prediction result.
3. The method for predicting photosynthetic rate of greenhouse grapes according to claim 1, characterized in that: The construction process of the grid search optimized K nearest neighbor model is as follows: Dividing the acquired first data set into a first training set and a first test set; Determine the basic structure of the K-nearest neighbor model, relevant parameters for hyperparameter optimization, and define cross-validation strategies; Perform hyperparameter optimization on the first training set: traverse each hyperparameter combination of the hyperparameter search grid, evaluate the performance of each set of hyperparameters through a cross-validation strategy, and select the optimal hyperparameter combination; The K nearest neighbor model is trained using the optimal hyperparameter combination, and the performance of the K nearest neighbor model on the first test set is verified. The verified K nearest neighbor model is used as a grid search to optimize the K nearest neighbor model.
4. The method for predicting photosynthetic rate of greenhouse grapes according to claim 1, characterized in that: The construction process of the Kalman filter optimized Gaussian process regression model is as follows: Dividing the acquired second data set into a second training set and a second test set; The second training set is smoothed by using Kalman filtering to obtain state prediction results and covariance prediction results; The kernel function hyperparameters of the Gaussian process regression model are optimized using the second training set; The state prediction results and covariance prediction results are used as inputs of the optimized Gaussian process regression model to perform non-parametric regression modeling; The Gaussian process regression model after non-parametric regression modeling is used as the Gaussian process regression model optimized by Kalman filtering.
5. The method for predicting photosynthetic rate of greenhouse grapes according to claim 4, characterized in that: The calculation formulas for state prediction results and covariance prediction results are as follows: ; ; in, is the time step, is the current time step The predicted photosynthetic rate, The previous time step The estimated photosynthetic rate, is the state transfer matrix, for The transpose of is the control matrix, is the multidimensional data feature vector of the current time step, is the current time step The covariance matrix of the state prediction, The previous time step The covariance matrix of the state estimate, is the process noise covariance matrix.
6. The method for predicting photosynthetic rate of greenhouse grapes according to claim 1, characterized in that: During the training process of the base learner group, a joint regularization term is introduced to construct a combined loss function to constrain the parameter update direction of each base learner. The formula is as follows: ; in, is the independent loss function of each base learner, is the index of the base learner, for Divergence, used to constrain grid search to optimize the predictions of the K nearest neighbor model Prediction with Support Vector Machine The distribution consistency of is the balance coefficient.
7. A greenhouse grape photosynthetic rate prediction system, characterized in that: The final photosynthetic rate prediction value was obtained using the multi-model fusion model; The multi-model fusion model includes a base learner group and a meta-learner, a grid search optimized K nearest neighbor model, a Kalman filter optimized Gaussian process regression model, a long short-term memory network model, and a support vector machine as base learners to form a base learner group, and an extreme gradient boosting tree model as a meta-learner; Each base learner in the base learner group takes the multidimensional data characteristics of the facility grape production environment as input and outputs a temporary photosynthetic rate prediction value; All temporary photosynthetic rate prediction values are superimposed as the input of the meta-learner to output the final photosynthetic rate prediction value; The multi-model fusion model fuses the base learner and the meta learner through the stacking framework. During the training process of each base learner in the base learner group, the stacking framework has implicit crossover in the data preprocessing stage, specifically: The original data set is smoothed using Kalman filtering, and the obtained state prediction value is used as the input feature of the Kalman filter optimized Gaussian process regression model, and is also shared with the long short-term memory network model as an input feature; The local neighborhood features extracted by the grid search optimized K nearest neighbor model and the temporal features extracted by the long short-term memory network model are spliced into composite features, and the composite features are used as the input features of the support vector machine.
8. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the method for predicting the photosynthetic rate of greenhouse grapes according to any one of claims 1 to 6 is implemented.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a plurality of classification programs, and the plurality of classification programs are used to be called by a processor and execute the greenhouse grape photosynthetic rate prediction method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Offshore doubly fed wind power generator fault judging method based on GRA-LSTM-stacking model
CN111237134A
Electromyogram gait recognition and evaluation method and system based on machine learning
CN118902480A