Gasoline fuel octane number prediction method based on near infrared spectroscopy
Through the artificial neural network model based on near-infrared spectroscopy, the principal component factors are extracted and a prediction model is established, which solves the problem that the existing technology cannot quickly and accurately measure the octane number of gasoline fuel, and achieves high-precision and low-cost octane number prediction. , suitable for gasoline fuel in different regions.
Patent Information
- Application Number
- CN202210137216.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-15
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2042-02-15
AI Technical Summary
Existing technology cannot quickly, accurately and cost-effectively measure the octane number of gasoline fuel online, and especially cannot accurately predict the octane number of real gasoline fuel from different regions.
An artificial neural network model based on near-infrared spectrum was used to extract principal component factors by collecting near-infrared spectrum and octane number experimental data, and an artificial neural network prediction model was established using the partial least squares method and gradient descent algorithm to predict the quality of gasoline fuel. Octane rating.
It achieves high-precision prediction of the octane number of gasoline fuel, saving time and economic costs, and has the potential to predict the octane number of gasoline fuel in multiple regions.
Smart Images

Figure CN114492197B
Abstract
Description
Technical Field
[0001] The invention relates to a prediction method in the technical field of octane number prediction, in particular to a gasoline fuel octane number prediction method based on near infrared spectrum and with an artificial neural network model. Background Art
[0002] In the petrochemical industry, octane number is usually used to characterize the anti-knock property of fuel. The higher the octane number of the fuel, the stronger its anti-knock property. Therefore, high-octane fuel can be used in high compression ratio engines to improve the thermal efficiency of the engine. The octane number of gasoline fuel obtained by experimental measurement is based on an octane number measuring machine. This process has high economic cost and is difficult to complete quickly. However, in the actual production process of an oil refinery or the inspection work of a gasoline quality inspection department, the octane number of each gasoline fuel needs to be measured quickly and accurately to improve production and inspection efficiency. Therefore, how to solve the problem of measuring the octane number of gasoline fuel online quickly, accurately and at low cost is a problem that urgently needs to be solved in this field.
[0003] Establishing an octane number prediction model can accomplish this task. Currently, there are many octane number prediction models, but these models cannot accurately predict the octane number of real gasoline fuel from different regions. Summary of the invention
[0004] In view of the shortcomings of the prior art, the present invention proposes a gasoline fuel octane number prediction method based on near-infrared spectroscopy. The artificial neural network method included in the present invention can automatically "learn" the complex internal relationship between input and output without any prior knowledge or specific model form assumptions, and has high prediction accuracy.
[0005] The present invention is achieved by the following technical solution, which comprises the following steps:
[0006] Step 1: Collect near infrared spectrum and octane number experimental data of gasoline fuel measurement;
[0007] Step 2: Extract principal component factors from near infrared spectral data;
[0008] Step 3: Using the principal component factors as characteristic parameters and the experimental data of the octane number of gasoline fuel as target parameters, an octane number prediction model is established based on the artificial neural network method;
[0009] Step 4: Input the principal component factors in the near infrared spectrum of the fuel to be tested into the prediction model to obtain the predicted octane number of the gasoline fuel.
[0010] Preferably, the gasoline fuel in step 1 above includes various real gasoline fuels.
[0011] Preferably, the above step 2 of extracting the principal component factors comprises the following steps:
[0012] Step 2.1, based on the partial least squares method, the input parameter matrix Decompose into a principal component matrix and a loading matrix :
[0013]
[0014] Among them, the principal component matrix , Representative principal components, loading matrix is an orthogonal matrix, Representative loads, and , is the total number of samples;
[0015] Step 2.2, calculate according to the variance maximization method :
[0016] ;
[0017] Step 2.3, calculate a prediction output:
[0018]
[0019] in, is the predicted value, is the true value, the superscript represents the transpose of the matrix, then the first residual is ;
[0020] Step 2.4, based on Continue to calculate the second load :
[0021]
[0022] By analogy, the load matrix is calculated All column vectors in ;
[0023] Step 2.5, calculate the principal component matrix:
[0024] .
[0025] Preferably, the above step 3 of establishing an artificial neural network prediction model comprises the following steps:
[0026] Step 3.1, normalize the input parameters to ;
[0027] Step 3.2, select the number of hidden layers, number of neurons, activation function, error function type and parameter optimizer type of the neural network model;
[0028] Step 3.3, perform forward propagation calculation on the neural network to obtain the predicted value:
[0029]
[0030] in, is the predicted value, is the output parameter, is the weight parameter, is the bias term, It is the activation function, which completes the nonlinear distortion from input to output;
[0031] Step 3.4: The predicted value With the true value Comparison results in the error function:
[0032]
[0033] in, is the mean square error between the true value and the predicted value;
[0034] Step 3.5, perform back propagation calculation on the neural network and update the weight parameters and bias items based on the gradient descent algorithm:
[0035]
[0036]
[0037] in, The learning rate is usually less than 1 to prevent excessive update steps, which can cause large fluctuations in the convergence process. Note that each parameter is updated by subtracting the gradient value. This is because the positive gradient direction represents the direction in which the error function grows fastest, and the negative gradient direction represents the direction in which the error function decreases fastest. When it is reduced to the minimum value, the artificial neural network model is completed.
[0038] Compared with the prior art, the present invention has the following effects: the present invention uses the principal component factors in the near infrared spectrum as input features and establishes a gasoline fuel octane number prediction model based on an artificial neural network. This method has higher prediction accuracy than previous methods and can save a lot of time and economic costs. The present invention establishes an octane number prediction model based on gasoline fuels from different regions of China, which makes the model have the potential to predict the octane number of gasoline fuels in multiple regions. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 is a flow chart of an embodiment of the present invention;
[0040] Figure 2 A graph showing the variation of the verification error of the partial least squares model with the number of principal components in an embodiment of the present invention;
[0041] Figure 3 This is a distribution diagram of the prediction error of the artificial neural network prediction model for the octane number of the test set gasoline fuel in an embodiment of the present invention. DETAILED DESCRIPTION
[0042] The following is a detailed description of an embodiment of the present invention in conjunction with the accompanying drawings. This embodiment is based on the technical solution of the present invention and provides a detailed implementation method and a specific operation process, but the protection scope of the present invention is not limited to the following embodiment.
[0043] Example
[0044] The technical solution adopted by the present invention is a gasoline fuel octane number prediction method based on near infrared spectroscopy and artificial neural network. Figure 1 The following steps are shown:
[0045] Step 1, collecting near infrared spectrum and octane number experimental data of gasoline fuel measurement;
[0046] The wavelength range of the near-infrared spectrum of gasoline fuel used in this example is 1000-1800 nm, and the octane number range is 90-100. Chemical bond vibration absorbs near-infrared light energy, resulting in absorbance peaks in the spectrum, among which the absorption band around 1190 nm belongs to the methylene CH absorption band, the absorption band around 1395 nm belongs to the methyl CH absorption band, and the absorption bands around 1144 and 1674 nm belong to the aromatic hydrocarbon CH absorption bands.
[0047] Step 2, extracting principal component factors from near infrared spectral data;
[0048] In this example, the partial least squares method is used to extract the principal component factors from the near-infrared spectral data, including the following process:
[0049] Step 2.1: Based on the partial least squares method, the input parameter matrix Decompose into a principal component matrix and a loading matrix :
[0050]
[0051] Among them, the principal component matrix , Representative principal components, loading matrix is an orthogonal matrix, Representative loads, and , represents the total number of samples;
[0052] Step 2.2: Calculate the first loading using the variance maximization method :
[0053]
[0054] Step 2.3: Calculate a prediction output:
[0055]
[0056] in, is the predicted value, is the true value, the superscript represents the transpose of the matrix, then the first residual is ;
[0057] Step 2.4: Based on Continue to calculate the second load :
[0058]
[0059] By analogy, the load matrix is calculated All column vectors in ;
[0060] Step 2.5: Calculate the principal component matrix:
[0061] .
[0062] like Figure 2 As shown in the figure, in this example, the partial least squares method is used to extract the principal component factors from the near-infrared spectrum, and the number of principal components to be extracted is determined based on the cross-validation method. As the number of principal components increases, the validation error of the partial least squares model decreases first and then increases. In the interval of 30-50 principal components, the validation error reaches the minimum value, so the principal component factors are extracted from this area, and the extraction step is 4.
[0063] Step 3, based on the near infrared spectrum and octane number experimental data and principal component factors of gasoline fuel, an artificial neural network prediction model is established, including the following processes;
[0064] Step 3.1: Normalize the input parameters to ;
[0065] Step 3.2: Select the number of hidden layers, number of neurons, activation function, error function type, and parameter optimizer type of the neural network model, including:
[0066] Step 3.2.1: Set the number of neurons in the first hidden layer to In the second hidden layer, indivual;
[0067] Step 3.2.2: Set the activation function to elu function;
[0068] Step 3.2.3: Set the error function type to mean square error function;
[0069] Step 3.2.4: Set the parameter optimizer type to Adam optimizer;
[0070] Step 3.3: Perform forward propagation calculation on the neural network to obtain the predicted value:
[0071]
[0072] in, is the predicted value, is the output parameter, is the weight parameter, is the bias term, It is an activation function that can complete the nonlinear distortion from input to output;
[0073] Step 3.4: Set the predicted value With the true value Comparison results in the error function:
[0074]
[0075] in, is the mean square error between the true value and the predicted value;
[0076] Step 3.5: Perform back propagation calculations on the neural network and update the weight parameters and bias items based on the gradient descent algorithm:
[0077]
[0078]
[0079] in, is the learning rate, which is usually less than 1. When it is reduced to the minimum value, the artificial neural network prediction model is completed.
[0080] As shown in Table 1, the artificial neural network prediction model in this example has two hidden layers, and when different numbers of principal components are used as input features, the number of neurons in each hidden layer also changes accordingly.
[0081]
[0082] Step 4, based on the near infrared spectrum of gasoline fuel, the main component information of the near infrared spectrum is introduced into the artificial neural network prediction model to obtain the predicted octane number of gasoline fuel;
[0083] In this example, the test set data is brought into the established artificial neural network prediction model to obtain the predicted octane number, which is compared with the true value to obtain the prediction error, as shown in Table 2. When the number of principal components is 34, the prediction accuracy of the artificial neural network prediction model is the highest, with the mean square error, mean absolute error and maximum absolute error being 0.125, 0.255 and 1.367 respectively. At this time, about 94% of the residuals between the predicted octane number and the experimental value are distributed within the experimental error range (±0.7), as shown in Table 2. Figure 3 shown.
[0084]
[0085] The gasoline fuel octane number prediction method provided by the present invention comprises:
[0086] Module M1: Collecting near infrared spectrum and octane number experimental data of gasoline fuel measurement;
[0087] Module M2: Extracting principal component factors from near-infrared spectral data;
[0088] Module M3: Taking the principal component factors as characteristic parameters and the experimental data of octane number measured by gasoline fuel as target parameters, an octane number prediction model is established based on the artificial neural network method;
[0089] Module M 4: Input the principal component factors in the near infrared spectrum of the fuel to be tested into the prediction model to obtain the predicted octane number of the gasoline fuel.
[0090] The above describes the specific operation mode of the present invention. It should be understood that the present invention is not limited to the above specific operation mode, and those skilled in the art can make various modifications or variations within the scope of the claims, which does not affect the essence of the present invention.
Claims
1. A gasoline fuel octane number prediction method based on near infrared spectroscopy, characterized in that: The following steps are involved: Step 1: Collect near infrared spectrum and octane number experimental data of gasoline fuel measurement; Step 2: Extract principal component factors from near infrared spectral data; Step 3: Using the principal component factors as characteristic parameters and the experimental data of the octane number of gasoline fuel as target parameters, an octane number prediction model is established based on the artificial neural network method; Step 4: Input the principal component factors in the near infrared spectrum of the fuel to be tested into the prediction model to obtain the predicted octane number of the gasoline fuel; The step 2 of extracting the principal component factors comprises the following steps: Step 2.1: Based on the partial least squares method, the input parameter matrix Decompose into a principal component matrix and a loading matrix : ; Among them, the principal component matrix , Representative principal components, loading matrix is an orthogonal matrix, Representative loads, and , is the total number of samples; Step 2.2, calculate the first load according to the variance maximization method : ; Step 2.3, calculate a prediction output: ; in, is the predicted value, is the true value, the superscript represents the transpose of the matrix, then the first residual is ; Step 2.4, based on Continue to calculate the second load : ; By analogy, the load matrix is calculated All column vectors in ; Step 2.5, calculate the principal component matrix: ; The step 3 of establishing an artificial neural network prediction model comprises the following steps: Step 3.1, normalize the input parameters to ; Step 3.2, select the number of hidden layers, number of neurons, activation function, error function type and parameter optimizer type of the neural network model; Step 3.3, perform forward propagation calculation on the neural network to obtain the predicted value: ; in, is the predicted value, is the output parameter, is the weight parameter, is the bias term, It is the activation function, which completes the nonlinear distortion from input to output; Step 3.4: The predicted value With the true value Comparison results in the error function: ; in, is the mean square error between the true value and the predicted value; Step 3.5, perform back propagation calculation on the neural network and update the weight parameters and bias items based on the gradient descent algorithm: ; ; in, The learning rate is usually less than 1. old Represents the original value, subscript new Represents the value after update.
2. The gasoline fuel octane number prediction method based on near infrared spectroscopy according to claim 1 is characterized in that The gasoline fuel in step 1 includes various actual gasoline fuels.
