Method and system for predicting farmland carbon sink based on meteorological factors

By using a meteorological factor-based method for predicting farmland carbon sequestration, and employing the AR-RF model and multi-factor loss function, the problem of insufficient measurement accuracy of farmland carbon sequestration in existing technologies is solved, and high-precision dynamic prediction and robust extrapolation of farmland carbon sequestration are achieved.

CN122288094APending Publication Date: 2026-06-26ENERGY RES INST OF JIANGXI ACAD OF SCI +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610351214.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-03-21
Publication Date
2026-06-26

AI Technical Summary

Technical Problem

Existing methods for measuring farmland carbon sequestration mainly rely on static models and limited observational data, neglecting the combined dynamic impact of meteorological factors and crop management measures, resulting in insufficient prediction accuracy and dynamic response capability.

Method used

A meteorological factor-based method for predicting farmland carbon sinks was adopted. By acquiring flux tower observation time series data, feature importance analysis was performed to screen the main controlling environmental factors, an AR-RF model was constructed, and the model hyperparameters were optimized by combining recursive feature elimination method and multi-factor loss function to achieve dynamic prediction of carbon sinks.

Benefits of technology

It significantly improves the accuracy and generalization ability of farmland carbon sink forecasting, can capture the diurnal variation of carbon sinks and meteorological process responses, and has ecological interpretability and extrapolation robustness under extreme conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122288094A_ABST
    Figure CN122288094A_ABST
Patent Text Reader

Abstract

This invention belongs to the field of farmland carbon sink prediction technology, specifically involving a method and system for predicting farmland carbon sinks based on meteorological factors. It scientifically selects key control factors (net radiation, soil temperature, saturated vapor pressure difference, and soil moisture content) using a recursive feature elimination method to ensure that the input features have clear ecological significance. A composite loss function containing physical constraints and temporal consistency terms is designed to embed the photosynthetic mechanism and the dynamic changes in carbon sinks into the model training objective. An AR-RF additive ensemble model is used to progressively fit the residuals, improving prediction accuracy and endowing the model with ecological interpretability and robustness under extreme conditions. This constrains the pure data-driven model output, thereby improving the prediction accuracy of farmland carbon sinks.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of farmland carbon sequestration prediction technology, specifically involving a method and system for predicting farmland carbon sequestration based on meteorological factors. Background Technology

[0002] With the rise and development of the carbon trading market, accurately measuring the carbon sink of farmland ecosystems has become particularly important. This not only provides a scientific basis for agricultural carbon sink projects but also helps businesses, farmers, and government agencies better understand the carbon absorption capacity of farmland, thereby formulating effective carbon reduction policies and measures. However, current methods for measuring carbon sinks in farmland ecosystems mainly face the following technical shortcomings: In existing technologies, farmland carbon sequestration largely relies on static models and limited field observation data. These methods typically use biomass monitoring data and soil organic carbon content as core parameters, estimating total carbon sequestration through empirical formulas or simple carbon cycle models. For example, some studies calculate net ecosystem carbon exchange based on the difference between net primary productivity of vegetation and soil respiration, or use remote sensing images to invert vegetation indices to estimate carbon sequestration capacity. While these methods can provide basic carbon sequestration estimates, they have significant shortcomings: firstly, static models struggle to capture the dynamic changes in carbon exchange within farmland ecosystems, neglecting the real-time regulation of photosynthesis and respiration by temporal fluctuations in meteorological conditions (such as radiation, temperature, and precipitation); secondly, differences in agricultural management practices (such as irrigation, fertilization, and tillage methods) are not effectively integrated, limiting the model's extrapolation capabilities across spatiotemporal scales and making it difficult to meet the quantitative requirements of the carbon trading market. Summary of the Invention

[0003] To address the aforementioned problems in existing technologies, this invention provides a method and system for predicting farmland carbon sequestration based on meteorological factors. This solves the technical problem that existing farmland carbon sequestration measurement methods mainly rely on static models and limited observation data, neglecting the comprehensive dynamic influence of meteorological factors and crop management measures, resulting in insufficient prediction accuracy and dynamic response capability.

