Diesel component detection method based on infrared spectroscopic analysis

By using infrared spectral data preprocessing and feature extraction in diesel component detection, the detection model is constructed and optimized, and the problem of low detection accuracy and efficiency of diesel component in the prior art is solved, and more efficient diesel component analysis is achieved.

CN120030419AInactive Publication Date: 2025-05-23JIANGXI PROD QUALITY SUPERVISION & TESTING INST (JIANGXI DEFECTIVE PROD RECALL CENT)
View PDF 13 Cites 0 Cited by

Patent Information

Application Number
CN202510500880.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-21
Publication Date
2025-05-23
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing infrared spectral detection methods face the problems of severe spectral data noise interference and insufficient model generalization capabilities in diesel component detection, resulting in low detection accuracy and efficiency.

Method used

By obtaining infrared spectral data of diesel samples, performing data preprocessing and feature extraction, a diesel component detection model is constructed, and the model is adaptively adjusted by iterating the function group when necessary to improve detection accuracy.

Benefits of technology

It improves the accuracy and efficiency of diesel component detection, can more effectively identify the main components and their content in diesel, and improves the reliability of the test results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120030419A_ABST
    Figure CN120030419A_ABST
Patent Text Reader

Abstract

The invention discloses a diesel oil component detection method based on infrared spectroscopic analysis, relates to the technical field of diesel oil component detection, and is used for solving the problems of poor diesel oil component detection precision and low efficiency in the prior art. The method comprises the following steps: acquiring infrared spectrum data of a diesel oil sample based on an infrared spectrum technology, carrying out data preprocessing on the infrared spectrum data, carrying out feature extraction to obtain corresponding diesel oil component features, carrying out feature sorting on the diesel oil component features to obtain diesel oil main component features, and constructing a diesel oil component detection model according to the diesel oil main component features. The method comprises the following steps: selecting an infrared spectrum of a to-be-detected diesel oil sample, judging whether an optimization demand exists, selecting whether to construct an iterative function group to adaptively adjust a diesel oil component detection model based on a judgment result, inputting the infrared spectrum of the to-be-detected diesel oil sample into the optimized diesel oil component detection model, and outputting a detection result by the diesel oil component detection model. And accurate and efficient detection of diesel components is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of diesel component detection, in particular to a diesel component detection method based on infrared spectrum analysis. Background Art

[0002] As an important petroleum product, diesel has a complex composition, including a variety of hydrocarbon compounds (such as alkanes, cycloalkanes, aromatic hydrocarbons) and additives. Although traditional diesel component detection methods (such as gas chromatography and mass spectrometry) have high accuracy, they have problems such as expensive equipment, long detection cycle, and complex pretreatment. Infrared spectroscopy analysis technology has been widely used in the field of component detection due to its rapid, non-destructive and high-throughput characteristics. However, existing infrared spectroscopy detection methods still face the following challenges:

[0003] 1. The spectral data is seriously disturbed by noise, which affects the identification of characteristic peaks. The overlapping spectra of complex components make it difficult to extract features.

[0004] 2. The model’s generalization ability is insufficient, and it is difficult to adapt to the detection needs of different batches of diesel samples.

[0005] Therefore, there is an urgent need for an efficient diesel component detection method based on infrared spectroscopy analysis to improve the accuracy and efficiency of diesel component detection. Summary of the invention

[0006] In order to solve the above problems, the object of the present invention is to provide a diesel component detection method based on infrared spectroscopy analysis.

[0007] The purpose of the present invention can be achieved by the following technical scheme: A method for detecting diesel components based on infrared spectroscopy analysis, comprising the following steps:

[0008] Step S1: Based on infrared spectroscopy technology, obtaining infrared spectrum data of a diesel sample;

[0009] Step S2: preprocessing the infrared spectrum data, extracting features of the infrared spectrum data after the data preprocessing to obtain corresponding diesel component features, and performing feature selection on the diesel main component features to obtain diesel main component features;

[0010] Step S3: constructing a diesel component detection model according to the main component characteristics of diesel, and judging whether there is a need to optimize the diesel component detection model, and based on the judgment result, choosing whether to construct an iterative function group to adaptively adjust the diesel component detection model;

[0011] Step S4: input the infrared spectrum of the diesel sample to be tested into the optimized diesel component detection model, and the diesel component detection model outputs the detection result.

[0012] Furthermore, based on infrared spectroscopy technology, the process of obtaining infrared spectroscopy data of diesel samples includes:

[0013] Equipped with Fourier transform infrared spectrometer;

[0014] Start the Fourier transform infrared spectrometer, scan several diesel samples, and obtain corresponding infrared spectrum data;

[0015] The infrared spectrum data is stored in a two-dimensional matrix form.

[0016] Furthermore, the process of scanning a number of diesel samples, obtaining corresponding infrared spectrum data, and storing them in a two-dimensional matrix form includes:

[0017] Divide a number of diesel samples into a number of scanning batches, set a scanning cycle for each diesel sample in each scanning batch, start a Fourier transform infrared spectrometer to scan each diesel sample several times, obtain the infrared spectrum of the diesel sample in each scanning, take the average of several scanning times as the final infrared spectrum of the corresponding diesel sample, and integrate the infrared spectra of all diesel samples in one scanning batch as the infrared spectrum data of the scanning batch;

[0018] A two-dimensional matrix is ​​created for the infrared spectrum data under each scanning batch. The rows of the two-dimensional matrix represent the batch number of each diesel sample under the corresponding scanning batch. The batch number represents the scanning order of the diesel sample under the current scanning batch. The columns of the two-dimensional matrix represent the absorbance values ​​matching the wavenumber recorded by the infrared spectrum of each diesel sample.

[0019] Furthermore, the infrared spectrum data is preprocessed, and the process of extracting features from the infrared spectrum data after the data preprocessing includes:

[0020] Data preprocessing includes baseline correction and noise filtering;

[0021] The infrared spectral data are processed based on the first-order derivative method to locate the characteristic peaks of the infrared spectrum corresponding to the diesel sample, and the diesel standard spectrum database is called to match the key absorption peaks. The principal component analysis method is used to perform principal component analysis on the matched key absorption peaks. After obtaining the main component characteristics of diesel, the synchronous data is projected into the low-latitude vector space by dimensionality reduction.

[0022] Furthermore, the process of locating the characteristic peak of the infrared spectrum corresponding to the diesel sample and matching the key absorption peak includes:

[0023] A sliding window is set, and the sliding window is moved point by point on the derivative curve of the infrared spectrum, and the average value and standard deviation of the derivative of each curve point in the sliding window are synchronously calculated. If the absolute value of the derivative at a certain point exceeds three times the standard deviation in the window, it is determined to be a potential peak position, and the peak width of each curve point on the derivative curve is statistically calculated, and the peak valley or peak top corresponding to the curve point whose peak width exceeds the preset peak width threshold is marked as a pseudo peak;

[0024] All potential peak positions on the derivative curve after removing pseudo peaks are taken as characteristic peaks of the infrared spectrum corresponding to the diesel sample, and all obtained characteristic peaks are compared with the diesel standard spectrum database with known diesel components to match the key absorption peaks in the diesel standard spectrum database with the same waveform position and similar peak shape as the currently compared characteristic peak.

[0025] Furthermore, the matching rules for matching key absorption peaks are as follows:

[0026] To determine whether the waveform positions are the same, set the allowable offset range between the waveform position of the characteristic peak and the waveform position of the key absorption peak in the diesel standard spectrum database. Specifically, the waveform position of the characteristic peak and the waveform position of the key absorption peak are allowed to be ±2cm. -1 The offset;

[0027] The determination of whether the peak shapes are similar is as follows: the peak shape similarity between the characteristic peak and the key absorption peak is calculated by the Euclidean distance calculation formula, a similarity threshold is preset, and when the peak shape similarity is greater than or equal to the similarity threshold, the corresponding key absorption peak is matched successfully, otherwise, the match fails.

[0028] Furthermore, the main component features of diesel are selected to obtain the main component features of diesel, and the process includes:

[0029] The dimensions of different key absorption peaks are unified. There are g diesel samples, and h key absorption peaks are detected in each diesel sample. The initial data matrix of each diesel sample is constructed, which is recorded as X = g × h. Each row of the initial data matrix represents a sample, and each column corresponds to the absorbance value or peak area of ​​a key absorption peak.

[0030] The key absorption peaks represented by each column in the initial data matrix are standardized and converted into a standard data matrix. The mean of each column in the standard data matrix is ​​0 and the variance is 1. The covariance matrix is ​​constructed, and the eigenvectors and eigenvalues ​​are solved. The eigenvalues ​​are sorted from large to small, and the eigenvectors corresponding to the first k eigenvalues ​​are selected as the main component characteristics of diesel.

[0031] Furthermore, the process of constructing a diesel composition detection model and determining whether there is an optimization demand includes:

[0032] A first detection sub-model for classifying and detecting diesel components is constructed by using a support vector machine;

[0033] A second detection sub-model for detecting the content percentage of different component categories in diesel components is constructed by using a convolutional neural network;

[0034] Construct a multi-dimensional feature vector and input it into the first detection sub-model and the second detection sub-model respectively, fuse the first detection sub-model and the second detection sub-model to construct a preliminary diesel component detection model, construct a kernel function and set hyperparameters for performing classification tasks, and construct a convolution structure and loss function for performing regression tasks;

[0035] The infrared spectrum data of several diesel samples are divided into a training set, a validation set, and a test set according to a set ratio, and the hyperparameters are adjusted based on the validation set;

