Integrated modeling method for hierarchical prediction of octane number and anti-knock coefficient based on heterogeneous multi-models
Through the heterogeneous multi-model integrated modeling method, optimized parameters and integrated algorithms, the problem of predicting octane number and anti-knock coefficient in gasoline blending has been solved, achieving more accurate prediction, adapting to the nonlinear characteristics of complex industrial processes, and improving Accuracy and efficiency of the gasoline blending process.
Patent Information
- Application Number
- CN202210245662.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-10
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2042-03-10
AI Technical Summary
Existing technology makes it difficult to accurately predict the octane number and anti-knock coefficient during the gasoline blending process, resulting in difficulty in establishing formula models and affecting product quality and corporate benefits.
A heterogeneous multi-model hierarchical predictive integrated modeling method of octane number and anti-knock coefficient is adopted, parameters are optimized through the K-fold cross-validation method, multiple sub-models are established and linear or nonlinear integration is performed, and the dependence of the anti-knock coefficient on the octane number is considered. properties, using weighted average and stacked integration algorithms, and introducing L1 and L2 regular terms to optimize weight distribution.
It significantly improves the prediction performance of octane number and anti-knock coefficient, provides a more accurate data basis, lays the foundation for the establishment of gasoline blending formula model, and adapts to the nonlinear characteristics of complex industrial processes.
Smart Images