[0004] The objective of this invention can be achieved through the following technical solution: a method for predicting farmland carbon sequestration based on meteorological factors, comprising the following steps: S1: Obtain the flux tower observation time series dataset of the target farmland area. The dataset includes meteorological factor time series, soil factor time series and corresponding ecosystem carbon exchange time series. S2: Perform feature importance analysis on the time series of meteorological factors and soil factors, and screen out the main environmental factors that contribute more than a preset threshold to the change in ecosystem carbon exchange. The main environmental factors include net radiation, soil temperature, saturated vapor pressure difference and soil moisture content. S3: Using the main controlling environmental factors as input features and the carbon exchange of the ecosystem as the prediction target, construct a farmland carbon sink prediction model based on the AR-RF model; S4: Train the farmland carbon sequestration prediction model using time series datasets, optimize the model hyperparameters through time series cross-validation, and obtain the trained farmland carbon sequestration prediction model; S5: Obtain real-time meteorological factor data and real-time soil factor data of the target farmland area, input the data corresponding to the main control environmental factor in the real-time meteorological factor data and real-time soil factor data into the farmland carbon sink prediction model to obtain the predicted ecosystem carbon exchange, and determine the farmland carbon sink based on the predicted ecosystem carbon exchange.

[0005] Preferably, S1 includes preprocessing the acquired dataset, the preprocessing including quality control, missing value imputation, and normalization.

[0006] Preferably, the parameters of the meteorological factor time series include net radiation, air temperature, saturated vapor pressure difference, solar radiation, relative humidity, and dew point temperature.

[0007] Preferably, in S2, a recursive feature elimination method combined with the importance assessment of the Gini coefficient in a random forest is used to screen the main environmental factors, specifically including the following process: Using meteorological factor time series and soil factor time series as the initial feature set, and net ecosystem carbon exchange as the target variable, a random forest regression model was trained, and the importance score of each feature was evaluated using the Gini importance built into the random forest. A greedy strategy is used for recursive elimination, gradually removing the least important features, and the model performance is re-evaluated in each round until the preset stopping condition is reached; K-fold cross-validation was used to evaluate the predictive performance of the model after removal.

[0008] Preferably, the formula for calculating the importance score is: ; In the formula, Features Importance score, where M is the number of trees in the random forest. For all internal nodes of the t-th tree, The decrease in Gini impurity caused by node v splitting. This is an indicator function.

[0009] Preferably, S3 also includes performing the following process for constructing the AR-RF model: Training a random forest regressor Output X is the input feature, and y is the predicted target; The maximum number of iterations is set to S. In each addition iteration s, the current residual is calculated. , ,in, This represents the cumulative predictions from the first n-1 rounds of the model; Train another random forest to fit the residuals, using the original features X as input, and... To achieve the output objective, train a new random forest regressor. , making It can approximate the current residual; Updated cumulative forecast: , The learning rate; After S rounds of iteration, the final AR-RF model is obtained.

[0010] Preferably, a new random forest is trained in each round of addition iteration. The multi-factor loss function is used as the optimization objective. The formula for calculating the multi-factor loss function is as follows: ; In the formula, , , These are the prediction error term, the physical constraint term, and the timing consistency term, respectively. , and These are the weighting coefficients that balance the importance of each item, and their sum is 1.

[0011] Preferred physical constraint terms The calculation formula is: ; In the formula, N is the number of training samples. Let be the maximum possible carbon absorption at time t. Let be the cumulative predicted value for the t-th sample in the s-th round. The formula for calculating the maximum possible carbon absorption is: k is the light energy utilization coefficient. This is the soil temperature response function. Let be the net radiation at time t.

[0012] Preferably, S4 specifically includes the following sub-steps: The training and test sets of the AR-RF model are divided into two time series using the time series outflow method; Scrolling window cross-validation is used within the training set until the validation subset covers the end of the training set. The hyperparameters of the AR-RF model were tuned using grid search or Bayesian optimization. Using the optimized hyperparameters, the AR-RF model was retrained on the entire training set to obtain the final farmland carbon sink prediction model.

[0013] A farmland carbon sequestration prediction system based on meteorological factors includes: The data acquisition module is used to acquire flux tower observation time series datasets of the target farmland area. The datasets include meteorological factor time series, soil factor time series, and corresponding ecosystem carbon exchange time series. The feature screening module is used to perform feature importance analysis on the time series of meteorological factors and soil factors, and screen out the main environmental factors whose contribution to the change of ecosystem carbon exchange exceeds a preset threshold. The model building and training module is used to construct an AR-RF ensemble learning model as a farmland carbon sink prediction model using the main environmental factors as input features, and to train the farmland carbon sink prediction model using the time series dataset. The AR-RF model gradually adds the fitting residuals of the random forest regressor through additive iteration, and uses a composite loss function as the optimization objective in each round of iteration training. The model prediction module is used to acquire real-time meteorological factor data and real-time soil factor data of the target farmland area, extract data corresponding to the main control environmental factors from the real-time data and input them into the farmland carbon sink prediction model to obtain the predicted ecosystem carbon exchange, and determine the farmland carbon sink based on the ecosystem carbon exchange.