[0036] The performance judgment indicators of the classification task and the regression task are set respectively, and whether the performance judgment indicators are met is judged based on the training set and the test set. If all the performance judgment indicators are met, it is judged that there is no optimization demand for the current diesel composition detection model, otherwise, it is judged that there is optimization demand.

[0037] Further, based on the judgment result, the process of selecting whether to construct an iterative function group to adaptively adjust the diesel composition detection model includes:

[0038] When the diesel composition detection model needs to be optimized, an iterative function group is constructed simultaneously, and the Bayesian optimization method is used to automatically search for several combinations of functions contained in the iterative function group, and the optimal combination and the hyperparameters of the optimal combination are located. Under the set iteration parameters, new training sets and test sets are input, and the diesel composition detection model is continuously optimized and trained until the performance judgment indicators of the classification task and the regression task meet the requirements. The adjustment of the diesel composition detection model is completed, otherwise, no adjustment is made.

[0039] Furthermore, the infrared spectrum of the diesel sample to be tested is input into the optimized diesel component detection model, and the process of the diesel component detection model outputting the detection result includes:

[0040] The infrared spectrum of the diesel sample to be tested is input into the diesel component detection model to identify the main component characteristics of the diesel corresponding to the infrared spectrum. The main components of the diesel are obtained based on the main component characteristics of the diesel, as well as the content, cetane number, density, freezing point and cold filter point of each main component. It is also used to obtain the various pollutants in the diesel and the content of the pollutants, which are integrated as the test results of the diesel sample to be tested.

[0041] Compared with the prior art, the beneficial effects of the present invention are as follows: by acquiring infrared spectrum data of a diesel sample, after completing data preprocessing, feature extraction is performed on the infrared spectrum data to obtain corresponding diesel component features, and feature picking is performed to obtain diesel main component features, a diesel component detection model is constructed according to the diesel main component features, and when it is determined that there is a need to optimize the diesel component detection model, an iterative function group is constructed to adaptively adjust the diesel component detection model, thereby improving the accuracy of subsequent detection models in detecting diesel components, and the infrared spectrum of the diesel sample to be detected is input into the optimized diesel component detection model, and the diesel component detection model outputs the final detection result reflecting the diesel component, thereby achieving efficient detection of diesel components. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] Figure 1 It is a flow chart of the present invention. DETAILED DESCRIPTION

[0043] The following is a clear and complete description of the technical solutions in the embodiments of the present application in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.

[0044] Example 1

[0045] like Figure 1 As shown, a diesel component detection method based on infrared spectroscopy analysis includes the following steps:

[0046] Step S1: Based on infrared spectroscopy technology, obtaining infrared spectrum data of a diesel sample;

[0047] Step S2: preprocessing the infrared spectrum data, extracting features of the infrared spectrum data after the data preprocessing to obtain corresponding diesel component features, and performing feature selection on the diesel main component features to obtain diesel main component features;

[0048] Step S3: constructing a diesel component detection model according to the main component characteristics of diesel, and judging whether there is a need to optimize the diesel component detection model, and based on the judgment result, choosing whether to construct an iterative function group to adaptively adjust the diesel component detection model;

[0049] Step S4: input the infrared spectrum of the diesel sample to be tested into the optimized diesel component detection model, and the diesel component detection model outputs the detection result.

[0050] Example 2

[0051] This embodiment is a further limitation of Embodiment 1, and Step S1 is implemented by the following process:

[0052] Step S1 includes: step S101, step S102, step S103;

[0053] Step S101: configuring a Fourier transform infrared spectrometer;

[0054] The specific implementation of step S101 includes:

[0055] Configure the spectral coverage and resolution of the Fourier transform infrared spectrometer, where the spectral coverage is configured to 4000cm -1 Up to 400cm -1 , the resolution is configured to 4cm -1 , by configuring a Fourier transform infrared spectrometer, it can play the following roles;

[0056] Different chemical bonds and functional groups in diesel have specific absorption frequencies in the infrared region. A wider spectral coverage can detect more types of chemical bonds and functional group information, thereby conducting a more comprehensive analysis of diesel. Appropriate spectral coverage ensures that appropriate characteristic absorption peaks can be selected for measurement during subsequent quantitative analysis of diesel. High resolution can distinguish more subtle features in the spectrum and can clearly distinguish the vibration modes of different chemical bonds or functional groups in complex molecules to accurately analyze the structure and chemical bond information of the molecule, such as distinguishing the absorption peaks produced by substituents at different positions on the benzene ring. For mixed samples, high resolution helps to separate and identify the characteristic absorption peaks of each component. Even if the absorption peaks of each component are relatively close, they can be accurately distinguished, thereby achieving qualitative and quantitative analysis of each component in the mixture, such as analyzing a variety of hydrocarbon compounds in petroleum products.

