A method for predicting octane number loss based on hybrid feature selection

Through a method based on hybrid feature selection, the main variables of catalytic cracking gasoline are screened and a multiple linear regression model is established, which solves the problems of high cost of octane loss measurement and unsatisfactory modeling effect in traditional methods, and achieves low-cost and fast Improvements in octane loss prediction and modeling.

CN113990409BActive Publication Date: 2024-09-24NANTONG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111232532.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-22
Publication Date
2024-09-24
Estimated Expiration
2041-10-22

AI Technical Summary

Technical Problem

The existing technology generally reduces the octane number of gasoline during the desulfurization and olefin reduction process of catalytic cracking gasoline, and the traditional octane loss measurement method is costly and time-consuming, and the chemical modeling method is not effective in the refining process. ideal.

Method used

An octane loss prediction method based on hybrid feature selection is adopted, variables are screened through k-means clustering algorithm, Pearson correlation coefficient and distance correlation coefficient are used to test the linear and nonlinear relationships of variables, decision trees calculate the importance of variables, and multivariate linearity is established The regression model is optimized using the AdaGrad algorithm of adaptive gradient descent.

Benefits of technology

It reduces the modeling cost of octane loss, improves the representativeness and independence of modeling, simplifies operations, avoids the impact of outliers and missing data on the model, and improves the convergence speed of model training.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113990409B
    Figure CN113990409B
Patent Text Reader

Abstract

The present invention provides an octane loss prediction method based on mixed feature selection, belonging to the field of petrochemical technology. The problem of high cost and time consumption of the existing octane loss determination method is solved. The technical scheme is as follows: the prediction method comprises the following steps: S1: obtaining the original data of the sample collected from the catalytic cracking gasoline refining device; S2: pre-processing the data sample; S3: using the k-means clustering algorithm to preliminarily screen the variables: S4: using the Pearson correlation coefficient to test the linear relationship of the variables, and using the distance correlation coefficient to test the nonlinear relationship of the variables, and eliminating the variables with high correlation with other variables: S5: according to the importance of each variable calculated by the decision tree, the final variables for modeling are obtained; S6: according to the octane loss and the screened variables, a multivariate linear regression model is established and trained. The beneficial effects of the present invention are: the main variables of the modeling can be made representative and independent.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of petrochemical engineering, and in particular to an octane number loss prediction method based on mixed feature selection. Background Art

[0002] Small vehicles are mostly fueled by gasoline, and the exhaust gas produced by the combustion of gasoline has a significant impact on the atmospheric environment, so gasoline needs to be cleaned to reduce the content of sulfur and olefins. More than 95% of the sulfur and olefins in finished gasoline come from catalytic cracking gasoline, so catalytic cracking gasoline needs to be refined. However, in the process of desulfurization and olefin reduction of catalytic cracking gasoline in the existing technology, the octane number of gasoline is generally reduced.

[0003] Octane number is the most important indicator of gasoline combustion performance, and low octane loss needs to be ensured during the process. Traditional octane loss determination methods are costly and time-consuming. Modeling methods for chemical processes have achieved certain results in some fields. However, due to the large number of operating variables in the refining process and the highly nonlinear and strongly coupled relationships between them, the traditional chemical modeling method is not ideal. Therefore, an effective feature extraction method is needed to screen out the main modeling variables from the operating variables. Summary of the invention

[0004] The object of the present invention is to provide an octane number loss prediction method based on hybrid feature selection, which can make the main variables of modeling representative and independent.

[0005] The present invention is achieved by the following measures: a method for predicting octane number loss based on mixed feature selection, which includes the following steps:

[0006] S1: Obtaining raw data of samples collected from a catalytic cracking gasoline refining unit;

[0007] S2: preprocess the data samples;

[0008] S3: Use k-means clustering algorithm to preliminarily screen variables:

[0009] S4: Use the Pearson correlation coefficient to test the linear relationship of variables, and use the distance correlation coefficient to test the nonlinear relationship of variables, and eliminate variables with high correlation with other variables:

[0010] S5: Obtain the final variables for modeling based on the importance of each variable calculated by the decision tree;

[0011] S6: Based on the octane number loss and the screened variables, a multivariate linear regression model is established and trained.

[0012] As a further optimization scheme of the octane number loss prediction method based on hybrid feature selection provided by the present invention, step S2 specifically includes the following steps:

[0013] S201: Delete the operating variables with too many missing data;

[0014] S202: removing outliers in the data according to the Laida criterion;

[0015] S203: For sites with null values ​​in some time points, the null values ​​are replaced by the average value of the data of the two hours before and after;

[0016] S204: Taking the time point at which the octane number data is measured as the reference time, taking the average value of the operating variable data of the previous two hours as the operating variable data corresponding to the octane number.