[0014] The beneficial effects of this invention are as follows: This invention scientifically screens key control factors (net radiation, soil temperature, saturated vapor pressure difference, and soil moisture content) using a recursive feature elimination method to ensure that the input features have clear ecological significance. It designs a composite loss function that includes physical constraints and temporal consistency terms, embedding the photosynthetic mechanism and dynamic changes in carbon sinks into the model training objective. An AR-RF additive ensemble strategy is employed to progressively fit the residuals, and hyperparameters are optimized through time-series cross-validation, significantly improving prediction accuracy and generalization ability. This also endows the model with ecological interpretability and robustness under extreme conditions, constraining the pure data-driven model output and further enhancing the prediction accuracy of farmland carbon sink forecasts. Attached Figure Description

[0015] To facilitate understanding by those skilled in the art, the present invention will be further described below with reference to the accompanying drawings.

[0016] Figure 1 This is a schematic diagram of the method steps of the present invention; Figure 2 This is a schematic diagram of the sub-steps for screening the main environmental factors in method S2 of the present invention; Figure 3 This is a schematic diagram of the system structure of the present invention. Detailed Implementation

[0017] To further illustrate the technical means and effects of the present invention in achieving its intended purpose, the following detailed description of the specific implementation methods, structures, features, and effects of the present invention, in conjunction with the accompanying drawings and preferred embodiments, is provided.

[0018] Please see Figures 1-2 This embodiment provides a method for predicting farmland carbon sequestration based on meteorological factors, including the following steps: S1: Obtain the flux tower observation time series dataset for the target farmland area. The dataset includes time series of meteorological factors, soil factors, and the corresponding ecosystem carbon exchange time series. This includes the following sub-steps: Deploy or utilize existing eddy covariance flux monitoring systems (flux towers) in the target farmland area. These systems include three-dimensional ultrasonic anemometers and open-circuit CO2 / H2O gas analyzers, capable of real-time measurement of net ecosystem carbon exchange (NEE) between the atmosphere and the farmland ecosystem. Simultaneously, the flux tower is equipped with meteorological and soil observation sensors to collect meteorological and soil factor data synchronously.

[0019] After preliminary processing, the collected raw data constitutes a multivariate time series dataset, including: a meteorological factor time series comprising parameters such as net radiation, air temperature, saturated vapor pressure difference, solar radiation, relative humidity, and dew point temperature; a soil factor time series comprising parameters such as soil temperature, soil moisture content, and soil conductivity; and an ecosystem carbon exchange time series primarily consisting of net ecosystem carbon exchange (NEE), directly observed by an eddy covariance system. A negative NEE value indicates CO2 uptake by the ecosystem, while a positive value indicates CO2 emission (carbon source). In some applications, ecosystem respiration (Re) and gross primary productivity (GPP) can also be acquired simultaneously as auxiliary data, but the core prediction objective of this invention is NEE.

[0020] Because raw flux tower data often contains outliers and missing values ​​due to instrument malfunctions, power outages, and unsuitable weather conditions (such as during rainfall or weak turbulence at night), it must undergo rigorous quality control and imputation before it can be used for subsequent model training. The raw data after initial processing undergoes data preprocessing, including quality control, missing value imputation, and normalization, specifically including the following steps: Data with obvious anomalies were removed based on a physically reasonable range. For example, NEE values ​​exceeding -50 to 50 μmol·m - ²·s -¹The scope (adjustable according to crop type and region), situations where net radiation is negative but NEE is excessively negative, etc. Outliers can be identified and removed using box plot method (exceeding 3 times the interquartile range) or standard deviation method based on moving window; Necessary corrections are performed on vorticity-related observation data, including coordinate rotation (to eliminate tilt effects), frequency response correction, and WPL correction (density fluctuation correction), to ensure the accuracy of NEE data. These corrections are typically performed using flux tower data post-processing software.

[0021] After quality control, missing values ​​may appear in the dataset. To ensure the continuity of the time series, imputation methods are needed to fill in these missing values. This invention preferably employs a multidimensional imputation algorithm based on artificial neural networks, which includes the following process: The dataset is arranged in chronological order. For each time point containing missing values, a shallow neural network is trained using complete data from other times, with relevant meteorological and soil factors as inputs and the variable to be imputed as the output. A chain equation multi-step interpolation strategy is adopted to interpolate each variable sequentially and update the interpolation model of subsequent variables using the interpolated values; Repeat the interpolation process multiple times (e.g., 5 times) and take the average value as the final interpolated value to reduce interpolation uncertainty.

[0022] After the above processing, a complete, continuous, and standardized time series dataset is obtained. To ensure that the time order remains unchanged, all processing steps maintain the same time index. The final dataset is in the form of a two-dimensional matrix, with rows representing time points (e.g., one sample every half hour) and columns including meteorological factors, soil factors, and the target variable NEE.

