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

Through data cleaning and preprocessing technology, combined with specially designed neural network models, the problem of sample data diversity and outliers in near-infrared spectral detection is solved, and fast and accurate distillate oil classification is achieved, reducing modeling costs.

CN119760478APending Publication Date: 2025-04-04NANJING RICHISLAND INFORMATION TECH CO LTD
View PDF 0 Cites 5 Cited by

Patent Information

Application Number
CN202411931005.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-26
Publication Date
2025-04-04

AI Technical Summary

Technical Problem

The existing near-infrared spectral detection methods require a large amount of sample data during the modeling process, resulting in a long modeling cycle, delayed operation time and high cost. The diversity and outliers of oil spectral data affect the feature extraction effect.

Method used

Data cleaning and preprocessing technology are used to clean abnormal data through threshold and Z-score variance methods, baseline correction, wave number segment interception and vector normalization are performed to generate sharpened spectral characteristic data. A neural network model is designed specifically for processing one-dimensional spectral data, and feature extraction and classification are combined with the Conformer architecture.

Benefits of technology

It effectively shortens the modeling time, reduces implementation costs, improves the spectral feature extraction effect, and achieves high-accurate distillate oil classification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119760478A_ABST
    Figure CN119760478A_ABST
Patent Text Reader

Abstract

The present invention discloses a distillate intelligent classification method for near-infrared spectral property detection, which uses data cleaning and preprocessing to sharpen near-infrared spectral features, designs a neural network model specifically for processing one-dimensional spectral data, extracts spectral data features and classifies them. The classification method can effectively utilize other modified enterprise data in the database to classify data collected from different enterprises, different devices and different time diversity, thereby helping to speed up modeling progress and reduce implementation costs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of distillate oil property detection in refining enterprises, and specifically is a method for classifying distillate oil based on near infrared spectroscopy combined with artificial intelligence. Background Art

[0002] In the refining industry, the rapid detection of distillate oil properties directly affects the optimization of production processes and the quality of final products. In recent years, near-infrared spectroscopy technology has been increasingly used in refining enterprises as a non-destructive testing method.

[0003] However, in the existing near-infrared spectroscopy detection process, it is often necessary to collect a large amount of sample data from the enterprise for modeling, which not only leads to a long modeling cycle and delayed commissioning, but also increases the implementation cost. If the historical data of distillate oil from other similar enterprises can be applied, the modeling progress can be significantly accelerated and the cost can be reduced. However, the data collected from different enterprises, different devices and at different times are different in nature. How to effectively classify and integrate these diverse data will help shorten the modeling time and reduce the implementation cost.

[0004] There are two main challenges in existing classification methods: First, the spectral data of oil products are usually presented in the form of one-dimensional sequences, which is significantly different from the structure of many traditional neural network models (such as convolutional neural networks) for processing two-dimensional image data. Second, the original spectra of oil products are usually very similar, with only slight differences in some wavenumber points. It is difficult to fully extract effective features to distinguish different oil categories by directly using the original spectra for modeling. Appropriate preprocessing methods are required to sharpen spectral features and improve feature extraction. Finally, spectral data often contains outliers, which will seriously affect the effect of feature extraction if these data are not cleaned. Summary of the invention

[0005] In view of the problems existing in the background technology, the present invention proposes an intelligent classification method for distillate oil for near-infrared spectral property detection, which uses data cleaning and preprocessing to sharpen spectral features, designs a neural network model specifically for processing one-dimensional spectral data, extracts spectral data features and classifies them, and specifically includes the following steps:

[0006] Step 1: Read the raw data in the distillate oil spectrum database and clean the abnormal spectrum data based on the threshold and Z-score variance. Set the upper threshold λ1=2.5 and the variance threshold λ2=3. When a piece of spectrum data meets any of the following conditions, the data is considered abnormal and needs to be removed:

[0007] x j >λ1

[0008]

[0009] Among them, x j is the absorbance at wave number j, μ j is the mean absorbance of the same type of distillate at wave number j, σ j is the absorbance variance of the same type of distillate at wave number j, thus obtaining pure spectral data X0:

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

[0011] Where M is the total number of original annotated spectral data, x i is the ith spectral data, t i is the label of the ith spectral data, i.e., the distillate oil category.

[0012] Step 2, preprocess the spectral data X0, first perform baseline correction, then cut the wavenumber segment, and finally perform vector normalization to sharpen the spectral features and generate the data set X.

[0013] Step 2-1, baseline correction, for each spectral data, select the wave number as 6400cm -1 and 9200cm -1 The point on (6400,x 6400 )、(9200,x 9200 ) as the base point, calculate the slope k and intercept b:

[0014]

[0015] b = x 6400 -6400*k

[0016] Then the baseline value y(j) at wave number j is:

[0017] y(j)=k*j+b

