A method for monitoring the carbon footprint of a residue hydroprocessing process

By using a neural network model with feature embedding and self-attention aggregation, the problem of monitoring the nonlinear coupling relationship between the inlet temperature of multiple reactors and carbon emissions in the process of residue oil hydrotreating was solved, achieving high-precision carbon footprint monitoring and improving the reliability of process optimization and carbon emission reduction.

CN123158084APending Publication Date: 2026-11-24EAST CHINA UNIV OF SCI & TECH
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202611234712.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-14
Publication Date
2026-11-24

AI Technical Summary

Technical Problem

Existing technologies struggle to accurately monitor the complex nonlinear coupling relationship between inlet temperature of multiple reactors and carbon emissions during residue hydrotreating, resulting in low accuracy of carbon footprint monitoring and low reliability in engineering applications.

Method used

A neural network model based on feature embedding and self-attention aggregation is adopted. By combining feature selection, normalization preprocessing, multi-head self-attention layer and feedforward network layer, a carbon footprint monitoring model is constructed to achieve high-precision monitoring of inlet temperature and carbon footprint of multiple reactors.

Benefits of technology

It improves the accuracy and reliability of carbon footprint monitoring during residue hydrotreating, effectively uncovers the complex correlation between process parameters and carbon emissions, and provides reliable data support for process optimization and carbon emission reduction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123158084A_ABST
    Figure CN123158084A_ABST
Patent Text Reader

Abstract

This invention relates to a method for monitoring the carbon footprint of a residue oil hydrotreating process. The method first acquires raw operational data of the residue oil hydrotreating process, performs feature filtering and standardization preprocessing to obtain a dataset; then, it constructs a neural network model based on feature embedding and self-attention aggregation, the model including a feature embedding layer, a multi-head self-attention layer, a feedforward network layer, a feature interaction layer, and an output layer; the model is trained using the dataset to obtain a carbon footprint monitoring model; real-time data to be measured is acquired, preprocessed, and input into the carbon footprint monitoring model, outputting the carbon footprint monitoring value of the residue oil hydrotreating process. Compared with existing technologies, this invention has advantages such as achieving high-precision monitoring of the carbon footprint of the residue oil hydrotreating process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of carbon footprint monitoring technology, and in particular to a method for monitoring the carbon footprint of a residue oil hydrogenation process. Background Technology

[0002] Currently, the petrochemical industry, as a key sector for energy consumption and carbon emissions, has an increasingly urgent need for precise control of carbon emissions during production. Accurate monitoring of carbon emissions is not only a core foundation for enterprises to formulate scientific emission reduction strategies, optimize production process parameters, and achieve low-carbon operations, but it is also particularly important in the critical process of petroleum refining—residue hydrogenation.

[0003] Residue hydrotreating is a core process in petroleum refining that converts heavy residue into clean fuels or high-value-added chemical feedstocks. This process involves complex hydrotreating reactions involving multiple reactors working in tandem. The inlet temperature of the hydrotreating reactors is a key operating parameter affecting reaction efficiency and carbon emission levels. Specifically, the process data includes the inlet temperatures of two types of key reactors: first, the first hydrotreating reactor (such as R101-1, R102-1, etc.), which serves as the core front-end hydrotreating unit, and its inlet temperature directly determines the initial start-up intensity of the hydrotreating reaction, the reaction path selection, and the energy consumption baseline; second, the second hydrotreating reactor (such as R101-II, R102-II, etc.), which serves as the subsequent deep hydrotreating unit, and its inlet temperature significantly affects the residual conversion efficiency of heavy components, byproduct generation, and energy consumption.

[0004] Under the process conditions described in this application, the flow rates of the mixed feedstock in both the first and second hydrogenation reactors are constant. Under this constraint, the inlet temperature of both types of reactors becomes the core variable for controlling the final carbon emissions. Its fluctuations, by changing the reaction rate, product distribution, and energy consumption per unit product, form a clear and close correlation with the carbon emissions.

[0005] Currently, monitoring methods for carbon emissions in residual oil hydrotreating processes still have significant limitations: traditional methods rely heavily on empirical formulas or static calculation models, making it difficult to accurately capture the complex nonlinear coupling relationship between inlet temperatures of multiple reactors and carbon emissions. Calculation methods based on simple mathematical models cannot effectively analyze the combined impact of different reactor temperature parameters on carbon emissions. Although some studies have introduced data-driven methods such as BP neural networks and random forests to explore the correlation between process parameters and carbon emissions, under specific operating conditions with fixed feedstock flow rates, there are still problems with insufficient accuracy in identifying the weights of key temperature variables and inadequate feature correlation mining when facing the interaction of multiple reactor temperature parameters. This leads to discrepancies between carbon emission monitoring results and actual values, making it difficult to meet the needs of refined management.

[0006] Based on data-driven feature embedding and self-attention mechanisms, this technology enables refined processing of multi-dimensional features in the residue hydrotreating process. By designing independent mapping networks for each feature through a feature embedding layer, the original parameters are mapped to a high-dimensional space, effectively uncovering implicit correlations between parameters. Furthermore, a multi-head self-attention mechanism is introduced to construct a multi-layer network structure (each layer containing a self-attention module and a feedforward network module). Positional encoding is combined to supplement feature temporal information, enabling the model to adaptively learn the weights of different features' impact on carbon emissions. Through the interaction and attention between features, key information is precisely aggregated.