[0023] S2: The time series data of meteorological and soil factors are evaluated for feature importance to identify the dominant environmental factors that contribute more than a preset threshold to changes in ecosystem carbon exchange (NEE). These dominant environmental factors include net radiation, soil temperature, saturated vapor pressure gradient, and soil moisture content. This process selects the dominant environmental factors with the highest contribution to changes in farmland ecosystem NEE from the collected meteorological and soil factor time series data, providing a concise and physically meaningful input feature set for subsequent farmland carbon sink prediction models. This embodiment uses Recursive Feature Elimination (RFE) combined with random forest Gini coefficient importance assessment to screen dominant environmental factors, specifically including the following steps: S201: Using the preprocessed meteorological and soil factor time series from S1 as the initial feature set X, and net ecosystem carbon exchange (NET) y as the target variable, a random forest regression model is first trained as the baseline model. The random forest consists of multiple decision trees, each trained based on bootstrap sampling and a random subset of features. After training, the importance score of each feature is evaluated using the built-in Gini Importance of the random forest. The calculation principle of Gini Importance is as follows: for each node split of each decision tree, the decrease in Gini impurity caused by the feature used at that node is recorded. The decrease caused by that feature on all trees is summed and normalized to obtain the importance score of that feature. The formula for calculating the importance score is as follows: ; In the formula, Features The importance score indicates that the higher the score, the greater the contribution of the feature to the prediction of NEE. M is the number of trees in the random forest. For all internal nodes of the t-th tree, The decrease in Gini impurity caused by node v splitting. As an indicator function, when the node splitting characteristic is If the value is 1, then the value is 0; otherwise, the value is 0.

[0024] S202: A greedy strategy is used for recursive elimination, gradually removing the features with the lowest importance, and the model performance is re-evaluated in each round until the preset stopping condition is reached. The specific sub-steps are as follows: A new random forest network is trained based on the current feature set X, and the importance score of each feature is calculated using the importance score calculation formula. The features are sorted according to their importance scores, and the feature with the lowest importance score is removed. Let the current feature set size be m, and the new feature set after removal be X. 1 Its size is m-1; S203: K-fold cross-validation is used to evaluate the predictive performance of the model after elimination. This invention uses 5-fold cross-validation, which randomly divides the training data into 5 parts, uses 4 parts for training and 1 part for validation in turn, calculates the coefficient of determination or root mean square error on the validation set, repeats 5 times and takes the average value as the model performance index corresponding to the current feature set. S204: Compare the changes in model performance before and after removal. Define the performance degradation as: ; in, This is the model performance metric corresponding to the current feature set. To improve model performance (taking cross-validation as an example, a larger value is better) before removing features from the previous feature set, when... When the preset threshold is exceeded, it indicates that removing the feature will cause a significant drop in model performance. At this point, the removal will be stopped, and the feature set before the feature removal will be used as the final set of main control environment factors to be retained. The preset threshold here can be set according to the specific scenario or by adopting empirical rules. If the performance degradation is less than or equal to the preset threshold, it is considered that removing the feature has no significant impact on the model performance, and the feature set with the removed feature is taken as the new current feature set. S201-S204 are repeated until the stopping condition is met or the feature set size is reduced to 1.

[0025] Through the above recursive feature elimination process, the final retained feature set is the main environmental factor that contributes the most to the prediction of farmland carbon sink. The main environmental factors include net radiation, soil temperature, saturated vapor pressure difference and soil moisture content.

[0026] By employing recursive feature elimination for feature selection, compared to traditional empirical selection or simple correlation analysis, it offers the following advantages: it is entirely data-driven, avoiding subjective bias from human selection; it combines cross-validation to assess performance changes, ensuring that the selected factors have stable importance across different data subsets; and it quantifies the contribution of each factor to the prediction using Gini importance, facilitating ecological interpretation.

[0027] In S2, a random forest regression model is used as a feature selection tool. Its built-in Gini importance is used to assess the contribution of each meteorological and soil factor to net ecosystem carbon exchange, and a recursive feature elimination method is used to determine the set of controlling environmental factors. This random forest model is used here only for feature selection.

[0028] S3: Using the main environmental factors as input features and the carbon exchange of the ecosystem as the prediction target, a farmland carbon sink prediction model is constructed based on the AR-RF model (Additive Regression-Random Forest).

[0029] The AR-RF model is a two-layer ensemble model: it uses a random forest as the base learner and progressively adds new random forest regressors through an additive regression strategy. Each new regressor aims to fit the residuals of the previous prediction. By leveraging the ability of random forests to handle high-dimensional nonlinear relationships, the model gradually corrects errors through additive iteration, improving overall accuracy. During model training, each additive iteration minimizes the current loss function, constructs a multi-factor loss function, and uses this multi-factor loss function as the optimization objective in each iteration to guide the new regressor in fitting the residuals. Simultaneously, before model training, a recursive feature elimination method is used to screen for controlling environmental factors, and after training, an incremental learning mechanism is introduced to achieve adaptive model updates.