Figure CN114741953B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of gasoline blending index prediction, and more specifically to a heterogeneous multi-model octane number and anti-knock coefficient graded prediction integrated modeling method. Background Art
[0002] As the final process of an oil refinery, oil blending is a very complex industrial process with huge profit margins. Octane number and anti-knock coefficient, which are key quality indicators in finished gasoline blending, have been difficult to obtain effectively due to the limitations of measurement technology. This has brought difficulties to the accurate establishment of the formula model in the gasoline blending process, directly affecting product quality and corporate benefits. The rise and development of soft measurement technology has undoubtedly provided an effective solution for this. However, due to the constraints of data or algorithms, the accuracy of soft measurement models still has a lot of room for improvement. Therefore, it is particularly important to establish a more accurate octane number and anti-knock coefficient prediction model based on the storage data of modern industrial processes, solve the problem of missing octane number and anti-knock coefficient in the formula data, and then lay a data foundation for the establishment of the finished gasoline blending formula model.
[0003] In practical applications, the establishment of high-performance prediction models depends not only on the optimization of modeling algorithms and integration strategies, but also on the in-depth analysis of production processes and measurement data acquisition processes. For the prediction of octane number and anti-knock coefficient, most traditional modeling methods take both as dominant variables at the same time, or use a relatively single modeling algorithm, or integrate several algorithms in a weighted average integration manner to establish prediction models for them and other easily measured auxiliary variables, but the prediction effect is still unsatisfactory. There are three reasons for this: First, the dependence of the anti-knock coefficient on the octane number analysis data in the acquisition of industrial measurement data is ignored, and the two are roughly treated as the same; second, the limitations of a single modeling algorithm lack diversity and complementarity for multiple working conditions with batch processing of raw materials; third, the integration strategy is mostly linear, and it is difficult to adapt to the nonlinear factors of complex industrial processes.
[0004] Therefore, how to provide a heterogeneous multi-model octane number and anti-knock coefficient graded prediction integrated modeling method that takes into account the complementary advantages of heterogeneous models in order to improve the prediction performance of the model is an urgent problem that technicians in this field need to solve. Summary of the invention
[0005] In view of this, the present invention provides a heterogeneous multi-model octane number and anti-knock coefficient graded prediction integrated modeling method, which considers two types of heterogeneous integrated graded modeling methods that depend on the anti-knock coefficient on the octane number. It has better performance and can be used for accurate prediction of octane number and anti-knock coefficient in the blending process of finished gasoline. It is expected to solve the problem of missing octane number and anti-knock coefficient data and lay a data foundation for the establishment of the subsequent formulation model.
[0006] In order to achieve the above object, the present invention adopts the following technical solution:
[0007] A heterogeneous multi-model octane number and anti-knock coefficient graded prediction integrated modeling method comprises the following steps:
[0008] The K-fold cross-validation method is used to tune and optimize the parameters of multiple heterogeneous learners, and multiple octane number prediction sub-models and multiple anti-knock coefficient prediction sub-models are established respectively;
[0009] Performing linear integration or nonlinear integration on the plurality of octane number prediction sub-models and the plurality of anti-knock coefficient prediction sub-models respectively to establish an octane number integrated model and an anti-knock coefficient integrated model;
[0010] The prediction result of the octane number is obtained based on the octane number integrated model; and the prediction result of the anti-knock coefficient is obtained based on the anti-knock coefficient integrated model.
[0011] Furthermore, in the above-mentioned heterogeneous multi-model octane number and anti-knock coefficient graded prediction integrated modeling method, the establishment process of the octane number prediction sub-model and the anti-knock coefficient prediction sub-model includes:
[0012] Determine n finished gasoline indicators that are highly correlated with octane number and anti-knock coefficient and easy to measure as data set 1;
[0013] Using the K-fold cross validation method on the data set one to select and tune parameters of multiple heterogeneous learners, and training multiple heterogeneous learners selected from the data set one based on the optimal parameters to obtain multiple octane number prediction sub-models;
[0014] Combining the octane number predicted and output by the octane number prediction sub-model with the data set 1 to obtain data set 2;
[0015] The selected heterogeneous learner is trained based on the second data set to obtain the anti-explosion coefficient prediction sub-model.
[0016] Furthermore, in the above-mentioned heterogeneous multi-model octane number and anti-knock coefficient graded prediction integrated modeling method, before training the selected heterogeneous learner, it also includes: deleting missing values, deleting outliers and normalizing the data set 1.
[0017] Furthermore, in the above-mentioned heterogeneous multi-model octane number and anti-knock coefficient graded prediction integrated modeling method, the process of linearly integrating the octane number prediction sub-model or the anti-knock coefficient prediction sub-model includes:
[0018] Determining an objective function, minimizing the objective function, and determining the optimal weight of each of the octane number prediction sub-models or the anti-knock coefficient prediction sub-models;
[0019] Based on the optimal weight, a weighted average integration algorithm is used to integrate the plurality of octane number prediction sub-models or the anti-knock coefficient prediction sub-models to obtain the octane number integrated model or the anti-knock coefficient integrated model.
[0020] Furthermore, in the above-mentioned heterogeneous multi-model octane number and anti-knock coefficient graded prediction integrated modeling method, L1 regularization term, L2 regularization term or mixed L1&L2 regularization term is introduced into the objective function, and the optimal weight obtained by minimizing the objective function is adjusted.
[0021] Furthermore, in the above-mentioned heterogeneous multi-model octane number and anti-knock coefficient graded prediction integrated modeling method, the expression of the objective function is:
[0022]
[0023] Among them, J 0 is the objective function, is the actual measured value, is the prediction output of each octane number prediction sub-model or anti-knock coefficient prediction sub-model, i = 1…m, j = 1…T, m is the number of samples, T is the number of heterogeneous learners, w j The weight of each octane number prediction sub-model or anti-knock coefficient prediction sub-model.
[0024] Furthermore, in the above-mentioned heterogeneous multi-model octane number and anti-knock coefficient graded prediction integrated modeling method, the expression of the octane number integrated model or the anti-knock coefficient integrated model is:
[0025]
[0026] in, And w j ≥0.
[0027] Furthermore, in the above-mentioned heterogeneous multi-model octane number and anti-knock coefficient graded prediction integrated modeling method, the process of nonlinearly integrating the octane number prediction sub-model or the anti-knock coefficient prediction sub-model includes:
[0028] The optimally selected heterogeneous learner for establishing the octane number prediction sub-model or the anti-knock coefficient prediction sub-model is used as a primary learner, and the finally established octane number prediction sub-model and anti-knock coefficient prediction sub-model are used as primary sub-models;
[0029] Use nonlinear machine learning algorithms as secondary learners;
[0030] The predicted output of the primary sub-model and the actual measured value are combined as new samples, and the new samples are used to optimize and train the parameters of the secondary learner to obtain a final stack-based nonlinear octane number integrated model or anti-knock coefficient integrated model.
[0031] Furthermore, in the above-mentioned heterogeneous multi-model octane number and anti-knock coefficient graded prediction integrated modeling method, the expression of the octane number integrated model or the anti-knock coefficient integrated model is:
[0032] H(x)=h'(h 1 (x),h 2 (x),…,h T (x)
[0033] Where h'=Γ(D new ), representing an octane number integrated model or an anti-knock coefficient integrated model; represents a new sample, Γ represents a secondary learner, and h t (x) represents the tth primary sub-model.
[0034] Furthermore, in the above-mentioned heterogeneous multi-model octane number and anti-knock coefficient graded prediction integrated modeling method, the primary learner adopts MLR algorithm, KNN algorithm, CART algorithm, RF algorithm and SVM algorithm; the secondary learner adopts any one of KNN algorithm, RF algorithm, BP algorithm and ELM algorithm.
[0035] It can be seen from the above technical solution that, compared with the prior art, the present invention discloses a heterogeneous multi-model octane number and anti-knock coefficient graded prediction integrated modeling method, which has the following beneficial effects:
[0036] 1) The present invention adopts hierarchical prediction modeling for octane number and anti-knock coefficient. Compared with the traditional two-output first-level model, the octane number prediction output is supplemented as an auxiliary variable to establish a second-level single-output anti-knock coefficient prediction model, which fully considers the dependence of the anti-knock coefficient on the octane number measurement data, better explores the relationship between variables, and can significantly improve the model prediction performance;
[0037] 2) The present invention is based on the theory of structural risk minimization. By introducing L1, L2, L1&L2 and other regularization constraints into the traditional objective function, especially the mixed L1&L2 regularization, it not only emphasizes the weight of high-quality models, but also takes into account the diversity of models, so that the weighted average integration algorithm can iteratively obtain a better weight distribution, thereby obtaining a prediction model with better performance in a linear integration manner, which is particularly suitable for primary modeling of octane number prediction.
[0038] 3) The nonlinear integration strategy proposed in the present invention, based on the stacking idea of machine learning, explores the nonlinear characteristics of complex industrial processes from a deeper level, and presents them through the stacking integration of sub-model outputs. It is not only suitable for the primary modeling of octane number prediction, but also for the secondary model of stacking integration under the hierarchical modeling scheme. Its depth and complexity are more conducive to the accurate mapping of nonlinearity, and it is more suitable for the predictive modeling of the secondary anti-knock coefficient.
[0039] In general, the present invention considers using heterogeneous multi-model integration to solve the problems of single or homogeneous models for multiple working conditions, lack of complementary advantages of nonlinearity, and insufficient adaptability, etc., specifically including two levels: sub-model algorithm and integration method. For the sub-model algorithm, considering the performance differences of different algorithms, heterogeneous learners are preferably used to establish sub-models, in order to improve the performance of the integrated model through the complementary advantages of diverse models; for the integration method, first start with further optimization of the weighted average weight, combine the structural risk minimization theory, and introduce regularization constraints on the error between the actual value and the predicted value as the objective function to obtain a linear integration model with better performance; then, considering the advantages of nonlinear algorithms in dealing with complex industrial processes, it is planned to perform nonlinear integration of heterogeneous sub-models based on stacking integration method of machine learning to adapt to the nonlinear characteristics in actual production. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0041] Figure 1 A flow chart of the heterogeneous multi-model octane number and anti-knock coefficient graded prediction integrated modeling method provided by the present invention;
[0042] Figure 2 A flow chart for linear integration of the octane number prediction sub-model or the anti-knock coefficient prediction sub-model provided by the present invention;
[0043] Figure 3 The present invention provides a flowchart for nonlinearly integrating the octane number prediction sub-model or the anti-knock coefficient prediction sub-model.
[0044] FIG4( a ) shows the prediction results of the single model and the integrated model provided by the present invention for the octane number and the anti-knock coefficient MSE / GE;
[0045] FIG4( b ) shows the prediction results of the octane number and the anti-knock coefficient MAE by the single model and the integrated model provided by the present invention;
[0046] FIG4(c) is the prediction results of octane number and anti-knock coefficient MAPE of the single model and the integrated model provided by the present invention;
[0047] FIG4( d ) is the prediction results of the octane number and the anti-knock coefficient PED (0.15) of the single model and the integrated model provided by the present invention.
[0048] FIG5(a) is a schematic diagram showing the prediction results of octane number and anti-knock coefficient using the weighted 5 method provided by the present invention;
[0049] FIG5( b ) is a schematic diagram of the prediction results of octane number and anti-knock coefficient using the Stacking3 method provided by the present invention;
[0050] FIG5(c) is a schematic diagram of the prediction results of octane number and anti-knock coefficient using the Stacking4 method provided by the present invention. DETAILED DESCRIPTION
[0051] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0052] like Figure 1 As shown, the embodiment of the present invention discloses a heterogeneous multi-model octane number and anti-knock coefficient graded prediction integrated modeling method, comprising the following steps:
[0053] S1. Parameter tuning and optimization of multiple heterogeneous learners are performed using the K-fold cross-validation method, and multiple octane number prediction sub-models and multiple anti-knock coefficient prediction sub-models are established respectively;
[0054] S2. Linearly or nonlinearly integrate the multiple octane number prediction sub-models and the multiple anti-knock coefficient prediction sub-models to establish an octane number integrated model and an anti-knock coefficient integrated model;
[0055] S3. Obtain the prediction result of the octane number based on the octane number integrated model; obtain the prediction result of the anti-knock coefficient based on the anti-knock coefficient integrated model.
[0056] Among them, in S1, the establishment process of the octane number prediction sub-model and the anti-knock coefficient prediction sub-model includes:
[0057] Determine n finished gasoline indicators that are highly correlated with octane number and anti-knock coefficient and easy to measure as data set 1;
[0058] The K-fold cross validation method is used on the dataset one to select and optimize the parameters of multiple heterogeneous learners, and based on the optimal parameters, multiple heterogeneous learners selected from the dataset one are trained to obtain multiple octane number prediction sub-models;
[0059] The octane number predicted by the octane number prediction sub-model is combined with the data set 1 to obtain the data set 2;
[0060] Based on data set 2, the selected heterogeneous learners are trained to obtain the anti-explosion coefficient prediction sub-model.
[0061] Considering that in the actual finished gasoline blending production, the measured value of the anti-knock coefficient is taken from the average of the motor octane number and the research octane number (hereinafter collectively referred to as the octane number), that is, the measured value of the former depends on the latter. Therefore, in view of this correlation, the present invention intends to adopt a hierarchical method to model the prediction of the two separately. The specific grading method is: among the more than 20 quality indicators of finished gasoline, the octane number and anti-knock coefficient that are not easy to obtain online are regarded as the leading variables, and 11 indicators such as 10% evaporation temperature, 50% evaporation temperature, 90% evaporation temperature, terminal distillation point, vapor pressure, sulfur content, benzene content, aromatics content, olefin content, oxygen content, density, etc. that are easy to measure and have a high correlation with the two are used as auxiliary variables to establish a primary octane number prediction sub-model between the indicators and the octane number; considering the strong dependence of the anti-knock coefficient on the octane number, the octane number is also added as an auxiliary variable for the prediction of the anti-knock coefficient, and it is used as an input together with the 11 indicators to establish a secondary anti-knock coefficient prediction sub-model of the anti-knock coefficient. In the following, the octane number prediction sub-model and the anti-knock coefficient prediction sub-model are collectively referred to as sub-models, and the octane number integrated model and the anti-knock coefficient integrated model are collectively referred to as integrated models.
[0062] Before training the selected heterogeneous learner, the method further includes: performing missing value deletion, outlier deletion and normalization processing on the data set 1.
[0063] For the sub-model algorithm, considering the performance differences of different algorithms, heterogeneous learners are preferred to establish sub-models, in order to improve the performance of the integrated model by complementing the advantages of diverse models.
[0064] As for the integration method, we first start with further optimization of the weighted average weight, and combine it with the structural risk minimization theory to introduce regularization constraints on the error between the actual value and the predicted value as the objective function to obtain a linear integration model with better performance; then, considering the advantages of nonlinear algorithms in dealing with complex industrial processes, we plan to perform nonlinear integration of heterogeneous sub-models based on a stacking integration method based on machine learning to adapt to the nonlinear characteristics in actual production.
[0065] In one embodiment, Figure 2 As shown in FIG. 1 , the process of linearly integrating the octane number prediction sub-model or the anti-knock coefficient prediction sub-model includes:
[0066] Determine the objective function, minimize the objective function, and determine the optimal weight of each octane number prediction sub-model or anti-knock coefficient prediction sub-model;
[0067] Based on the optimal weight, a weighted average integration algorithm is used to integrate multiple octane number prediction sub-models or anti-knock coefficient prediction sub-models to obtain an octane number integration model or an anti-knock coefficient integration model.
[0068] Specifically, assuming that Γ 1 ,Γ 2 ,…,Γ T The data set is the learner that has been selected to build the prediction sub-model. is the predicted output of each sub-model (i=1…m, j=1…T), m is the number of samples, and T is the number of learners. is the actual sample input to the model, and n is the number of input variables (for octane number: n = 11, anti-knock coefficient: n = 12); is the actual sample output by the model, l is the number of output variables (for octane number and anti-knock coefficient, both are 1); The output data is predicted for the sub-model. If the weighted average integration algorithm is used, for the i-th sample The integrated model output corresponding to T sub-models is:
[0069]
[0070] in: And w j ≥0,w j is the weight of each sub-model.
[0071] Assuming that the error between the integrated model output and the actual measurement value is ε, we have:
[0072]
[0073] From formula (2), we can see that after the sub-model is determined, the error between the predicted value and the actual value depends largely on the weight factor. Therefore, we can minimize the objective function J 0 Determine the optimal weight values for the model.
[0074]
[0075] The weight determination based on the minimization of formula (3) is mainly based on the principle of empirical risk minimization, which is prone to overfitting to a certain extent. Therefore, in order to prevent overfitting and improve the generalization ability of the model, it is possible to consider introducing regularization to the objective function to add constraints. By adjusting the penalty coefficient added to the objective function, a certain optimal balance between the deviation and the variance is achieved, and then the optimal weight of the model is determined. Here, three regularization terms, L1, L2, and mixed L1&L2, are introduced into the objective function, as shown in formulas (4), (5), and (6). Among them, the introduction of L1 regularization aims to give full play to its good sparsity ability, increase the weight of high-quality models, weaken or eliminate the influence of models with poor performance, and highlight the role of high-quality sub-models; the introduction of L2 regularization is intended to use gentle and smooth weight changes to consider model differences, so as to better balance the role of multiple models; in addition, in order to avoid the sparsity of L1 regularization that may filter out too many models, resulting in insufficient model diversity, and L2 regularization that is too weak to reflect the weight of high-quality models, it is difficult to give full play to the advantages of integrated models. In order to give full play to the advantages of L1 and L2, hybrid L1&L2 regularization is introduced, in order to obtain more reasonable model weights through complementary advantages.
[0076]
[0077]
[0078]
[0079] Among them, α and β are the penalty coefficients of L1 and L2 regularization, and γ and ρ are the penalty coefficients of mixed L1&L2 regularization.
[0080] Based on the above analysis, the real measurement data provided by a large oil refinery was preprocessed and divided into a training set and a test set. K-fold cross validation was used on the training set to optimize the parameters of each algorithm, so as to establish heterogeneous sub-models of octane number and anti-knock coefficient respectively, and combined with equations (1), (4) to (6) to establish an octane number integrated model and an anti-knock coefficient integrated model based on improved weighted average. Table 1 shows the modeling algorithm of the heterogeneous integrated model based on improved weighted average.
[0081] Table 1 Improved weighted average heterogeneous ensemble modeling algorithm
[0082]
[0083] In Table 1, in the sub-model establishment and weight optimization, the octane number prediction sub-model has 11 inputs and 1 output, and the anti-knock coefficient prediction sub-model has 12 inputs and 1 output.
[0084] In another specific embodiment, Figure 3 As shown in FIG. 1 , the process of performing nonlinear integration on the octane number prediction sub-model or the anti-knock coefficient prediction sub-model includes:
[0085] The optimally selected heterogeneous learner for establishing the octane number prediction sub-model or the anti-knock coefficient prediction sub-model is used as a primary learner, and the finally established octane number prediction sub-model and the anti-knock coefficient prediction sub-model are used as primary sub-models;
[0086] Use nonlinear machine learning algorithms as secondary learners;
[0087] The predicted output of the primary sub-model and the actual measured value are combined as new samples, and the new samples are used to optimize and train the parameters of the secondary learner to obtain the final stacking-based nonlinear octane number integrated model or anti-knock coefficient integrated model.
[0088] The weighted average integration algorithm is essentially a linear integration method. For industrial processes with nonlinear characteristics, the integration effect is often not adaptable enough. Considering the good fitting ability of machine learning algorithms such as neural networks to nonlinear characteristics, this embodiment is based on the stacking idea, using such nonlinear machine learning algorithms as secondary learners to further mine the nonlinear features in the data and establish a stacked nonlinear integration octane number and anti-knock coefficient classification prediction model. Table 2 shows the modeling algorithm of the heterogeneous integration model based on Stacking.
[0089] Similar to the above description, assuming that Γ 1 ,Γ 2 ,…,Γ T In order to optimize the primary learner for establishing the prediction sub-model, Γ is the secondary learner. According to the algorithms of each primary learner, the primary sub-model h can be trained based on the data set D. t , (t=1,…,T), in this way, the prediction output of each sub-model can be obtained Then get new samples Then, the secondary learner Γ is optimized and trained with this sample set to obtain the secondary integrated model h'; combined with the prediction output of the primary sub-model, the final prediction result can be obtained.
[0090] Table 2 Heterogeneous ensemble modeling algorithm based on Stacking
[0091]
[0092]
[0093] In Table 2, for the establishment of the primary sub-model, the octane number prediction model is 11 inputs and 1 output, and the anti-knock coefficient prediction model is 12 inputs and 1 output; for the establishment of the secondary integrated model, both the octane number prediction and the anti-knock coefficient prediction are T input and 1 output.
[0094] Next, simulation verification is performed on the sub-model and integrated model obtained by the embodiment of the present invention respectively.
[0095] 1. Data preparation and model evaluation indicators
[0096] The experimental sample data was taken from some measured data of a large oil refinery during 2019-2021, during which the operating conditions changed relatively little. In order to reduce the impact of measurement noise, data loss, etc. and ensure data quality, before modeling, some unqualified data were deleted according to the test results of professional departments, and the triple standard deviation criterion was used to eliminate outliers, and a total of 1,105 qualified data were obtained. They were normalized and divided by autonomous sampling, and about 63.2% of the data was used for model training, and the rest of the data was used for testing. The entire simulation process was based on an Intel Core i7 64-bit laptop with 16G memory, and different models were built using Python language and Scikit-learn library.
[0097] Model evaluation is an important part of testing the performance of the established model. This experiment mainly uses mean square error (MSE), mean absolute error (MAE), mean absolute percentage error (MAPE), generalization error (GE), and custom prediction error distribution (PED) to evaluate the performance of the model established in this paper. Specifically, MSE, MAE, MAPE, and PED (0.15) are used to evaluate the accuracy of the model, and GE is used to evaluate the generalization ability of the model.
[0098] 1) Mean Square Error (MSE)
[0099]
[0100] 2) Mean Absolute Error (MAE)
[0101]
[0102] 3) Mean Absolute Percentage Error (MAPE)
[0103]
[0104] 4) Forecast error distribution
[0105]
[0106] In the formula, num(Δ≤δ) represents the number of errors within the δ range, num(N) represents the total number of predictions, and Δ represents the error set. The greater the proportion of PED within the error range, the better the prediction effect.
[0107] 5) Generalization Error (GE)
[0108] Given a training sample set D and a learning algorithm, the trained estimator y(x; D) has a predicted output for each test sample x Then the expected generalization error of the learner can be decomposed into the sum of bias, variance and noise:
[0109] GE=Bias 2 +Varience+ε 2 (11)
[0110] in, ε 2 =E D [(y D -y)] 2 , is the expectation of sample x. Since the noise of data mainly comes from sensors, human factors, etc., it is usually difficult to obtain. Here it is taken as 0, then:
[0111] GE=Bias 2 +Varience (12)
[0112] In the above formula, n is the number of samples, y i is the true value, y D is the measured value, is the predicted value.
[0113] 2. Hierarchical modeling and analysis of heterogeneous proton models
[0114] In order to achieve more accurate prediction of octane number and anti-knock coefficient, the reasonable selection of modeling scheme and algorithm is crucial. Therefore, based on the previous analysis, this experiment first selects the optimal model for various machine learning algorithms that may be used for modeling, and then compares and analyzes the traditional two-output modeling scheme and the hierarchical modeling scheme of this paper.
[0115] 2.1 Algorithm optimization and parameter setting
[0116] Firstly, K-fold cross validation and grid search were used to adjust the parameters of multiple machine learning algorithms such as Multiple Linear Regression (MLR), Ridge Regression (RR), Least Absolute Shrinkage and Selection Operator (LASSO), Elastic Network (EN), Support Vector Regression (SVM), Classification and Regression Tree (CART), Random Forest (RF), K-Nearest Neighbors (KNN), etc., to establish prediction models of octane number and anti-knock coefficient respectively, and the model performance was evaluated. Five algorithms with better performance, such as MLR, KNN, CART, RF, and SVM, were selected for the establishment of subsequent sub-models. Among them, the parameter selection of the model algorithm is mainly based on K-fold cross validation and grid search, and the preferred parameters are shown in Table 3.
[0117] Table 3 Optimal parameter settings for single model algorithm
[0118]
[0119] In Table 3, n_neighbor is the number of nearest neighbor points K, that is, K nearest samples are taken to predict the target point. This value determines the accuracy of the model. Adjusting the K value can prevent the model from overfitting.
[0120] max_leaf_nodes and min_samples_leaf are the maximum number of leaf nodes and the minimum number of samples contained in a leaf node, respectively. By balancing the values of the two, overfitting can be effectively prevented.
[0121] n_estimators, min_samples_split, and max_depth are the number of decision trees (too small is prone to underfitting, too large cannot significantly improve model performance), the minimum number of samples that can be divided into nodes, and the maximum tree depth (the depth of the subtree when building the optimal model).
[0122] kernel, C, and max_iter are the kernel function, penalty coefficient, and maximum number of iterations, respectively. The smaller the C value, the stronger the generalization ability.
[0123] 2.2 Analysis of simulation results of heteroproton model
[0124] To verify the advantages of the hierarchical modeling scheme, it is compared with the traditional octane number and anti-knock coefficient modeling scheme, where the hierarchical prediction model is: 11 inputs and 1 output (octane number), 12 inputs and 1 output (anti-knock coefficient), and the traditional prediction model is: 11 inputs and 2 outputs (octane number, anti-knock coefficient). At the same time, in order to reduce the impact of random factors and objectively evaluate the performance of the model, the self-service sampling method is used to repeat the experiment on the data 100 times to obtain 100 sample subsets equal to the number of training sample sets, that is, for a given training sample set From it, we sample m times with replacement to obtain a sample subset with a sample size of m. Repeat this process 100 times to obtain the sample set D new ={D 1 ,…,D 100},in And satisfy D=D 1 ∪...∪D 100 , Using this as the training set, the five algorithms selected above were used to establish single prediction models for octane number and anti-knock coefficient respectively, and 100 models of the same algorithm were tested using the same test set. The evaluation results of MSE, MAE, MAPE, PED (0.15) and GE were averaged. The simulation results are shown in Tables 4 to 7.
[0125] Table 4 Prediction results of traditional octane number model (11-2)
[0126]
[0127] Table 5 Prediction results of traditional anti-explosion coefficient model (11-2)
[0128]
[0129]
[0130] Observe the 11-input-2-output traditional models in Tables 4 and 5. For the prediction of octane number and anti-knock coefficient, RF has a good performance in both model accuracy and generalization ability, followed by KNN and SVM, and MLR and CART are relatively poor. This shows that under the traditional modeling scheme, the single model RF is more suitable for the joint prediction of octane number and anti-knock coefficient.
[0131] Table 6 Prediction results of graded octane number model (11-1)
[0132]
[0133] Table 7 Prediction results of graded anti-explosion coefficient model (12-1)
[0134]
[0135] Combining the 11-input-1-output and 12-input-1-output classification models in Tables 6 and 7, for the octane number, in terms of model accuracy and generalization ability, RF performs best, followed by KNN and SVM, and MLR and CART are poorer; for the anti-knock coefficient, RF also performs best, followed by MLR and CART, and SVM and KNN are poorer.
[0136] Further comparison of the prediction results in Table 4 and Table 6, and Table 5 and Table 7 shows that the performance of the five heterogeneous single models established under the hierarchical modeling scheme is significantly improved compared with the traditional two-output model. For the octane number, the performance of the 1-output under the hierarchical model is still improved compared with the traditional two-output model, although the input is the same. The reason is that it is easier to find the optimal solution for the 1-output than for the 2-output. For the anti-knock coefficient, the overall performance of the hierarchical model is more significant. In particular, from the perspective of MSE, GE, MAPE and other indicators, the performance of most algorithms is improved by about 5 to 8 times, and the other indicators are also improved by about 1 to 5 times. The reason is that the hierarchical model considers the strong correlation between the anti-knock coefficient and the octane number, that is, the anti-knock coefficient of the secondary output depends on the predicted value of the primary octane number output. When the octane number prediction is more accurate, the prediction of the anti-knock coefficient is also more accurate. This fully shows that the hierarchical modeling scheme is more suitable for establishing high-quality octane number and anti-knock coefficient prediction models than the traditional dual-output primary modeling scheme that does not consider the correlation. In the future, a heterogeneous integrated prediction model of the two will be established under the hierarchical modeling scheme.
[0137] 3. Simulation results and analysis of heterogeneous integrated models
[0138] In order to verify the performance of the heterogeneous integration model proposed in the present invention, this experiment simulates and verifies the proposed integration model based on improved weighted average and the integration model based on Stacking. For the sake of simplicity, the above integration modeling methods are respectively recorded as MethodⅠ and MethodⅡ. Among them, 5 different weighted integrations are performed on MethodⅠ, which are respectively recorded as weighted 1 to weighted 5, where weighted 1 is the average integration of the results of 5 algorithms such as MLR, KNN, CART, RF and SVM; weighted 2 is the weighted integration that minimizes the objective function of formula (3); weighted 3, weighted 4 and weighted 5 are weighted integrations that introduce L1 regularization, L2 regularization and mixed L1&L2 regularization constraints into the objective function formula (3). In MethodⅡ, 5 algorithms such as MLR are used as primary learners, and 4 nonlinear algorithms such as KNN, RF, BP and ELM are used as secondary learners to establish Stacking integration models, which are respectively recorded as Stacking1, Stacking2, Stacking3 and Stacking4. The simulation results are shown in Tables 8 to 11, where Tables 8 and 9 are weight coefficient tables of octane number and anti-knock coefficient under Method I. The simulation process is similar to that in Section 2.2. The self-service sampling method is still used to repeat the experiment 100 times, and the final results are averaged.
[0139] Table 8 Octane number model weight coefficient
[0140] MLR KNN CART RF SVM Weighted 1 0.200 0.200 0.200 0.200 0.200 Weighted 2 0.134 0.314 0.104 0.409 0.039 Weighted 3 0 0.033 0.001 0.966 0 Weighted 4 0.002 0.365 0.081 0.477 0.075 Weighted 5 0 0.349 0.023 0.580 0.048
[0141] Table 9 Anti-explosion coefficient model weight coefficient
[0142] MLR KNN CART RF SVM Weighted 1 0.200 0.200 0.200 0.200 0.200 Weighted 2 0.139 0.239 0.206 0.298 0.118 Weighted 3 0.017 0.058 0.012 0.913 0 Weighted 4 0.027 0.202 0.132 0.637 0.002 Weighted 5 0.140 0.228 0.202 0.331 0.099
[0143] Table 10 Octane number integrated model prediction results
[0144]
[0145] Table 11 Prediction results of the integrated model of anti-knock coefficient
[0146]
[0147]
[0148] In order to more intuitively demonstrate the prediction performance of the two heterogeneous integrated model integration methods for octane number and anti-knock coefficient, they are compared with the prediction results of five heterogeneous single models (here the influence of noise is ignored, GE is equal to MSE). Figure 4(a)-4(d) shown.
[0149] Combined with Table 8 to Table 11, Figure 4(a)-4(d)It can be seen that the two types of heterogeneous integrated modeling methods proposed in the present invention have significantly improved the performance of Method Ⅰ and Method Ⅱ compared with the single model in terms of the prediction of octane number and anti-knock coefficient, showing good prediction performance.
[0150] In Method Ⅰ, from the perspective of prediction accuracy and generalization performance, weighted 5 has the best performance, followed by weighted 3 and weighted 4, and weighted 1 and weighted 2 are relatively poor. The reason is that since weighted 1 simply averages the weight coefficients and does not consider the differences between the sub-models, the prediction performance of the integrated model is unsatisfactory; weighted 2 only aims to minimize the error between the actual output value and the predicted value, and it iteratively optimizes the model weights through the principle of empirical minimization, but affected by the training data, the model applicability is poor, that is, the consideration of high-quality sub-models is still insufficient, so it is still difficult to give full play to the advantages of each heterogeneous sub-model. For example, for the prediction of octane number, the weight of RF with better performance accounts for only 0.409, while the weights of MLR, KNN, CART with relatively poor performance all account for a certain proportion (0.134, 0.314, 0.104); and the weighted 3 to weighted 5 methods start from the integrated algorithm itself and introduce regularization constraints to the objective function. On the one hand, it reduces the complexity of the model and prevents the occurrence of overfitting in the weight optimization process. On the other hand, it can fully consider the impact of various heterogeneous proton models on the results, making the model performance more significantly improved. For example, in the weighted 3 method, the introduction of L1 regularization makes the model weights closer to 0 or 1 (octane number: wRF=0.966, wMLR=wSVM=0, anti-knock coefficient: wRF=0.913, wSVM=0), which can weaken the inferior sub-models and highlight the advantages of the high-quality sub-models. Therefore, the model performance is improved more significantly. In the weighted 4 method, due to the introduction of L2 regularization, the solution of the model weights is smoother, all sub-models have a certain contribution to the integrated model, and the model performance is also significantly improved. The weighted 5 method combines the advantages of L1 and L2 regularization. On the one hand, it makes full use of the information of each sub-model, and on the other hand, it weakens the weight of the inferior sub-model. Through the balance between the two, the performance of the model is better improved.
[0151] For Method Ⅱ, due to the use of a nonlinear algorithm based on stacking integration to integrate each sub-model, it can learn nonlinear features that cannot be expressed by linear algorithms to a certain extent, and the performance is significantly improved compared with a single model, and is better than the linear integration model overall. Stacking4 has the best performance, followed by Stacking3 and Stacking2, and Stacking1 is relatively poor. The reason is that in the Stacking1 integration algorithm, KNN itself is more sensitive to data distribution, so the model performance is relatively poor; Stacking2 fully utilizes the advantages of the tree model structure, integrates the advantages of multiple trees, and improves the performance of the integration model; Stacking3 uses BP network as a secondary learner, and the number of hidden layer nodes and the selection of activation functions can well learn the nonlinear characteristics of the data, and the performance is significantly improved compared with the single model and Method Ⅰ; Stacking4 uses ELM as a secondary learner, which not only improves the training speed of the model, but also improves the accuracy of the integrated model, and has the best performance among all models.
[0152] In summary, the two types of heterogeneous multi-model octane number and anti-knock coefficient graded prediction integration methods proposed in the present invention can improve the performance of the integrated model to a certain extent. In the first-level modeling process, the model complexity is relatively low, so both linear and nonlinear integrated modeling methods can establish accurate octane number prediction models, while in the second-level modeling process, the model complexity is high, so the nonlinear integrated method has more advantages. Among them, the weighted 5 method and the Stacking3 and Stacking4 stacking integrated models are more suitable for the prediction modeling of octane number and anti-knock coefficient in finished gasoline blending.
[0153] 4. Optimal model prediction results
[0154] The above-mentioned integrated linear weighted 5, nonlinear Stacking 3 and Stacking 4 with better performance are used in the prediction of octane number and anti-knock system. The results are as follows Figure 5(a)-5(c) shown.
[0155] from Figure 5(a)-5(c) It can be seen more intuitively that the prediction models with the best performance in the two types of linear and nonlinear integration methods proposed in the present invention (weighted 5, Stacking3, Stacking4) have a high degree of overlap between the predicted values and the true values, and a small number of deviation points also have a high degree of proximity. This further verifies the hierarchical prediction integration model proposed in the present invention, which can obtain relatively satisfactory prediction results for the prediction of octane number and anti-knock coefficient, and can be used for the accurate prediction of octane number and anti-knock coefficient in the blending process of finished gasoline, and is expected to solve the problem of completeness of formula data in the later formula modeling process.
[0156] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0157] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A heterogeneous multi-model octane number and anti-knock coefficient graded prediction integrated modeling method, characterized in that: The following steps are involved: The K-fold cross-validation method is used to tune and optimize the parameters of multiple heterogeneous learners, and multiple octane number prediction sub-models and multiple anti-knock coefficient prediction sub-models are established respectively; Performing linear integration or nonlinear integration on the plurality of octane number prediction sub-models and the plurality of anti-knock coefficient prediction sub-models respectively to establish an octane number integrated model and an anti-knock coefficient integrated model; Obtaining a prediction result of the octane number based on the octane number integrated model; Obtaining a prediction result of the anti-knock coefficient based on the anti-knock coefficient integrated model; The establishment process of the octane number prediction sub-model and the anti-knock coefficient prediction sub-model includes: Determine n finished gasoline indicators that are highly correlated with octane number and anti-knock coefficient and easy to measure as data set 1; Using the K-fold cross validation method on the data set one to select and tune parameters of multiple heterogeneous learners, and training multiple heterogeneous learners selected from the data set one based on the optimal parameters to obtain multiple octane number prediction sub-models; Combining the octane number predicted and output by the octane number prediction sub-model with the data set 1 to obtain data set 2; Based on the second data set, a plurality of selected heterogeneous learners are trained to obtain the anti-explosion coefficient prediction sub-model.
2. The heterogeneous multi-model octane number and anti-knock coefficient graded prediction integrated modeling method according to claim 1 is characterized in that: Before training the optimal heterogeneous learner, the method further includes: performing missing value deletion, outlier deletion and normalization processing on the data set 1.
3. The heterogeneous multi-model octane number and anti-knock coefficient graded prediction integrated modeling method according to claim 1 is characterized in that: The process of linearly integrating the octane number prediction sub-model or the anti-knock coefficient prediction sub-model comprises: Determining an objective function, minimizing the objective function, and determining the optimal weight of each of the octane number prediction sub-models or the anti-knock coefficient prediction sub-models; Based on the optimal weight, a weighted average integration algorithm is used to integrate the plurality of octane number prediction sub-models or the anti-knock coefficient prediction sub-models to obtain the octane number integrated model or the anti-knock coefficient integrated model.
4. The heterogeneous multi-model octane number and anti-knock coefficient graded prediction integrated modeling method according to claim 3 is characterized in that: An L1 regularization term, an L2 regularization term, or a mixed L1 & L2 regularization term is introduced into the objective function, and the optimal weight obtained by minimizing the objective function is adjusted.
5. The heterogeneous multi-model octane number and anti-knock coefficient graded prediction integrated modeling method according to claim 3 is characterized in that: The expression of the objective function is: Among them, J0 is the objective function, is the actual measured value, is the prediction output of each octane number prediction sub-model or anti-knock coefficient prediction sub-model, i = 1…m, j = 1…T, m is the number of samples, T is the number of heterogeneous learners, w j The weight of each octane number prediction sub-model or anti-knock coefficient prediction sub-model.
6. The heterogeneous multi-model octane number and anti-knock coefficient graded prediction integrated modeling method according to claim 3 is characterized in that: The expression of the octane number integrated model or the anti-knock coefficient integrated model is: in, And w j ≥0.
7. The heterogeneous multi-model octane number and anti-knock coefficient graded prediction integrated modeling method according to claim 1 is characterized in that: The process of performing nonlinear integration on the octane number prediction sub-model or the anti-knock coefficient prediction sub-model comprises: The optimally selected heterogeneous learner for establishing the octane number prediction sub-model or the anti-knock coefficient prediction sub-model is used as a primary learner, and the finally established octane number prediction sub-model and anti-knock coefficient prediction sub-model are used as primary sub-models; Use nonlinear machine learning algorithms as secondary learners; The predicted output of the primary sub-model and the actual measured value are combined as new samples, and the new samples are used to optimize and train the parameters of the secondary learner to obtain a final stack-based nonlinear octane number integrated model or anti-knock coefficient integrated model.
8. The heterogeneous multi-model octane number and anti-knock coefficient graded prediction integrated modeling method according to claim 7 is characterized in that: The expression of the octane number integrated model or the anti-knock coefficient integrated model is: H(x)=h'(h1(x),h2(x),…,h T (x)) Where h'=Γ(D new ), indicating an octane number integrated model or an anti-knock coefficient integrated model; represents a new sample, Γ represents a secondary learner, and h t (x) represents the tth primary sub-model.
9. The heterogeneous multi-model octane number and anti-knock coefficient graded prediction integrated modeling method according to claim 7, characterized in that: The primary learner adopts the MLR algorithm, the KNN algorithm, the CART algorithm, the RF algorithm and the SVM algorithm; the secondary learner adopts any one of the KNN algorithm, the RF algorithm, the BP algorithm and the ELM algorithm.