[0057] Step S102: Start the Fourier transform infrared spectrometer to scan a number of diesel samples to obtain corresponding infrared spectrum data;

[0058] The specific implementation of step S102 includes:

[0059] Divide a number of diesel samples into a number of scanning batches, set a scanning cycle for each diesel sample in each scanning batch, start the Fourier transform infrared spectrometer to scan each diesel sample several times, obtain the infrared spectrum of the diesel sample in each scanning, take the average of several scanning times as the final infrared spectrum of the corresponding diesel sample, and integrate the infrared spectra of all diesel samples in a scanning batch as the infrared spectrum data of the scanning batch.

[0060] Step S103: storing the infrared spectrum data in a two-dimensional matrix form;

[0061] The specific implementation of step S103 is as follows: a two-dimensional matrix is ​​created for the infrared spectrum data of each scanning batch, wherein the two-dimensional matrix is ​​used to store the infrared spectrum data of each scanning batch, the rows of the two-dimensional matrix represent the batch number of each diesel sample under the corresponding scanning batch, the batch number represents the scanning order of the diesel sample under the current scanning batch, and the columns of the two-dimensional matrix represent the absorbance value matching the wave number recorded by the infrared spectrum of each diesel sample;

[0062] The infrared spectrum data is stored in the form of a two-dimensional matrix, which facilitates the subsequent data tracing of each diesel sample.

[0063] Example 3

[0064] This embodiment is a further limitation of Embodiment 1, and Step S2 is implemented by the following process:

[0065] Step S2 includes: step S201, step S202;

[0066] Step S201: preprocessing the infrared spectrum data including baseline correction and noise filtering;

[0067] The specific implementation of step S201 includes:

[0068] For the infrared spectrum of each diesel sample, the adaptive iterative weighted penalty least squares method is used to eliminate the corresponding spectral baseline drift. The expression formula of the adaptive iterative weighted penalty least squares method is as follows:

[0069] ;

[0070] in, is the original absorbance, is the corrected absorbance, is the weight factor, is the smoothing parameter;

[0071] The infrared spectrum is filtered out by a filter, and the corresponding working frequency band of the filter is selected according to the noise type. The noise type is divided into low-frequency noise, high-frequency noise and specific frequency noise. The low-pass filter band of the filter is configured for low-frequency noise, and the high-pass filter band of the filter is configured for high-frequency noise. For specific frequency noise, a bandpass filter is selected for processing, thereby removing all noise fragments in the infrared spectrum and effectively suppressing the impact of random noise.

[0072] Step S202: Process the infrared spectrum data based on the first-order derivative method, locate the characteristic peak of the infrared spectrum corresponding to the diesel sample, call the diesel standard spectrum database to match the key absorption peak, use the principal component analysis method to perform principal component analysis on the matched key absorption peak, obtain the diesel main component characteristics, and then synchronize the data dimensionality reduction projection to the low-dimensional vector space;

[0073] The specific implementation of step S202 includes:

[0074] The principle of the first-order derivative method is: the first-order derivative method calculates the first-order derivative of the infrared spectrum data, that is, the rate of change of absorbance with wave number, to highlight the inflection point of the infrared spectrum curve, that is, the peak valley or peak top, so as to locate the characteristic peak position more accurately. The first-order derivative method can effectively eliminate the influence of baseline drift and enhance the recognition ability of weak peaks;

[0075] The infrared spectrum data that has completed data preprocessing is subjected to first-order difference calculation, and the calculation formula is expressed as follows:

[0076] ;

[0077] in, is the absorbance corresponding to the i-th wave number point in the infrared spectrum, is the absorbance corresponding to the i+1th wave number point in the infrared spectrum, is the wave value corresponding to the i-th wave number point in the infrared spectrum, is the wave value corresponding to the i+1th wave number point in the infrared spectrum;

[0078] A sliding window is set, and the sliding window is moved point by point on the derivative curve corresponding to the infrared spectrum, and the average value and standard deviation of the derivative corresponding to each curve point in the sliding window are synchronously calculated. If the absolute value of the derivative at a certain point exceeds three times the standard deviation in the window, it is determined to be a potential peak position, and the peak width of each curve point on the derivative curve is statistically calculated, and the peak valley or peak top corresponding to the curve point whose peak width exceeds the preset peak width threshold is marked as a pseudo peak;

[0079] All potential peak positions after removing pseudo peaks on the derivative curve are used as characteristic peaks of the infrared spectrum corresponding to the diesel sample, and all obtained characteristic peaks are compared with the diesel standard spectrum database with known diesel components, and key absorption peaks in the diesel standard spectrum database with the same waveform position and similar peak shape as the currently compared characteristic peak are matched;

[0080] The matching rules are as follows:

[0081] To determine whether the waveform positions are the same, set the allowable offset range between the waveform position of the characteristic peak and the waveform position of the key absorption peak in the diesel standard spectrum database. Specifically, the waveform position of the characteristic peak and the waveform position of the key absorption peak are allowed to be ±2cm.-1 Offset;

[0082] Determining whether the peak shapes are similar is as follows: By using the Euclidean distance calculation formula, calculate the peak shape similarity between the characteristic peak and the key absorption peak. Preset a similarity threshold. When the peak shape similarity is greater than or equal to the similarity threshold, the corresponding key absorption peak is successfully matched; otherwise, the matching fails.

[0083] When there are multiple peak shape similarities greater than or equal to the similarity threshold, select the one with the highest peak shape similarity between the multiple matched key absorption peaks and the characteristic peak as the target key absorption peak required finally.

[0084] There may be an overlapping phenomenon between the characteristic peaks representing different components in the infrared spectrum. The process of decomposing the overlapping multiple characteristic peaks is as follows:

[0085] Perform preliminary peak separation: Determine the number and positions of the overlapping characteristic peaks.

[0086] Perform Gaussian function modeling: Construct a function expression where each characteristic peak conforms to a Gaussian distribution. The function expression is as follows:

[0087] ;

[0088] where A is the peak height, is the peak position, is the peak width parameter;

[0089] Use the non - linear least - squares method to fit each characteristic peak, decompose the overlapping characteristic peaks into several sub - peaks, and calculate the proportion of the peak area of each sub - peak in the overlapping area of the characteristic peaks for quantitative analysis of the component content corresponding to each sub - peak in the diesel sample.

[0090] An example is as follows:

[0091] In the infrared spectrum of the diesel sample, overlapping characteristic peaks are detected near 1600 cm -1 . After being fitted and decomposed through the above steps, they are decomposed into two sub - peaks as follows:

[0092] Sub - peak 1 (1580 cm -1 ): Corresponding to the skeletal vibration of aromatic hydrocarbon C = C in diesel;

[0093] Sub - peak 2 (1620 cm -1 ): Corresponding to the characteristic peak of the oxygenated additive.

[0094] And call the diesel standard spectrum database to match the key absorption peaks, perform principal component analysis on the matched key absorption peaks by using the principal component analysis method. After obtaining the diesel principal component characteristics, synchronously project the data for dimensionality reduction into a low - dimensional vector space.

[0095] It should be noted that the characteristic peak identification achieves accurate analysis of the complex components of diesel through positioning by the first-order derivative method, matching with the diesel standard spectrum database and fitting decomposition after function modeling. This method is superior to traditional means in terms of anti-interference ability, peak separation accuracy and degree of automation, laying a solid foundation for subsequent modeling and quantitative analysis.

[0096] The key absorption peaks are analyzed by principal component analysis to obtain the main component characteristics of diesel and the data is reduced in dimension and projected into low-dimensional vector space, including:

[0097] The dimensions of different key absorption peaks are unified. There are g diesel samples, and h key absorption peaks (such as CH stretching vibration peak, C=C skeleton vibration peak) are detected in each diesel sample. The initial data matrix of each diesel sample is constructed, recorded as X=g×h. Each row of the initial data matrix represents a sample, and each column corresponds to the absorbance value or peak area of ​​a key absorption peak.

[0098] The key absorption peaks represented by each column in the initial data matrix are normalized;

[0099] The standardization formula is: ;

[0100] in, represents the mean of the matrix elements in the jth column of the initial data matrix, represents the standard deviation of the matrix elements in the jth column of the initial data matrix. After standardization, the initial data matrix is ​​converted into a standard data matrix, and the standard data matrix is ​​recorded as , the mean of each column in the standard data matrix is ​​0 and the variance is 1;

[0101] Construct the covariance matrix and solve for the eigenvector;

[0102] The covariance matrix is ​​denoted as ;

[0103] Among them, the dimension of the covariance matrix is ​​h×h, is the standard data matrix The transposed matrix of , and the covariance matrix are used to reflect the correlation between different key absorption peaks;

[0104] Covariance matrix Perform feature decomposition, ;

[0105] in, is the i-th eigenvalue, The eigenvectors corresponding to the i-th eigenvalue are sorted from large to small according to the eigenvalues, and the eigenvectors corresponding to the first k eigenvalues ​​are selected as the diesel main component features. The cumulative variance contribution rate of the eigenvalues ​​corresponding to the first k eigenvectors needs to meet the preset contribution rate threshold, that is, the cumulative variance contribution rate is greater than or equal to the contribution rate threshold;

[0106] The calculation formula of the cumulative variance contribution rate is as follows:

[0107] ;