[0030] The process of constructing an AR-RF model for predicting farmland carbon sequestration includes: Step 1: Perform model initialization, including training the first random forest regressor. Using X as the input feature and y as the prediction target, we obtain the initial predicted value: ; The random forest regressor generates multiple sample subsets from the training set through bootstrap sampling, builds a decision tree for each subset, and finally predicts the average of the predictions from all decision trees.

[0031] Step 2: Perform iterative addition integration: For s = 1, 2, ..., S, where S is the maximum number of addition iterations, typically between 50 and 200, the following process is repeated: Calculate the current residual: ,in, This represents the cumulative predictions from the first n-1 rounds of the model; Train a new random forest to fit the residuals, using the original features X as input and the residuals... To achieve the output objective, train a new random forest regressor. The training objective of this regressor is to minimize a pre-defined multi-factor loss function (details below), such that... It can approximate the current residual; Updated cumulative forecast: , The learning rate is used to control the contribution of each new model iteration. After S rounds of iteration, the final AR-RF model is obtained.

[0032] Each random forest regressor All systems use the same hyperparameter configurations, including: number of decision trees (e.g., 100 trees), maximum depth (e.g., 10 layers), minimum number of samples required for internal node splits (e.g., 5), and minimum number of samples required for leaf nodes (e.g., 2). These hyperparameters will be optimized through cross-validation in step S4.

[0033] Traditional machine learning regression tasks typically use only mean squared error (MSE) or mean absolute error (MAE) as loss functions. These standard loss functions only focus on the numerical difference between predicted and observed values, failing to fully utilize the inherent physical laws and temporal characteristics of farmland ecosystems. The multi-factor loss function used in this embodiment embeds ecological prior knowledge into the model training objective, guiding the machine learning model not only to fit the data but also to learn carbon sink change patterns that conform to natural laws.

[0034] Therefore, in each round of addition iteration, a new random forest is trained. The multi-factor loss function is used as the optimization objective, and its calculation formula is as follows: ; In the formula, , , These are the prediction error term, the physical constraint term, and the timing consistency term, respectively. , and These are weighting coefficients that balance the importance of each term, ensuring that the sum of the three is 1. The weighting coefficients can be adaptively adjusted according to different farmland types or climate regions (e.g., through validation set optimization), making the loss function flexible and capable of generalization. The calculation formulas for each term are: ; In the formula, This is the prediction error term calculated using the standard mean squared error, where N is the number of training samples and t is the time index. This represents the cumulative predicted value for the t-th sample from the previous s-1 rounds. This represents the output of the new model for the t-th sample in the current round. Let be the true observation value of the t-th sample.

[0035] The net carbon uptake (i.e., negative net ecosystem carbon exchange) of farmland ecosystems theoretically has an upper limit. This limit is constrained by key drivers of photosynthesis: photosynthetically active radiation (usually approximated by net radiation) provides the energy source, and soil temperature affects enzyme activity and the rate of photosynthesis. Carbon uptake reaches its maximum when radiation is sufficient and temperature is suitable; predicted values ​​exceeding this upper limit are physically unrealistic. Using the key controlling factors (net radiation and soil temperature) screened for feature importance, an empirical maximum possible carbon uptake is constructed. The calculation formula is: ; In the formula, Let t be the maximum possible carbon absorption at time t, and k be the light energy utilization coefficient. The soil temperature response function can be constructed using a bell-shaped curve or a piecewise linear function. Let be the net radiation at time t. Let be the soil temperature at time t; ; The physical constraint term is specifically a theoretical maximum carbon sequestration prediction based on photosynthesis mechanisms, net radiation, and soil temperature. It represents the cumulative prediction value for the t-th sample in the s-th round. When the model encounters extreme weather conditions not present in the training data (such as abnormally high temperatures or strong radiation), a purely data-driven model may produce physically meaningless maximum carbon sink values. The physical constraint term penalizes exceeding these limits. The prediction limits the model output to a reasonable range, and by directly encoding the core factors (net radiation and soil temperature) selected by feature importance screening into the loss function, the model is forced to learn causal relationships dominated by these factors, rather than simple correlation relationships, thereby improving the model's generalization ability under different farmland management measures and the credibility of carbon sink measurement prediction results.

