Method for improving intelligent classification precision of distillate oil

Through spectral cleaning and feature space optimization methods, the classification accuracy and model generalization problems of distillate oil spectral data are solved, and more efficient intelligent classification effects are achieved.

CN120408270APending Publication Date: 2025-08-01NANJING RICHISLAND INFORMATION TECH CO LTD

Patent Information

Application Number
CN202510486438.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-17
Publication Date
2025-08-01

AI Technical Summary

Technical Problem

In the prior art, the near-infrared spectral data of distillate oil lacks model generalization ability, poor aggregation effect of similar samples, and insufficient category distinction of one-dimensional convolutional self-attention network, resulting in low classification accuracy.

Method used

Threshold-based spectral cleaning method and S-G smoothing technology are used to improve the signal-to-noise ratio of spectral characteristics; a central loss function is introduced in model training to optimize the spatial distribution of features, enhance the intra-class similarity and inter-class differences, and improve the classification accuracy through improved loss function.

Benefits of technology

It effectively improves the accuracy of distillate oil spectral classification, improves the generalization ability of the model, and provides a more accurate and efficient intelligent classification solution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120408270A_ABST
    Figure CN120408270A_ABST
Patent Text Reader

Abstract

The invention discloses a method for improving the intelligent classification precision of distillate oil, and the method comprises the steps: employing a method based on a threshold value during spectrum cleaning, and adding S-G to smooth and sharpen spectral features during data preprocessing; during model supervised training, the high-dimensional feature center of distillate oil types is increased, and the identification capability of the model on inter-class differences is enhanced. The method can effectively improve the fraction oil spectrum classification precision, improve the model generalization ability, and provide a more accurate and efficient intelligent classification scheme for refinery enterprises.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of rapid detection of the properties of distillate oil in refining and chemical enterprises, and specifically relates to a method for intelligent classification of distillate oil. Background Art

[0002] In the refining and chemical industry, the rapid detection of the properties of distillate oil directly affects the optimization of the production process and the quality of the final product. As a non-destructive detection method, near-infrared spectroscopy technology has been widely used in the classification and property detection of distillate oil.

[0003] However, there are differences in spectral data among different enterprises, devices, and sampling times, which will affect the generalization ability of the model. Previously, we applied for an invention patent of "A Method for Intelligent Classification of Distillate Oil for Near-Infrared Spectrum Property Detection (Application No.: 202411931005.6)". In this patent, a method based on thresholds and Z-score variance is used for data cleaning, which is likely to result in the incorrect rejection of valid spectral data. In addition, the one-dimensional convolutional self-attention network in this patent is only trained using cross-entropy loss. Since the near-infrared spectrum absorbance data of distillate oil usually has high similarity, it may lead to insufficient class discrimination in actual use, and there is still room for improvement in the aggregation effect of samples in the same class in the feature space. Therefore, we hope that in the feature space, samples of the same class are more closely aggregated, while samples of different classes are separated as much as possible, so as to improve the classification effect. Summary of the Invention

[0004] In view of the problems existing in the background art, the present invention proposes a method for improving the intelligent classification accuracy of distillate oil. When performing spectral cleaning, a threshold-based method is adopted, and S-G smoothing is added in the data preprocessing stage to further sharpen the spectral features, thereby improving the signal-to-noise ratio and feature discrimination of the spectral data. In addition, center loss is introduced, and a high-dimensional feature center of the distillate oil type is added during the model supervised training. By optimizing the feature space distribution, the similarity within the class and the difference between classes are enhanced, and the classification accuracy is improved by enhancing the model's ability to identify differences between classes. This method can effectively improve the spectral classification accuracy of distillate oil, improve the generalization ability of the model, and provide a more accurate and efficient intelligent classification solution for refining and chemical enterprises. The specific steps are as follows:

[0005] Step 1-1: Read the original data in the distillate oil spectral database and clean the spectral abnormal data based on the threshold. Set the threshold λ1 = 2.5, that is, when a spectral data meets the following conditions, this data is regarded as abnormal and needs to be excluded:

[0006] x j > λ1

[0007] where x jis the absorbance at the j wave number, so as to obtain pure spectral data X0:

[0008] X0 = {(x i , t i ) | i = 1, 2,..., M}

[0009] where M is the total number of original spectral data with labels, x i is the i-th spectral data, and t i is the label of the i-th spectral data, that is, the fraction oil category.