[0018] For the absorbance value x at any wave number j in the spectrum j , subtract the corresponding baseline value y(j) to obtain the corrected absorbance value x′ j :

[0019] x′ j =x j -y(j)

[0020] Step 2-2, wave number segment interception, intercept wave number range (4000cm -1 ,4800cm -1 ) between the absorbances.

[0021] Step 2-3, vector normalization, the calculation formula is:

[0022]

[0023] where x ij is the absorbance of the i-th sample at wave number j; is the average absorbance of the i-th sample; m is the number of wavenumber points; is the absorbance of the ith sample at wave number j after vector normalization.

[0024] Step 3: Divide the cleaned and preprocessed data set X into a training set X in a ratio of 8:2 train and the test set X test .

[0025] Step 4: Modify the Conformer architecture and replace the two-dimensional convolution, global average pooling, layer normalization, and batch normalization in the Conformer with one-dimensional operations. In addition, in the feature coupling unit (FCU), the traditional downsampling operation requires flattening the data dimension, while the upsampling operation requires expanding the data dimension. These operations are replaced by one-dimensional length scaling operations.

[0026] Step 5: Set the training set X train In the input network, the loss function l is minimized by the AdamW algorithm, the weight parameters of the model are adjusted, and the nonlinear mapping relationship between spectral absorbance and distillate oil categories is learned. The loss function l adopts the convolution branch cross entropy loss l c and the attention branch cross entropy loss l T The algebraic sum of :

[0027] l=l C +l T

[0028] Step 6: 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 95%. If so, go to step 7; otherwise, modify the hyperparameters and go to step 5.

[0029] Step 7, obtain the trained network model, extract the high-dimensional feature vector V of each near-infrared spectrum data, and classify the distillate oil using cosine similarity. The cosine similarity calculation formula is:

[0030]

[0031] Among them, V A 、V B are the feature vectors of samples A and B in the database respectively. If cos(V A ,VB )≥0.9, indicating that A and B are of the same type.

[0032] Beneficial effects:

[0033] This application first improves the structure of the neural network to make it suitable for one-dimensional spectral data; at the same time, appropriate preprocessing measures are taken to sharpen the spectral features and improve the feature extraction effect; finally, the outliers in the spectral data are cleaned to further improve the feature extraction effect.

[0034] This classification method can effectively utilize other modified enterprise data in the database to classify the collected data of different enterprises, different devices and different time diversity, which helps to speed up the modeling progress and reduce the implementation cost. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 The present invention is a flow chart of a distillate oil intelligent classification method for near-infrared spectral property detection.

[0036] Figure 2 This is the improved neural network structure diagram.

[0037] Figure 3 The loss curve and accuracy curve of the model training process. DETAILED DESCRIPTION

[0038] The following is a detailed description of an embodiment of the present invention. This embodiment is implemented on the premise of the technical solution of the present invention, and a detailed implementation method and a specific operation process are given, but the protection scope of the present invention is not limited to the following embodiment.

[0039] By implementing near-infrared spectroscopy rapid analysis technology in a number of domestic refining and chemical plants, the company has collected a large amount of distillate oil spectral data. The data in the company's database is used to verify the effectiveness of the distillate oil intelligent classification method proposed in the present invention.

[0040] The overall system flow chart of the present invention is as follows: Figure 1 As shown, the specific steps include:

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

[0042] Table 1 Spectral absorbance measurement data

[0043]

[0044]

[0045] 2) Clean and preprocess the original annotated spectral data to generate data set X. Data cleaning is to clean the spectral abnormal data based on threshold and Z-score variance; data preprocessing includes: baseline correction, wave number segment interception, and vector normalization. Table 2 shows the abnormal spectral data, the absorbance far exceeds the threshold upper limit of 1.5.

[0046] Table 2 Abnormal spectral data

[0047]

[0048] Table 3 Spectral data after preprocessing.

[0049] Table 3 Original spectral data and preprocessed spectral data

[0050]

[0051] 3) Divide the cleaned and preprocessed data set X into the training set X in a ratio of 8:2 train and the test set X test .

[0052] 4) Modify the Conformer architecture and replace the two-dimensional convolution, global average pooling, layer normalization, and batch normalization in the Conformer with one-dimensional operations; in addition, in the feature coupling unit (FCU), the traditional downsampling operation requires flattening the data dimension, while the upsampling operation requires expanding the data dimension. These operations are replaced by one-dimensional length scaling operations. Figure 2 As shown in the figure, the CNN branch follows the definition in ResNet, and the bottlenecks contain 1×1, 3×3, 1×1 one-dimensional convolutions and residual connections between input and output. The Transformer branch contains repeated transformer blocks, consisting of a multi-head self-attention module and an MLP block, both of which use residual connections. The spectral data is first extracted through the CNN branch for local features, then downsampled through the FCU module and input into the Transformer branch for global feature learning. Next, the data is upsampled through the FCU module and returned to the CNN branch, and the final output is a feature representation that combines local and global information.