[0036] Farmland carbon sinks exhibit significant temporal continuity and variability. In the absence of sudden disturbances (such as heavy rainfall, irrigation, or tillage), carbon exchange between adjacent time points typically shows a smooth change; even when disturbances occur, the change pattern is somewhat predictable (e.g., a brief increase in soil respiration after irrigation). Simple point-to-point predictions easily overlook this temporal dependence. By introducing a first-order difference consistency constraint, the deviation between the predicted and observed rates of change is penalized, guiding the model to capture the dynamic trend of carbon sinks rather than merely focusing on instantaneous values, thereby improving the consistency of time series predictions. (Temporal consistency term) The calculation formula is: ; In the formula, The first difference of the current cumulative prediction at time t is calculated using the following formula: ; This represents the cumulative predicted value for the (t-1)th sample from the previous (s-1) rounds. This is the output of the new model for the (t-1)th sample in the current round.

[0037] The temporal consistency term, through differential consistency, enables the model to learn not only static mappings but also the dynamic evolution of carbon sinks. This is particularly important for capturing abrupt changes caused by agricultural management practices (such as irrigation and fertilization). Since flux tower observation data often contains high-frequency noise, training with only LMSE might cause the model to attempt to fit this noise, resulting in drastic fluctuations in the prediction curve. The temporal consistency term encourages the prediction curve to maintain a similar trend to the observed curve, thus smoothing the data and extracting the true signal.

[0038] S4: Train the farmland carbon sequestration prediction model using a time-series dataset, optimize the model hyperparameters through time-series cross-validation, obtain the trained farmland carbon sequestration prediction model, and encapsulate the trained farmland carbon sequestration prediction model into a lightweight prediction engine, deploying it on edge computing nodes or cloud servers in farmland. S4 specifically includes the following sub-steps: S401: Use the time series outflow method to divide the training set and test set into two time series, and ensure that the three sets are continuous in time, and the validation set and test set do not participate in the training. Training set: the first 70%~80% of the data in the time series, validation set: the next 10%~15% of the data after the training set (for hyperparameter tuning), test set: the last 10%~15% of the data (for final model performance evaluation).

[0039] S402: Scrolling window cross-validation is used within the training set until the validation subset covers the end of the training set. This includes the following process: Set the initial training window length L (e.g., L=T) t ×0.6) and the verification window length V (e.g., V=T) t ×0.1); Starting from the beginning of the training set, take the first L time steps as the first training subset, and the next V time steps as the first validation subset; The model is trained on the first training subset and the prediction performance is computed on the first validation subset. The prediction performance can be measured using RMSE. Slide the training window backward by s steps (usually s=V, i.e., the length of the validation window), to obtain a second training subset (from s+1 to L+s) and a second validation subset (from L+s+1 to L+s+V). Train and validate again, and repeat the validation process until the validation subset covers the end of the training set. The average performance metrics across all validation subsets are used as the cross-validation score for the current hyperparameter combination. In this way, the model is trained on each historical time window and predicts the next future period, fully simulating the prediction scenario in actual deployment and effectively avoiding data leakage and overfitting.

[0040] S403: The hyperparameters of the AR-RF model are tuned using either Grid Search or Bayesian Optimization. The hyperparameters to be optimized include: the number of addition iterations, the learning rate, the core parameters of the randomized deep forest base learner, and the weight coefficients of the multi-factor loss function. The optimization objective is to minimize the root mean square error (RMSE) of the rolling window cross-validation or maximize the average coefficient of determination (R²). 2 Finally, the combination of hyperparameters that performs best on the validation set is selected for training the final model.

[0041] S404: Using the optimized hyperparameters, retrain the AR-RF model on the entire training set (i.e., the original training set + validation set) to obtain the final farmland carbon sink prediction model. The training process follows the additive iterative flow described in step S3, with each round of random forest training aiming to minimize the composite loss function. After training, save the model structure, parameters, and the mean and standard deviation required for standardization (for destandardized output) for use in subsequent steps.

[0042] S5: Obtain real-time meteorological factor data and real-time soil factor data for the target farmland area. Input the data corresponding to the main control environmental factors from the real-time meteorological factor data and real-time soil factor data into the farmland carbon sink prediction model to obtain the predicted ecosystem carbon exchange. Determine the farmland carbon sink based on the predicted ecosystem carbon exchange. The method for obtaining real-time meteorological factor data and real-time soil factor data is as described in S1.