[0007] In existing technologies, such as CN119229989A, the effects of residue hydrotreating reaction are mainly analyzed. Convolutional neural networks are used for prediction, focusing on local feature extraction. It is difficult to effectively model the complex nonlinear coupling relationship between the inlet temperature of multiple reactors and carbon footprint, and it also lacks the ability to adaptively identify the contribution of key features. Therefore, it is not suitable for the fine monitoring of carbon footprint in the residue hydrotreating process.

[0008] In summary, current carbon footprint monitoring technologies for residual oil hydrotreating processes suffer from several problems, including difficulty in accurately identifying the complex nonlinear coupling relationship between key process parameters such as inlet temperature of multiple reactors and carbon footprint under fixed feedstock flow conditions, insufficient identification of the contribution of key features, and inadequate feature interaction modeling, resulting in low monitoring accuracy and reliability in engineering applications. Summary of the Invention

[0009] The purpose of this invention is to overcome the shortcomings of the existing technology and provide a method for monitoring the carbon footprint of the residue hydrotreating process.

[0010] The objective of this invention can be achieved through the following technical solutions: According to one aspect of the present invention, a method for monitoring the carbon footprint of a residue hydrotreating process is provided, the method comprising the following steps: S1. Obtain the raw operating data of the residue hydrotreating process. The raw operating data shall include at least the inlet temperature data of the hydrotreating reactor. Perform feature screening and standardization preprocessing on the raw operating data to obtain the dataset. S2. Construct a neural network model based on feature embedding and self-attention aggregation. The neural network model includes a feature embedding layer, a multi-head self-attention layer, a feedforward network layer, a feature interaction layer, and an output layer connected in sequence. S3. Use the dataset to train the neural network model, optimize the model parameters, and obtain a trained carbon footprint monitoring model. S4. Obtain real-time test data of the residue hydrotreating process. After feature screening and standardization preprocessing in step S1, input the real-time test data into the trained carbon footprint monitoring model to obtain prediction results. Output the carbon footprint monitoring value of the residue hydrotreating process based on the prediction results.

[0011] As a preferred technical solution, the feature selection in S1 specifically adopts a selection method based on variance threshold, including: Calculate the variance of each feature in the original running data; A preset variance threshold is set, and features with variance less than the threshold are removed, while features with variance greater than or equal to the threshold are retained to form the filtered data.

[0012] As a preferred technical solution, the standardization preprocessing in S1 specifically includes: The filtered data is divided into training set, validation set and test set according to a preset ratio; Standardized parameters are obtained by calculating the mean and standard deviation of each feature in the filtered data based solely on the training set; The training set, validation set, and test set are subjected to Z-score normalization transformation using normalization parameters to obtain the dataset.

[0013] As a preferred technical solution, the feature embedding layer configures an independent embedding transformation path for each feature, and maps each one-dimensional feature to a high-dimensional embedding vector through linear transformation and activation function. The output of the feature embedding layer is then position-encoded and input into the multi-head self-attention layer. Specifically, the position encoding involves adding the output of the feature embedding layer to the position encoding matrix to inject the feature order position information.

[0014] As a preferred technical solution, in the multi-head self-attention layer, each attention head calculates the attention weights between features based on the query matrix, key matrix, and value matrix, and the outputs of each attention head are concatenated and fused by linear transformation; the output of the multi-head self-attention layer is then fed into the feedforward network layer after residual connection and layer normalization.

[0015] As a preferred technical solution, the feedforward network layer includes a ReLU activation function and two linear transformation layers; The feature interaction layer flattens the output of the feedforward network layer into a one-dimensional vector, and then performs a non-linear transformation with the activation function through a fully connected layer to aggregate the interaction information of all features; the output layer is a two-layer fully connected structure used to map the aggregated features into carbon footprint prediction values.

[0016] As a preferred technical solution, when training the neural network model in S3, the mean squared error is used as the loss function, and the AdamW optimizer with weight decay is used to update the model parameters.

[0017] As a preferred technical solution, gradient clipping is performed during training, specifically including: calculating the gradient of the loss function relative to all model parameters before updating the model parameters; and scaling the gradient proportionally to make the gradient L2 norm equal to the preset gradient threshold when the L2 norm of the gradient exceeds the preset gradient threshold.

[0018] As a preferred technical solution, the training process of S3 also includes: The learning rate is dynamically adjusted based on the validation set loss. After each preset training round, the learning rate is reduced by a preset fixed percentage. An early stopping mechanism is introduced: when the validation set loss does not reach the preset improvement threshold within multiple consecutive training cycles, training is terminated and the model parameters with the minimum validation loss are saved as the optimal parameters.

[0019] As a preferred technical solution, S4 further includes: performing an inverse standardization transformation on the standardized scale prediction value output by the neural network model using the label mean and standard deviation obtained during the training phase to restore it to the original carbon footprint value; and using root mean square error and coefficient of determination to quantitatively evaluate the model monitoring accuracy.

