Nonlinear coding algorithm and application method thereof in oil product classification system
By applying a nonlinear encoding algorithm in the oil classification system, the one-dimensional fluorescence spectral data is encoded into two-dimensional images, which solves the problems of limited data feature extraction capabilities and low classification accuracy in oil classification, and achieves high accuracy and real-timeness.
Patent Information
- Application Number
- CN202510108369.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-23
- Publication Date
- 2025-05-23
AI Technical Summary
The prior art has problems in oil classification with limited data feature extraction capabilities and low classification accuracy, making it difficult to achieve real-time classification.
The nonlinear encoding algorithm is used to encode the one-dimensional fluorescence spectral data into two-dimensional images through the segmented nonlinear encoding algorithm, and the classification of oil products is achieved using the SVM classifier.
It improves the accuracy of oil product classification, reduces information loss during digital signal processing, and realizes real-time classification.
Smart Images

Figure CN120030423A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of oil classification, and in particular to a nonlinear coding algorithm and an application method thereof in an oil classification system. Background Art
[0002] In the field of oil classification, the two-dimensional or three-dimensional fluorescence spectrum of oil is generally used as input information for classification. This method has a high experimental threshold and the oil spectrum data collection is cumbersome, so it is difficult to classify the oil to be tested in real time. Directly using one-dimensional fluorescence spectrum data for oil type analysis has the problem of limited data feature extraction ability, and its classification accuracy has room for improvement. Therefore, it is urgent to study a method to improve the classification accuracy in real time. Summary of the invention
[0003] In order to solve the problems of limited data feature extraction capability and low classification accuracy in the prior art, the present invention provides a nonlinear coding algorithm and its application method in an oil classification system. The present invention introduces and improves image coding algorithms that have been verified in other fields, and proposes a new nonlinear coding algorithm. The segmented nonlinear coding algorithm can encode one-dimensional fluorescence spectrum data into a two-dimensional image, thereby realizing oil classification, reducing information loss in the digital signal processing process, and extracting and amplifying more data features. The classification algorithm based on one-dimensional oil fluorescence signals can improve the accuracy of oil classification as much as possible while ensuring real-time performance. The method mainly includes:
[0004] S1: using an ultraviolet laser source to illuminate the oil product, measuring the emission wavelength spectrum data of the oil product at a preset excitation wavelength, and normalizing the measured data;
[0005] S2: According to the emission wavelength characteristics of the one-dimensional fluorescence spectrum of the oil product, the normalized data is sliced, and one-dimensional data of a preset length is screened out, and the screened one-dimensional data is sampled and reconstructed to obtain a data matrix L;
[0006] S3: Referring to PCM coding, each element in the data matrix is subjected to piecewise nonlinear scaling, and the matrix R is obtained after reconstruction;
[0007] S4: further process the matrix R by performing operations on different column vectors in the matrix to extract the correlation between elements at different positions in the matrix and obtain a new matrix;
[0008] S5: normalize the new matrix, and then map all elements in the new matrix to corresponding color intervals to generate a two-dimensional coded image;
[0009] S6: Send the two-dimensional coded image to the SVM classifier to classify the oil products.
[0010] A computer device comprises a memory, a processor and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of the above method.
[0011] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the above method.
[0012] A computer program product comprises a computer program or instructions, and when the program or instructions are executed by a processor, the steps of the above method are implemented.
[0013] The technical solution provided by the present invention has the following beneficial effects: the present invention uses vector addition to find the modulus or the Euclidean distance between vectors to reduce the dimension of the data matrix. Different calculation methods are used for data of different sizes to scale them to different intervals. The present invention abandons the PAA dimensionality reduction algorithm used in traditional algorithms, and uses matrix calculation to achieve the purpose of data dimensionality reduction, thereby reducing information loss in the process of data dimensionality reduction. The present invention introduces the segmentation idea of the A-rate 13-fold line in PCM coding into the image coding algorithm, thereby improving the sensitivity of the coding result to data with smaller values and enhancing the effect of image coding algorithm applied to oil product identification. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] The present invention will be further described below with reference to the accompanying drawings and embodiments, in which:
[0015] Figure 1 The present invention is a flowchart of a nonlinear coding algorithm and its application method in an oil classification system according to an embodiment of the present invention. DETAILED DESCRIPTION
[0016] In order to have a clearer understanding of the technical features, purposes and effects of the present invention, specific embodiments of the present invention are now described in detail with reference to the accompanying drawings.
[0017] Example 1
[0018] A nonlinear coding algorithm and its application method in an oil classification system in an embodiment of the present invention, please refer to Figure 1 , the method comprises the following steps:
[0019] S1: Use a 420nm ultraviolet laser source to irradiate the oil product, measure the emission wavelength spectrum data of the oil product at an excitation wavelength of 420nm, and normalize the measured data.
[0020] For a given spectral data X = {x 1 , x 2 , …, x n}, n is the number of samples, all values in the original data are scaled into the interval [0,1] to obtain normalized spectral data The formula is shown in formula (1):
[0021]
[0022] S2: According to the emission wavelength characteristics of the one-dimensional fluorescence spectrum of oil products, the normalized data is sliced and processed to select one-dimensional data with a length of 2048. Because the intensity of the fluorescence spectrum data of oil products is basically zero when the emission wavelength is too small or too large, and the front and back parts of the one-dimensional spectrum data are basically zero, the data with a total length of 2048 from 1001 to 3048 is taken for processing and analysis. In this way, while ensuring the classification accuracy, the amount of calculation is greatly reduced. Then the selected one-dimensional data is sampled and reconstructed, and one data is taken out every 128 data to form a 16*128 data matrix. For example: for the input one-dimensional data {x t |t=1,2,3,...,2048}, the calculation formula of the element points in the reconstructed data matrix L is:
[0023] L i,j (i=1,2,…,16)=x j (2)
[0024] So the data matrix L with a dimension of 16*128 after sampling and reconstruction is:
[0025]
[0026] S3: Perform piecewise nonlinear scaling on each element in the data matrix L to obtain the reconstructed matrix R. This step refers to the idea of the A-rate 13-fold line in PCM coding. The normalized data is divided into 4 segments, namely 0-0.125, 0.125-0.25, 0.25-0.5, and 0.5-1. Formula (3) is used to scale each segment of data using different calculation methods. The first segment of data is scaled to 0-1, the second segment of data is scaled to 1-1.5, the third segment of data is scaled to 1.5-2, and the fourth segment of data is scaled to 2-2.5. After the nonlinear transformation of the elements in the matrix, the influence of the smaller part of the median value of the data on the result is increased, making the algorithm more sensitive to small data. The element R in the reconstructed matrix R i,j The calculation formula is as follows:
[0027]
[0028] S4: After nonlinear reconstruction of the input data matrix, it is necessary to further extract the features of the data. Referring to the ideas of GAF coding and RP coding, two solutions are provided in this step to process the matrix R:
[0029] The first method is to treat the reconstructed data matrix R as 128 column vectors The 128 column vectors are summed up in pairs, and then the resulting vectors are modulo to obtain the elements in the new matrix. After reconstructing the data matrix in this way, a new 128*128 matrix S is obtained, thereby extracting more data features and enhancing the connection between data. i,j The calculation formula is as follows:
[0030]
[0031] The second method is to treat the reconstructed data matrix R as 128 column vectors Then, the Euclidean distance between these 128 column vectors is calculated, and a new 128*128 matrix D is obtained. The element D in the matrix D i,j The calculation formula is as follows:
[0032]
[0033] In this way, the operation of encoding the one-dimensional fluorescence spectrum data into a two-dimensional image is completed, the sensitivity of the classification algorithm to small data is improved, and more data features are extracted.
[0034] S5: Normalize the elements in the reconstructed data matrix, and then map all elements to the color interval [0,255] to generate a two-dimensional coded image. Taking matrix D as an example, the element C in the matrix C obtained after normalization and mapping is i,j The calculation formula is as follows:
[0035]
[0036] S6: Send the encoded image to the SVM classifier for training to achieve the oil classification function. Under the same condition of using the SVM classifier, the classification accuracy results of the no encoding algorithm, the RP encoding algorithm, the GAF encoding algorithm, the MTF encoding algorithm and the encoding algorithm proposed by the present invention (using the first method in S4) applied to oil classification are shown in the following Table 1:
[0037] Table 1 Oil classification accuracy
[0038]
[0039]
[0040] It can be seen from Table 1 that the new coding algorithm proposed in the present invention has a higher accuracy rate than the traditional coding algorithm and the non-coding algorithm when applied to the oil classification task. The encoded data effectively amplifies the characteristics of the oil fluorescence spectrum data.
[0041] Example 2
[0042] A computer device comprises a memory, a processor and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of the above method.
[0043] Example 3
[0044] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the above method.
[0045] Example 4
[0046] A computer program product includes a computer program or instructions, and when the program or instructions are executed by a processor, the above method steps are implemented.
[0047] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A nonlinear coding algorithm and its application method in an oil classification system, characterized in that: include: S1: using an ultraviolet laser source to illuminate the oil product, measuring the emission wavelength spectrum data of the oil product at a preset excitation wavelength, and normalizing the measured data; S2: According to the emission wavelength characteristics of the one-dimensional fluorescence spectrum of the oil product, the normalized data is sliced, and one-dimensional data of a preset length is screened out, and the screened one-dimensional data is sampled and reconstructed to obtain a data matrix L; S3: Referring to PCM coding, each element in the data matrix is subjected to piecewise nonlinear scaling, and the matrix R is obtained after reconstruction; S4: further process the matrix R by performing operations on different column vectors in the matrix to extract the correlation between elements at different positions in the matrix and obtain a new matrix; S5: normalize the new matrix, and then map all elements in the new matrix to corresponding color intervals to generate a two-dimensional coded image; S6: Send the two-dimensional coded image to the SVM classifier to classify the oil products.
2. A nonlinear coding algorithm and its application method in an oil classification system as claimed in claim 1, characterized in that: In S2, the preset length of the filtered one-dimensional data is 2048, and the filtered one-dimensional data is sampled and reconstructed, and one data is taken out every 128 data to form a 16*128 data matrix; t |t=1,2,3,...,2048}, the calculation formula of the element points in the reconstructed data matrix L is: L i,j (i=1,2,…,16)=x j (1) The data matrix L with a dimension of 16*128 after sampling and reconstruction is: Among them, j=1,2,3,...,2048.
3. A nonlinear coding algorithm and its application method in an oil classification system as claimed in claim 2, characterized in that: In S3, referring to PCM coding, the normalized data is divided into four segments, namely 0-0.125, 0.125-0.25, 0.25-0.5, and 0.5-1. Different calculation methods are used for each segment of data. The first segment of data is scaled to 0-1, the second segment of data is scaled to 1-1.5, the third segment of data is scaled to 1.5-2, and the fourth segment of data is scaled to 2-2.
5. After reconstruction, the element R in the new matrix R i,j The calculation formula is as follows:
4. A nonlinear coding algorithm and its application method in an oil classification system as claimed in claim 1, characterized in that: In S4, the process of obtaining the new matrix is: Treat the reconstructed matrix R as 128 column vectors Sum these 128 column vectors in pairs, then modulo the resulting vectors to get the elements in the new matrix, and finally get a new 128*128 matrix S. The elements S in the new matrix S are i,j The calculation formula is as follows: in, Indicates that it is different from Column vector of .
5. The nonlinear coding algorithm and its application method in the oil classification system according to claim 1, characterized in that: In S4, the process of obtaining the new matrix is: Treat the reconstructed matrix R as 128 column vectors Calculate the Euclidean distance between these 128 column vectors and get a new 128*128 matrix D. The element D in the matrix D i,j The calculation formula is as follows: in, Indicates that it is different from Column vector of .
6. A nonlinear coding algorithm and its application method in an oil classification system as claimed in claim 5, characterized in that: In S5, the element C in the matrix C obtained after normalization and mapping is i,j The calculation formula is as follows:
7. A computer device comprising a memory, a processor and a computer program stored in the memory, characterized in that: The processor executes the computer program to implement the steps of the nonlinear coding algorithm and the method for applying the same in an oil classification system as described in any one of claims 2 to 6.
8. A computer-readable storage medium, characterized in that: A computer program is stored, and when the program is executed by a processor, the steps of the nonlinear coding algorithm and the application method thereof in an oil classification system as described in any one of claims 2 to 6 are implemented.
9. A computer program product, characterized in that It includes a computer program or instruction, which, when executed by a processor, implements the steps of the nonlinear coding algorithm and the method for applying the same in an oil classification system as described in any one of claims 2 to 6.