[0017] As a further optimization scheme of the octane number loss prediction method based on hybrid feature selection provided by the present invention, step S3 specifically includes the following steps:

[0018] S301: Using the normalized variable data as a training set for the k-means algorithm, initializing k cluster centers;

[0019] S302: Calculate the Euclidean distance from the variable to the centroid of each cluster, assign it to the cluster with the closest distance, and recalculate the centroid of the cluster;

[0020] S303: repeating steps S301 and S302 until the centroid of each cluster no longer changes;

[0021] S304: Draw a curve graph of the sum of squared errors (SSE) and the k value, use the elbow rule to determine the optimal number of clusters, and select the centroid of each cluster as a variable for preliminary screening.

[0022] As a further optimization scheme of the octane number loss prediction method based on hybrid feature selection provided by the present invention, step S4 specifically includes the following steps:

[0023] S401: Calculate the Pearson correlation coefficient of each variable with other variables to test the linear correlation. The calculation formula is as follows:

[0024]

[0025] S402: Calculate the distance correlation coefficient between each variable and other variables to test nonlinear correlation. The calculation formula is as follows:

[0026]

[0027] Among them, the distance covariance and They are:

[0028]

[0029]

[0030]

[0031] Similarly, calculate the distance covariance and Among them, X and Y are two variables for correlation analysis, and n represents the number of samples.

[0032] S403: Obtain the Pearson and distance correlation matrix of the variables, calculate the mean of the correlation coefficients of each variable with other variables, and eliminate the variables whose mean is greater than the threshold.

[0033] As a further optimization scheme of the octane number loss prediction method based on hybrid feature selection provided by the present invention, the step S5 is specifically: using a decision tree to calculate the importance of each variable, and calculating the sum of the Gini index decrease degrees (Gini importance, GI) of the branch nodes, and the calculation formula is as follows:

[0034]

[0035] Among them, N is the total number of samples, N t is the number of samples of the current node, is the number of samples of the right child of the node, is the number of samples of the left child of the node, G is the Gini index, G l and G r are the Gini indexes for the left and right branches respectively.

[0036] After calculating the importance of each variable, they are sorted and the variables with importance higher than the threshold are screened out.

[0037] As a further optimization scheme of the octane number loss prediction method based on hybrid feature selection provided by the present invention, establishing a multivariate linear regression model in step S6 includes: taking the root mean square error as the loss function and optimizing using the AdaGrad algorithm of adaptive gradient descent.

[0038] Compared with the prior art, the present invention has the following beneficial effects:

[0039] (1) The present invention adopts a modeling method to predict octane number loss. Compared with traditional methods, it is low in cost and simple in operation. It uses a variety of data preprocessing methods to process the original data samples, avoiding the influence of outliers and data missing on model prediction. The k-means clustering algorithm is used to select the centroid of the cluster to represent a class of variables, and the decision tree algorithm is used to screen variables according to the sum of the degree of decrease of the Gini index. The variables used for modeling can be representative and highly important, which is conducive to ignoring minor factors and discovering and analyzing the main variables and factors affecting octane number loss.

[0040] (2) The variable linear and nonlinear correlation test method proposed in the present invention makes the selected variables independent, avoiding the unsatisfactory modeling effect caused by the high nonlinearity and strong coupling between the dependent variables. When establishing a multivariate linear regression model, the AdaGrad algorithm with adaptive gradient descent is used for optimization, which can improve the convergence speed of the model training. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] The accompanying drawings are used to provide further understanding of the present invention and constitute a part of the specification. They are used to explain the present invention together with the embodiments of the present invention and do not constitute a limitation of the present invention.

[0042] Figure 1 The flowchart of the octane number loss prediction method based on the mixture characteristic selection of the present invention.

[0043] Figure 2 A K-SSE curve diagram provided by an embodiment of the present invention.

[0044] Figure 3 A Pearson correlation matrix diagram provided by an embodiment of the present invention.

[0045] Figure 4 A distance correlation matrix diagram provided by an embodiment of the present invention.

[0046] Figure 5 This is a graph of the multiple linear regression prediction results provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0047] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. Of course, the specific embodiments described here are only used to explain the present invention and are not used to limit the present invention.

[0048] Example

[0049] See also Figure 1 The present invention provides a technical solution, which is a method for predicting octane number loss based on hybrid feature selection, comprising the following steps:

[0050] S1: Obtaining raw data of samples collected from a catalytic cracking gasoline refining unit;

[0051] S2: preprocess the data samples;

[0052] S3: Use k-means clustering algorithm to preliminarily screen variables:

[0053] S4: Use the Pearson correlation coefficient to test the linear relationship of variables, and use the distance correlation coefficient to test the nonlinear relationship of variables, and eliminate variables with high correlation with other variables:

[0054] S5: Obtain the final variables for modeling based on the importance of each variable calculated by the decision tree;

[0055] S6: Based on the octane number loss and the screened variables, a multivariate linear regression model is established and trained.

[0056] 325 data samples were collected from the catalytic cracking gasoline refining desulfurization unit of a petrochemical enterprise, and each data sample had 354 operating variables.

[0057] In the original data, some variables only contain data for a part of the time period, and some variables have all null values ​​or part of the data has null values. The original data needs to be processed before it can be used.

[0058] Preferably, the specific steps of preprocessing the data samples in step S2 are as follows:

[0059] S201: Delete the operating variables with too many missing data;

[0060] S202: removing outliers in the data according to the Laida criterion;

[0061] The calculation process of the Laida criterion is as follows:

[0062] (1) Assume that the measured variable is measured with equal precision, and we get x 1 ,x 2 ,...,x n , calculate its arithmetic mean x and residual error v i :

[0063] v i =x i -x

[0064] (2) Calculate the standard error σ according to the Bessel formula:

[0065]

[0066] (3) If a certain measurement value x b The residual error v b(1<=b<=n), satisfying |v b |=|x b -x|>3σ, then x b It is a bad value containing large error values ​​and should be eliminated.

[0067] S203: For sites with null values ​​in some time points, the null values ​​are replaced by the average value of the data of the two hours before and after;

[0068] S204: Taking the time point at which the octane number data is measured as the reference time, taking the average value of the operating variable data of the previous two hours as the operating variable data corresponding to the octane number.

[0069] Preferably, the specific steps of using the k-means algorithm to preliminarily screen variables in step S3 are as follows:

[0070] S301: Use the normalized variable data as the training set of the K-means algorithm, and record the input data samples as the set D = {x 1 ,x 2 ,x 3 ,...x m}, randomly select k data from the data sample set as randomly initialized centroid vectors: Initialize k cluster centers: {μ 1 ,μ 2 ,μ 3 ,...,μ k};

[0071] S302: record the cluster set as Where t = 1, 2, 3, ..., k, in the data sample set D, calculate each sample x i and each centroid vector μ j The Euclidean distance between them is given by the following formula:

[0072]

[0073] x i The smallest one is marked as d ij The corresponding category λ i ,renew And for the cluster set C t The new centroid is calculated for all sample points in the formula as follows:

[0074]

[0075] S303: repeat steps S301 and S302 until the centroid of each cluster no longer changes;

[0076] S304: Figure 2As shown, a curve graph of the sum of squared errors (SSE) and k value is drawn, and the elbow rule is used to determine that the optimal number of clusters is 50. The centroid of each cluster is selected as the variable for preliminary screening.

[0077] In order to ensure the independence of the selected modeling variables, it is necessary to test the linear and nonlinear correlations between the variables.

[0078] Preferably, in step S4, the variable correlation is tested, and the specific steps are as follows:

[0079] S401: Calculate the Pearson correlation coefficient of each variable with other variables to test the linear correlation. The calculation formula is as follows:

[0080]

[0081] S402: Calculate the distance correlation coefficient between each variable and other variables to test nonlinear correlation. The calculation formula is as follows:

[0082]

[0083] Among them, the distance covariance and They are:

[0084]

[0085]

[0086]

[0087] Similarly, calculate the distance covariance and Among them, X and Y are two variables for correlation analysis, and n represents the number of samples.

[0088] S403: Figure 3 and Figure 4 As shown, the Pearson correlation matrix and distance correlation matrix of the variables are obtained, and the following operations are performed on these two matrices respectively: sum the matrix columns to obtain the sum of the correlation coefficients of each variable with other variables, and then divide it by the number of variables to obtain the average correlation coefficient of each variable, and then sort the correlation coefficient of each feature, and eliminate those with a relationship number greater than 0.6. The variables screened by the above steps can reduce the highly nonlinear and strongly coupled relationships between variables, and finally 35 variables are obtained as shown in Table 1.

[0089] Table 1 35 variables selected according to the correlation

[0090]

[0091]

[0092] Preferably, the specific steps of using the decision tree algorithm to screen variables according to important contingencies in step S5 are as follows:

[0093] Calculate the importance of each variable and the sum of the Gini index decreases of the branch nodes (Giniimportance, GI for short). The calculation formula is as follows:

[0094]

[0095] Among them, N is the total number of samples, N t is the number of samples of the current node, is the number of samples of the right child of the node, is the number of samples of the left child of the node, G is the Gini index, G l and G r are the Gini indexes for the left and right branches respectively.

