Tree sap flow prediction method and device combining gradient boosting and time convolution
By using LightGBM to filter key factors and combining a temporal convolution model with dilated causal convolution and local temporal attention mechanisms, the problems of high computational cost and low accuracy in tree trunk sap flow prediction are solved, achieving efficient and robust sap flow prediction.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- YANGTZE RIVER WATER RESOURCES PROTECTION SCI RES INST
- Filing Date
- 2025-09-04
- Publication Date
- 2026-05-01
AI Technical Summary
Existing methods for predicting sap flow in tree trunks are computationally expensive, inefficient, and lack interpretability. Furthermore, it is difficult to improve the accuracy of the models, as they involve numerous features, require a large amount of computation, and are prone to overfitting.
We employ the LightGBM model, a lightweight gradient booster, to screen key influencing factors. We then combine a multivariate temporal convolution model with multi-layer dilated causal convolution and local temporal attention mechanisms to construct a multivariate temporal convolution prediction model with an integrated gating feature fusion mechanism. Finally, we perform post-processing using sliding quantiles and environmental factors.
It achieves efficient prediction of tree trunk sap flow, improves computational efficiency, reduces costs, enhances the model's robustness and uncertainty representation capabilities, and is suitable for long-term monitoring and early warning.
Smart Images

Figure CN121072336B_ABST
Abstract
Description
A method and device for predicting tree sap flow by combining gradient boosting and temporal convolution. Technical Field
[0001] This invention relates to the field of tree trunk sap flow prediction technology, and more specifically, to a method and device for predicting tree trunk sap flow that combines gradient boosting and temporal convolution. Background Technology
[0002] Sap flow refers to the process by which plants transport water and dissolved inorganic salts from the roots to the leaves through the xylem vessels. It is an internal water transport process that reflects plant physiological activities (such as transpiration and root water uptake), directly reflecting plant water use efficiency. It is used to assess drought adaptability and irrigation needs, and is a key indicator in carbon-water coupling research (such as the relationship between photosynthesis and transpiration). Sap flow is regulated by environmental factors (light, humidity) and plant physiological states (stomatal opening and closing, water potential). Sap flow (SSF) prediction refers to the estimation of the rate and dynamic changes of water transport in tree stems using models or technical means. This research is of great significance in ecology, agriculture, climate, and environmental management. It not only helps to understand plant water use mechanisms, optimize agricultural and forestry irrigation management, and support urban ecological and greening management, but also helps to quantify the contribution of forests to the regional water cycle and improve the accuracy of evapotranspiration (ET) simulations. Furthermore, it can predict changes in tree sap flow under extreme climates such as high temperatures and droughts, assess forest adaptability or degradation risks, and reveal future vegetation-climate feedback mechanisms. With advancements in remote sensing, sensor, and modeling technologies, its applications will expand further, providing scientific support for sustainable water resource management and ecosystem protection.
[0003] In the course of implementing this invention, the inventors discovered that current methods for predicting tree sap flow mainly employ conventional machine learning or deep learning, which suffer from high data acquisition and computational costs, low computational efficiency, weak interpretability, large training data requirements, and a tendency to overfit. To address the issues of numerous features, high computational cost, and difficulty in improving model accuracy in tree sap flow prediction, this invention proposes a method and device for predicting tree sap flow that combines gradient boosting and temporal convolution. Summary of the Invention
[0004] The purpose of this invention is to provide a method and device for predicting tree trunk sap flow by combining gradient boosting and temporal convolution, so as to solve or at least partially solve the technical problems of existing technologies, such as large number of features, large amount of computation, and difficulty in improving model accuracy.
[0005] To address the aforementioned technical problems, the first aspect of this invention provides a method for predicting tree trunk sap flow that combines gradient boosting and temporal convolution, comprising:
[0006] Collect time-series data including sap flow data, corresponding environmental factors, and equipment parameters;
[0007] Preprocess the collected time-series data;
[0008] The LightGBM lightweight gradient lift model was used to screen environmental factors and equipment parameters corresponding to the sap flow data in the tree trunk;
[0009] A multivariate temporal convolutional prediction model with an integrated gated feature fusion mechanism is constructed. The model includes a temporal feature extraction module, a dynamic feature extraction module, a feature fusion module, and an output module. The temporal feature extraction module is used to extract temporal features from the input data using multi-layer dilated causal convolution. The dynamic feature extraction module is used to extract the dynamic influence features of different historical time steps on the prediction target from the input data by introducing a local temporal attention mechanism. The feature fusion module is used to fuse the temporal features extracted by the temporal feature extraction module with the dynamic influence features extracted by the dynamic feature extraction module using a gated fusion mechanism. The output module is used to obtain the predicted fluid flow time series segment based on the fused features.
[0010] The constructed multivariate temporal convolutional prediction model is trained;
[0011] Predicting sap flow in tree trunks using a trained multivariate temporal convolutional prediction model;
[0012] The prediction results are post-processed based on the moving quantile and environmental factors, and then converted into probabilistic outputs.
[0013] In one implementation, the Lightweight Gradient Boosting Machine (LightGBM) model is used to filter environmental factors and equipment parameters corresponding to the sap flow data, including:
[0014] Environmental factors or equipment parameters whose information content does not meet the preset conditions when using the variance threshold method;
[0015] By combining LightGBM with external statistical methods, the importance of the remaining environmental factors or equipment parameters is scored through weighted fusion, and the key influencing factors affecting sap flow in tree trunks are selected based on the comprehensive score.
[0016] In one implementation, LightGBM and external statistical methods are combined to score the importance of remaining environmental factors or equipment parameters through weighted fusion. Based on the comprehensive score, key influencing factors affecting sap flow in the tree trunk are selected, including:
[0017] Train a LightGBM model, where the LightGBM model aims to predict sap flow in tree trunks;
[0018] The trained LightGBM model is used to extract three feature importance metrics from the remaining environmental factors or device parameters, including the number of splits, information gain, and coverage.
[0019] The entropy weight method is used to assign weights to the three feature importance indices;
[0020] Based on the three feature importance indicators and their corresponding weights, the scores of environmental factors or equipment parameters are calculated.
[0021] Based on whether the final score meets the set threshold, the key influencing factors affecting the sap flow in the tree trunk are selected.
[0022] In one implementation, the feature fusion module processes the following steps:
[0023]
[0024] in, This represents the output of the time-series feature extraction module. This represents the output of the dynamic feature extraction module. For learnable Sigmoid gated functions, These are the features after fusion.
[0025] In one implementation, the feature fusion module further employs a multi-layer gated fusion structure with residual connections, and introduces a 1×1 convolution matching input / output channel. The calculation process is as follows:
[0026]
[0027] in, This represents two one-dimensional convolution operations. Indicates the first Layer fusion feature output, Indicates the first Layer fusion feature output.
[0028] In one implementation, training the constructed multivariate temporal convolutional prediction model includes:
[0029] The multivariate temporal convolution prediction model is trained by inputting the training set. The training process combines the AdamW optimizer and cosine annealing scheduling strategy, and uses the Yeats optimization algorithm to automatically search for the key hyperparameters of the multivariate temporal convolution prediction model, thus obtaining the trained multivariate temporal convolution prediction model.
[0030] In one implementation, the prediction results are post-processed based on the moving quantile and environmental factors to transform the prediction results into a probabilistic output, including:
[0031] Construct a sliding window and use an exponentially decaying weight allocation mechanism to assign weights to the predicted values within the sliding window;
[0032] After sorting the predicted values in the sliding window in ascending order, the weighted quantile of a given quantile is estimated based on the cumulative weight.
[0033] The estimated weighted quantiles are corrected by introducing key influencing factors affecting sap flow in the tree trunk;
[0034] Based on the corrected weighted quantiles and the set target quantiles, the corrected predicted values are output.
[0035] Based on the same inventive concept, a second aspect of the present invention provides a tree trunk sap flow prediction device combining gradient boosting and temporal convolution, comprising:
[0036] The data acquisition module is used to collect time-series data including sap flow data, corresponding environmental factors, and equipment parameters.
[0037] The data preprocessing module is used to preprocess the collected time-series data;
[0038] The impact factor screening module is used to screen environmental factors and equipment parameters corresponding to the sap flow data using the Lightweight Gradient Boosting Machine (LightGBM) model.
[0039] The model building module is used to construct a multivariate temporal convolutional prediction model with an integrated gated feature fusion mechanism. The model includes a temporal feature extraction module, a dynamic feature extraction module, a feature fusion module, and an output module. The temporal feature extraction module is used to extract temporal features from the input data using multi-layer dilated causal convolution. The dynamic feature extraction module is used to extract the dynamic impact features of different historical time steps on the prediction target from the input data by introducing a local temporal attention mechanism. The feature fusion module is used to fuse the temporal features extracted by the temporal feature extraction module with the dynamic impact features extracted by the dynamic feature extraction module using a gated fusion mechanism. The output module is used to obtain the predicted fluid flow time series segment based on the fused features.
[0040] The model training module is used to train the constructed multivariate temporal convolutional prediction model.
[0041] The trunk sap flow prediction module is used to predict trunk sap flow using a trained multivariate temporal convolutional prediction model.
[0042] The post-processing module is used to post-process the prediction results based on the moving quantile and environmental factors, and to convert the prediction results into probabilistic outputs.
[0043] Based on the same inventive concept, a third aspect of the present invention provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, provides the tree trunk sap flow prediction method combining gradient boosting and temporal convolution as described in the first aspect.
[0044] Based on the same inventive concept, a fourth aspect of the present invention provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the tree trunk sap flow prediction method combining gradient boosting and temporal convolution as described in the first aspect.
[0045] Compared with the prior art, the advantages and beneficial technical effects of the present invention are as follows:
[0046] This invention proposes a method and device for predicting tree sap flow by combining gradient boosting and temporal convolution. Through a triple optimization strategy of "feature selection—model construction—post-processing," it achieves efficient prediction of tree sap flow. First, dynamic dimensionality reduction is performed based on the lightweight LightGBM and various statistical indicators to improve computational efficiency and reduce costs. Second, a structurally enhanced lightweight Gated-DAT-TCN model is constructed. The temporal feature extraction module uses multi-layer dilated causal convolution to extract temporal features from the input data, while the dynamic feature extraction module introduces a local temporal attention mechanism to extract the dynamic impact features of different historical time steps on the prediction target from the input data. Then, a gated fusion mechanism is used to fuse the features extracted by the two paths and output the predicted sap flow time series segment. Finally, a post-processing method using moving quantiles and environmental factor correction is employed to achieve probabilistic output of the prediction results, enhancing the model's robustness and uncertainty expression capabilities. The overall solution balances accuracy and efficiency, and the supporting equipment is simple and low-power, making it suitable for long-term monitoring and early warning applications of tree sap flow. Attached Figure Description
[0047] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0048] Figure 1 is a flowchart of the trunk sap flow prediction method combining gradient boosting and temporal convolution provided in an embodiment of the present invention;
[0049] Figure 2 is a schematic diagram comparing the predicted values of tree trunk sap flow based on the first tree trunk sap flow data with the actual monitored values in different prediction methods in the embodiments of the present invention.
[0050] Figure 3 is a schematic diagram comparing the predicted values of tree trunk sap flow based on the second tree trunk sap flow data with the actual monitored values in different prediction methods in the embodiments of the present invention.
[0051] Figure 4 is a schematic diagram comparing the predicted values of tree trunk sap flow based on the third tree trunk sap flow data with the actual monitored values in different prediction methods in the embodiments of the present invention.
[0052] Figure 5 is a block diagram of the trunk sap flow prediction device combining gradient boosting and temporal convolution provided in an embodiment of the present invention. Detailed Implementation
[0053] This embodiment provides a tree trunk sap flow prediction method that combines gradient boosting and temporal convolution, as shown in Figure 1, including:
[0054] S1: Collect time-series data including sap flow data from tree trunks, corresponding environmental factors, and equipment parameters.
[0055] In the specific implementation process, heating probes can be deployed to monitor the sap flow in the tree trunks based on the target trees to be predicted, and simple solar environmental factor monitoring equipment can be deployed at the center of the polygon formed by the target trees to monitor relevant factor parameters such as sap flow in the target trees, environment and equipment.
[0056] Environmental factors include soil moisture, soil temperature, soluble ion concentration, and atmospheric pressure, while equipment factors include mainboard temperature, voltage of solar panels, and voltage of main batteries.
[0057] S2: Preprocess the collected time-series data.
[0058] Preprocessing includes outlier removal, linear interpolation, and standardization, as detailed below:
[0059] (1) Use the interquartile range (IQR) method to identify outliers in time series data, that is, use the quartiles of the data ( , ) and interquartile range ( The range of outliers is:
[0060]
[0061]
[0062] in, For the first The first sample The monitored values of each factor, where N is the total number of samples. and The first The values of the first quartile (lower quartile) and third quartile (upper quartile) of each factor
[0063] (2) The identified outliers are directly removed and marked as missing values NaN. For the removed outliers and missing values, linear interpolation can be used for data that has changed continuously and gradually over the past month; for periodic data, interpolation is performed according to the corresponding position within the period (such as filling by three hours / six hours / day, etc.).
[0064] (3) Since different environmental factors have different dimensions and numerical ranges, in order to prevent the model from being biased towards environmental factors with large numerical values, Z-score standardization is uniformly applied to all environmental factors, as shown in the following formula:
[0065]
[0066] in, Indicates the first The standardized sample of the first Monitoring values of each factor For the first The mean of each factor, For the first The standard deviation of each factor.
[0067] (4) Data partitioning: The standardized environmental factors and tree trunk sap flow data are divided into training and validation sets (e.g., 8:2) in a certain ratio to ensure that the assessment of the importance of environmental factors in the subsequent modeling process is based on independent datasets and to avoid information leakage.
[0068] S3: The Lightweight Gradient Boosting Machine (LightGBM) model was used to screen environmental factors and equipment parameters corresponding to the sap flow data in the tree trunk.
[0069] Specifically, step S3 aims to screen environmental factors or equipment parameters (including monitored meteorological variables and monitored equipment parameters) that significantly affect sap flow. This involves two steps: first, using the variance threshold method to eliminate factors with low information content, thus achieving preliminary dimensionality reduction; and second, combining LightGBM with external statistical methods to screen out key influencing factors affecting sap flow.
[0070] In one implementation, S3 can be achieved in the following way:
[0071] S31: Environmental factors or equipment parameters whose information content does not meet the preset conditions when using the variance threshold method;
[0072] S32: Combining LightGBM with external statistical methods, the importance of the remaining environmental factors or equipment parameters is scored through weighted fusion, and the key influencing factors affecting sap flow in the tree trunk are selected based on the comprehensive score.
[0073] The specific implementation of S31 is as follows:
[0074] A variance thresholding method is used to quickly eliminate environmental factors that lack information or are redundant, reducing the computational burden on the model. For the preprocessed factors... (The j-th factor of the n-th sample), define the factor Its value vector across all samples:
[0075]
[0076] Its variance is defined as:
[0077]
[0078] in, This is the set of factors after initial screening. For the j-th factor, By setting empirical quantiles, factors with variances below the 5th percentile are removed.
[0079] S32 trains a LightGBM model to extract internal feature importance indicators such as split count, information gain, and sample coverage. Finally, it uses the entropy weight method to weight and fuse multiple indicators to calculate a comprehensive importance score, and sorts them by score or sets a threshold to select key environmental factors for subsequent modeling and analysis.
[0080] The specific implementation of S32 is as follows:
[0081] Train a LightGBM model, where the LightGBM model aims to predict sap flow in tree trunks;
[0082] The trained LightGBM model is used to extract three feature importance metrics from the remaining environmental factors or device parameters, including the number of splits, information gain, and coverage.
[0083] The entropy weight method is used to assign weights to the three feature importance indices;
[0084] Based on the three feature importance indicators and their corresponding weights, the scores of environmental factors or equipment parameters are calculated.
[0085] Based on whether the final score meets the set threshold, the key influencing factors affecting the sap flow in the tree trunk are selected.
[0086] In the specific implementation process, after the initial screening of the factor set The LightGBM model is trained to predict sap flow in tree trunks. Its optimization objective is:
[0087]
[0088] in, This represents the prediction loss function. and The first The actual and predicted values of sap flow in the tree trunk for each sample. For the first A decision tree, Indicates the total number of decision trees. It is a regularization term for structural complexity, used to control the model complexity.
[0089] Next, three types of internal feature importance metrics are extracted from the trained model, including weights based on the number of splits, contribution of information gain, and coverage, defined as follows:
[0090] Weights based on the number of splits:
[0091]
[0092] in, Let k represent the set of non-leaf nodes in the k-th tree. As an indicator function, when node s uses The value is 1 when splitting, and 0 otherwise.
[0093] The importance of information gain:
[0094]
[0095] in, Indicates the first Trees composed of factors The set of non-leaf nodes to be split. The reduction in the loss function before and after node s splits reflects the information gain brought by this feature.
[0096] Based on the importance of sample coverage:
[0097]
[0098] in, This is the sum of sample weights covered by node s, used to measure the sample range affected by this feature.
[0099] 3. Weighted Fusion Scoring and Screening Based on Entropy Weight Method
[0100] To objectively assess the overall importance of each factor, the Entropy Weight Method (EWM) was used to automatically assign three categories of indicators (number of splits). Information gain Coverage The weights in the weighted fusion calculation ( The specific calculation method is as follows:
[0101] First, normalize each indicator to construct a standardized matrix.
[0102]
[0103] in, Indicates the first The environmental factor in the first Scores on each indicator Indicates the first The environmental factor in the first Normalized scores on each indicator The total number of factors.
[0104] Next, the information entropy of each indicator is calculated. :
[0105]
[0106] in, To avoid zero logarithms for small constants, then based on redundancy... Calculate the weights:
[0107]
[0108] Finally, the weight vector is obtained. This is used to calculate the overall score for each factor:
[0109]
[0110] in accordance with The scores are sorted and ranked according to a set threshold. Select key factors affecting changes in sap flow in tree trunks:
[0111]
[0112] The final set of environmental factors obtained through screening This will be used as the input variable for subsequent modeling and interpretive analysis, where d represents the dimension of the filtered input factor.
[0113] S4: Construct a multivariate temporal convolutional prediction model with an integrated gated feature fusion mechanism. The model includes a temporal feature extraction module, a dynamic feature extraction module, a feature fusion module, and an output module. The temporal feature extraction module is used to extract temporal features from the input data using multi-layer dilated causal convolution. The dynamic feature extraction module is used to introduce a local temporal attention mechanism to extract the dynamic impact features of different historical time steps on the prediction target from the input data. The feature fusion module is used to fuse the temporal features extracted by the temporal feature extraction module with the dynamic impact features extracted by the dynamic feature extraction module using a gated fusion mechanism. The output module is used to obtain the predicted fluid flow time series segment based on the fused features.
[0114] Specifically, S4 constructs a structure-enhanced multivariate time series prediction model (Gated-DAT-Temporal Convolutional Network, Gated-DAT-TCN). It constructs input sequences based on key factors selected by S3, combines dilated convolution to capture long-term dependent features and local temporal attention to perceive the influence of key moments, and adaptively integrates information from different modeling paths through a gating fusion mechanism to finally obtain future fluid flow data.
[0115] In the specific implementation process, firstly, based on the high-impact factors selected in step S3 using the LightGBM model, the supervised sample pairs are divided using the sliding window method. ,in Indicates the prediction time step. Input window length, To predict the window length, ∈ For at any time The length of the front is Historical key environmental factor sequence fragments, among which This represents the number of factors after screening. For at any time The future The tree trunk sap flow sequence at each time step.
[0116] To enhance the model's ability to capture long-term dependent features, a multi-layer dilated causal convolution is used to construct the basic temporal modeling structure without significantly increasing the parameter size. Its expression is as follows:
[0117]
[0118] in, Indicates historical time step The input sequence fragment, For the convolution kernel in the th The weight of each position, Where is the kernel size and δ is the dilation coefficient, which determines the time interval for feature extraction. ∈ It is a temporal feature representation obtained after passing through multiple layers of dilated causal convolutional networks. This represents the feature dimension of the model. This structure can capture the long-term response relationship of liquid flow to meteorological factors without increasing the number of parameters.
[0119] To further capture the dynamic impact of different historical time steps within the sliding window on the predicted target, a local temporal attention mechanism is introduced to process the input segment. Perform weighted modeling. First, generate a vector of queries, keys, and values:
[0120]
[0121]
[0122]
[0123] in, These are the learnable query, key, and value mapping matrices, respectively. The attention weight matrix is calculated as follows:
[0124]
[0125]
[0126] This is the attention weight matrix. ∈ The attention output after weighted aggregation is used to emphasize the impact of key historical moments on current fluid flow changes, and to model its hysteresis and abrupt response.
[0127] The feature fusion module adaptively integrates the outputs of dilated convolutional paths and local attention paths through a gated fusion mechanism, avoiding the need for manually setting the fusion ratio. For input segments... The fused output is represented as:
[0128]
[0129] in, This represents the output of a multi-layer dilated causal convolution path. This represents the output of the local temporal attention path. It is a learnable sigmoid gate function that dynamically controls the fusion ratio of the two path information. This represents the feature representation after fusion.
[0130] To improve the stability of deep training and the efficiency of feature propagation, a multi-layer gated fusion structure with residual connections is adopted, and a 1×1 convolution is introduced to match the input and output channels. The calculation process is as follows:
[0131]
[0132] in, This represents two one-dimensional convolution operations. Indicates the first Layer fusion feature output, , (Right now Pick (Time) is the final multi-layer fusion output. Ultimately, the fused features... Multilayer Perceptron (MLP) Output future predicted values:
[0133]
[0134] in, Indicates the process Feature output of layer-gated fusion Indicates length is Predicted fluid flow time series segments.
[0135] S5: Train the constructed multivariate temporal convolutional prediction model.
[0136] The model employs a residual structure to enhance training stability, and combines He initialization, the AdamW optimizer, and a cosine annealing strategy to improve convergence efficiency. Finally, Bayesian optimization is used to automatically search for key hyperparameters, achieving a balance between prediction accuracy and model complexity, thereby improving the model's adaptability and practicality.
[0137] In the specific implementation, He initialization is used to match the ReLU activation characteristic to maintain signal flow stability. The training process combines the AdamW optimizer with a cosine annealing scheduling strategy to improve model convergence speed and generalization performance. The learning rate update process is as follows:
[0138]
[0139] in, For the first The learning rate for each training round. and These are the upper and lower limits of the learning rate. This represents the total number of iterations.
[0140] The Bayesian optimization algorithm is used to automatically search for key hyperparameters of the TCN model, including kernel size, number of network layers, and learning rate. The optimization objective function is expressed as:
[0141]
[0142] in, This refers to a combination of hyperparameters, including kernel size, number of layers, and learning rate. For the hyperparameter search space, The objective function with a penalty term is in the form of:
[0143]
[0144] in, It is the validation set error. It's about model complexity. It is a complexity weighting coefficient that controls the balance between precision and complexity.
[0145] To address the lag response and multi-scale coupling characteristics of tree sap flow to meteorological variables, this invention presents the structure-enhanced multivariate time series forecasting model Gated-DAT-TCN. Furthermore, a lightweight integrated forecasting framework is constructed through Bayesian hyperparameter optimization, thereby improving the model's adaptability and stability.
[0146] S6: Use a trained multivariate temporal convolutional prediction model to predict sap flow in the tree trunk.
[0147] Once a trained model is obtained, it can be used to predict sap flow in tree trunks.
[0148] S7: Post-process the prediction results based on the moving quantile and environmental factors to transform the prediction results into probabilistic outputs.
[0149] Specifically, S7 proposes a post-processing method based on Exponentially Weighted Moving Quantile (EWMA Quantile) to transform deterministic prediction results into probabilistic outputs. The method constructs quantile estimates using historical prediction values and dynamically adjusts them in conjunction with environmental factors to enhance responsiveness to external disturbances. By setting multiple target quantiles, prediction intervals are generated, enabling modeling of the uncertainty of sap flow changes in tree trunks and improving the model's robustness and adaptability.
[0150] S7 can be implemented in the following ways:
[0151] Construct a sliding window and use an exponentially decaying weight allocation mechanism to assign weights to the predicted values within the sliding window;
[0152] After sorting the predicted values in the sliding window in ascending order, the weighted quantile of a given quantile is estimated based on the cumulative weight.
[0153] The estimated weighted quantiles are corrected by introducing key influencing factors affecting sap flow in the tree trunk;
[0154] Based on the corrected weighted quantiles and the set target quantiles, the corrected predicted values are output.
[0155] In the specific implementation process, in order to improve the model output's ability to characterize uncertainty, the deterministic point prediction results obtained in step four are... Based on this, a probabilistic prediction post-processing mechanism is introduced. This method constructs a conditional distribution estimate using exponentially weighted moving quantiles (EWMA quantiles) and introduces an environmental factor sensitivity adjustment mechanism to dynamically correct the quantiles, thereby realizing the transformation from point estimation to confidence interval estimation and enhancing the model's generalization ability and local adaptability.
[0156] (1) Constructing and initializing the sliding window. At each prediction time step... Using historical prediction results from the model, a length of [length missing] is constructed. sliding window To simulate the timeliness of information, an exponentially decaying weight allocation mechanism is adopted, which assigns weights to the first element within the window. Predicted values Assign weights:
[0157]
[0158] in, This is an exponential decay factor that controls the preference for recent data. This weight satisfies monotonically decreasing properties and is approximately normalized. .
[0159] (2) Weighted moving quantile calculation. After sorting the predicted values in the window in ascending order, the given quantile is estimated based on the cumulative weight. Weighted quantiles The calculation process is as follows:
[0160]
[0161] in, The candidate threshold variable takes values that cover all predicted values within the sliding window. The possible range; This indicates that, under the weighted distribution of historical predicted values, the cumulative weight reaches... The predicted value at that time. hour, This is the weighted median.
[0162] (3) Introducing environmental factors to correct quantiles. To improve the adaptability of quantile estimation to external environmental disturbances, the environmental factors that have the greatest impact on trunk sap flow are introduced for quantile correction. Let the environmental factor with the highest score after S3 screening be... Within the history sliding window The mean and standard deviation are respectively and The corrected quantile estimate is:
[0163]
[0164] in, This is the environmental response sensitivity coefficient, used to control the adjustment magnitude of the prediction threshold by the environmental migration. This mechanism can be viewed as a temperature-driven migration correction of the prediction distribution boundary, improving the model's dynamic response to non-stationary external disturbances.
[0165] (4) Quantile set output and probability modeling. By setting multiple target quantiles (e.g. The above process (processes (1) to (3)) can be repeated to obtain a set of time points. The following are the corrected forecast values:
[0166]
[0167] This set of quantiles constitutes an approximate expression of the current predicted distribution, independent of specific distribution assumptions, thus enabling direct modeling of future fluid flow variation ranges. Compared to traditional regression models, this method enhances the sensitivity of prediction results to uncertainties and external disturbances while maintaining the main model structure.
[0168] To evaluate the performance of the prediction model, this embodiment also includes assessing the overall performance of the method compared to common models (such as LSTM, GRU, TCN, and LightGBM) from three aspects: point prediction accuracy, probability prediction capability, and resource overhead.
[0169] Specifically, the prediction accuracy and uncertainty representation ability are measured by root mean square error (RMSE), mean absolute error (MAE), and continuous rank probability score (CRPS), and training time, inference efficiency, and memory usage are compared. Evaluation results show that the proposed method combines high accuracy, strong generalization, and good deployment performance, making it suitable for fluid flow monitoring and early warning applications.
[0170] In the specific implementation process, in order to comprehensively evaluate the performance of the tree trunk sap flow prediction method proposed in this invention, prediction accuracy and uncertainty expression ability are measured from the dimensions of point prediction accuracy, probability prediction ability and resource consumption through RMSE, MAE and CRPS. Training time, single sample inference time and memory usage are compared and compared with a variety of common single models (such as LSTM, GRU, TCN and LightGBM) to quantify the advantages and adaptability of this method in practical applications.
[0171] (1) Point prediction accuracy assessment. First, the error level between the model output value and the actual observed value is assessed, and the root mean square error (RMSE) and mean absolute error (MAE) are selected as the main evaluation indicators:
[0172]
[0173]
[0174] in, Indicates the first The true value of sap flow in the tree trunk for each sample. For the first The model prediction value for each sample. The total number of samples. This metric is suitable for comparing the differences in point prediction accuracy between this invention and baseline models (such as LSTM, GRU, TCN, LightGBM).
[0175] (2) Evaluation of probability prediction capability. The overall quality of the probability predictions obtained in step five is quantitatively evaluated using the Continuous Rank Probability Score (CRPS).
[0176]
[0177] in, Represents a set of quantiles The constructed cumulative distribution function, This is an indicator function. The smaller the CRPS value, the closer the predicted distribution is to the true value, and the better the probability prediction performance.
[0178] (3) Resource efficiency and deployment capability assessment. In addition to prediction accuracy, to assess the engineering usability of the model, the resource overhead of the method of this invention is compared with that of common models in the following aspects:
[0179] Training time: The total training time of the model under the same hardware conditions, in seconds;
[0180] Inference efficiency: Inference time for prediction of a single sample, in seconds;
[0181] Memory usage: Peak memory usage of the model during runtime, in MB.
[0182] Based on the above evaluation indicators, the method of the present invention maintains high-precision prediction while also possessing distributed representation capability and deployment feasibility, making it suitable for tree trunk sap flow monitoring and early warning scenarios where high prediction reliability and system stability are required.
[0183] The method of the present invention will be described in detail below through specific examples.
[0184] Taking the cedar cypress vegetation community affected by meteorological conditions and human activities as an example, a trunk sap flow prediction method combining gradient boosting and temporal convolution is used to predict the changes in trunk sap flow every 3 hours over the next 15 days.
[0185] Step 1: Based on the three target cedar trees to be predicted, deploy heated probes to monitor the sap flow in the tree trunks. Also, deploy simple environmental monitoring equipment (solar-powered) in the center of the triangle formed by the three cedar trees to monitor the sap flow in the target trees, the soil environment, and the equipment temperature, etc. The default equipment data monitoring frequency is once every 30 minutes.
[0186] Step Two: Data Collection and Preprocessing of Tree Sap Flow Time Series. Data on tree sap flow and related environmental and equipment parameters, such as soil moisture, soil temperature, soluble ion concentration, atmospheric pressure, and motherboard temperature, were collected from December 2023 to September 2024. Outliers were removed and missing values were imputed from the time series data, followed by a weighted average to obtain 3-hour data points. The preprocessed data was then split into training and validation sets at a 9:1 ratio. The descriptive characteristics of the pre-processed data are as follows:
[0187] Table 1. Descriptive statistics of monitoring data
[0188]
[0189] It should be noted that soil EC refers to the concentration of soluble ions.
[0190] Step 3: High-impact factor screening based on the lightweight LightGBM model. First, low-variance environmental features are eliminated using a variance threshold. Then, the LightGBM algorithm is used to calculate the weight, gain, and coverage of each feature. The entropy weighting method is used to weight and fuse multiple indicators to calculate a comprehensive score. Key environmental factors are then selected by sorting the scores or setting thresholds for subsequent modeling and analysis. The weights, gains, and coverage of each selected factor, as well as the weighted fusion comprehensive score, are as follows:
[0191] Table 2 Importance factors and weighted scores for impact factor screening
[0192]
[0193] Step 4: Construct a multivariate time series prediction model, Gated-DAT-TCN. Building upon Step 3, the input sequence is constructed based on the key influencing factors selected in Step 3. Dilated convolution is used to capture long-term dependency features, and local temporal attention is used to perceive the impact of key moments. Finally, information from different modeling paths is adaptively integrated through a gating fusion mechanism.
[0194] Step 5: Train the constructed multivariate temporal convolution prediction model, combine He initialization, AdamW optimizer and cosine annealing strategy to improve convergence efficiency, and automatically search for key hyperparameters through Bayesian optimization.
[0195] Step Six: Predict the trunk flow using the trained multivariate temporal convolutional prediction model.
[0196] Step 7: Post-process the prediction results based on the moving quantile and environmental factors, transforming the prediction results into probabilistic outputs.
[0197] Step 8: Performance Evaluation of the Prediction Model. The model is compared to a single machine learning or deep learning model. Prediction accuracy and uncertainty representation ability are measured using RMSE, MAE, and CRPS. Training time (s), inference efficiency (s), and memory usage (MB) are also compared to evaluate the overall performance of the method compared to common models (such as LSTM, GRU, TCN, and LightGBM).
[0198] Specifically, as shown in Table 4, the comparison of the prediction results of sap flow using different prediction methods is presented under three types of sap flow data (sap flow 1, 2 and 3 as examples). Please refer to Figures 2 to 4, which respectively show the comparison between the predicted and monitored values of sap flow using different methods under the three types of sap flow data.
[0199] Table 4 Comparison of Tree Trunk Sap Flow Prediction Results Indicators Using Different Prediction Methods
[0200]
[0201] In summary, this embodiment utilizes simple soil environmental monitoring equipment to construct a tree trunk sap flow prediction method that combines gradient boosting and temporal convolution. Through a triple optimization strategy of "feature selection - model construction - post-processing", it achieves efficient prediction of tree trunk sap flow. Customized improvements were made to the data input design (lightgbm factor selection), model construction (structurally enhanced Gated-DAT-TCN model), training strategy (H initialization + AdamW + cosine annealing scheduling), and post-processing (moving quantile and environmental factor correction) for the sap flow prediction task. The model has excellent prediction accuracy and strong generalization performance.
[0202] Example 2
[0203] Based on the same inventive concept, this embodiment discloses a tree trunk sap flow prediction device based on gradient boosting and temporal convolution, as shown in Figure 5, including:
[0204] The data acquisition module 101 is used to acquire time-series data including sap flow data, corresponding environmental factors, and equipment parameters.
[0205] The data preprocessing module 102 is used to preprocess the collected time-series data;
[0206] The impact factor screening module 103 is used to screen environmental factors and equipment parameters corresponding to the tree trunk sap flow data using the Lightweight Gradient Boosting Machine (LightGBM) model.
[0207] The model building module 104 is used to build a multivariate temporal convolutional prediction model with an integrated gated feature fusion mechanism. The model includes a temporal feature extraction module, a dynamic feature extraction module, a feature fusion module, and an output module. The temporal feature extraction module is used to extract temporal features from the input data using multi-layer dilated causal convolution. The dynamic feature extraction module is used to extract the dynamic influence features of different historical time steps on the prediction target from the input data by introducing a local temporal attention mechanism. The feature fusion module is used to fuse the temporal features extracted by the temporal feature extraction module with the dynamic influence features extracted by the dynamic feature extraction module using a gated fusion mechanism. The output module is used to obtain the predicted liquid flow time series segment based on the fused features.
[0208] The model training module 105 is used to train the constructed multivariate temporal convolutional prediction model.
[0209] The trunk flow prediction module 106 is used to predict the trunk flow using a trained multivariate temporal convolutional prediction model.
[0210] The post-processing module 107 is used to post-process the prediction results based on the moving quantile and environmental factors, and to convert the prediction results into probabilistic outputs.
[0211] Because of the equipment used in the method of Embodiment 2 of the present invention, those skilled in the art can understand the specific structure and variations of the equipment based on the method described in Embodiment 1 of the present invention, and therefore will not be described again here. All equipment used in the method of Embodiment 1 of the present invention falls within the scope of protection of the present invention.
[0212] Example 3
[0213] Based on the same inventive concept, the present invention also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the tree trunk sap flow prediction method based on gradient boosting and temporal convolution of Embodiment 1.
[0214] Since the computer-readable storage medium described in Embodiment 3 of this invention is the same computer-readable storage medium used in implementing the tree trunk sap flow prediction method based on gradient boosting and temporal convolution in Embodiment 1 of this invention, those skilled in the art can understand the specific structure and variations of this computer-readable storage medium based on the method described in Embodiment 1 of this invention, and therefore will not be repeated here. All computer-readable storage media used in the method of Embodiment 1 of this invention fall within the scope of protection of this invention.
[0215] Example 4
[0216] Based on the same inventive concept, the present invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the method described in Embodiment 1.
[0217] Since the computer device described in Embodiment 4 of this invention is the same computer device used to implement the tree trunk sap flow prediction method based on gradient boosting and temporal convolution in Embodiment 1 of this invention, those skilled in the art can understand the specific structure and variations of this computer device based on the method described in Embodiment 1 of this invention, and therefore will not be described again here. All computer devices used in the method of Embodiment 1 of this invention fall within the scope of protection of this invention.
[0218] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0219] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in one or more blocks of the flowchart illustrations and / or one or more blocks of the block diagrams.
[0220] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including both the preferred embodiments and all changes and modifications falling within the scope of the invention. Clearly, those skilled in the art can make various modifications and variations to the embodiments of the invention without departing from the spirit and scope of the invention. Thus, if these modifications and variations of the embodiments of the invention fall within the scope of the claims of the invention and their equivalents, the invention also intends to include these modifications and variations.
Claims
1. A method for predicting sap flow in tree trunks by combining gradient boosting and temporal convolution, characterized in that, include: Collect time-series data including sap flow data, corresponding environmental factors, and equipment parameters; Preprocess the collected time-series data; A lightweight gradient booster model (LightGBM) is used to screen environmental factors and equipment parameters corresponding to tree sap flow data. This includes identifying environmental factors or equipment parameters whose information content does not meet preset conditions using a variance thresholding method. Combining LightGBM with external statistical methods, the importance of the remaining environmental factors or equipment parameters is scored through weighted fusion, and key influencing factors affecting tree sap flow are selected based on the comprehensive score. A multivariate temporal convolutional prediction model with an integrated gated feature fusion mechanism is constructed. The model includes a temporal feature extraction module, a dynamic feature extraction module, a feature fusion module, and an output module. The temporal feature extraction module extracts temporal features from the input data using multi-layer dilated causal convolution. The dynamic feature extraction module introduces a local temporal attention mechanism to extract the dynamic impact features of different historical time steps on the prediction target from the input data. The feature fusion module... The fusion module uses a gated fusion mechanism to fuse the temporal features extracted by the temporal feature extraction module with the dynamic influence features extracted by the dynamic feature extraction module. The output module is used to obtain the predicted sap flow time series segment based on the fused features. The constructed multivariate temporal convolution prediction model is trained. The trained multivariate temporal convolution prediction model is used to predict trunk sap flow. The prediction results are post-processed based on the sliding quantile and environmental factors, and the prediction results are converted into probabilistic outputs, including: constructing a sliding window and using an exponential decay weight allocation mechanism to assign weights to the predicted values within the sliding window; sorting the predicted values within the sliding window in ascending order and estimating the weighted quantile of a given quantile based on the cumulative weight; introducing key influencing factors affecting trunk sap flow to correct the estimated weighted quantile; and outputting the corrected predicted value based on the corrected weighted quantile and the set target quantile.
2. The tree trunk sap flow prediction method combining gradient boosting and temporal convolution as described in claim 1, characterized in that, Combining LightGBM with external statistical methods, this study scores the importance of remaining environmental factors or equipment parameters using a weighted fusion approach. Based on the comprehensive score, key influencing factors affecting sap flow are selected. The process includes: training a LightGBM model aimed at predicting sap flow; extracting three feature importance indices from the remaining environmental factors or equipment parameters using the trained LightGBM model: split count, information gain, and coverage; assigning weights to these three feature importance indices using an entropy weighting method; calculating the scores of the environmental factors or equipment parameters based on the three feature importance indices and their corresponding weights; and selecting key influencing factors affecting sap flow based on whether the final score meets a set threshold.
3. The trunk sap flow prediction method combining gradient boosting and temporal convolution as described in claim 1, characterized in that, The feature fusion module's processing procedure is as follows: in, Indicates at time The length of the front is Historical key environmental factor sequence fragments, This represents the output of the time-series feature extraction module. This represents the output of the dynamic feature extraction module. For learnable Sigmoid gated functions, These are the features after fusion.
4. The trunk sap flow prediction method combining gradient boosting and temporal convolution as described in claim 1, characterized in that, The feature fusion module also employs a multi-layer gated fusion structure with residual connections, and introduces 1×1 convolutional matching input and output channels. The calculation process is as follows: in, This represents two one-dimensional convolution operations. Indicates the first Layer fusion feature output, Indicates the first Layer fusion feature output.
5. The tree trunk sap flow prediction method combining gradient boosting and temporal convolution as described in claim 1, characterized in that, The constructed multivariate temporal convolution prediction model is trained by: inputting the training set into the constructed multivariate temporal convolution prediction model for training; combining the AdamW optimizer and cosine annealing scheduling strategy during the training process; and using the Yeats optimization algorithm to automatically search for the key hyperparameters of the multivariate temporal convolution prediction model to obtain the trained multivariate temporal convolution prediction model.
6. A tree trunk sap flow prediction device combining gradient boosting and temporal convolution, characterized in that, include: The data acquisition module is used to collect time-series data including sap flow data, corresponding environmental factors, and equipment parameters. The data preprocessing module is used to preprocess the collected time-series data; The impact factor screening module uses the Lightweight Gradient Boosting Machine (LightGBM) model to screen environmental factors and equipment parameters corresponding to the sap flow data. This includes screening environmental factors or equipment parameters whose information content does not meet preset conditions using a variance thresholding method; combining LightGBM with external statistical methods, the importance of the remaining environmental factors or equipment parameters is scored through weighted fusion, and key impact factors affecting sap flow are selected based on the comprehensive score. The model building module constructs a multivariate temporal convolutional prediction model with an integrated gated feature fusion mechanism. The model includes a temporal feature extraction module, a dynamic feature extraction module, a feature fusion module, and an output module. The temporal feature extraction module extracts temporal features from the input data using multi-layer dilated causal convolution; the dynamic feature extraction module introduces a local temporal attention mechanism to extract the dynamic impact features of different historical time steps on the prediction target from the input data; and the feature fusion module... The system employs a gated fusion mechanism to fuse the temporal features extracted by the temporal feature extraction module with the dynamic influence features extracted by the dynamic feature extraction module. The output module is used to obtain the predicted sap flow time series segment based on the fused features. The model training module is used to train the constructed multivariate temporal convolutional prediction model. The trunk sap flow prediction module is used to predict trunk sap flow using the trained multivariate temporal convolutional prediction model. The post-processing module is used to post-process the prediction results based on the sliding quantile and environmental factors, converting the prediction results into probabilistic outputs. This includes: constructing a sliding window and using an exponential decay weighting mechanism to assign weights to the predicted values within the sliding window; sorting the predicted values within the sliding window in ascending order and estimating the weighted quantile of a given quantile based on the cumulative weights; introducing key influencing factors affecting trunk sap flow to correct the estimated weighted quantile; and outputting the corrected predicted value based on the corrected weighted quantile and the set target quantile.
7. A computer-readable storage medium, characterized in that, It stores a computer program that, when executed by a processor, implements the trunk sap flow prediction method combining gradient boosting and temporal convolution as described in any one of claims 1 to 5.
8. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the trunk sap flow prediction method combining gradient boosting and temporal convolution as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Linear baseline model economic forest health monitoring method and system based on sap flow
CN118362684A
CNN-BiGRU model sap flow prediction method and system based on attention mechanism
CN119537935A