{'fraction_non_alphanumeric': 0.024182768258597644, 'fraction_numerical': 0.009964758779924657, 'mean_word_length': 4.779494382022472, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Research on Forecast of Gasoline Octane Loss Based on Neural Network

Low-sulfur gasoline has become the world’s fuel development trend. However, the existing technology generally reduces the gasoline octane number in the process of desulfurization and olefin reduction of FCC gasoline. How to predict the octane loss of gasoline is very important for subsequent related research. This paper analyzes and screens the refinery data of chemical plants, builds a neural network-based gasoline octane loss prediction model, inputs 12 main operating variables to predict the octane loss, and verifies it with real data. The results show that the training effect of the model is good, and the training error is within 1%, which provides a reference for the research on predicting the loss of gasoline octane number.


Introduction
In recent years, the problem of automobile exhaust pollution has become more and more serious [1], and people have paid more and more attention. Countries have formulated corresponding automobile exhaust emission regulations and become more and more stringent [2][3]. The strengthening of emission standards has promoted the progress of automobile emission control technology and the improvement of fuel oil quality. With the substantial increase in the number of cars in my country's cities, air pollution is also increasing, and the country is gradually upgrading its gasoline quality standards. Low-sulfur gasoline has become the world's fuel development trend.
While reducing the sulfur content of gasoline, olefins are easily saturated under these conditions [4], so the octane number of hydrogenated gasolines is reduced. The octane number is the most important indicator reflecting the combustion performance of gasoline, and serves as the brand name of gasoline. Each decrease in the octane number by 1 unit is equivalent to a loss of about 150 yuan/ton. Taking a 1 million tons/year catalytic cracking gasoline refinery unit as an example, if it can reduce the RON loss by 0.3 units, its economic benefit will reach 45 million yuan. How to reduce the loss of octane number while keeping the sulfur content of gasoline as low as possible is an urgent problem to be solved at present.
In the past, many studies focused on how to make gasoline as low as possible [5]. There are few studies on the prediction and optimization of gasoline octane loss. Therefore, this paper proposes a model for predicting and optimizing gasoline octane loss based on neural network, and uses real data from refineries for verification and analysis, which provides a reference for the research on reducing gasoline octane loss.

Neural network prediction algorithm
Neural network is one of the classic algorithms in prediction methods. Artificial Neural Network (ANN) is a mathematical model that applies a structure similar to the synaptic connections of the brain's nerves for information processing. In this model, a large number of nodes (or "neurons" and "units") are connected to each other to form a network, that is, a "neural network" to achieve the purpose of processing information. Neural networks usually need to be trained, and the training process is the learning process of the network. The training changes the value of the connection weight of the network node, so that it has the function of prediction, and the trained network can be used for prediction.

Figure 1. Neural network structure
In the figure, x1x2...xn are the input values of the neural network, and y1y2...yn are the predicted values of the neural network. It can be seen from the figure that the neural network can be regarded as a non-linear function, and the network input value and predicted value are the independent and dependent variables of the function. When the input node is n and the number of output nodes is m, the neural network expresses the functional mapping relationship from n independent variables to m independent variables. When training the model, the network parameters are optimized by constantly updating the weights of neurons.
Neural network models are generally trained using gradient descent. The gradient descent method is a method to find the local optimal solution of a function using first-order gradient information, and it is also the simplest and most commonly used optimization method in machine learning. The gradient descent method is one of the straight-line search methods, and the main iterative formula is as follows:

xk+1=xk+αkPk
(1) Among them, P k is the direction we choose to move in the kth iteration. In the gradient descent method, the direction of movement is set to the negative direction of the gradient. It is the distance of the kth iteration selected to move by the line search method, and the distance of each movement. The coefficients can be the same or different, the academic term is called learning rate (learning rate) The loss function uses mean square error (MSE), and its formula is as follows: Using the gradient descent method, the local extremum of the function can be found (as shown in the figure below), and the optimal solution to the problem can often be obtained.

Design a neural network
By consulting and reading the relevant literature of oil refining, the main operating variables that affect oil refining have been screened out [6]. There are 12 main operating variables [7], including sulfur content in raw materials, octane number RON, olefin content, aromatic content, spent adsorbent properties, coke, and S Content, coke, S content in the nature of the regenerated adsorbent, hydrogenoil ratio, reactor mass space velocity, reactor top pressure and reaction system pressure. The 12 main operating variables are used as the input vector of the neural network input layer. The input variable is the loss value of the octane number, and the real data obtained from the chemical plant is used for training and verification. The overall process is shown in the figure: The neural network structure designed in this paper has 12 neurons in the input layer, corresponding to 12 main variables after dimensionality reduction, and 300 neurons in the hidden layer. More neurons are conducive to better optimization and training of the neural network, the input layer is 1 neuron, corresponding to the predicted RON loss value. The activation function of the hidden layer uses tansig, and the activation function of the output layer uses purlin output.
The structure of the neural network is as follows: 1 1 The function diagram is as follows: The function diagram is as follows:

Training a neural network
There is a total of 325 data samples. During training, the first 300 data samples are used as the training set to train the parameters of the neural network model, and the last 25 samples are used as the test set to test the training effect of the model. In order to use the training more thoroughly, the model is more perfect, the number of training is set to 12000 times. MATLAB's neural network toolbox shows that the root mean square error (MSE) after training is 0.00735, the gradient value is about 0.07, so the error is within a permissible range, and the model is acceptable.

Model verification and result analysis
Call 25 data in the test set to verify the accuracy of the model. Input 25 sets of data into the neural network to get the output result value. Calculate the error between the predicted value and the result. As follows:

Figure 13. Test set verification results
The error of the test set is 0.0090012, and the gradient value dropped below 0.18. Within the allowable range, the trained model can operate normally.

Conclusion
This paper builds a prediction model of gasoline octane loss based on neural network. It takes 12 main operating variables as the input layer parameters, and the output layer is the octane loss value. The model uses actual data from chemical plants for training, and the trained model is more reliable. Through the verification of the validation set, the model error is within 1%, which is within the allowable range. This algorithm provides a reference for actual research. In the future research on reducing gasoline octane loss, neural network algorithm can be considered to construct the model.