[0108] The explanation is as follows: The cumulative variance contribution rate represents the cumulative value of the variance contribution rate of the eigenvalues ​​of the first k eigenvectors, and the ratio of the cumulative value of the eigenvalues ​​of all eigenvectors;

[0109] Construct the corresponding projection matrix based on the first k selected eigenvectors, and record the projection matrix as , the standard data matrix The data is projected into the principal component space at a low latitude and the matrix after data dimension reduction is recorded as , then .

[0110] It should be noted that the projection matrix The column vector of represents the weight of the key absorption peak. The larger the weight value is, the more important the contribution of the corresponding key absorption peak to the main component in the diesel sample is.

[0111] Example 4

[0112] This embodiment is a further limitation of Embodiment 1, and step S3 is implemented by the following process:

[0113] A first detection sub-model for classifying and detecting diesel components is constructed by a support vector machine; a second detection sub-model for detecting the content percentage of different component categories in diesel components is constructed by a convolutional neural network;

[0114] The key absorption peak after data dimensionality reduction is concatenated with the original characteristic peak before data dimensionality reduction, and the characteristic vectors corresponding to the characteristic values ​​are then constructed to form a multi-dimensional characteristic vector, which is then input into the first detection sub-model and the second detection sub-model respectively;

[0115] Select several model fusion points corresponding to the first detection sub-model and the second detection sub-model, construct a model embedding channel at each model fusion point, and when the model embedding channels at all model fusion points are constructed, a preliminary diesel composition detection model is constructed by fusion.

[0116] Construct kernel functions and set hyperparameters to perform classification tasks for diesel composition detection models;

[0117] The kernel function adopts radial basis function;

[0118] The hyperparameters include penalty parameters and kernel parameters, which are denoted as as well as ;

[0119] Construct a convolutional structure and loss function to perform the regression task of the diesel composition detection model;

[0120] The number of layers corresponding to the convolution structure is 3, and the number of filters corresponding to the 1st to 3rd layers are 32, 64 and 128 respectively. It also includes 2 fully connected layers, configures the activation function in the fully connected layer, sets the mean square error of the loss function, and configures the optimizer of the loss function.

[0121] The infrared spectrum data of several diesel samples are divided into a training set, a validation set and a test set;

[0122] The division ratio is: training set: validation set: test set = 70%: 15%: 15%;

[0123] Adjust the penalty parameter based on the validation set And the kernel parameters , get the maximum value of classification accuracy; and monitor the loss rate of the validation set. If the loss rate of the validation set is lower than the preset loss threshold, the validation is considered to have failed, and the hyperparameters are adjusted based on the validation set. Otherwise, no operation is performed.

[0124] Set performance criteria for classification tasks, including: classification accuracy and value;

[0125] Set performance criteria for regression tasks, including: coefficient of determination and RMS error ;

[0126] Setting classification accuracy and The first expected interval corresponding to each value;

[0127] Denoted as and ;

[0128] Setting the coefficient of determination and RMS error the second expected intervals corresponding to each;

[0129] Recorded as and ;

[0130] For the training set and the test set, when , , and If all of them are true, it is judged that there is no optimization demand for the current diesel composition detection model; otherwise, it is judged that there is optimization demand.

[0131] When the diesel composition detection model needs to be optimized, an iterative function group is constructed simultaneously, and the Bayesian optimization method is used to automatically search for several combinations of functions contained in the iterative function group, and the optimal combination and the hyperparameters of the optimal combination are located. Under the set iteration parameters, new training sets and test sets are input, and the diesel composition detection model is continuously optimized and trained until the performance judgment indicators of the classification task and the regression task meet the requirements. The adjustment of the diesel composition detection model is completed, otherwise, no adjustment is made.

[0132] Example 5

[0133] This embodiment is a further limitation of Embodiment 1, and step S4 is implemented by the following process:

[0134] When the final diesel component detection model is constructed, the infrared spectrum of the diesel sample to be tested will be input into the diesel component detection model. The diesel component detection model will identify the main component characteristics of the diesel corresponding to the infrared spectrum. According to the main component characteristics of the diesel, the various main components included in the diesel are obtained, as well as the content, cetane number, density, freezing point and cold filter point of each main component. It is also used to obtain the various pollutants in the diesel and the content of the pollutants, which are integrated as the detection results of the diesel sample to be tested.

[0135] The various main components in the diesel specifically include hydrocarbon substances and additives;

[0136] Diesel oil is mainly composed of various hydrocarbon substances, such as alkanes, olefins and aromatic hydrocarbons, and the content ratios of different hydrocarbons in diesel oil are obtained. Specific examples of various hydrocarbon substances include normal alkanes, isoalkanes, monocyclic aromatic hydrocarbons and polycyclic aromatic hydrocarbons;

[0137] Diesel fuel will be added with some additives to improve its performance, such as antioxidants, detergents, cetane number improvers, etc., to obtain the types and contents of various additives in diesel fuel.