[0010] Step 1-2: First, perform conventional data preprocessing on the spectral data X0, including baseline correction, wave number segment interception, and vector normalization. On this basis, add Savitzky-Golay (S-G) smoothing. The smoothed average value at wavelength k is:

[0011]

[0012] where h i is the smoothing coefficient, H is the normalization factor, and w is the half-width of the window.

[0013] Step 1-3: Divide the cleaned and preprocessed dataset X into a training set X train and a test set X test .

[0014] Step 2: Concatenate the features extracted by the convolutional neural network (CNN) branch with the class labels of the Transformer branch as the high-dimensional feature representation z of the spectral data. The feature dimension of the CNN branch is 1024, the class token dimension of the Transformer branch is 768, and the dimension of the concatenated features is d = 1792.

[0015] Step 3: Improve the loss function of the one-dimensional convolutional self-attention network and add the high-dimensional feature center of the fraction oil types Introduce a hyperparameter λ to construct an improved loss function L.

[0016] Center loss function:

[0017]

[0018] where z i ∈R d represents the high-dimensional feature output by the neural network for the i-th sample, belonging to the y i -th class, represents the high-dimensional feature center of the fraction oil of the y i -th class in the feature space, and the batch size is M.

[0019] The high-dimensional feature center {c of the distillate oil types n |n = 1, 2, …, N} is updated using a mini-batch-based strategy, and the hyperparameter α is introduced to control the learning rate of the class center update:

[0020]

[0021] cn = c n -α△c n

[0022] where the number of classes is N, and △c n represents the update gradient of the center of the distillate oil class n, and δ(y i = n) is an indicator function that is 1 when y i = n and 0 otherwise. represents the number of samples belonging to class n in the current batch, and cN is the center of class n after update.

[0023] The hyperparameter λ is introduced to balance the weights of the two loss functions, and the formula for the joint loss is as follows:

[0024]

[0025] where L2 is the cross-entropy loss function; W j ∈R d is the j-th column of the parameter matrix W ∈ R d×N , and b j ∈R N is the bias term.

[0026] Step 4, Input the training set X train into the network, minimize the loss function L through the AdamW algorithm, and adjust the weight parameters of the model to learn the non-linear mapping relationship between the spectral absorbance and the distillate oil types.

[0027] Step 5, Evaluate the generalization ability of the network weight parameter model through the test set X test , and determine whether the classification accuracy of the model on the test set is greater than 98%. If it is satisfied, go to Step 6; otherwise, modify the hyperparameters and go back to Step 4.

[0028] Step 6, Obtain the trained network model, extract the high-dimensional feature vector V of each near-infrared spectral data, and classify the distillate oil using the cosine similarity. The formula for the cosine similarity is:

[0029]

[0030] where V A , V B are the feature vectors of samples A and B in the database respectively. If cos(V A , VB )≥0.9 indicates that A and B belong to the same category.

[0031] Beneficial effects:

[0032] The present invention discloses a method for improving the intelligent classification accuracy of distillate oil. When performing spectral cleaning, a threshold-based method is adopted, and S-G smoothing is added during data preprocessing to sharpen spectral features; when performing model supervised training, a high-dimensional feature center of distillate oil types is added to enhance the model's ability to identify differences between classes. This method can effectively improve the spectral classification accuracy of distillate oil, improve the generalization ability of the model, and provide a more accurate and efficient intelligent classification solution for refining enterprises. Description of the drawings

[0033] Figure 1 is a flowchart of a method for improving the intelligent classification accuracy of distillate oil according to the present invention.

[0034] Figure 2 is a structural diagram of a one-dimensional convolutional self-attention network Conformer1D.

[0035] Figure 3 is a schematic diagram of a joint supervised training method of center loss and cross-entropy loss.

[0036] Figure 4 is a loss curve diagram of the model training process.

[0037] Figure 5 is an accuracy curve diagram of the model training process. Detailed implementation manners

[0038] The following details the embodiments of the present invention. These embodiments are implemented on the premise of the technical solution of the present invention, and detailed implementation manners and specific operation processes are given. However, the protection scope of the present invention is not limited to the following embodiments.

[0039] By implementing the near-infrared spectroscopy rapid analysis technology in multiple domestic refining units, the enterprise has collected a large amount of distillate oil spectral data. Using the data in the enterprise database, the effectiveness of the distillate oil intelligent classification method proposed by the present invention is verified. It should be noted that during the previous data cleaning by the enterprise, although the prediction accuracy meets the requirements by using a method based on threshold and Z-score variance, this is obtained under the condition of deleting a large number of valid spectral data, indirectly increasing the data collection cost.