[0020] According to another aspect of the present invention, a carbon footprint monitoring system for a residue hydrotreating process is provided, the system comprising: The data acquisition module is used to acquire raw operating data and real-time data to be measured in the residue hydrotreating process. The raw operating data includes at least the inlet temperature data of the hydrotreating reactor. The data preprocessing module, connected to the data acquisition module, is used to perform feature filtering and standardization preprocessing on the raw running data to obtain a dataset for model training, and to perform feature filtering and standardization preprocessing on the real-time test data using the same rules as the raw running data. The model building module, connected to the data preprocessing module, is used to build a neural network model based on feature embedding and self-attention aggregation. The neural network model includes a feature embedding layer, a multi-head self-attention layer, a feedforward network layer, a feature interaction layer, and an output layer connected in sequence. The model training module, connected to the model building module and the data preprocessing module, is used to train the neural network model using the dataset, optimize the model parameters, and obtain a trained carbon footprint monitoring model. The monitoring output module, connected to the data preprocessing module and the model training module, is used to input the preprocessed real-time test data into the trained carbon footprint monitoring model to obtain prediction results, and output the carbon footprint monitoring value of the residue hydrotreating process based on the prediction results.

[0021] Compared with the prior art, the present invention has the following beneficial effects: 1. This invention addresses the problems of high-dimensional feature redundancy, complex nonlinear coupling relationships of process variables, and large dynamic fluctuations in operating conditions in carbon footprint monitoring of residue oil hydrotreating processes, which make it difficult for traditional methods to achieve high-precision monitoring. It proposes a carbon footprint monitoring method based on feature embedding and self-attention aggregation neural networks. By constructing a complete technical process covering raw operating data preprocessing, neural network modeling, model training, and real-time prediction output, it can effectively uncover the complex correlation between key process variables such as the inlet temperature of multiple reactors and the carbon footprint in residue oil hydrotreating, thereby achieving high-precision monitoring of the carbon footprint of the residue oil hydrotreating process and providing reliable data support for process optimization and carbon emission reduction.

[0022] 2. This invention removes low-information features from the original operating data by using variance threshold screening, and performs consistency standardization processing on the training set, validation set, and test set based solely on the training set to calculate standardized parameters. This effectively reduces the interference of redundant features and dimensional differences on model training, avoids data leakage problems, improves the quality of input data, and enhances the stability and generalization ability of model training, thereby improving the reliability of carbon footprint monitoring results.

[0023] 3. This invention sets independent embedding transformation paths for each process feature in the feature embedding layer, maps the original one-dimensional features to a high-dimensional representation space, and injects feature sequence position information by combining position encoding. Then, it uses a multi-head self-attention mechanism to model the correlation relationships in different feature subspaces in parallel. This can enhance the model's ability to represent different process variables, more effectively capture the complex nonlinear relationships and global dependencies between key variables such as multi-reactor inlet temperature and carbon footprint, thereby improving the model's adaptability and monitoring accuracy to complex dynamic conditions of residue hydrotreating.

[0024] 4. By setting up a feedforward network layer and a feature interaction layer, this invention fully mines the nonlinear expression and high-order interaction information of the input features, and realizes end-to-end carbon footprint prediction through the output layer. This can further improve the model's ability to characterize the coupling characteristics of process parameters, thereby improving the accuracy and interpretability of carbon footprint prediction results and enhancing the practical value of monitoring results in industrial applications.

[0025] 5. This invention employs a mean squared error loss function and a weighted decay AdamW optimizer for model training, combined with gradient pruning, dynamic learning rate adjustment, and an early stopping mechanism. This effectively suppresses gradient explosion, training oscillation, and overfitting during training, improving the stability and convergence of model training, thereby enhancing the model's generalization ability and monitoring accuracy under dynamic conditions of residue hydrotreating.

[0026] 6. This invention de-standardizes the standardized prediction results output by the model, restoring the carbon footprint monitoring values ​​to their original physical dimensions, which facilitates direct correspondence with the carbon emission levels in actual industrial processes. At the same time, it uses root mean square error and coefficient of determination to quantitatively evaluate the model's monitoring accuracy, providing an intuitive and reliable evaluation basis for model performance verification, thereby improving the engineering usability and credibility of the monitoring results. Attached Figure Description

[0027] Figure 1 This is a schematic diagram of the carbon footprint monitoring method steps in this invention; Figure 2 This is a flowchart illustrating the overall implementation of the carbon footprint monitoring method in the examples; Figure 3 This is a structural diagram of the feature embedding and self-attention aggregation neural network model in the embodiment; Figure 4 This is a graph showing the loss variation during the model training process in the example. Detailed Implementation