[0138] The cetane number, density, pour point and cold filter point are key quality indicators reflecting the performance of diesel, and are described in detail as follows:

[0139] Cetane number: It is an important indicator to measure the combustion performance of diesel in compression ignition engines. The higher the cetane number, the better the combustion performance of diesel and the smoother the engine works.

[0140] Density: The density of diesel is closely related to its composition. Different density ranges correspond to different composition ratios and masses.

[0141] Pour point and cold filter point: the pour point is the temperature at which diesel loses fluidity at low temperatures, and the cold filter point is the lowest temperature at which diesel passes through the filter. They affect the performance of diesel at different ambient temperatures.

[0142] The various pollutants in diesel mainly include sulfur and nitrogen oxide precursors. Among them, sulfur is a harmful element in diesel. After combustion, it will produce pollutants such as sulfur dioxide, which will cause damage to the environment and the engine. Nitrogen oxide precursors refer to certain nitrogen-containing compounds that are precursors of nitrogen oxides generated after diesel combustion.

[0143] The above embodiments are only used to illustrate the technical method of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical method of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical method of the present invention.

Claims

1. A diesel component detection method based on infrared spectroscopy analysis, characterized in that: The following steps are involved: Step S1: Based on infrared spectroscopy technology, obtaining infrared spectrum data of a diesel sample; Step S2: preprocessing the infrared spectrum data, extracting features of the infrared spectrum data after the data preprocessing to obtain corresponding diesel component features, and performing feature selection on the diesel main component features to obtain diesel main component features; Step S3: constructing a diesel component detection model according to the main component characteristics of diesel, and judging whether there is a need to optimize the diesel component detection model, and based on the judgment result, choosing whether to construct an iterative function group to adaptively adjust the diesel component detection model; Step S4: input the infrared spectrum of the diesel sample to be tested into the optimized diesel component detection model, and the diesel component detection model outputs the detection result.

2. A diesel component detection method based on infrared spectroscopy analysis according to claim 1, characterized in that: Based on infrared spectroscopy technology, the process of obtaining infrared spectral data of diesel samples includes: Equipped with Fourier transform infrared spectrometer; Start the Fourier transform infrared spectrometer, scan several diesel samples, and obtain corresponding infrared spectrum data; The infrared spectrum data is stored in a two-dimensional matrix form.

3. A diesel component detection method based on infrared spectroscopy analysis according to claim 2, characterized in that: The process of scanning several diesel samples, obtaining corresponding infrared spectrum data, and storing them in a two-dimensional matrix form includes: Divide a number of diesel samples into a number of scanning batches, set a scanning cycle for each diesel sample in each scanning batch, start a Fourier transform infrared spectrometer to scan each diesel sample several times, obtain the infrared spectrum of the diesel sample in each scanning, take the average of several scanning times as the final infrared spectrum of the corresponding diesel sample, and integrate the infrared spectra of all diesel samples in one scanning batch as the infrared spectrum data of the scanning batch; A two-dimensional matrix is ​​created for the infrared spectrum data under each scanning batch. The rows of the two-dimensional matrix represent the batch number of each diesel sample under the corresponding scanning batch. The batch number represents the scanning order of the diesel sample under the current scanning batch. The columns of the two-dimensional matrix represent the absorbance values ​​matching the wavenumber recorded by the infrared spectrum of each diesel sample.

4. A diesel component detection method based on infrared spectroscopy analysis according to claim 3, characterized in that: The process of preprocessing the infrared spectrum data and extracting features from the infrared spectrum data after the preprocessing includes: Data preprocessing includes baseline correction and noise filtering; The infrared spectral data are processed based on the first-order derivative method to locate the characteristic peaks of the infrared spectrum corresponding to the diesel sample, and the diesel standard spectrum database is called to match the key absorption peaks. The principal component analysis method is used to perform principal component analysis on the matched key absorption peaks. After obtaining the main component characteristics of diesel, the synchronous data is projected into the low-latitude vector space by dimensionality reduction.

5. A diesel component detection method based on infrared spectroscopy analysis according to claim 4, characterized in that: The process of locating the characteristic peak of the infrared spectrum corresponding to the diesel sample and matching the key absorption peak includes: A sliding window is set, and the sliding window is moved point by point on the derivative curve of the infrared spectrum, and the average value and standard deviation of the derivative of each curve point in the sliding window are synchronously calculated. If the absolute value of the derivative at a certain point exceeds three times the standard deviation in the window, it is determined to be a potential peak position, and the peak width of each curve point on the derivative curve is statistically calculated, and the peak valley or peak top corresponding to the curve point whose peak width exceeds the preset peak width threshold is marked as a pseudo peak; All potential peak positions on the derivative curve after removing pseudo peaks are taken as characteristic peaks of the infrared spectrum corresponding to the diesel sample, and all obtained characteristic peaks are compared with the diesel standard spectrum database with known diesel components to match the key absorption peaks in the diesel standard spectrum database with the same waveform position and similar peak shape as the currently compared characteristic peak.