[0043] Furthermore, farmland ecosystems are influenced by crop rotation, evolving management practices, and long-term climate change, which can lead to conceptual drift in data distribution. To maintain prediction accuracy, the model needs to be updated regularly, including the following processes: Continuously store newly observed flux tower data (if available) or high-confidence prediction results into the historical database; The model predictions are regularly compared with actual observations (such as monthly soil respiration measurements or satellite inversion products), and error indices are calculated. When the error exceeds a preset threshold for a continuous period of time (e.g., RMSE increases by 20%), or when the feature importance ranking changes significantly, the model is triggered to update. If there is new NEE data, incremental learning methods can be used to adjust only some decision trees on the basis of the original AR-RF model, or a new random forest regressor can be trained using the new data and added to the additive ensemble without completely retraining. If there is no new NEE data but environmental conditions have changed significantly, meteorological data for the current year can be collected as input, and historical models from the same period can be used for prediction. Transfer learning adaptation can also be considered.

[0044] Please see Figure 3 This embodiment provides a farmland carbon sequestration prediction system based on meteorological factors, including: The data acquisition module is used to acquire flux tower observation time series datasets of the target farmland area. The datasets include meteorological factor time series, soil factor time series, and corresponding ecosystem carbon exchange time series. The feature screening module, connected to the data acquisition module, is used to perform feature importance analysis on the meteorological factor time series and soil factor time series, and screen out the main environmental factors whose contribution to the change in ecosystem carbon exchange exceeds a preset threshold. The model building and training module, connected to the feature selection module, is used to construct an AR-RF ensemble learning model as a farmland carbon sink prediction model using the main environmental factors as input features. The model is trained using the time-series dataset. The AR-RF model iteratively adds the fitting residuals of the random forest regressor through additive iteration. In each round of training iteration, a composite loss function is used as the optimization objective. The composite loss function includes a prediction error term, a physical constraint term, and a temporal consistency term. The physical constraint term is based on the theoretical maximum carbon uptake constrained by the photosynthetic mechanism constructed from net radiation and soil temperature. The temporal consistency term is used to penalize the deviation between the predicted rate of change of carbon sink amount and the observed rate of change in adjacent time steps. The model prediction module, connected to the model building and training module, is used to acquire real-time meteorological factor data and real-time soil factor data of the target farmland area, extract data corresponding to the main environmental factors from the real-time data and input them into the farmland carbon sink prediction model to obtain the predicted ecosystem carbon exchange, and determine the farmland carbon sink based on the ecosystem carbon exchange.

[0045] This application addresses the technical problems of existing farmland carbon sequestration measurement methods, which rely on static models, ignore the dynamic influence of meteorological factors, neglect agricultural management measures, and suffer from insufficient prediction accuracy. It constructs a time-series dataset using high-frequency flux tower observation data and replaces the traditional static model with an AR-RF ensemble learning model. By inputting meteorological factors in real time, it achieves dynamic prediction of carbon sequestration, capturing diurnal variations and weather process responses. Through recursive feature elimination, it scientifically selects the main controlling factors (net radiation, soil temperature, saturated vapor pressure difference, and soil moisture content) that contribute the most to carbon exchange from numerous meteorological and soil factors, ensuring the model focuses on core driving factors. Simultaneously, it introduces a time-series consistency term and a physical constraint term into the multi-factor loss function, enabling the model to learn the dynamic changes in carbon sequestration and indirectly respond to sudden changes in carbon flux caused by agricultural activities such as irrigation and fertilization. The physical constraint term, by embedding the mechanism of photosynthesis as prior knowledge into the model training, effectively prevents extrapolation runaway under extreme weather conditions. An AR-RF additive ensemble strategy is used to progressively fit the residuals, and hyperparameters are optimized through time-series cross-validation, significantly improving prediction accuracy and generalization ability.

[0046] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention in any way. Although the present invention has been disclosed above with reference to preferred embodiments, it is not intended to limit the present invention. Any person skilled in the art can make some modifications or alterations to the above-disclosed technical content to create equivalent embodiments without departing from the scope of the present invention. Any simple modifications, equivalent changes and alterations made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the scope of the present invention.

Claims

1. A method for predicting farmland carbon sequestration based on meteorological factors, characterized in that: Includes the following steps: S1: Obtain the flux tower observation time series dataset of the target farmland area. The dataset includes meteorological factor time series, soil factor time series and corresponding ecosystem carbon exchange time series. S2: Perform feature importance analysis on the time series of meteorological factors and soil factors, and screen out the main environmental factors that contribute more than a preset threshold to the change in ecosystem carbon exchange. The main environmental factors include net radiation, soil temperature, saturated vapor pressure difference and soil moisture content. S3: Using the main controlling environmental factors as input features and the carbon exchange of the ecosystem as the prediction target, construct a farmland carbon sink prediction model based on the AR-RF model; S4: Train the farmland carbon sequestration prediction model using time series datasets, optimize the model hyperparameters through time series cross-validation, and obtain the trained farmland carbon sequestration prediction model; S5: Obtain real-time meteorological factor data and real-time soil factor data of the target farmland area, input the data corresponding to the main control environmental factor in the real-time meteorological factor data and real-time soil factor data into the farmland carbon sink prediction model to obtain the predicted ecosystem carbon exchange, and determine the farmland carbon sink based on the predicted ecosystem carbon exchange.