[0028] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0029] Example To address the challenges of complex features and difficulty in capturing correlations in carbon footprint monitoring during residual oil hydrotreating, this paper proposes a carbon footprint monitoring method based on feature embedding and self-attention aggregation neural networks. First, data redundancy is addressed through data cleaning and standardization. Then, a neural network incorporating features embedding and self-attention aggregation is constructed and trained using optimization strategies to accurately capture the correlation between features and carbon footprint. Finally, model detection and evaluation are used to achieve accurate carbon footprint monitoring. The method steps are as follows: Figure 1 As shown, it specifically includes: S1. Obtain the raw operating data of the residue hydrotreating process. The raw operating data shall include at least the inlet temperature data of the hydrotreating reactor. Perform feature screening and standardization preprocessing on the raw operating data to obtain the dataset. S2. Construct a neural network model based on feature embedding and self-attention aggregation. The neural network model includes a feature embedding layer, a multi-head self-attention layer, a feedforward network layer, a feature interaction layer, and an output layer connected in sequence. S3. Use the dataset to train the neural network model, optimize the model parameters, and obtain a trained carbon footprint monitoring model. S4. Obtain real-time test data of the residue hydrotreating process. After feature screening and standardization preprocessing in step S1, input the real-time test data into the trained carbon footprint monitoring model to obtain prediction results. Output the carbon footprint monitoring value of the residue hydrotreating process based on the prediction results.

[0030] The specific implementation steps of the method are as follows: In this method, the key indicators for monitoring the carbon footprint of the residue hydrotreating process are usually the key variables recognized in the field, such as the inlet temperature of the hydrotreating reactor. Figure 2 The overall flowchart of this method implementation is shown. The method implementation steps include: Data processing and partitioning for the residue hydrotreating process specifically includes: reading the raw data of the residue hydrotreating process and filtering numerical columns; removing constant features through variance thresholding to complete data cleaning; dividing the cleaned data into feature data and carbon footprint target data, and further dividing them into training, validation, and test sets; and standardizing both the feature data and target data to obtain a standardized dataset suitable for model training.

[0031] A feature embedding and self-attention aggregation neural network model is constructed and trained, specifically including: constructing a neural network model containing a feature embedding layer, a position encoding layer, a multi-head self-attention layer, a feedforward network layer, a feature interaction layer, and an output layer. The model is trained using the MSE (Mean Squared Error) loss function and AdamW as the optimizer, combined with learning rate scheduling and early stopping mechanisms. The model performance is monitored using the validation set, and the optimal model parameters are saved.

[0032] Carbon footprint monitoring in the residue hydrotreating process specifically includes: loading the optimally trained model, inputting the standardized test set into the model to obtain carbon footprint predictions, and then performing inverse standardization on the predictions. The carbon footprint is then measured using RMSE (Root Mean Squared Error) and the coefficient of determination R0. 2 The indicator evaluation model monitors accuracy and ultimately outputs the carbon footprint monitoring results of the residue hydrotreating process.

[0033] The specific implementation process of the above steps will be described in detail below: 1. Determine auxiliary variables and predictive indicators, remove constant features using variance thresholding, and divide the dataset; In step one, the residue hydrotreating process conforms to a typical refining process model using fixed-bed hydrotreating technology. The hydrotreating reaction system includes multiple hydrotreating reactors connected in series. The residue is deeply converted and refined through a combination of hydrodesulfurization (HDS), hydrodenitrogenation (HDN), hydrodemetallization (HDM), and hydrocracking (HC). The products flowing out of the reaction system enter a high-pressure separator. After gas-liquid separation, the liquid phase enters a low-pressure separator and a fractionation tower for further separation. Finally, light products such as naphtha and diesel are discharged from the top and side streams of the tower, while refined heavy oil is discharged from the bottom of the tower. Sulfur-containing waste gas and wastewater are discharged from the waste gas treatment unit.

[0034] The selected monitoring variables should reflect the hydrotreating reaction behavior and operating status of the residue hydrotreating process. In this embodiment, 12 readily available process variables were selected as auxiliary variables to construct the soft sensor model, including the mixed feed flow rate of the first hydrotreating reactor and the mixed feed flow rate of the second hydrotreating reactor, the inlet temperatures of devices R101-1, R102-1, R103-1, R104-1 and R105-1 in the first hydrotreating reactor, and the inlet temperatures of devices R101-II, R102-II, R103-II, R104-II and R105-II in the second hydrotreating reactor.

[0035] The inlet temperature of the first hydrotreating reactor reflects the initial start-up intensity, reaction pathway, and energy consumption baseline of the hydrotreating reaction. However, the inlet temperature of the second hydrotreating reactor significantly affects the conversion efficiency of heavy component residues, the amount of reaction byproducts generated, and energy consumption. This directly interferes with the total carbon emission intensity of the residue hydrotreating process.

[0036] In step one, the total carbon emissions from the residual oil hydrotreating process are selected as the prediction variable.

[0037] In step one, in order to reduce the dimensionality of the data, improve the training efficiency, computational stability and generalization ability of the subsequent machine learning model, avoid the model from learning from meaningless noise, and ensure its robustness and interpretability, it is necessary to remove redundant variables that do not provide any effective information or discrimination.

[0038] Suppose the original dataset has p features and n sample points. Composition. The characteristic matrix is ​​denoted as... : Let the label vector be denoted as : The complete data matrix obtained is .

[0039] The steps for data preprocessing are as follows: Step a: Calculate the variance of each feature in the feature matrix X to obtain the variance vector v. : in, This is the mean of the j-th feature. The variance vector calculated in this step is used to quantify the dispersion of each feature.

