A method for predicting CO2 emission concentration based on a Bayesian optimized principal-complement model
By combining the Bayesian optimization master-complement model with ARIMA and LSTM models, and optimizing the hyperparameter combination, the problems of single algorithm and cumbersome hyperparameter setting in CO2 emission concentration prediction are solved, achieving high-precision multi-step prediction and avoiding the uncertainty of manual parameter tuning.
Patent Information
- Application Number
- CN202410882567.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-02
- Publication Date
- 2025-12-02
- Estimated Expiration
- 2044-07-02
AI Technical Summary
Existing CO2 emission concentration prediction methods cannot achieve high-precision prediction with a single prediction algorithm, and the hyperparameter settings are cumbersome and have great uncertainty, making it difficult to meet the needs of multi-step prediction.
A Bayesian optimization master-complement model approach is adopted, which combines the ARIMA master model and the LSTM compensation model to optimize the hyperparameter combination and construct a CO2 emission concentration prediction model. This achieves synergistic optimization of coupled hyperparameters and avoids manual parameter tuning.
It improves the accuracy and stability of CO2 emission concentration prediction, reduces the tediousness and uncertainty of manual parameter adjustment, and enables efficient multi-step prediction.
Smart Images

Figure CN118839846B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of CO2 emission concentration detection technology, and in particular to a method for predicting CO2 emission concentration based on a Bayesian optimized principal-complement model. Background Technology
[0002] Urban solid waste incineration (MSWI) processes emit the greenhouse gas CO2. Multi-step prediction of its emission concentration and subsequent control measures can help achieve dual-carbon goals and protect the ecological environment. However, the setting of hyperparameters in the model can severely limit its predictive performance. Currently, there are no reports on multi-step prediction of CO2 emissions from MSWI processes. Predicting CO2 concentration is essentially a time series modeling problem. Among these, the Autoregressive Differential Integrated Moving Average (ARIMA) model is a classic time series prediction model suitable for non-stationary data. Long Short-Term Memory (LSTM) neural networks have more complex hidden units than recurrent neural networks, allowing for selective addition or subtraction of information. Research shows that LSTM models can better handle the nonlinear characteristics of data compared to ARIMA models.
[0003] However, the inherent differences in data characteristics mean that high-precision predictions cannot be achieved using only ARIMA or LSTM models. Therefore, it is essential to design a CO2 emission concentration prediction method based on a Bayesian optimized principal-complement model. Summary of the Invention
[0004] The purpose of this invention is to provide a method for predicting CO2 emission concentration based on a Bayesian optimized master-complement model, so as to solve the problem of a single prediction algorithm and avoid the tediousness and uncertainty of manual parameter tuning.
[0005] To achieve the above objectives, the present invention provides the following solution:
[0006] A method for predicting CO2 emission concentration based on a Bayesian optimized principal-complement model includes the following steps:
[0007] Obtain the raw dataset of CO2 emission concentrations;
[0008] The BO algorithm is used to select optimization parameters, and the optimization parameters are initialized to obtain the sample space.
[0009] Construct the objective function and calculate the objective value for the original dataset and the sample space to obtain the objective function value;
[0010] The objective function is optimized, and the optimal parameter combination is obtained through the optimized objective function;
[0011] The final prediction model is obtained based on the optimal parameter combination, and the CO2 emission concentration is predicted using the final prediction model.
[0012] The specific steps to obtain the objective function value are as follows:
[0013] The target values of the original dataset and sample space are processed, an ARIMA master model is constructed based on the processed data, the ARIMA master model is tested, and the data is predicted based on the tested ARIMA master model to obtain the predicted value of the master model.
[0014] Calculate the residual of the master model prediction, construct an LSTM compensation model based on the residual of the master model prediction, and use the LSTM compensation model to make advance predictions of the master model prediction to obtain the prediction of the compensation model.
[0015] The objective function value is obtained based on the predictions from the master model and the compensation model.
[0016] Optionally, the initialization process for the optimization parameters involves setting the optimization range of the optimization parameters; the optimization range is specifically defined as follows:
[0017]
[0018] Where p is the autoregressive order of the classic ARIMA model, and LB p UB is the lower bound for finding the autoregressive order. p LB is the upper bound for the optimization of the autoregressive order, q is the moving average order of the classic ARIMA model, and LB is the lower bound for the higher bound. q UB is the lower bound for the optimization of the moving average order. q N is the upper limit for the optimization of the moving average order. hidden LB is the number of hidden layer units. hidden UB is the lower bound for finding the number of hidden layer units. hidden N is the upper limit for optimizing the number of hidden layer units. epoch For training rounds, LB epoch To find the lower bound of the number of training rounds, UB epoch To optimize the upper limit of training epochs, R learn For the learning rate, LB learn UB is the lower bound for finding the optimal learning rate. learn N is the upper limit for finding the optimal learning rate. DropFactor As a penalty factor, LB DropFactor UB is the lower bound for the optimization of the penalty factor. DropFactor This represents the upper limit of the optimization of the penalty factor.
[0019] Optionally, data processing of the target values in the original dataset and sample space is performed using the Z-Score method. The formula for calculating the Z-Score is as follows:
[0020]
[0021] Among them, z score Let z be the score, and y be the score. ori For the original dataset, For y ori length, f std (·) is used to calculate the standard deviation.
[0022] Optionally, an ARIMA master model is constructed based on the processed data, including:
[0023] The stationarity of the processed data is tested using the extended Dickie-Fowler test method; the calculation formula for the test is: in, m is the length of the processed data. ORT s is a normalized column vector. ADF As an intermediate variable, The first to the second in the original dataset Each element.
[0024] Optionally, constructing the ARIMA master model based on the processed data also includes:
[0025] Perform a differencing operation on the non-stationary processed data until the processed data becomes stationary; the formula for the differencing operation is Δy. t =y t -y t-1 ; where Δy t The value after difference, y t Let y be the sequence at time t. t-1 This is the sequence at time t-1.
[0026] Optionally, the specific steps for validating the ARIMA master model include:
[0027] Calculate the residual sequence of the ARIMA master model;
[0028] The ARIMA master model was tested based on the residual sequence and the Durbin-Watson test.
[0029] The formula for calculating the Durbin-Watson test is: s DW =((f diff (r std )) T *f diff (r std )) / ((r std ) T *r std ); where f diff (·) represents the difference operation, sDW This is the Durbin-Watson test value.
[0030] Optionally, the formula for calculating the master model prediction is: in, The main model's predicted values. For N start The predicted value at time +1, For N start The predicted value at time +2.
[0031] Optionally, the specific steps for using the LSTM compensation model to predict the main model's forecasts ahead of time include:
[0032] Multiple data standardization operations are performed on the residual sequence of the master model to obtain multiple standardized data; the standardization calculation formula is as follows: Among them, f min (·) is the operation to find the minimum value, f max (·) represents the maximum value operation, where a is the lower bound of standardization, b is the upper bound of standardization, and r is the input to the LSTM compensation model. str For standardized data;
[0033] The network parameters of the LSTM compensation model were updated multiple times using standardized data and gradient descent to obtain predicted values for different residual sequences.
[0034] The predicted values of different residual sequences are combined to obtain the predicted values of the compensation model.
[0035] Optionally, the specific steps for optimizing the objective function include:
[0036] Calculate the posterior distribution of the objective function; the specific calculation formula is as follows: Where μ(·) is the mean vector, Σ(·) is the covariance matrix, and N(·) is the normal distribution. The first to the second in the sample space One element, The first to the second in the objective function One element;
[0037] The function value of the next sampling point is calculated using the acquisition function; the specific calculation formula for the acquisition function is as follows: in, The function value is the optimal point in the sample space. This is the function value for the next sampling point.
[0038] The next sampling point is obtained based on the function value of the next sampling point; the specific calculation formula is as follows: Where, is the next sampling point, This indicates that the function value is returned when the acquisition function reaches its maximum value.
[0039] According to specific embodiments provided by the present invention, the following technical effects are disclosed: The CO2 emission concentration prediction method based on a Bayesian optimized principal-complement model provided by the present invention includes: obtaining the original dataset of CO2 emission concentration; selecting optimization parameters based on the BO algorithm and initializing the optimization parameters to obtain a sample space; constructing an objective function and calculating the objective value for the original dataset and the sample space to obtain the objective function value; optimizing the objective function and obtaining the optimal parameter combination through the optimized objective function; obtaining the final prediction model based on the optimal parameter combination, and predicting the CO2 emission concentration through the final prediction model. This method solves the problem of a single prediction algorithm, realizes the collaborative optimization of coupled hyperparameters, and avoids the tediousness and uncertainty of manual parameter tuning. Attached Figure Description
[0040] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0041] Figure 1 This is a flowchart of the CO2 emission concentration prediction method based on the Bayesian optimized principal-complement model according to an embodiment of the present invention;
[0042] Figure 2 This is a flowchart of the parameter optimization process according to an embodiment of the present invention;
[0043] Figure 3 This is a flowchart of the classic ARIMA model prediction process according to an embodiment of the present invention;
[0044] Figure 4 This is a flowchart illustrating the construction of the objective function in an embodiment of the present invention;
[0045] Figure 5 This is a flowchart illustrating the objective function optimization process according to an embodiment of the present invention.
[0046] Figure 6 The following are prediction results for CO2 test sets of different models with different prediction steps according to embodiments of the present invention: (a) is a prediction result with 1 step ahead; (b) is a prediction result with 2 steps ahead; (c) is a prediction result with 3 steps ahead; (d) is a prediction result with 4 steps ahead; and (e) is a prediction result with 5 steps ahead. Detailed Implementation
[0047] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0048] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0049] like Figure 1 As shown, this embodiment of the invention provides a method for predicting CO2 emission concentration based on a Bayesian optimized principal-complement model, including the following steps:
[0050] Step 100: Obtain the raw dataset y of CO2 emission concentrations. ori .
[0051] like Figure 2 As shown, step 200 is: selecting optimization parameters based on the Bayesian optimization algorithm (BO) and initializing the optimization parameters to obtain the sample space.
[0052] Specifically, the selected optimization parameters include: the autoregressive order and moving average order of the classic ARIMA model, the number of hidden layer units, the number of training epochs, the learning rate, and the penalty factor.
[0053] Specifically, such as Figure 3 As shown, the classic ARIMA model is a differential moving average autoregressive model, which essentially uses historical information from the data itself to predict future values. It includes both AR and MA models. The AR model, being an autoregressive model, considers the influence of past observations on the current value. Its advantage lies in data with long historical trends, but it cannot handle data with outliers or high noise levels. The MA model, being a moving average model, considers the influence of past prediction errors on the current value and can handle noisy data. The ARIMA model combines the advantages of both models, and its expression is shown below:
[0054]
[0055] Among them, s constant For the constant term, y t Let y be the value of y at time t, and s be the value of y at time t. AR Let s be the AR coefficient. MA ε is the MA coefficient. t Let be the error term at time t.
[0056] More specifically, the specific steps for initializing the optimization parameters are as follows: setting the optimization range of the optimization parameters; the optimization range is specifically:
[0057]
[0058] Where p is the autoregressive order of the classic ARIMA model, and LB p UB is the lower bound for finding the autoregressive order. p LB is the upper bound for the optimization of the autoregressive order, q is the moving average order of the classic ARIMA model, and LB is the lower bound for the higher bound. q UB is the lower bound for the optimization of the moving average order. q N is the upper limit for the optimization of the moving average order. hidden LB is the number of hidden layer units. hidden UB is the lower bound for finding the number of hidden layer units. hidden N is the upper limit for optimizing the number of hidden layer units. epoch For training rounds, LB epoch To find the lower bound of the number of training rounds, UB epoch To optimize the upper limit of training epochs, R learn For the learning rate, LB learn UB is the lower bound for finding the optimal learning rate. learn N is the upper limit for finding the optimal learning rate. DropFactor As a penalty factor, LB DropFactor UB is the lower bound for the optimization of the penalty factor. DropFactor This represents the upper limit of the optimization of the penalty factor;
[0059] Initialize N seed The samples form the sample space of BO. in, For the i-th sample, p i Let q be the autoregression order of the i-th sample. i Let be the order of the moving average of the i-th sample. Let be the number of hidden layer units for the i-th sample. For the i-th sample, the training round is... Let N be the learning rate for the i-th sample. i DropFactor Let be the penalty factor for the i-th sample.
[0060] like Figure 4 As shown, step 300 is: constructing the objective function and calculating the objective values for the original dataset and the sample space to obtain the objective function value.
[0061] Specifically, the objective function of BO is expressed as: Find the hyperparameter combination that minimizes the objective function. The calculation formula is:
[0062]
[0063] in, When the return function reaches its minimum value The possible values of ;
[0064] Calculate the target value corresponding to the initial sample. And set the sample space length of BO. The maximum number of iterations for Bayesian optimization is The current number of iterations for BO is N. iter The size of the active set is N active .
[0065] More specifically, the steps to obtain the objective function value are as follows: construct the ARIMA master model and the LSTM compensation model, and calculate the objective function value using the ARIMA master model and the LSTM compensation model.
[0066] Furthermore, the specific steps for calculating the predicted values using the ARIMA master model are as follows:
[0067] 1) The Z-Score method is used to handle outliers in the original dataset. The calculation formula is as follows:
[0068]
[0069] Among them, z score The z-score value. For y ori length, f std (·) is used to calculate the standard deviation. When the z-axis of a sample... score When the absolute value of the value is greater than the empirically set value of 3, it is determined to be an outlier and the entire data is deleted. The dataset after processing the outlier is denoted as y.
[0070] 2) The extended Dickey-Fuller test (ADF) is used to determine the stationarity of time series data. The calculation formula is as follows:
[0071]
[0072] in, The length of y is represented by m. ORT for Normalized column vector, s ADF As an intermediate variable, The first to the second in the original dataset There are 1 element, ||·|| and (·). T These represent the modulo and transpose operations, respectively, where I is the identity matrix and m...T ORT For matrix m ORT The transpose of .
[0073] Calculate the polynomial coefficients s coeff Covariance s cov The calculation formula is:
[0074]
[0075] The test statistic is calculated using the following formula:
[0076] s test =(s coeff -1) / f sqrt (s cov );
[0077] Where stest is the test statistic, f sqrt (·) is used for the square root operation.
[0078] Calculate the critical value s for hypothesis testing value And obtain the distance by looking up the table. The two smallest sample sizes, N1 and N2, and their corresponding critical values s at a significance level of α = 0.05. value1 and s value2 The calculation formula is:
[0079]
[0080] Where, k s Let b be the slope. s Let k be the intercept. Solving the system of equations yields k. s and b s And in sample size and the critical value s at significance level α value The calculation formula is:
[0081]
[0082] If s test <s value If s test >s value If the sequence is non-stationary, then the sequence is not stationary.
[0083] 3) If the sequence y is stationary, then a differencing operation is performed to achieve stationarity. The calculation formula is as follows:
[0084] Δy t =y t -y t-1 ;
[0085] Among them, y tLet y be the sequence at time t. t-1 Let y be the sequence at time t-1. t This is the value after the difference.
[0086] The values after d differencing operations are combined in time sequence to form a difference sequence, denoted as . Then perform an ADF test on the sequence; if it is still non-stationary, continue the differencing operation until the sequence after d differencing is a stationary sequence, and record the stationary sequence as y. s for.
[0087] 4) Based on the parameter difference order d, p i and q i Construct the ARIMA master model.
[0088] 5) The residual QQ plot is used to determine whether the residual sequence satisfies a normal distribution to test the applicability of the model. The specific calculation process is as follows:
[0089] First, estimate the AR coefficients, and then... s The calculation formula is as follows:
[0090]
[0091] Among them, y d The sequence after centering. For y s The length.
[0092] Next, regarding y d The Fourier transform calculation formula is as follows:
[0093]
[0094] Where, N FFT f is the number of points in the Fourier transform. fft For y d The result of performing the Fourier transform, f represents conjugation nextpow2 (·) indicates that a condition is met. The smallest integer np.
[0095] Calculate the autocorrelation coefficient c acf The calculation formula is:
[0096]
[0097] in, This is the first element in the autocorrelation coefficient. Let g be the g-th element in the autocorrelation coefficient, where g is the position;
[0098] Calculate the covariance c of the AR processAR The calculation formula is:
[0099]
[0100] in, For y d The length.
[0101] The AR coefficient is calculated using the following formula:
[0102]
[0103] Among them, f tp (·) is the Toeplitz matrix, and |a:-1:c| represents the absolute value of the vector decreasing by 1 from a to c.
[0104] To determine the stability of the AR model polynomial, the threshold value is u. ARMA If the following formula condition is met, the AR model is considered to be polynomial unstable, as shown in the formula:
[0105] |s AR |≥1-u ARMA ;
[0106] Here, |·| represents the absolute value operation.
[0107] The MA process affects the sequence y. s The formula for calculating the filtering is:
[0108] x filter =f filter (y s );
[0109] Where xfilter is the vector after filtering ys, f filter (·) represents the filtering operation.
[0110] Calculate the constant s constant The calculation formula is:
[0111]
[0112] in, For x filter The length.
[0113] Calculate the covariance sequence c of the MA process MA The calculation formula is:
[0114]
[0115] Set the MA coefficient to 0, and use variable s MA1 The MA coefficients obtained from the storage iteration are denoted as u.tol When the conditions are met When, f sqrt (·) To perform the square root operation, the following loop is entered:
[0116] Settings MA1 =s MA The variance of the white noise e(t) is var e(t) The calculation formula is:
[0117]
[0118] Let l = q, and calculate s. MA The calculation formula is:
[0119]
[0120] Then execute l = l - 1, continue calculating the above formula until l = 0, then stop the calculation, and continue the loop until... Get s MA .
[0121] To determine the stability of the MA model polynomial, if |s MA |≥1-u ARMA If the MA model polynomial is unstable, the MA coefficients need to be reset.
[0122] Next, regarding s AR The correction is made, and the calculation formula is as follows:
[0123] s ARd =f conv ((1,-s AR ),(1,-1));
[0124] Among them, f conv (·) indicates the operation of convolution.
[0125] Let l = max(p,q) + 1, and calculate the predicted value at time j. The calculation formula is:
[0126]
[0127] Among them, y 1:max(p,q) The sequence of values from 1 to l, with the maximum value. For s ARd The second to the last element.
[0128] Then, execute l = l + 1, and continue executing the following formula until l > (2 * max(p, q)), the formula is:
[0129]
[0130] in, Let be the predicted value at time l, and max(·) is the operation to find the maximum value.
[0131] Finally, calculate the new predicted value y. new The calculation formula is:
[0132]
[0133] Next, let l = max(p,q) + 1, r e =0, and calculate the residual using the following formula:
[0134]
[0135] Where, r l e This represents the residual when estimating l using the model.
[0136] Then, execute l = l + 1, and continue executing the above r. l e The calculation formula, until Finally, the residual r is obtained. e .
[0137] The standardized residual r of the calculation model std The calculation formula is:
[0138] r std =r e / f sqrt (var e(t) );
[0139] Next, sort r in ascending order to obtain r stdup And store the index value r index That is, r std Each element in the sorted vector r stdup The position in the middle.
[0140] Calculate the x-axis of the drawing object qq The calculation formula is:
[0141]
[0142] Finally, the coordinates of the plotting point in the residual QQ plot are obtained as (x qq r stdup If the deviation between the data points and the straight line is small, and most of them fall on the straight line, then it proves that the data conforms to a normal distribution.
[0143] Finally, the Durbin-Waston (DW) test value is calculated. The closer the DW test value is to 2, the less significant the autocorrelation in the residual series. The calculation formula is as follows:
[0144] s DW =((f diff (r std )) T *f diff (r std )) / ((r std ) T *r std );
[0145] Among them, f diff (·) represents the difference operation, s DW This is the DW test value.
[0146] 6) First, set the initial values for the ARIMA master model. When p < q, the number of initial values is N. start =max(p,q); when p>q, the number of initial values is N. start = p + q + 2.
[0147] Secondly, according to Get N start Predicted value at time +1 And according to Get N start Predicted value at time +2 The loop continues, assuming the length of sequence y is...
[0148] Finally, the ARIMA master model prediction value is obtained, calculated using the following formula:
[0149]
[0150] in, These are the predictions from the ARIMA master model.
[0151] Furthermore, the specific steps for calculating the residual prediction values using the LSTM compensation model are as follows:
[0152] 1) Calculate the predicted value and the true value based on the loss function. The calculation formula is as follows:
[0153]
[0154] Among them, E t The loss at time t, Let y be the predicted value at time t. tLet be the true value at time t. An LSTM compensation model is constructed based on the predicted value, the true value, the number of hidden layer units, the number of training epochs, the learning rate, and the penalty factor.
[0155] 2) Calculate the input to the LSTM compensation model. The calculation formula is as follows:
[0156]
[0157] Where r represents the residual data.
[0158] 3) Using the residual data as input data, the standardized residuals are obtained through standardization calculation. The calculation formula is as follows:
[0159]
[0160] Among them, f min (·) is to find the minimum value, f max (·) To find the maximum value, a and b are the lower and upper bounds of the standardization, respectively, and r str To standardize the residuals, and assuming that the prediction is performed for the m-th input window, the values of the n time steps prior to time t (including time t) are input. Obtain the predicted values for n time steps after time t. Right now At this point, t = m + n - 1. Next, let's take the input r... t str For example, the corresponding output value is
[0161] 4) Input r at time t t str and h at time t-1 t-1 and c t-1 And calculate the process value f of the forgetting gate at time t. t And the output value g of the forget gate t The calculation formula is:
[0162]
[0163] g t =c t-1 f t ;
[0164] Where σ is the sigmoid function, These are the weights corresponding to the forget gate in the m-th input window. Let be the bias corresponding to the forget gate of the m-th input window, and let be the Hadamard product.
[0165] 5) Calculate the process value i of the input gate at time t. t and output value c t and cell status update value The calculation formula is:
[0166]
[0167] in, It is the cell state update value at time t, and tanh is the tanh function. These are the weights corresponding to the input gates of the m-th input window. The offset corresponding to the input door is set for the m-th input window. All of these are the weights corresponding to the updated state of the m-th input window unit. Update the bias corresponding to the state of the m-th input window unit.
[0168] 5) Calculate the process value and output value of the output gate at time t. The calculation formula is:
[0169]
[0170] h t =o t tanh(c t );
[0171] Among them, o t h is the process value of the output gate at time t. t Let t be the output value of the output gate. These are the weights corresponding to the output gate of the m-th input window. This is the bias corresponding to the output gate of the m-th input window.
[0172] 6) Calculate the predicted value at time t+n. The calculation formula is:
[0173]
[0174] in, Let v be the predicted value at time t+n, where n is the prediction step size. T is the weight of the output layer, and b is the bias of the output layer.
[0175] 7) By repeating steps (3) to (6), all predicted values corresponding to the m-th input window are obtained.
[0176] 8) Gradient descent method is used to compensate the LSTM model. and Update the parameters.
[0177] 9) Execute m = m + 1 and repeat steps (3)-(9) to calculate the predicted value of the next input window and update the network parameters until the entire sequence is predicted.
[0178] 10) Calculate the predicted value of the residual sequence using the following formula:
[0179]
[0180] in, These are the predicted values of the residual sequence. The predicted residual value at t=1 The predicted residual value at t=2 Let be the predicted residual value at time t.
[0181] Furthermore, based on the predicted values of the ARIMA master model and the residual predicted values of the LSTM compensated model, the predicted values of the BO-ARIMA-LSTM combined model are obtained. The calculation formula is:
[0182]
[0183] And based on the BO-ARIMA-LSTM combined model, the evaluation index R is used. 2 The objective function value of BO is calculated using the following formula:
[0184] like Figure 5 As shown, step 400 involves optimizing the objective function and obtaining the optimal parameter combination using the optimized objective function. The specific steps are as follows:
[0185] First, execute N iter =1 operation, in which any linear combination of random variables in the Gaussian process of this operation follows the following multidimensional Gaussian distribution:
[0186]
[0187]
[0188] in, Let μ be the size of the current BO sample space, μ(·) be the mean vector, Σ(·) be the covariance matrix, and N(·) be the normal distribution. The first to the second in the sample space One element, The first to the second in the objective function One element, Obtained through kernel function and The inner product of the kernel and its derivative. The formula for calculating the kernel function is:
[0189]
[0190] in, for and The Euclidean distance between them, σ v The parameters for controlling the oscillation speed are given, and f is calculated using the mean vector and covariance matrix. BO The posterior probability of the function value at any point.
[0191] Secondly, the mean Set to 0. This applies to samples that are about to be added to the sample space. Satisfy the following formula:
[0192]
[0193] Among them, f * BO Let k(·) be the objective function for the newly added samples, and Σ be the kernel function. * and Σ ** All of these are intermediate variables.
[0194] Calculations yielded the known... In the case of f * BO The conditional distribution it follows is:
[0195]
[0196] Wherein, the mean vector μ under this conditional distribution * and variance The calculation formula is as follows:
[0197]
[0198]
[0199] Again, the update includes N active The active set of each sample And assume the next exploration point is Its corresponding function value is And the optimal point in the sample space is denoted as It satisfies the following formula:
[0200]
[0201] The goal of Bayesian optimization is to... Find the expression that maximizes the above expression. But the function value at that point It is unknown.
[0202] Calculate the expected value of the above expression and select the expression with the largest expected value. As the next point of exploration, and marked as The calculation formula is:
[0203]
[0204] Where, N find For the exploration ratio, σ * Let φ(·) be the standard deviation, φ(·) be the probability density function of the standard normal distribution, and Φ(·) be the distribution function of the standard normal distribution. The formulas for calculating the probability density function and the distribution function are as follows:
[0205]
[0206] And calculate the exploration points The calculation formula is:
[0207]
[0208] in, To return the value that makes the function achieve its maximum value.
[0209] Next, the sample points are calculated. The corresponding objective function value is then used to update the sample space of BO: Update the corresponding objective function value as follows:
[0210] Finally, execute The process involves performing operations and updating the Gaussian process, selecting the next sampling point and updating the sample set, until N. iter N iter =N iter +1 reaches the preset maximum number of iterations. The optimal parameter combination is finally obtained.
[0211] Step 500: Obtain the final prediction model based on the optimal parameter combination, and use the final prediction model to predict CO2 emission concentration.
[0212] Specifically, the mean absolute error (MAE), root mean square error (RMSE), and coefficient of determination (R²) are selected. 2 The final prediction model is evaluated using the following formula:
[0213]
[0214] Where, n e For the sample size, Let ξ be the mean of y. MSE Let ξ be the mean square error. Var Let Variance be the variance.
[0215] This invention uses CO2 emission data from a MSWI power plant in Beijing as an example. The data for each minute was averaged, resulting in 720 sets, each containing 194 process variables; column 191 of the data represents the CO2 concentration. Ultimately, 28 samples were identified as outliers, leaving 692 valid data points.
[0216] The number of start values for the ARIMA main model was set to 7, resulting in 685 residual data points. The residual sequences were then divided into training, validation, and test sets in a ratio of 11:1:1.
[0217] Specifically, the parameter settings, hyperparameter optimization range, and results for Bayesian optimization are shown in Table 1 and Table 2, respectively.
[0218] Table 1 CO2 Dataset BO Parameter Settings Table
[0219]
[0220]
[0221] Table 2 shows the optimization range and results for the CO2 dataset BO.
[0222]
[0223] The hyperparameters of the Bayesian-optimized ARIMA-LSTM model are as follows: autoregression order 4, moving average order 1, initial learning rate 0.0014, training epochs 198, hidden layer units 299, and penalty factor 0.6522.
[0224] Furthermore, a BO-ARIMA-LSTM model is constructed to perform multi-step predictions on the CO2 dataset with lead times of 1 step, 2 steps, 3 steps, 4 steps, and 5 steps, respectively. The specific implementation process includes:
[0225] We constructed and compared LSTM multi-step prediction models, BO-LSTM multi-step prediction models, and ARIMA-LSTM multi-step prediction models respectively.
[0226] The corresponding parameters were set as follows: LSTM model learning rate 0.01, training epochs 300, hidden layer units 64, penalty factor 0.2; BO-LSTM model learning rate 0.0091, training epochs 296, hidden layer units 105, penalty factor 0.4911; ARIMA-LSTM model autoregression order 4, moving average order 1, learning rate 0.001, training epochs 250, hidden layer units 200, penalty factor 0.2.
[0227] Furthermore, the above four models were subjected to 10 repeated experiments, and the experimental results are as follows: Figure 6 The results are shown in sections (a), (b), (c), (d), and (e). The average of the evaluation indicators from 10 experiments was taken as the final evaluation indicator for the model, as shown in Table 3.
[0228] Table 3. Comparison of CO2 test set evaluation metrics for different models with different prediction steps.
[0229]
[0230] Specifically, taking one-step advance prediction as an example, the R² of the BO-ARIMA-LSTM combined model is 0.6007, which is an improvement of 10.1%, 4.7% and 7.3% compared to the LSTM model's 0.5453, the BO-LSTM model's 0.5737 and the ARIMA-LSTM model's 0.5595.
[0231] Specifically, taking 5-step lead and 1-step lead as examples, the R values of the LSTM model, BO-LSTM model, ARIMA-LSTM model, and BO-ARIMA-LSTM model are... 2 The accuracy of the BO-ARIMA-LSTM model decreased by 9.2%, 3.7%, 2.4%, and 1.1% respectively, outperforming other models and remaining at a high level.
[0232] The beneficial effects of this invention are as follows:
[0233] 1) By leveraging the linear sequence prediction capability and nonlinear modeling capability of the final prediction model, the problem of a single prediction algorithm is solved;
[0234] 2) It realizes the collaborative optimization of coupled hyperparameters and avoids the tediousness and uncertainty of manual parameter tuning.
[0235] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0236] Specific examples have been used to illustrate the principles and implementation methods of this invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this invention. Furthermore, those skilled in the art will recognize that, based on the ideas of this invention, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of this invention.
Claims
1. A method for predicting CO2 emission concentration based on a Bayesian optimized principal-complement model, characterized in that, Includes the following steps: Obtain the raw dataset of CO2 emission concentrations; The BO algorithm is used to select optimization parameters, and the optimization parameters are initialized to obtain the sample space. Construct an objective function and calculate the objective function value for the original dataset and the sample space; The objective function is optimized, and the optimal parameter combination is obtained through the optimized objective function; The final prediction model is obtained based on the optimal parameter combination, and the CO2 emission concentration is predicted using the final prediction model. The specific steps to obtain the objective function value are as follows: The target values of the original dataset and the sample space are processed, an ARIMA master model is constructed based on the processed data, the ARIMA master model is tested, and data prediction is performed based on the tested ARIMA master model to obtain the predicted value of the master model. Calculate the residual of the master model prediction value, construct an LSTM compensation model based on the residual of the master model prediction value, and use the LSTM compensation model to make advance predictions of the master model prediction value to obtain the compensation model prediction value. The objective function value is obtained based on the predicted values of the master model and the compensation model.
2. The CO2 emission concentration prediction method based on the Bayesian optimized principal-complement model according to claim 1, characterized in that, The initialization process for the optimization parameters involves setting the optimization range of the optimization parameters; specifically, the optimization range is: Where p is the autoregressive order of the classic ARIMA model, and LB p UB is the lower bound for finding the order of autoregression. p LB is the upper bound for the optimization of the autoregressive order, q is the moving average order of the classic ARIMA model, and LB is the lower bound for the higher bound. q UB is the lower bound for the optimization of the moving average order. q N is the upper limit for the optimization of the moving average order. hidden LB is the number of hidden layer units. hidden UB is the lower bound for finding the number of hidden layer units. hidden N is the upper limit for optimizing the number of hidden layer units. epoch For training rounds, LB epoch To find the lower bound of the number of training rounds, UB epoch To optimize the upper limit of training epochs, R learn For the learning rate, LB learn UB is the lower bound for finding the optimal learning rate. learn N is the upper limit for finding the optimal learning rate. DropFactor As a penalty factor, LB DropFactor UB is the lower bound for finding the penalty factor. DropFactor This represents the upper limit of the optimization of the penalty factor.
3. The CO2 emission concentration prediction method based on the Bayesian optimized principal-complement model according to claim 1, characterized in that, Data processing of the original dataset and the target values of the sample space is performed using the Z-Score method, and the formula for calculating the Z-Score is as follows: Among them, z score Let z be the score, and y be the score. ori For the original dataset, For y ori length, f std (·) is used to calculate the standard deviation.
4. The CO2 emission concentration prediction method based on the Bayesian optimized principal-complement model according to claim 1, characterized in that, Construct the ARIMA master model based on the processed data, including: The stationarity of the processed data is tested using the extended Dickie-Fowler test; the calculation formula for the test is as follows: in, m is the length of the processed data. ORT s is a normalized column vector. ADF As an intermediate variable, The first to the second in the original dataset Each element.
5. The CO2 emission concentration prediction method based on the Bayesian optimized principal-complement model according to claim 4, characterized in that, Building the ARIMA master model based on the processed data also includes: The processed data, which is not stable, is subjected to a differencing operation until the processed data becomes stable; the formula for the differencing operation is Δy. t =y t -y t-1 ; where Δy t The value after difference, y t Let y be the sequence at time t. t-1 This is the sequence at time t-1.
6. The CO2 emission concentration prediction method based on the Bayesian optimized principal-complement model according to claim 1, characterized in that, The specific steps for verifying the ARIMA master model include: Calculate the residual sequence of the ARIMA master model; The ARIMA master model is tested based on the residual sequence and the Durbin-Watson test. The formula for calculating the Durbin-Watson test is: s DW =((f diff (r std )) T *f diff (r std )) / ((r std ) T *r std ); where f diff (·) represents the difference operation, s DW This is the Durbin-Watson test value.
7. The CO2 emission concentration prediction method based on the Bayesian optimized principal-complement model according to claim 4, characterized in that, The formula for calculating the predicted value of the master model is as follows: in, The main model's predicted values. For N start The predicted value at time +1, For N start The predicted value at time +2.
8. The CO2 emission concentration prediction method based on the Bayesian optimized principal-complement model according to claim 6, characterized in that, The specific steps for using the LSTM compensation model to predict the predicted value of the main model in advance include: The residual sequence of the master model is subjected to multiple data standardization operations to obtain multiple standardized data; the calculation formula for standardization is: Among them, f min (·) is the operation to find the minimum value, f max (·) represents the maximum value operation, where a is the lower bound of standardization, b is the upper bound of standardization, and r is the input to the LSTM compensation model. str For standardized data; The network parameters of the LSTM compensation model are updated multiple times based on the standardized data and gradient descent method to obtain predicted values for different residual sequences; The predicted values of different residual sequences are combined to obtain the predicted values of the compensation model.
9. The CO2 emission concentration prediction method based on the Bayesian optimized principal-complement model according to claim 1, characterized in that, The specific steps for optimizing the objective function include: Calculate the posterior distribution of the objective function; the specific calculation formula is as follows: Where μ(·) is the mean vector, Σ(·) is the covariance matrix, and N(·) is the normal distribution. The first to the second in the sample space One element, The first to the second in the objective function One element; The function value of the next sampling point is calculated using the acquisition function; the specific calculation formula for the acquisition function is as follows: in, The function value at the optimal point in the sample space. The function value for the next sampling point; The next sampling point is obtained based on the function value of the next sampling point; the specific calculation formula is as follows: Where, is the next sampling point, This indicates that the function value is returned when the acquisition function reaches its maximum value.
Citation Information
Patent Citations
Steel industry carbon emission prediction method and system based on Bayesian optimization
CN117709524A
Carbon dioxide prediction system
KR102410275B1