[0096] After calculating the importance of each variable, we sorted and screened out the top 15 most important variables. The sum of the importance of these 15 variables accounted for more than half of the original ones, which is highly representative. The calculation results are shown in Table 2.

[0097] Table 2 The 15 variables finally selected

[0098]

[0099] Preferably, the general form of the multivariate linear regression model in step S6 is as follows:

[0100] Y=β 0 +β 1 X 1 +β 2 X 2 +...+β k X k +μ

[0101] Import 325 sample data containing 15 main variables, divide them into training set and test set in a ratio of 8:2, and start training data. According to the prior, set the learning rate to 100, the number of training times to 5000, and use the root mean square error as the loss function. The loss function is shown in the following formula.

[0102]

[0103] and r Represent the true value and predicted value of the rth sample respectively.

[0104] The training set will be used with the loss function to train the multivariate linear regression model. The loss function is optimized using the AdaGrad algorithm with adaptive gradient descent, as shown in the following formula.

[0105]

[0106] where θ i,t is the parameter at time t, G i,t is the square sum of the gradients of the parameter, η is the learning rate, g t,i is the parameter θ i,t The gradient of the loss function, ε is a minimum value.

[0107] After training, the prediction effect is as follows Figure 5 As shown in the figure, the multivariate linear regression algorithm has better prediction effect than the neural network algorithm.

[0108] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for predicting octane number loss based on hybrid feature selection, characterized in that: The steps include: S1: Obtaining raw data of samples collected from a catalytic cracking gasoline refining unit; S2: preprocess the data samples; S3: Use k-means clustering algorithm to preliminarily screen variables: S4: Use the Pearson correlation coefficient to test the linear relationship of variables, and use the distance correlation coefficient to test the nonlinear relationship of variables, and eliminate variables with high correlation with other variables: S5: Obtain the final variables for modeling based on the importance of each variable calculated by the decision tree; S6: Based on the octane number loss and the screened variables, a multivariate linear regression model is established and trained.

2. The octane number loss prediction method based on hybrid feature selection according to claim 1, characterized in that: The step S2 specifically includes the following steps: S201: Delete the operating variables with too many missing data; S202: removing outliers in the data according to the Laida criterion; S203: For sites with null values ​​in some time points, the null values ​​are replaced by the average value of the data of the two hours before and after; S204: Taking the time point at which the octane number data is measured as the reference time, taking the average value of the operating variable data of the previous two hours as the operating variable data corresponding to the octane number.

3. The octane number loss prediction method based on hybrid feature selection according to claim 1, characterized in that: The step S3 specifically comprises the following steps: S301: Using the normalized variable data as a training set for the k-means algorithm, initializing k cluster centers; S302: Calculate the Euclidean distance from the variable to the centroid of each cluster, assign it to the cluster with the closest distance, and recalculate the centroid of the cluster; S303: repeating steps S301 and S302 until the centroid of each cluster no longer changes; S304: Draw a curve graph of the sum of squared errors (SSE) and the k value, use the elbow rule to determine the optimal number of clusters, and select the centroid of each cluster as a variable for preliminary screening.

4. The octane number loss prediction method based on hybrid feature selection according to claim 1, characterized in that: The step S4 specifically comprises the following steps: S401: Calculate the Pearson correlation coefficient of each variable with other variables to test the linear correlation. The calculation formula is as follows: S402: Calculate the distance correlation coefficient between each variable and other variables to test nonlinear correlation. The calculation formula is as follows: Among them, the distance covariance and They are: Similarly, calculate the distance covariance and Where X and Y are two variables for correlation analysis, and n represents the number of samples; S403: Obtain the Pearson and distance correlation matrix of the variables, calculate the mean of the correlation coefficients of each variable with other variables, and eliminate the variables whose mean is greater than the threshold.

5. The octane number loss prediction method based on hybrid feature selection according to claim 1, characterized in that: The step S5 is specifically as follows: using a decision tree to calculate the importance of each variable, and calculating the sum of the Gini index decreases (Giniimportance, GI) of the branch nodes, and the calculation formula is as follows: Among them, N is the total number of samples, N t is the number of samples of the current node, is the number of samples of the right child of the node, is the number of samples of the left child of the node, G is the Gini index, G l and G r are the Gini indexes for the left and right branches respectively; After calculating the importance of each variable, they are sorted and the variables with importance higher than the threshold are screened out.

6. The octane number loss prediction method based on hybrid feature selection according to claim 1, characterized in that: The step S6 of establishing the multivariate linear regression model includes: using the root mean square error as the loss function and optimizing using the AdaGrad algorithm of adaptive gradient descent.