[0040] Step b: Initialize the variance threshold selector: threshold This is a hyperparameter used to define the minimum variance requirement for feature preservation. It can be adjusted according to the application scenario, with a variance lower than [a certain value]. Features that are considered low-information features (such as constant features) will be removed.

[0041] Step c: Extract the feature matrix based on the threshold: Extract the feature matrix X from the complete data matrix D (ignoring the label column): Based on variance vector v and threshold Determine the index set for preserving features. : This set contains the indexes of all features whose variance is greater than a threshold.

[0042] Step d: Update the dataset and feature names Based on the preserved feature index set Construct a new feature matrix and new data matrix : At the same time, update the feature name list: Let the original feature name be... The new feature name is: if If the set is empty (i.e. no features are retained), the original feature names are preserved, but the data matrix only contains the label column.

[0043] Step e: Output the filtering results Finally, output the retained feature names and the shape of the new data matrix.

[0044] Assume the final number of retained features is The new data matrix is: .

[0045] The filtered features are: In step one, by dividing the dataset into three independent parts—training set, validation set, and test set—and ensuring that standardized parameters are learned only from the training set, data leakage can be effectively prevented, thereby guaranteeing the objectivity of model evaluation.

[0046] Step a: Separate the feature matrix and the label vector: First, extract the feature matrix and label vector from the complete dataset: in, This represents the j-th feature value of the i-th sample. This represents the label value of the i-th sample.

[0047] Step b: Divide the dataset according to the proportions Divided into training set, validation set, and test set: , , in, Indicates the number of samples in the dataset. and These represent the number of samples in the training set, validation set, and test set, respectively.

[0048] Step c: Mix the training set and validation set according to the specified ratio. Divided into training set and validation set: , , in, and These represent the number of samples in the training set and the validation set, respectively.

[0049] Step d: Calculate the standardized parameters of the training set. Calculate the standardized parameters using only the training set data: in, This represents the average value of the j-th feature in the training set. This represents the standard deviation of the j-th feature in the training set. This represents the average value of the labels in the training set. This represents the standard deviation of the labels in the training set. This indicates the number of samples in the training set.

[0050] Step e: Apply standardized transformation Standardize all datasets using the training set parameters: The final standardized dataset is obtained as follows: The standardized features and labels have a mean of 0 and a standard deviation of 1, which are on the same order of magnitude and are beneficial for model training.

[0051] II. Construct and train a feature embedding and self-attention aggregation neural network model; In step two, a model based on feature embedding and self-attention aggregation neural network architecture is constructed. Multi-head self-attention, positional encoding, and deep feature interaction techniques are used to dynamically identify and strengthen the representation of key features. Simultaneously, multi-layer regularization, gradient pruning, and weight decay are employed to effectively suppress redundant features and noise interference. This significantly improves model training efficiency, computational stability, and generalization ability while reducing data complexity, ensuring stronger robustness and noise resistance. Figure 3 The diagram shown is a structural diagram of the feature embedding and self-attention aggregation neural network model in this scheme, which contains five core components: 1. Feature embedding layer: Creates an independent embedding transformation path for each feature, mapping the original features to a high-dimensional space. in, Let be the weight matrix for the i-th feature. For bias vectors, For the embedded dimension, LayerNorm represents the layer normalization operation.

[0052] Positional encoding techniques add learnable positional information to capture feature order relationships: in, It is a learnable positional encoding matrix that is optimized through a training process.

[0053] A stacked Transformer layer, whose main components include a multi-head self-attention mechanism, residual connections and layer normalization, and a feedforward network: 2. Self-attention mechanism, through calculation of the query matrix: Key matrix: Value matrix: And using the formula: Dynamically model the relationships between features to capture the correlation strength between different features, and use the softmax function to generate attention weights to focus on the interactions of important features.

[0054] Multi-head self-attention mechanism, assuming the number of attention heads in the multi-head self-attention mechanism is h.

[0055] The multi-head mechanism enables the model to learn diverse feature relation patterns in parallel from multiple representation subspaces: Residual connectivity and layer normalization enable information transfer: Among them, layer normalization: Where x is the input vector, μ and σ are the mean and standard deviation of the vector, respectively, γ and β are learnable scaling and offset parameters, and ⊙ denotes element-wise multiplication. Layer normalization can stabilize the activation value distribution and accelerate training convergence.

[0056] Residual connection: Residual connection operations can ensure effective gradient propagation, thereby alleviating the gradient vanishing problem in deep network training. At the same time, the Dropout mechanism provides a regularization effect by randomly deactivating some neurons to prevent overfitting.

[0057] 3. Feedforward network: in, This is the weight matrix. For bias vectors, For the hidden layer dimension, For the embedded dimension.

[0058] Perform a nonlinear transformation. The parameter matrix... From embedding dimension Expand to The ReLU activation function is used to introduce nonlinearity to enhance the model's expressive power, and a two-layer linear transformation is employed: in, , , , All of these are learnable parameters. Complex feature transformations are achieved, thereby enriching the feature representation capabilities.