[0053] 5) The training set X train Enter the network and set the initial learning rate of the network to 1e -4 , learning rate decay rate is 0.1, batch size is 256, regularization coefficient is 1e -4 , the drop rate is 0.5, and the total number of training epochs is 100. According to the defined loss function, the loss function is minimized by the AdamW algorithm.

[0054] 6) The loss curve and accuracy curve of the model training process are as follows Figure 3 As shown. According to the results, the model is tes The accuracy on the dataset is 99.6%, which is over 95%, indicating that the model has been trained and has good feature extraction capabilities.

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

[0056]

[0057] Among them, 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, indicating that A and B are of the same type.

Claims

1. A distillate intelligent classification method for near infrared spectroscopy property detection, characterized in that: Data cleaning and preprocessing are used to sharpen spectral features, a neural network model is designed to process one-dimensional spectral data, and spectral data features are extracted and classified. The specific steps include the following: 1) Read the original data in the distillate oil spectrum database, clean the spectral abnormal data based on the threshold and Z-score variance, and obtain the pure spectral data X0: X0={(x i ,t i )|i=1,2,...,M} Where M is the total number of spectral data after cleaning, x i is the ith spectral data, t i is the label of the ith spectral data, i.e. distillate oil category; 2) Preprocess the spectral data X0 by first performing baseline correction, then intercepting the wavenumber segment, and finally performing vector normalization to sharpen the spectral features and generate the data set X; 3) Divide the cleaned and preprocessed data set X into the training set X in a ratio of 8:2 train and the test set X test ; 4) Replace the two-dimensional convolution, global average pooling, layer normalization, and batch normalization of the traditional Conformer with one-dimensional operations; replace the downsampling and upsampling operations of the feature coupling unit FCU with one-dimensional length scaling operations; use the improved Conformer architecture as the network of the spectral recognition algorithm Conformer1D; 5) The training set X train In the input network, according to the loss function defined in Conformer1D, the AdamW algorithm is used to minimize the loss function l, adjust the weight parameters of the model, and learn the nonlinear mapping relationship between spectral absorbance and distillate oil categories; 6) 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 95%. If so, go to step (7); otherwise, modify the hyperparameters and go to step 5); 7) Obtain the trained network model, extract the high-dimensional feature vector V of each spectral data, and classify the distillate oil using cosine similarity.

2. The intelligent classification method for distillate oil based on near infrared spectroscopy property detection according to claim 1, characterized in that The spectral abnormal data is cleaned based on the threshold and Z-score variance. The upper threshold λ1 is set to 2.5 and the variance threshold λ2 is set to 3. When a spectral data meets any of the following conditions, the data is considered abnormal and needs to be removed: x j >λ1 Among them, x j is the absorbance at wave number j, μ j is the mean absorbance of the same type of distillate at wave number j, σ j is the absorbance variance of the same type of distillate at wave number j.

3. The intelligent classification method for distillate oil based on near infrared spectroscopy property detection according to claim 1, characterized in that Use baseline correction and select a wave number of 6400 cm for each spectral data. -1 and 9200cm -1 The point on (6400,x 6400 )、(9200,x 9200 ) as the base point, calculate the slope k and intercept b: b=x 6400 -6400*k Then, the baseline value y(j) at wave number j is: y(j)=k*j+b For the absorbance value x at any wave number j in the spectrum j , minus the corresponding baseline value y(j), to obtain the corrected absorbance value x j ′ :x j ′ =x j -y(j).

4. The intelligent classification method for distillate oil based on near infrared spectroscopy property detection according to claim 1, characterized in that Use wave number segment interception and set the wave number range F, F = (4000cm -1 ,4800cm -1 ).

5. The intelligent classification method for distillate oil based on near infrared spectroscopy property detection according to claim 1, characterized in that Use the following formula to normalize the vector: where x ij is the absorbance of the i-th sample at wave number j; is the average absorbance of the i-th sample; m is the number of wavenumber points; is the absorbance of the ith sample at wave number j after vector normalization.

6. The intelligent classification method for distillate oil based on near infrared spectroscopy property detection according to claim 1, characterized in that The loss function l of the spectral classification model adopts the convolution branch cross entropy loss l C and the attention branch cross entropy loss l T The algebraic sum of: l = l C +l T .

7. The intelligent classification method for distillate oil based on near infrared spectroscopy property detection according to claim 1, characterized in that Classification using cosine similarity: Among them, 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, indicating that A and B are of the same type.

Citation Information

Cited By

  • Method for improving intelligent classification precision of distillate oil

    CN120408270A

  • 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

  • Distillate oil depth classification network lightweight method

    CN122245525A

  • Method for classifying near infrared spectrum fine granularity of distillate oil

    CN122413097A