6. A diesel component detection method based on infrared spectroscopy analysis according to claim 5, characterized in that: The matching rules for matching key absorption peaks are as follows: To determine whether the waveform positions are the same, set the allowable offset range between the waveform position of the characteristic peak and the waveform position of the key absorption peak in the diesel standard spectrum database. Specifically, the waveform position of the characteristic peak and the waveform position of the key absorption peak are allowed to be ±2cm. -1 The offset; The determination of whether the peak shapes are similar is as follows: the peak shape similarity between the characteristic peak and the key absorption peak is calculated by the Euclidean distance calculation formula, a similarity threshold is preset, and when the peak shape similarity is greater than or equal to the similarity threshold, the corresponding key absorption peak is matched successfully, otherwise, the match fails.

7. A diesel component detection method based on infrared spectroscopy analysis according to claim 6, characterized in that: The process of feature picking of diesel main component features to obtain diesel main component features includes: The dimensions of different key absorption peaks are unified. There are g diesel samples, and h key absorption peaks are detected in each diesel sample. The initial data matrix of each diesel sample is constructed, which is recorded as X = g × h. Each row of the initial data matrix represents a sample, and each column corresponds to the absorbance value or peak area of ​​a key absorption peak. The key absorption peaks represented by each column in the initial data matrix are standardized and converted into a standard data matrix. The mean of each column in the standard data matrix is ​​0 and the variance is 1. The covariance matrix is ​​constructed, and the eigenvectors and eigenvalues ​​are solved. The eigenvalues ​​are sorted from large to small, and the eigenvectors corresponding to the first k eigenvalues ​​are selected as the main component characteristics of diesel.

8. A diesel component detection method based on infrared spectroscopy analysis according to claim 7, characterized in that: The process of building a diesel composition detection model and determining whether there is an optimization need includes: A first detection sub-model for classifying and detecting diesel components is constructed by using a support vector machine; A second detection sub-model for detecting the content percentage of different component categories in diesel components is constructed by using a convolutional neural network; Construct a multi-dimensional feature vector and input it into the first detection sub-model and the second detection sub-model respectively, fuse the first detection sub-model and the second detection sub-model to construct a preliminary diesel component detection model, construct a kernel function and set hyperparameters for performing classification tasks, and construct a convolution structure and loss function for performing regression tasks; The infrared spectrum data of several diesel samples are divided into a training set, a validation set, and a test set according to a set ratio, and the hyperparameters are adjusted based on the validation set; The performance judgment indicators of the classification task and the regression task are set respectively, and whether the performance judgment indicators are met is judged based on the training set and the test set. If all the performance judgment indicators are met, it is judged that there is no optimization demand for the current diesel composition detection model, otherwise, it is judged that there is optimization demand.

9. A diesel component detection method based on infrared spectroscopy analysis according to claim 8, characterized in that: Based on the judgment result, the process of selecting whether to construct an iterative function group to adaptively adjust the diesel composition detection model includes: When the diesel composition detection model needs to be optimized, an iterative function group is constructed simultaneously, and the Bayesian optimization method is used to automatically search for several combinations of functions contained in the iterative function group, and the optimal combination and the hyperparameters of the optimal combination are located. Under the set iteration parameters, new training sets and test sets are input, and the diesel composition detection model is continuously optimized and trained until the performance judgment indicators of the classification task and the regression task meet the requirements. The adjustment of the diesel composition detection model is completed, otherwise, no adjustment is made.

10. A diesel component detection method based on infrared spectroscopy analysis according to claim 9, characterized in that: The infrared spectrum of the diesel sample to be tested is input into the optimized diesel component detection model, and the process of the diesel component detection model outputting the detection result includes: The infrared spectrum of the diesel sample to be tested is input into the diesel component detection model to identify the main component characteristics of the diesel corresponding to the infrared spectrum. The main components of the diesel are obtained based on the main component characteristics of the diesel, as well as the content, cetane number, density, freezing point and cold filter point of each main component. It is also used to obtain the various pollutants in the diesel and the content of the pollutants, which are integrated as the test results of the diesel sample to be tested.

Citation Information

Patent Citations

  • Optical device and identification method for identifying components and content of organic matter

    CN107064049A

  • Method for rapidly predicting attribute of crude oil based on near-infrared spectroscopy

    CN107748146A

  • Method for rapidly discriminating edible oil types based on multiple characteristic components

    CN108267424A

  • Coal quality on-line analysis system and method based on incoming factory

    CN116297273A

  • Sea surface emulsification oil spill detection method, system, equipment and medium

    CN117169159A