[0059] 4. Feature interaction layer: Aggregates all feature information to capture complex interaction relationships between features. Where vec(⋅) represents the matrix flattening operation, 5. Output layer, generating the final prediction results: in, , , , .

[0060] In step two, it is necessary to configure the key hyperparameter for model training: embedding dimension. Number of attention heads (h), number of Transformer layers (L), and hidden layer dimensions. Batch size B, number of training epochs E, initial learning rate L2 regularization coefficient Dropout ratio .

[0061] In step two, three independent data loaders are created for model training, validation, and testing, respectively, ensuring efficient data loading and processing. The training loader also employs a random shuffling strategy to enhance the model's generalization ability, while the validation and testing loader maintain the original data order to stabilize the evaluation results. , , In step two, the model parameters are initialized. A Xavier uniform distribution is used to initialize the model parameters: The location encoding matrix P is sampled from a standard normal distribution: in, i=1,...,p,j=1,..., In step two, the optimizer and loss function of the model are configured.

[0062] Step a: Configure the loss function for this model, using mean squared error loss: Where B is the batch size. These are the model's predicted values. This is the actual label value.

[0063] Step b: Configure the optimizer for this model, using the AdamW optimizer with weight decay: in, and ε and λ are the first and second moment estimates after bias correction, respectively, where ϵ is the numerical stability constant and λ is the weight decay coefficient.

[0064] In step two, the learning rate is dynamically adjusted based on the validation loss. The model training process is optimized by periodically decaying the learning rate, balancing convergence speed and accuracy, preventing training oscillations, and promoting stable convergence of the model to the optimal solution.

[0065] The formula for learning rate scheduling is: in, The current learning rate is denoted by 'p', and the current training epoch is denoted by 'epoch'.

[0066] In step two, the configured model is trained iteratively. Assume the number of training rounds is E.

[0067] Step a: Set the model to training mode. The purpose of training mode is to enable specific training-related behaviors (such as Dropout random deactivation and Batch Normalization using the current batch statistics) to ensure that the forward propagation and backward propagation processes meet the training requirements.

[0068] Step b: Zero out the gradient buffer: The purpose of zeroing the gradient buffer is to clear the accumulated historical gradient information in the optimizer, ensuring that the gradient calculated in each backpropagation reflects the true update direction of the current batch, and avoiding training bias caused by gradient accumulation.

[0069] Step c: Perform gradient clipping. By imposing L2 norm constraints on the gradients of the model parameters, gradient explosion during backpropagation is prevented, ensuring training stability, avoiding abnormal parameter updates, and improving the controllability and robustness of model training. in, The loss function L represents the loss function with respect to the model parameters. gradient, This represents the L2 norm, and its function is to calculate the magnitude of the gradient. It is a preset threshold, which limits the maximum norm of the gradient.

[0070] Step d: Update model parameters: in, This represents the updated model parameters. This represents the model parameters before the update. This represents the learning rate.

[0071] Step e: Set the model to evaluation mode. The purpose of evaluation mode is to turn off the randomization mechanisms enabled during the training phase (such as the dynamic behavior of Dropout and Batch Normalization), to ensure that the prediction process is stable and consistent, reduce memory usage and speed up inference.

[0072] Step f: Calculate the validation loss: in, To determine the number of samples in the validation set, Let be the model's predicted value for the i-th sample. Let be the true label value of the i-th sample.

[0073] Step g: Select the best model: in, Indicates the optimal model parameters. This represents the parameter value that minimizes the verification loss.

[0074] In step two, an early stopping mechanism is added during model training. Its purpose is to automatically terminate training when the validation loss has not improved for k consecutive training epochs, preventing the model from overfitting the training data, improving generalization ability, and saving computational resources. in, This indicates a trigger flag for early model stopping. This represents the change in validation loss. This represents the threshold for loss improvement, where k represents the number of tolerance periods. It is an indicator function that takes the value true when a condition is met.

[0075] III. Carbon Footprint Monitoring of Residue Hydrotreating Process In step three, the optimal model parameters saved during training are loaded and then added to the model structure: in, These are the optimal model parameters saved during training, which can achieve the minimum loss on the validation set.

[0076] In step three, the prediction calculation is performed using the model with the optimal parameters loaded: Step a: Set the model to evaluation mode. Setting it to evaluation mode disables gradient calculation and fixes the state of all batch normalization layers and dropout layers.

[0077] Step b: Batch prediction calculation: Where B is the size of the data batch. This is the feature matrix of the current batch.

[0078] Step c: Results collection, merging all batches of prediction results: Predictions were made on the training set, validation set, and test set respectively, and the prediction results under standardized scale were obtained: Step d: Destandardization. Using the standardized parameters calculated during training, an inverse transformation is performed to convert the predicted values ​​back to the original data scale. The destandardization formula is: in, This represents the mean of the training set labels. The standard deviation of the training set labels. This represents each standardized predicted value.

[0079] Step e: Model performance evaluation, calculating the root mean square error (RMSE) and coefficient of determination (R²) for each dataset. 2 ), to comprehensively evaluate model performance.