[0040] The overall system flowchart of the present invention is as Figure 1 shown, and the specific steps include:

[0041] 1) Read the original data in the distillate oil spectral database. Table 1 shows some spectral data and labels.

[0042] Table 1 Spectral Absorbance Measurement Data

[0043]

[0044] 2) Clean and preprocess the original labeled spectral data to generate dataset X. Data cleaning is the cleaning of spectral anomaly data based on a threshold; data preprocessing includes baseline correction, wavenumber segment truncation, vector normalization, and Savitzky-Golay smoothing. Table 2 shows some abnormal spectral data, where the absorbance far exceeds the upper threshold of 2.5.

[0045] Table 2 Abnormal Spectral Data

[0046]

[0047] Table 3 shows the preprocessed spectral data.

[0048] Table 3 Original Spectral Data and Preprocessed Spectral Data

[0049]

[0050] 3) Divide the cleaned and preprocessed dataset X into a training set X train and a test set X test .

[0051] 4) The architecture of the one-dimensional convolutional self-attention network Conformer1D is as Figure 2 shown. Improve the classification layer of Conformer1D, summarize the features of the convolutional neural network CNN branch and concatenate them with the class tokens of the Transformer branch. The feature dimension of the CNN branch is 1024, the class token dimension of the Transformer branch is 768, and the concatenated feature dimension is d = 1792.

[0052] 5) Improve the loss function of Conformer1D, add the high-dimensional feature center of the types of distillate oils introduce the hyperparameter λ, and construct the improved loss function L, as Figure 3 shown.

[0053] Center loss function:

[0054]

[0055] where, z i ∈R d represents the high-dimensional feature output by the neural network for the i-th sample, belonging to the y i -th class, represents the high-dimensional feature center of the distillate oil of the y i -th class in the feature space, and the batch size is M.

[0056] The high-dimensional feature centers {c n |n = 1, 2, …, N} of the distillate oil types are updated using a mini-batch-based strategy, and a hyperparameter α is introduced to control the learning rate of the class center update:

[0057]

[0058] cn = c n -α△c n

[0059] where the number of classes is N, and △c n represents the update gradient of the center of distillate oil class n, and δ(y i = n) is an indicator function that is 1 when y i = n and 0 otherwise, represents the number of samples belonging to class n in the current batch, and cN is the center of class n after update.

[0060] A hyperparameter λ is introduced to balance the weights of the two loss functions. The formula for the combined loss is as follows:

[0061]

[0062] where L2 is the cross-entropy loss function; W j ∈R d is the j-th column of the parameter matrix W ∈ R d×N , and b j ∈R N is the bias term.

[0063] 6) Input the training set X train into the network. Set the initial learning rate of the network to 1e -4 , the learning rate decay rate to 0.1, the batch size to 256, the regularization coefficient 1e -4 , the dropout rate to 0.5, λ = 0.1, α = 0.01, and the total number of training epochs to 100. Then perform the training. According to the defined loss function, minimize the loss function L through the AdamW algorithm.

[0064] 7) The loss curve and accuracy curve during the model training process are respectively as shown in Figure 4 and Figure 5 . According to the results, the accuracy of the model on the test set X test is 99.57%, while the accuracy using only the cross-entropy loss is 95.1%. It can be seen that introducing the center loss can optimize the feature space distribution, enhance the similarity of samples within classes and the difference between samples of different classes, retain the effective spectral data, improve the spectral classification accuracy of distillate oils, and enhance the generalization ability of the model.

[0065] 8) Obtain the trained network model, extract the high-dimensional feature vector V of each near-infrared spectral data, and classify the fractionated oil using cosine similarity. The cosine similarity calculation formula is:

[0066]

[0067] where V A , V B are the feature vectors of samples A and B in the database respectively. If cos(V A , V B ) ≥ 0.9, it indicates that A and B are of the same class.

Claims

1. A method for improving the intelligent classification accuracy of distillate oil, characterized in that, When performing spectral cleaning, a threshold-based method is adopted, and Savitzky-Golay (S-G) smoothing is added during data preprocessing to sharpen spectral features. When training the model under supervision, high-dimensional feature centers of different types of distillate oils are added to enhance the model's ability to identify differences between classes, thereby improving the classification accuracy. The specific steps are as follows: 1) Read the original data in the distillate oil spectral database, and perform threshold-based cleaning and conventional data preprocessing on the spectra. And add S-G smoothing to generate dataset X, and divide it into training set X and test set X according to the ratio of 8:

2. train test ; 2) Concatenate the features extracted by the Convolutional Neural Network (CNN) branch with the class labels of the Transformer branch as the high-dimensional feature representation z of the spectral data. 3) On the basis of the cross-entropy loss function of the one-dimensional convolutional self-attention network, add the high-dimensional feature center loss L1 of the fraction oil types. L1 uses the Euclidean distance between the high-dimensional features and the high-dimensional feature center c of the fraction oil types to measure: yi to measure: where z i ∈R d represents the high-dimensional feature output after the neural network for the i-th sample, belonging to the y i -th class, d is the feature dimension, and c yi ∈R d represents the high-dimensional feature center of the fraction oil of the y i -th class in the feature space, and the batch size is M; introduce a hyperparameter λ to construct an improved loss function L = λL1 + L2, where L2 is the cross-entropy loss function; 4) Input the training set X train into the network, minimize the loss function L through the AdamW algorithm, adjust the weight parameters of the model, and learn the non-linear mapping relationship between the spectral absorbance and the fractionated oil category; 5) Through the test set X test Evaluate the generalization ability of the network weight parameter model, and determine whether the classification accuracy of the model on the test set is greater than 98%. If it is satisfied, go to step 6); otherwise, modify the hyperparameters and go to step 4). 6) Obtain the trained network model, extract the high-dimensional feature vector V of each spectral data, and classify the distillate oils using cosine similarity.

2. The method for improving the intelligent classification accuracy of distillate oil according to claim 1, characterized in that Clean the spectral abnormal data based on the threshold. Set the threshold λ1 = 2.

5. That is, when a spectral data meets the following conditions, this data is regarded as abnormal and needs to be excluded: x j > λ1 where x j is the absorbance at the j wave number.

3. The method for improving the intelligent classification accuracy of distillate oil according to claim 1, characterized in that The conventional data preprocessing methods include baseline correction, spectral truncation, and vector normalization.

4. A method for improving the intelligent classification accuracy of distillate oil according to claim 1, characterized in that Increase S-G smoothing, the smoothed average value x at wavelength k k,SG is as follows: where h i is the smoothing coefficient, H is the normalization factor, and w is the half-width of the window.

5. A method for improving the intelligent classification accuracy of distillate oil according to claim 1, characterized in that The high-dimensional feature centers {c n |n = 1, 2, …, N} of the distillate oil types are updated using a mini-batch-based strategy, and a hyperparameter α is introduced to control the learning rate of the class center update: c′ n = c n - αΔc n Among them, the number of categories is N, and △c n represents the update gradient of the center of fraction oil category n, and δ(y i = n) is an indicator function, which is 1 when y i = n and 0 otherwise, represents the number of samples belonging to category n in the current batch, and c′ N is the center of updated category n.

6. A method for improving the intelligent classification accuracy of distillate oil according to claim 1, characterized in that The hyperparameter λ is used to balance the cross-entropy loss and the center loss: L = λL1 + L2 Among them, is the cross-entropy loss function; W j ∈R d is the j-th column of the parameter matrix W ∈ R d×N , and b j ∈R N is the bias term.

7. A method for improving the intelligent classification accuracy of distillate oil according to claim 1, characterized in that Cosine similarity cos(V A ,V B ) is calculated as follows: Among them, V A and V B are the feature vectors of samples A and B in the database respectively. If cos(V A , V B ) ≥ 0.9, it indicates that A and B are of the same class. ||·|| represents the Euclidean norm of the vector, and · represents the dot product operation of the vectors.

Citation Information

Patent Citations

  • An intelligent classification method for distillate oil based on near-infrared spectral property detection

    CN119760478A

  • Hyperspectral Sensing System and Method for Tracing / Tracking Refined Oil Products

    US20250012714A1

Cited By

  • Distillate oil property prediction method based on deep learning feature extraction and partial least squares regression

    CN121122479A

  • A method for predicting properties of distillate oil based on deep learning feature extraction and partial least squares regression

    CN121122479B

  • Crude oil property prediction method based on distillate oil depth characteristic modeling

    CN121583376A

  • Intelligent distillate oil property prediction method in combination with multi-center loss

    CN121583377A

  • Distillate oil depth classification network lightweight method

    CN122245525A