2. The method for predicting farmland carbon sequestration based on meteorological factors according to claim 1, characterized in that: S1 includes preprocessing the acquired dataset, which includes quality control, missing value imputation, and normalization.

3. The method for predicting farmland carbon sequestration based on meteorological factors according to claim 1, characterized in that: The parameters of the meteorological factor time series include net radiation, air temperature, saturated vapor pressure difference, solar radiation, relative humidity, and dew point temperature.

4. The method for predicting farmland carbon sequestration based on meteorological factors according to claim 1, characterized in that: In S2, a recursive feature elimination method combined with the importance assessment of the Gini coefficient in a random forest is used to screen the main environmental factors. The specific process includes the following steps: Using meteorological factor time series and soil factor time series as the initial feature set, and net ecosystem carbon exchange as the target variable, a random forest regression model was trained, and the importance score of each feature was evaluated using the Gini importance built into the random forest. A greedy strategy is used for recursive elimination, gradually removing the least important features, and the model performance is re-evaluated in each round until the preset stopping condition is reached; K-fold cross-validation was used to evaluate the predictive performance of the model after removal.

5. The method for predicting farmland carbon sequestration based on meteorological factors according to claim 4, characterized in that: The formula for calculating the importance score is as follows: ; In the formula, Features Importance score, where M is the number of trees in the random forest. For all internal nodes of the t-th tree, The decrease in Gini impurity caused by node v splitting. This is an indicator function.

6. The method for predicting farmland carbon sequestration based on meteorological factors according to claim 1, characterized in that: S3 also includes the following process for building the AR-RF model: Training a random forest regressor Output X is the input feature, and y is the predicted target; The maximum number of iterations is set to S. In each addition iteration s, the current residual is calculated. , ,in, This represents the cumulative predictions from the first n-1 rounds of the model; Train another random forest to fit the residuals, using the original features X as input, and... To achieve the output objective, train a new random forest regressor. , making It can approximate the current residual; Updated cumulative forecast: , The learning rate; After S rounds of iteration, the final AR-RF model is obtained.

7. The method for predicting farmland carbon sequestration based on meteorological factors according to claim 6, characterized in that: In each round of addition iteration, a new random forest is trained. The multi-factor loss function is used as the optimization objective. The formula for calculating the multi-factor loss function is as follows: ; In the formula, , , These are the prediction error term, the physical constraint term, and the timing consistency term, respectively. , and These are the weighting coefficients that balance the importance of each item, and their sum is 1.

8. The method for predicting farmland carbon sequestration based on meteorological factors according to claim 7, characterized in that: Physical constraints The calculation formula is: ; In the formula, N is the number of training samples. Let be the maximum possible carbon absorption at time t. Let be the cumulative predicted value for the t-th sample in the s-th round. The formula for calculating the maximum possible carbon absorption is: k is the light energy utilization coefficient. This is the soil temperature response function. Let be the net radiation at time t.

9. The method for predicting farmland carbon sequestration based on meteorological factors according to claim 1, characterized in that: S4 specifically includes the following sub-steps: The training and test sets of the AR-RF model are divided into two time series using the time series outflow method; Scrolling window cross-validation is used within the training set until the validation subset covers the end of the training set. The hyperparameters of the AR-RF model were tuned using grid search or Bayesian optimization. Using the optimized hyperparameters, the AR-RF model was retrained on the entire training set to obtain the final farmland carbon sink prediction model.

10. A farmland carbon sequestration prediction system based on meteorological factors, characterized in that: include: The data acquisition module is used to acquire flux tower observation time series datasets of the target farmland area. The datasets include meteorological factor time series, soil factor time series, and corresponding ecosystem carbon exchange time series. The feature screening module is used to perform feature importance analysis on the time series of meteorological factors and soil factors, and screen out the main environmental factors whose contribution to the change of ecosystem carbon exchange exceeds a preset threshold. The model building and training module is used to construct an AR-RF ensemble learning model as a farmland carbon sink prediction model using the main environmental factors as input features, and to train the farmland carbon sink prediction model using the time series dataset. The AR-RF model gradually adds the fitting residuals of the random forest regressor through additive iteration, and uses a composite loss function as the optimization objective in each round of iteration training. The model prediction module is used to acquire real-time meteorological factor data and real-time soil factor data of the target farmland area, extract data corresponding to the main control environmental factors from the real-time data and input them into the farmland carbon sink prediction model to obtain the predicted ecosystem carbon exchange, and determine the farmland carbon sink based on the ecosystem carbon exchange.