[0080] The root mean square error (RMSE) measures the average deviation between predicted and actual values; a smaller value indicates higher prediction accuracy. The calculation formula is: in, The number of samples in the dataset. Let be the predicted value for the i-th sample. Let be the true label value of the i-th sample.

[0081] Coefficient of determination R 2 The value ranges from [0,1], and the closer the value is to 1, the stronger the model's explanatory power for data variability. Coefficient of Determination R0 2 The calculation formula is: in This represents the label mean.

[0082] Calculate the evaluation metrics for the training set, validation set, and test set respectively: This embodiment uses the carbon footprint monitoring soft sensor of the residue hydrotreating process as a specific application scenario. To monitor the carbon footprint of the residue hydrotreating process, the total carbon emissions of the process are selected as the predictor variable. Twelve easily obtainable process variables are selected as auxiliary variables to construct the soft sensor model, as shown in Table 1. These include the mixed feed flow rate of the first and second hydrotreating reactors, the inlet temperatures of devices R101-1, R102-1, R103-1, R104-1, and R105-1 in the first hydrotreating reactor, and the inlet temperatures of devices R101-II, R102-II, R103-II, R104-II, and R105-II in the second hydrotreating reactor. A total of 5050 samples were collected in this embodiment.

[0083] Table 1. Auxiliary variables for soft measurement modeling The results of calculating the characteristic variance are shown in Table 2.

[0084] Table 2. Variance of Features Variance threshold If the value is set to 0.01, the features removed are the inlet temperature of the second hydrogenation reactor R105-1, the mixed feed flow rate of the first hydrogenation reactor, and the mixed feed flow rate of the second hydrogenation reactor.

[0085] 64% of the samples in the total dataset were selected as the training set, 16% as the validation set, and 20% as the test set.

[0086] S2: Construct and train a feature embedding and self-attention aggregation neural network model. The key hyperparameters for model training are shown in Table 3. The loss curve during model training is shown in Table 3. Figure 4 As shown, Figure 4 In the diagram, the blue line represents the training loss, and the orange line represents the validation loss.

[0087] Table 3 Key Hyperparameters S3: Carbon footprint monitoring of residue hydrotreating process, loading the saved optimal model parameters into the model structure: The model with the optimal parameters is used to perform prediction calculations on the training set, validation set, and test set respectively, and the prediction results under the standardized scale are obtained.

[0088] Inverse transform is performed using the standardized parameters calculated during the training phase. The denormalized parameters are then used to evaluate the model performance. To verify the superiority of the Feature Embedding and Self-Attention Aggregation Neural Network Model (FEAN Model), two well-known classic machine learning models are evaluated as baselines for comparison: the Random Forest Model and the XGBoost Model. The final evaluation results of the three models are shown in Table 4.

[0089] Table 4. Predictions of total carbon emissions on the test set As shown in Table 4, the Feature Embedding and Self-Attention Converging Neural Network (FEAN) model significantly outperforms the Random Forest (RF) and XGBoost models in the carbon footprint monitoring task of residue hydrotreating. The fundamental reason lies in the synergistic effect of the feature embedding layer and the self-attention mechanism, which enables deep representation of high-dimensional heterogeneous process features and accurate capture of global dependencies. The feature embedding layer independently constructs a high-dimensional mapping path for each input feature, effectively overcoming the limitations of traditional tree models that rely on splitting thresholds and struggle to fully exploit the inherent semantic information of features when processing continuous numerical features. Meanwhile, the multi-head self-attention layer dynamically identifies the complex nonlinear coupling effects between different reactor inlet temperature parameters by parallelly calculating the association weights of multiple feature subspaces, thus more accurately modeling the high-order interaction between these parameters and carbon emissions. In contrast, while Random Forest can improve generalization ability by integrating multiple decision trees, its feature interactions rely on the local splitting rules of tree nodes, making it difficult to globally optimize feature weights. Although XGBoost enhances model fitting ability through gradient boosting strategies, its feature combination method is still limited by the greedy splitting strategy of the tree structure, making it unable to explicitly model long-distance feature dependencies. Furthermore, the positional encoding technique and residual connection structure introduced in the FEAN model further enhance the perception of the sequence information of features and the stability of gradient propagation, while random forests and XGBoost lack explicit modeling mechanisms for feature position sensitivity. Ultimately, in industrial scenarios such as residual oil hydrotreating where features are strongly coupled, highly nonlinear, and require global perception, the FEAN model, with its architectural advantages, achieves more accurate carbon footprint prediction, with a lower root mean square error (RMSE) of 349.25 and a lower coefficient of determination (R²). 2 (0.9471) is significantly better than random forest (RMSE: 653.24, coefficient of determination R). 2 R0.8151) and XGBoost (RMSE: 490.49, coefficient of determination R0.8151) 2 : 0.8957).

[0090] In summary, this method combines feature embedding with a self-attention aggregation neural network, effectively addressing challenges such as high-dimensional feature redundancy, nonlinear coupling, and dynamic operating conditions in the residue hydrotreating process, thus achieving high-precision monitoring of the carbon footprint. Specifically, feature embedding technology facilitates mapping the original features to a high-dimensional space, enhancing feature representation capabilities and overcoming variable redundancy; the introduction of a multi-head self-attention mechanism helps capture the complex nonlinear correlation between key variables such as multi-reactor inlet temperature and the carbon footprint; combining training strategies such as position encoding, gradient pruning, and early shutdown mechanisms improves the model's adaptability and generalization ability to dynamic processes; and finally, end-to-end carbon footprint prediction is achieved through feature interaction and the output layer, improving the accuracy and interpretability of monitoring results and providing reliable data support for carbon emission reduction in the residue hydrotreating process.

[0091] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present invention, and these modifications or substitutions should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A method for monitoring the carbon footprint of a residue hydroprocessing process, characterized in that, The method steps include: S1. Obtain the raw operating data of the residue hydrotreating process, wherein the raw operating data includes at least the inlet temperature data of the hydrotreating reactor, and perform feature screening and standardization preprocessing on the raw operating data to obtain a dataset; S2. Construct a neural network model based on feature embedding and self-attention aggregation. The neural network model includes a feature embedding layer, a multi-head self-attention layer, a feedforward network layer, a feature interaction layer, and an output layer connected in sequence. S3. Use the dataset to train the neural network model, optimize the model parameters, and obtain a trained carbon footprint monitoring model. S4. Obtain real-time test data of the residue hydrotreating process. After the real-time test data is processed by feature screening and standardization preprocessing as described in step S1, it is input into the trained carbon footprint monitoring model to obtain prediction results. Based on the prediction results, the carbon footprint monitoring value of the residue hydrotreating process is output.

2. A method of monitoring carbon footprint of a residue hydroprocessing process as claimed in claim 1, wherein, The feature selection in S1 specifically employs a variance threshold-based selection method, including: Calculate the variance of each feature in the original running data; A preset variance threshold is set, and features with variances less than the variance threshold are removed, while features with variances greater than or equal to the variance threshold are retained to form the filtered data.

3. A method of monitoring carbon footprint of a residue hydroprocessing process as claimed in claim 2, wherein, The standardization preprocessing in S1 specifically includes: The filtered data is divided into training set, validation set and test set according to a preset ratio; The standardized parameters are obtained by calculating the mean and standard deviation of each feature in the filtered data based solely on the training set. The training set, validation set, and test set are subjected to Z-score normalization transformation using the normalization parameters to obtain the dataset.

4. A method of monitoring carbon footprint of a residue hydroprocessing process as claimed in claim 1, wherein, The feature embedding layer configures an independent embedding transformation path for each feature, and maps each one-dimensional feature to a high-dimensional embedding vector through linear transformation and activation function. The output of the feature embedding layer is then position-encoded and input into the multi-head self-attention layer. Specifically, the position encoding involves adding the output of the feature embedding layer to the position encoding matrix to inject feature order position information.

5. A method of monitoring carbon footprint of a residue hydroprocessing process as claimed in claim 1, wherein, In the multi-head self-attention layer, each attention head calculates the attention weights between features based on the query matrix, key matrix, and value matrix, and the outputs of each attention head are concatenated and fused by linear transformation; the output of the multi-head self-attention layer is then fed into the feedforward network layer after residual connection and layer normalization.

6. A method of monitoring carbon footprint of a residue hydroprocessing process as claimed in claim 1, wherein, The feedforward network layer contains a ReLU activation function and two linear transformation layers; The feature interaction layer flattens the output of the feedforward network layer into a one-dimensional vector, and then performs a non-linear transformation with an activation function through a fully connected layer to aggregate the interaction information of all features; the output layer is a two-layer fully connected structure used to map the aggregated features into carbon footprint prediction values.

7. A method of monitoring carbon footprint of a residue hydroprocessing process as claimed in claim 1, wherein, In step S3, when training the neural network model, the mean squared error is used as the loss function, and the AdamW optimizer with weight decay is used to update the model parameters.

8. A method of monitoring carbon footprint of a residue hydroprocessing process as claimed in claim 7 wherein, During the training process, gradient clipping is performed, specifically including: calculating the gradient of the loss function relative to all model parameters before updating the model parameters; when the L2 norm of the gradient exceeds a preset gradient threshold, scaling the gradient proportionally so that the L2 norm of the gradient is equal to the preset gradient threshold.

9. A method of monitoring carbon footprint of a residue hydroprocessing process as claimed in claim 7, wherein, The training process of S3 also includes: The learning rate is dynamically adjusted based on the validation set loss. After each preset training round, the learning rate is reduced by a preset fixed percentage. An early stopping mechanism is introduced: when the validation set loss does not reach the preset improvement threshold within multiple consecutive training cycles, training is terminated and the model parameters with the minimum validation loss are saved as the optimal parameters.

10. A method of monitoring carbon footprint of a residue hydroprocessing process as claimed in claim 1, wherein, S4 further includes: The standardized scale prediction value output by the neural network model is destandardized using the label mean and standard deviation obtained during the training phase to restore the carbon footprint value in the original dimension. The root mean square error and coefficient of determination are used to quantitatively evaluate the model's monitoring accuracy.

Citation Information

Patent Citations

  • Residual oil hydrogenation reaction effect analysis method and device

    CN119229989A