Jet fuel multi-index detection method, system, medium and electronic device
By constructing a detection model of near-infrared spectral data, using characteristic bands and abnormal sample removal technology, the complex and time-consuming problems of jet fuel detection methods are solved, and the rapid, accurate and concise effect of multi-index detection of jet fuel is achieved.
Patent Information
- Application Number
- CN202410696660.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-31
- Publication Date
- 2025-04-15
- Estimated Expiration
- 2044-05-31
AI Technical Summary
The existing jet fuel detection methods have problems such as long detection cycle, complicated method processes, pre-processing of samples and poor portability of detection equipment, especially when multi-index detection, model establishment investment is large and model complex.
By constructing the detection model Y = XB, using near-infrared spectral data for multi-index detection, the training model establishes a rapid detection model that can simultaneously detect multiple physical and chemical properties of jet fuel by selecting representative samples, determining characteristic bands, eliminating abnormal samples, and performing baseline correction.
It realizes the rapidity and accuracy of multi-index detection of jet fuel, simplifies the detection process, reduces data processing time and hardware load, and improves the reliability of detection results.
Smart Images

Figure CN118706680B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of jet fuel detection, and in particular to a jet fuel multi-index detection method, system, medium and electronic device. Background Art
[0002] In order to ensure the quality of 3# jet fuel in the market, the state has formulated a series of standards and strictly regulated the property parameters and detection methods of 3# jet fuel. However, these methods have the disadvantages of long detection cycle, complicated method process, sample pretreatment and poor portability of detection equipment. Most of the methods suitable for rapid detection are near-infrared spectroscopy, but the measurement models currently reported by this method are mostly only applicable to the detection of a single property index, because the pretreatment method used for the optimal model of each property index may be different, and the optimal parameters for modeling are also different. Therefore, the model effect of measuring two properties established by the same method may appear that one of them is better and the other is worse; when realizing multi-index measurement, it is necessary to select appropriate models for different indicators to be measured, which leads to a large investment required for model establishment. At the same time, the measurement models of multiple indicators are independent of each other, making the overall model more complex and placing certain requirements on equipment hardware. Summary of the invention
[0003] The present invention provides a jet fuel multi-index detection method, comprising:
[0004] Constructing a detection model: Constructing a detection model through the following formula (1):
[0005] Y=XB(1)
[0006] Wherein, X is the input matrix of the detection model, and the spectral matrix composed of the spectral values of the near-infrared spectrum is used as the input matrix; Y is the output matrix of the detection model, and the index matrix composed of the index values of multiple detection indexes of the spray paint fuel is used as the output matrix, and the multiple detection indexes include initial distillation point, 10% distillation range, 20% distillation range, 50% distillation range, 90% distillation range, final distillation point, 20°C density, 20°C viscosity, -20°C viscosity, freezing point and flash point; B is a coefficient matrix;
[0007] Obtaining a near infrared spectrum of the jet fuel to be tested, thereby obtaining a spectrum matrix of the jet fuel to be tested;
[0008] Train the detection model to obtain the coefficient matrix;
[0009] Inputting the spectrum matrix of the jet fuel to be tested into the trained detection model to obtain the index matrix of the jet fuel, thereby obtaining the index values of multiple detection indexes of the jet fuel;
[0010] The step of training the detection model includes:
[0011] Select a representative sample of the jet fuel to be tested;
[0012] Measuring a plurality of representative samples by a standard method, obtaining standard values of a plurality of detection indicators of the plurality of representative samples, and forming a standard indicator matrix;
[0013] Obtaining a near infrared spectrum of each representative sample, thereby obtaining a spectrum matrix consisting of spectrum values of near infrared spectra of a plurality of representative samples;
[0014] One or more characteristic bands for training are determined through spectral matrices of multiple representative samples and a standard indicator matrix;
[0015] Constructing a training set, wherein the training set includes a spectral matrix composed of spectral values of representative samples in characteristic bands and a standard index matrix composed of index values of detection indexes of representative samples;
[0016] Train the detection model through the training set;
[0017] The step of determining one or more characteristic bands for training through the spectral matrix of multiple representative samples and the standard indicator matrix includes:
[0018] Constructing a representative sample set, wherein the representative sample set includes a spectral matrix and a standard indicator matrix of a plurality of representative samples;
[0019] Multiple representative samples are randomly selected from the representative sample set multiple times or once to form multiple characteristic band training sets, and are sequentially input into the detection model to obtain a coefficient matrix for each training;
[0020] The coefficient of variation corresponding to each wavelength of the coefficient matrix trained multiple times is used as the spectral coefficient of variation to form a spectral coefficient of variation matrix;
[0021] A noise matrix with the same dimension as the spectral matrix of the characteristic band training set is randomly generated, and the coefficient of variation corresponding to each wavelength of the noise matrix is used as the noise coefficient of variation to form a noise coefficient of variation matrix;
[0022] The spectrum variation coefficient matrix and the noise variation coefficient matrix are compared to screen out wavelengths whose spectrum variation coefficient is greater than the noise variation coefficient to obtain one or more characteristic bands.
[0023] According to one aspect of the present invention, the step of comparing the spectrum coefficient of variation matrix and the noise coefficient of variation matrix comprises:
[0024] The spectrum variation coefficient matrix and the noise variation coefficient matrix are concatenated in the same dimension, and the noise variation coefficient threshold is obtained through the noise variation coefficient;
[0025] The wavenumbers corresponding to the spectral coefficient of variation being greater than the threshold value of the noise coefficient of variation are selected to form the characteristic bands.
[0026] According to one aspect of the present invention, the step of determining one or more characteristic bands for training through the spectral matrix of a plurality of representative samples and the standard indicator matrix comprises:
[0027] Analyze the spectral matrix of multiple representative samples and eliminate abnormal representative samples.
[0028] According to one aspect of the present invention, the step of analyzing the near-spectral matrix of multiple representative samples and removing abnormal representative samples comprises:
[0029] Randomly select multiple representative samples from the representative sample set to form a first training set;
[0030] The mean spectral value at each wavelength of the spectral matrix of the first training set is obtained by formula (2), the standard deviation of the spectral value at each wavelength of the spectral matrix of the first training set is obtained by formula (3), and the spectral values of the spectral matrix are standardized by formula (4) using the mean spectral value and the standard deviation of the spectral value at each wavelength of the spectral matrix of the first training set to obtain the standard spectral matrix
[0031]
[0032]
[0033] Among them, μ lsj is the mean spectral value at the jth wavelength, i is the representative sample index, j is the wavelength index, σ lsj is the standard deviation of the spectral value at the jth wavelength, ls ij is the spectrum value of the i-th representative sample at the j-th wavelength, ls′ ij is the standard spectrum value of the i-th representative sample at the j-th wavelength after standardization, LS′ is the standard spectrum matrix, LS′=[ls′ ij ] I×J , I is the total number of representative samples, J is the total number of wavelengths;
[0034] The covariance matrix of the standard spectral matrix is obtained by formula (5):
[0035]
[0036] The covariance matrix is decomposed by formula (6) to obtain the eigenvalues and eigenvectors of each representative sample:
[0037] ∑CM=V*DM (6)
[0038] Where DM is the diagonal matrix containing the eigenvalues of the covariance matrix, V is the characteristic matrix, and the columns of V are the corresponding eigenvectors;
[0039] Select the eigenvectors corresponding to the number of dimensions to be achieved by dimensionality reduction in descending order of eigenvalues to form a projection matrix:
[0040] PM=[v1,v2,…,v K ](7)
[0041] Among them, PM is the projection matrix, K is the number of dimensions to be achieved by dimensionality reduction;
[0042] The standard spectral matrix is transformed into a reduced-dimensional spectral matrix through the projection matrix using formula (8):
[0043] DR=LS′*PM (8)
[0044] Among them, DR is the dimension-reduced spectrum matrix, DR = [dr ik ] I×K ;
[0045] Obtaining the Mahalanobis distance of the vector corresponding to each representative sample in the dimension-reduced spectrum matrix, and using the Mahalanobis distance as the T statistic, thereby obtaining a T statistic matrix;
[0046] The first degree of freedom is K, the second degree of freedom is IK-1, the critical value of the T statistic is searched in the T distribution critical table according to the first degree of freedom and the second degree of freedom, and the representative sample corresponding to the T statistic whose difference with the critical value of the T statistic is greater than the first difference range is taken as the abnormal representative sample;
[0047] Input the standard indicator matrix and the reduced-dimensional spectrum matrix of the first training set into the detection model for training, input the reduced-dimensional spectrum matrix of the first training set into the trained detection model, obtain the prediction indicator matrix composed of the predicted values of the detection indicators of the first training set, obtain the residual indicator matrix composed of the residuals of the standard values and predicted values of the detection indicators through the standard indicator matrix and the prediction indicator matrix of the first training set, and construct the F statistic matrix of the residual indicator matrix through the F statistic;
[0048] The first degree of freedom is K, the second degree of freedom is IK-1, and the second critical value is searched in the F test critical value table according to the first degree of freedom and the second degree of freedom. The representative sample corresponding to the F statistic whose difference with the second critical value is greater than the second difference range is taken as the abnormal representative sample.
[0049] According to one aspect of the present invention, after the step of analyzing the near-spectral matrix of multiple representative samples and removing abnormal representative samples and before the step of determining one or more characteristic bands for training through the spectral matrix of multiple representative samples and the standard indicator matrix, the method includes:
[0050] The near-infrared spectra of normal representative samples after excluding abnormal representative samples were baseline corrected.
[0051] According to one aspect of the present invention, the step of performing baseline correction on the near infrared spectrum of the normal representative sample after removing the abnormal representative sample comprises:
[0052] Smoothing the spectral matrix of normal representative samples to obtain a smoothed matrix;
[0053] Performing derivative processing on the smoothing matrix to obtain a derivative matrix composed of derivative values, wherein the derivative processing is first-order derivative processing or high-order derivative processing;
[0054] Among them, in the step of constructing the training set:
[0055] The training set includes a derivative matrix composed of derivative values of normal representative samples in characteristic bands and a standard index matrix composed of index values of detection indexes of normal representative samples.
[0056] According to one aspect of the present invention, the step of determining one or more characteristic bands for training through the spectral matrix of a plurality of representative samples and the standard indicator matrix comprises:
[0057] The NIR spectra of several representative samples were baseline corrected.
[0058] According to one aspect of the present invention, the step of performing baseline correction on the near infrared spectra of a plurality of representative samples comprises:
[0059] Smoothing the spectral matrices of multiple representative samples to obtain a smoothed matrix;
[0060] Performing derivative processing on the smoothing matrix to obtain a derivative matrix composed of derivative values, wherein the derivative processing is first-order derivative processing or high-order derivative processing;
[0061] Among them, in the step of constructing the training set:
[0062] The training set includes a derivative matrix composed of derivative values of representative samples in characteristic bands and a standard index matrix composed of index values of detection indexes of representative samples.
[0063] According to one aspect of the present invention, the derivative processing is second-order derivative processing.
[0064] According to one aspect of the present invention, in the step of constructing a detection model: the detection model is constructed by a PLS method.
[0065] The present invention also provides a jet fuel multi-index detection system, comprising:
[0066] The model building module constructs a detection model by the following formula (1):
[0067] Y=XB(1)
[0068] Wherein, X is the input matrix of the detection model, and the spectral matrix composed of the spectral values of the near-infrared spectrum is used as the input matrix; Y is the output matrix of the detection model, and the index matrix composed of the index values of multiple detection indexes of the spray paint fuel is used as the output matrix, and the multiple detection indexes include initial distillation point, 10% distillation range, 20% distillation range, 50% distillation range, 90% distillation range, final distillation point, 20°C density, 20°C viscosity, -20°C viscosity, freezing point and flash point; B is a coefficient matrix;
[0069] A training module, wherein the training module is configured to train a detection model constructed by a model construction module;
[0070] A spectrum acquisition module, wherein the spectrum acquisition module is configured to acquire a near infrared spectrum of the jet fuel to be tested, thereby obtaining a spectrum matrix of the jet fuel to be tested;
[0071] A detection result acquisition module, wherein the detection result acquisition module is configured to input the spectrum matrix collected by the spectrum acquisition module into the detection model trained by the training module to obtain an index matrix of the jet fuel, thereby obtaining index values of multiple detection indexes of the jet fuel;
[0072] The training modules include:
[0073] A representative sample selection submodule selects representative samples corresponding to the jet fuel to be tested;
[0074] A standard value collection submodule collects standard values of detection indicators of multiple representative samples obtained by a representative sample selection submodule measured by a standard method to form a standard indicator matrix;
[0075] A representative sample spectrum acquisition submodule is used to acquire the near-infrared spectrum of each representative sample obtained by the representative sample selection submodule, thereby obtaining a spectrum matrix composed of spectrum values of the near-infrared spectra of multiple representative samples;
[0076] The characteristic band selection submodule determines one or more characteristic bands for training through the spectrum matrix of multiple representative samples collected by the representative sample spectrum collection submodule and the standard indicator matrix collected by the standard value collection submodule;
[0077] A training set construction submodule is used to construct a training set, wherein the training set includes a spectral matrix composed of spectral values of representative samples in characteristic bands and a standard index matrix composed of index values of detection indexes of representative samples;
[0078] The training submodule takes the spectral matrix of the training set constructed by the training set construction submodule as input and the standard indicator matrix of the training set as output to train the detection model;
[0079] Wherein, the characteristic band selection submodule includes:
[0080] A representative sample set construction unit is used to construct a representative sample set, wherein the representative sample set includes a spectral matrix and a standard index matrix of a plurality of representative samples;
[0081] The training unit randomly selects multiple representative samples from the representative sample set of the representative sample set construction unit multiple times or once to form multiple characteristic band training sets, and sequentially inputs them into the detection model to obtain a coefficient matrix for each training;
[0082] The spectral variation analysis unit uses the variation coefficient corresponding to each wavelength of the coefficient matrix trained multiple times by the training unit as the spectral variation coefficient to form a spectral variation coefficient matrix;
[0083] The noise variation analysis unit randomly generates a noise matrix with the same dimension as the spectral matrix of the characteristic band training set, and the coefficient of variation corresponding to each wavelength of the noise matrix is used as the noise variation coefficient to form a noise variation coefficient matrix;
[0084] The characteristic band analysis unit compares the spectrum variation coefficient matrix and the noise variation coefficient matrix, selects the wavelengths whose spectrum variation coefficient is greater than the noise variation coefficient, and obtains one or more characteristic bands.
[0085] The present invention also provides a computer-readable storage medium, which includes a jet fuel multi-indicator detection program. When the jet fuel multi-indicator detection program is executed by a processor, the steps of the above-mentioned jet fuel multi-indicator detection method are implemented.
[0086] The present invention also provides an electronic device, which includes a memory and a processor. The memory includes a jet fuel multi-indicator detection program. When the jet fuel multi-indicator detection program is executed by the processor, the steps of the above-mentioned jet fuel multi-indicator detection method are implemented.
[0087] The jet fuel multi-index detection of the present invention is trained by measuring the standard values of multiple detection indicators of representative samples of jet fuel by standard methods, using the coefficient of variation of the coefficient matrix trained multiple times as the spectral coefficient of variation and randomly generating a noise matrix, and selecting the characteristic bands for training by comparing the spectral coefficient of variation and the noise coefficient of variation, thereby increasing the robustness of the multi-index detection, ensuring not only the rapidity of training but also the accuracy of training, and realizing the near-infrared spectral rapid determination of the simultaneous detection of jet fuel multi-indexes.
[0088] The present invention adds standard values for feature selection after preprocessing the spectrum. Compared with the method in which each indicator measurement in the traditional multi-index measurement model needs to be preprocessed, this method saves the stage of multiple preprocessing, realizes the simultaneous measurement of multiple indicators, reduces the number of operations, and thus reduces the processing time of data, especially when the amount of data is huge. In order to make the prediction results of each indicator accurate and reliable, the traditional multi-index prediction model needs to separately explore the preprocessing method and feature selection method suitable for the indicator, which leads to the need for a variety of algorithm programs in the prediction model and increases the hardware equipment load. The present invention uses two data processing methods (eliminating abnormal samples and smoothing derivative processing) with the detection model to realize the determination of the detection indicators of multiple physical and chemical properties of jet fuel. Compared with the traditional method, the model program of the present invention is more concise. At the same time, in the actual application process, the present invention has high accuracy and reliability for the measurement results of multiple physical and chemical properties of jet fuel. BRIEF DESCRIPTION OF THE DRAWINGS
[0089] Figure 1 It is a flow chart of an embodiment of the jet fuel multi-index detection method of the present invention;
[0090] Figure 2 is a schematic diagram of an embodiment of the method for comparing a spectrum variation coefficient matrix and a noise variation coefficient matrix according to the present invention;
[0091] Figure 3 It is a flow chart of a preferred embodiment of the method for training a detection model of the present invention;
[0092] Figure 4 is a coordinate diagram of eliminating abnormal representative samples of the jet fuel multi-index detection method of the present invention;
[0093] Figure 5 It is a schematic diagram of a block diagram of an embodiment of the jet fuel multi-index detection system of the present invention;
[0094] Figure 6 It is a schematic diagram of a block diagram of an embodiment of the electronic device of the present invention.
[0095] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0096] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0097] Figure 1 FIG. 1 is a flow chart of an embodiment of the jet fuel multi-index detection method of the present invention. Figure 1As shown, the jet fuel multi-index detection method includes:
[0098] Step S1, construct a detection model through the following formula (1):
[0099] Y=XB(1)
[0100] Wherein, X is the input matrix of the detection model, and the spectral matrix composed of the spectral values of the near-infrared spectrum is used as the input matrix; Y is the output matrix of the detection model, and the index matrix composed of the index values of multiple detection indexes of the spray paint fuel is used as the output matrix, and the multiple detection indexes include initial distillation point, 10% distillation range, 20% distillation range, 50% distillation range, 90% distillation range, final distillation point, 20°C density, 20°C viscosity, -20°C viscosity, freezing point and flash point; B is a coefficient matrix;
[0101] Step S2, obtaining a near infrared spectrum of the jet fuel to be tested, thereby obtaining a spectrum matrix of the jet fuel to be tested;
[0102] Step S3, training the detection model to obtain a coefficient matrix;
[0103] Step S4: inputting the spectrum matrix of the jet fuel to be tested into the trained detection model to obtain the index matrix of the jet fuel, thereby obtaining the index values of multiple detection indexes of the jet fuel.
[0104] In some embodiments of the present invention, step S3 includes:
[0105] Step S31, selecting a representative sample corresponding to the jet fuel to be tested, for example, selecting jet fuel samples collected from more than 30 representative domestic oil refineries as representative samples, and for example, collecting a representative sample of No. 3 jet fuel;
[0106] Step S32, measuring a plurality of representative samples by a standard method, obtaining standard values of the detection indicators of the plurality of representative samples, and forming a standard indicator matrix, for example, testing a plurality of representative samples of No. 3 jet fuel according to the standard method specified in "GB 6537-2018 No. 3 Jet Fuel";
[0107] Step S33, obtaining a near infrared spectrum of each representative sample, thereby obtaining a spectrum matrix consisting of spectrum values of near infrared spectra of multiple representative samples;
[0108] Step S36, determining one or more characteristic bands for training through the spectral matrix of multiple representative samples and the standard indicator matrix;
[0109] Step S37, constructing a training set, wherein the training set includes a spectral matrix composed of spectral values of representative samples in characteristic bands and a standard index matrix composed of index values of detection indexes of representative samples;
[0110] Step S38, training the detection model through the training set, taking the spectral matrix of the training set as the input of the detection model, taking the standard indicator matrix of the training set as the output of the detection model, and obtaining the coefficient matrix through training.
[0111] In some embodiments of the present invention, step S36 includes:
[0112] Step S361, constructing a representative sample set, wherein the representative sample set includes a spectral matrix and a standard index matrix of a plurality of representative samples;
[0113] Step S362, randomly selecting multiple representative samples from the representative sample set multiple times or once to form multiple characteristic band training sets, and sequentially inputting them into the detection model to obtain a coefficient matrix for each training;
[0114] Step S363, the coefficient of variation corresponding to each wavelength of the coefficient matrix trained multiple times is used as the spectral coefficient of variation to form a spectral coefficient of variation matrix, and the spectral coefficient of variation reflects the degree of variation of each wavelength;
[0115] Step S364, randomly generate a noise matrix with the same dimension as the spectral matrix of the characteristic band training set, and use the coefficient of variation corresponding to each wavelength in the noise matrix as the noise coefficient of variation to form a noise coefficient of variation matrix;
[0116] Step S365, select and compare the spectral coefficient of variation matrix and the noise coefficient of variation matrix, screen out the wavelengths whose spectral coefficient of variation is greater than the noise coefficient of variation, and obtain one or more characteristic bands. The fluctuation caused by the spectral coefficient of variation being lower than the noise coefficient of variation may be caused by noise, while the spectral coefficient of variation being higher than the noise coefficient of variation indicates that the fluctuation may show useful information.
[0117] The jet fuel multi-index detection method of the present invention measures the standard values of multiple detection indicators of representative samples of jet fuel by standard methods for training, uses the coefficient of variation of the coefficient matrix trained multiple times as the spectral coefficient of variation and randomly generates a noise matrix, and selects the characteristic bands for training by comparing the spectral coefficient of variation and the noise coefficient of variation, thereby increasing the robustness, rapidity and accuracy of the multi-index detection, and realizing a concise near-infrared spectroscopy determination model suitable for jet fuel multi-index and rapid detection at the same time.
[0118] In some embodiments of the present invention, step S365 includes:
[0119] The spectral variation coefficient matrix and the noise variation coefficient matrix are concatenated in the same dimension, and the noise variation coefficient threshold is obtained through the noise variation coefficient, such as Figure 2As shown, the noise is simulated based on the representative sample information. The black curve on the far right represents the noise, the gray curve in front is the spectral variation coefficient, and the black points are the selected points.
[0120] The wavenumbers corresponding to the spectral coefficient of variation being greater than the threshold value of the noise coefficient of variation are selected to form the characteristic bands.
[0121] In some embodiments of the present invention, the step S36 includes:
[0122] Step S34, analyzing the spectral matrix of multiple representative samples and eliminating abnormal representative samples to eliminate the interference of abnormal representative samples on the accuracy of the detection model.
[0123] In some embodiments of the present invention, step S34 includes:
[0124] Step S341, randomly selecting a plurality of representative samples from the representative sample set to form a first training set;
[0125] Step S342, obtain the mean spectral value at each wavelength of the spectral matrix of the first training set by formula (2), obtain the standard deviation of the spectral value at each wavelength of the spectral matrix of the first training set by formula (3), and standardize the spectral values of the spectral matrix by using the mean spectral value and the standard deviation of the spectral value at each wavelength of the spectral matrix of the first training set by formula (4) to obtain a standard spectral matrix
[0126]
[0127] Among them, μ lsj is the mean spectral value at the jth wavelength, i is the representative sample index, j is the wavelength index, σ lsj is the standard deviation of the spectral value at the jth wavelength, ls ij is the spectrum value of the i-th representative sample at the j-th wavelength, ls′ ij is the standard spectrum value of the i-th representative sample at the j-th wavelength after standardization, LS′ is the standard spectrum matrix, LS′=[ls′ ij ] I×J , I is the total number of representative samples, J is the total number of wavelengths;
[0128] Step S343, obtain the covariance matrix of the standard spectrum matrix through the following formula (5):
[0129]
[0130] Step S344, perform eigendecomposition on the covariance matrix using the following formula (6) to obtain the eigenvalues and eigenvectors of each representative sample:
[0131] ∑CM=V*DM (6)
[0132] Where DM is the diagonal matrix containing the eigenvalues of the covariance matrix, V is the characteristic matrix, and the columns of V are the corresponding eigenvectors;
[0133] Step S345, select the eigenvectors corresponding to the number of dimensions to be achieved by dimensionality reduction in descending order of eigenvalues to form a projection matrix. Dimensionality reduction reduces the amount of calculation while increasing the impact of the eigenvectors on the detection model effect:
[0134] PM=[v1,v2,…,v K ](7)
[0135] Among them, PM is the projection matrix, K is the number of dimensions to be achieved by dimensionality reduction;
[0136] Step S346, transforming the standard spectrum matrix into a reduced-dimensional spectrum matrix through the projection matrix using the following formula (8):
[0137] DR=LS′*PM (8)
[0138] Among them, DR is the dimension-reduced spectrum matrix, DR = [dr ik ] I×k ;
[0139] Step S346, obtaining the Mahalanobis distance of the vector corresponding to each representative sample in the dimension-reduced spectrum matrix, and using the Mahalanobis distance as the T statistic, thereby obtaining a T statistic matrix;
[0140] Step S347, the first degree of freedom is K, the second degree of freedom is IK-1, the T statistic critical value is searched in the T distribution critical table according to the first degree of freedom and the second degree of freedom, and the representative sample corresponding to the T statistic whose difference with the T statistic critical value is greater than the first difference range is taken as the abnormal representative sample;
[0141] Step S348, inputting the standard indicator matrix and the reduced-dimensional spectrum matrix of the first training set into the detection model for training, inputting the reduced-dimensional spectrum matrix of the first training set into the trained detection model, obtaining a prediction indicator matrix consisting of the predicted values of the detection indicators of the first training set, obtaining a residual indicator matrix consisting of the residuals of the standard values and predicted values of the detection indicators through the standard indicator matrix and the prediction indicator matrix of the first training set, and constructing an F statistic matrix of the residual indicator matrix through the F statistic;
[0142] Step S349, the first degree of freedom is K, the second degree of freedom is IK-1, and the second critical value is searched in the F-test critical value table based on the first degree of freedom and the second degree of freedom, and the representative sample corresponding to the F statistic whose difference with the second critical value is greater than the second difference range is taken as the abnormal representative sample.
[0143] In the method for eliminating abnormal representative samples of the present invention, spectral data are sampled to generate representative samples, and the spectral data of the representative samples are mapped from a high-dimensional space to a low-dimensional space, so that the main features of the spectral data are retained. Then, the Mahalanobis distance in the low-dimensional space is used. The T statistical critical value is used as a threshold, and the data points whose distance exceeds the threshold are marked as abnormal values, and are excluded from the consideration range, and the samples abnormal on the X axis are screened out, and the abnormal samples whose predicted values on the Y axis deviate greatly from the standard value are screened out by the F statistic, and a scheme combining the T statistic and the F statistic degrees of freedom is adopted, which reduces the complexity while ensuring the accuracy and comprehensiveness of eliminating abnormal samples.
[0144] In some embodiments of the present invention, the step S36 includes:
[0145] Step S35, performing baseline correction on the near infrared spectra of a plurality of representative samples.
[0146] In some embodiments of the present invention, step S35 includes:
[0147] Smoothing the spectral matrices of multiple representative samples to obtain a smoothed matrix;
[0148] Performing derivative processing on the smoothing matrix to obtain a derivative matrix composed of derivative values, wherein the derivative processing is first-order derivative processing or high-order derivative processing, and preferably, the derivative processing is second-order derivative processing;
[0149] Wherein, in step S38, a derivative matrix consisting of derivative values of representative samples of the training set in the characteristic band is taken as input.
[0150] In some embodiments of the present invention, after step S34 and before step S36, the following steps are included:
[0151] Step S35, performing baseline correction on the near infrared spectra of the normal representative samples after the abnormal representative samples are removed.
[0152] In some embodiments of the present invention, step S35 includes:
[0153] Smoothing the spectral matrix of normal representative samples to obtain a smoothed matrix;
[0154] Performing derivative processing on the smoothing matrix to obtain a derivative matrix composed of derivative values, wherein the derivative processing is first-order derivative processing or high-order derivative processing, and preferably, the derivative processing is second-order derivative processing;
[0155] Wherein, in step S38, a derivative matrix consisting of derivative values of normal representative samples of the training set in the characteristic band is taken as input.
[0156] The present invention alleviates the phenomenon of sudden changes in response values at a certain wavelength caused by external factors such as environmental noise through smoothing processing, thereby achieving smoothing of the data. Second-order derivative processing is performed on the spectral data after smoothing. If the spectral image is represented by a function, the numerical remainder in the function formula can be eliminated by differentiation. The remainder can be reflected in the graph as an upward or downward shift. For this purpose, the use of the second-order derivative can eliminate the baseline offset. At the same time, the second-order derivative represents the curvature of the data, and the convexity and concavity information of the data curve can be obtained, thereby magnifying the convexity and concavity information in the curve that is not obvious itself.
[0157] Figure 3 FIG. 1 is a flow chart of a preferred embodiment of the method for training a detection model according to the present invention. Figure 3 As shown, the method for training the detection model includes:
[0158] Step S310, analyzing the spectral matrix of multiple representative samples and eliminating abnormal representative samples, includes:
[0159] Step S311, randomly select multiple representative samples from the representative sample set to form a first training set, obtain the mean spectral value at each wavelength of the spectral matrix of the first training set by formula (2), obtain the standard deviation of the spectral value at each wavelength of the spectral matrix of the first training set by formula (3), and standardize the spectral values of the spectral matrix by using the mean spectral value and the standard deviation of the spectral value at each wavelength of the spectral matrix of the first training set by formula (4) to obtain a standard spectral matrix LS′. LS is the spectral matrix of the first training set, I is the number of representative samples in the first training set, J is the number of wavelengths, ls IJ is the spectral value of the I-th representative sample at the J-th wavelength, wherein the spectral value is a spectral value such as reflectivity or absorptivity;
[0160] Step S312, obtaining the covariance matrix of the standard spectrum matrix by formula (5);
[0161] Step S313, perform eigendecomposition on the covariance matrix using formula (6) to obtain the eigenvalues and eigenvectors of each representative sample;
[0162] Step S314, selecting eigenvectors of a number corresponding to the number of dimensions to be achieved by dimensionality reduction in descending order of eigenvalues, to form a projection matrix;
[0163] Step S315, transforming the standard spectrum matrix into a reduced-dimensional spectrum matrix through the projection matrix according to formula (8);
[0164] Step S316, obtaining the Mahalanobis distance of the vector corresponding to each representative sample in the dimension-reduced spectrum matrix, and using the Mahalanobis distance as the T statistic, thereby obtaining a T statistic matrix;
[0165] Step S317, the first degree of freedom is K, the second degree of freedom is IK-1, the T statistic critical value is searched in the T distribution critical table according to the first degree of freedom and the second degree of freedom, and the representative samples corresponding to the T statistic whose difference with the T statistic critical value is greater than the first difference range are taken as abnormal representative samples, such as Figure 4 As shown, the horizontal axis is the T statistic, the critical value of the T statistic is 15.402, and among the 31 representative samples, representative sample 24 and representative sample 19 are abnormal representative samples;
[0166] Step S318, inputting the standard indicator matrix and the reduced dimension spectrum matrix of the first training set into the detection model for training, inputting the reduced dimension spectrum matrix of the first training set into the trained detection model, obtaining a prediction indicator matrix composed of the predicted values of the detection indicators of the first training set, obtaining a residual indicator matrix composed of the residuals of the standard values and predicted values of the detection indicators through the standard indicator matrix and the prediction indicator matrix of the first training set, and constructing an F statistic matrix of the residual indicator matrix through F statistics;
[0167] Step S319, the first degree of freedom is K, the second degree of freedom is IK-1, the second critical value is searched in the F test critical value table according to the first degree of freedom and the second degree of freedom, and the representative sample corresponding to the F statistic whose difference with the second critical value is greater than the second difference range is taken as the abnormal representative sample, such as Figure 4 As shown, the vertical axis is the F statistic, and the critical value of the F statistic is 0.00118;
[0168] Step S320, baseline correction is performed on the near infrared spectrum data of the plurality of normal representative samples after the abnormal representative samples are removed, to eliminate the spectrum baseline shift phenomenon caused by factors such as the instrument and the representative sample background, and to make the information difference between the representative samples more obvious, including:
[0169] Step S321, smoothing the normal representative sample spectrum matrix to obtain a smoothed matrix. The normal representative sample spectrum matrix after removing the abnormal representative samples is: z is the number of normal representative samples after the abnormal representative samples are eliminated; preferably, the smoothing process is SG smoothing process, and the original data is subjected to multiple convolution operations (the convolution operation applies one function to another function to generate a new function;
[0170] Step S322, performing derivative processing on the smoothing matrix, wherein the derivative processing is first-order derivative processing or high-order derivative processing, and the derivative spectrum matrix after the derivative processing is Preferably, the derivative processing is second-order derivative processing. If the spectral image is represented by a function, the numerical remainder in the function formula can be eliminated by taking the derivative. The remainder can be reflected in the graph as an upward or downward translation. For this purpose, the second-order derivative can eliminate the baseline offset. At the same time, the second-order derivative represents the curvature of the data, and the convexity and concavity information of the data curve can be obtained, thereby amplifying the convexity and concavity information in the curve that is not obvious itself;
[0171] Step S330, feature band selection: combining the standard value of the detection index with the near-infrared spectrum data of the representative sample, analyzing the spectral variation coefficient of each wavelength of the spectral matrix, randomly generating a noise matrix with the same dimension as the original spectral matrix, analyzing the noise variation coefficient of each wavelength in the noise matrix, and determining the wavelength positions that can be used to train the detection model by comparing the spectral variation coefficient with the noise variation coefficient, including:
[0172] Step S331, randomly select multiple representative samples from the derivative spectrum matrix after baseline correction to form a second training set. The derivative spectrum matrix of the second training set is O is the number of representative samples in the second training set. Representative samples are randomly selected multiple times to form multiple second training sets. The standard indicator matrix and derivative spectrum matrix of each second training set are input into the detection model for training. The mean of the training coefficient value at each wavelength of the regression coefficient of each training is obtained by formula (9). The standard deviation of the training coefficient value at each wavelength of the regression coefficient of each training is obtained by the following formula (10). The standard deviation can measure the degree of discreteness of the data. The larger the standard deviation, the greater the difference in the data.
[0173]
[0174] Among them, C is the total number of detection indicators; c is the detection indicator index, is the regression coefficient corresponding to the cth detection index at the jth wavelength in the dth training; is the mean value of the training coefficient at the jth wavelength of the dth training, is the mean square error of the training coefficient values at the jth wavelength of the dth training;
[0175] Step S332, according to the coefficient value mean at each wavelength of the regression coefficient of each training, the coefficient value mean at each wavelength is obtained by the following formula (11), according to the training coefficient value standard deviation at each wavelength of the regression coefficient of each training, the coefficient value mean square error at each wavelength is obtained by the following formula (12), and the spectral variation coefficient is obtained by the following formula (13):
[0176]
[0177] in, is the mean coefficient value at the jth wavelength after baseline correction, d is the training number index, is the standard deviation of the coefficient value at the jth wavelength after baseline correction, is the spectral variation coefficient at the jth wavelength, and the spectral variation coefficient matrix G is obtained CV ; D is the total number of training times;
[0178] Step S334, randomly generate a noise matrix US with the same dimension as the derivative spectrum matrix, and analyze the noise coefficient of variation CV of the noise matrix at each wavelength through the following equations (14)-(16): usj , obtain the noise variation coefficient matrix US CV :
[0179]
[0180] Among them, us ij is the noise value of the i-th representative sample at the j-th wavelength, μ usj is the mean noise value at the jth wavelength, i is the representative sample index, j is the wavelength index, σ usj is the standard deviation of the noise value at the jth wavelength, CV usj is the noise variation coefficient at the jth wavelength, and the noise variation coefficient matrix US is obtained CV ; Preferably, the coefficient of variation of the noise matrix and the coefficient of variation of the spectrum matrix are obtained in the same way; the noise matrix can be used to simulate the noise or random error of the data;
[0181] Step S335: combine the spectrum variation coefficient matrix and the noise variation coefficient matrix to obtain the noise spectrum variation matrix ME = [G CV US CV ], the noise matrix is placed behind the spectrum matrix, which is convenient for determining the threshold value according to the noise level. For example, a 218*1 matrix is concatenated with a 218*1 matrix to become a 436*1 matrix;
[0182] Step S336, selecting the wave number corresponding to the spectral coefficient of variation being greater than the noise coefficient of variation threshold to form a characteristic band; if the spectral coefficient of variation is greater than the noise coefficient of variation, it indicates that the wavelength position has a large variability and may contain information related to the target variable, which can be used to establish a detection model;
[0183] Step S340, dividing the representative samples after the characteristic bands are selected into a calibration set and a verification set, wherein the calibration set is used to establish the detection model, and the verification set is used to verify the measurement capability of the detection model, including:
[0184] Step S341', the spectral values of the normal representative samples in the characteristic band after spectral preprocessing constitute an input training matrix, the standard index matrix composed of the standard values of the detection indexes of the normal representative samples constitutes an output training matrix, and the output training matrix is reordered in the order of the standard values from large to small or from small to large, and the reordered output training matrix and its corresponding input training matrix constitute a third training set;
[0185] Step S342', cutting the third training set into a calibration set and a validation set. Preferably, an appropriate cutting point (6:1) is selected to divide the samples into two parts: a calibration set and a validation set. The selection of the cutting point can be based on some criteria, such as dividing according to the percentile of the standard value of the detection index, or selected according to specific needs and problem areas;
[0186] Step S343', assigning the samples before the cut point to the calibration set, and assigning the samples after the cut point to the validation set, ensuring that the samples in the calibration set and the validation set have similar distributions in terms of spectra and standard values, so as to ensure the generalization ability of the model under different data distributions;
[0187] Step S350, using the PLS method to establish a detection model and train the detection model, including:
[0188] Y=BX, where X is the input training matrix of the calibration set and also the independent variable matrix. Where N is the number of representative samples in the calibration set, M is the wave number of the characteristic band, and x NM is the spectral value of reflectance / absorbance etc. at the Mth wave number of the Nth representative sample; Y represents the output training matrix of the calibration set, which is also the dependent variable matrix. C is the number of detection indicators, y NC It is the standard value of the Cth detection index of the Nth representative sample.
[0189] Step S350 includes:
[0190] Step S351, perform principal component decomposition on the independent variable matrix X and the corresponding dependent variable matrix Y simultaneously:
[0191] X=T+E=∑t n p n +E
[0192] Y=UQ T +F=∑u n q n +F
[0193] Where n = 1,…,N; T∈R N×a , U∈R N×aare the score matrices of X and Y, covering a large amount of system essential information of the two; P∈R M×a , Q∈R C×a represents the load matrix of the two, a is the set dimension value (not exceeding N), E and F are the residual components remaining after projection;
[0194] Step S352, maximizing the covariance between the linear combination of process variables and quality variables by projection: maxt T u, including:
[0195] Step S3521, initialization, setting the score vector u to any column of Y;
[0196] Step S3522, perform linear regression calculation on each column of X and u to obtain its load vector: w = u T X / u T u;
[0197] Step S3523, in order to ensure the stability of calculation, the load vector w is normalized;
[0198] Step S3524, use the normalized w to calculate the score vector: t = Xw / w T w;
[0199] Step S3525, perform linear regression calculation on each column of Y and t to obtain its load vector: q = t T Y / t T t;
[0200] Step S3526, use q to calculate the new score vector of Y: y = Yq / q T q;
[0201] Step S3527, determine whether u converges, if converged, go to step S353, if not converged, return to step S3522, step S3522-step S3527, these steps iteratively calculate the score vector t and u, load vectors w, q, and update the load vector p and residual matrix E, F, until u converges. The convergence of u ensures a stable linear relationship between the independent variable X and the dependent variable Y;
[0202] Step S353, calculate the projection vector of X: p = t T X / t T t
[0203] Step S354, calculate the residual matrix of X: E = X-tp T ; Residual matrix of Y: F = Y-uq T ;
[0204] Step S355, compress the matrix, use E and F to replace the original samples X and Y to calculate the next set of latent variables, and combine the score variables of each group into score matrices U and T;
[0205] Step S356, repeat the above steps to gradually extract a group of latent variables;
[0206] Step S357, the final prediction model is:
[0207] R=X T U(T T XXU) -1
[0208] Y=XB=XX T U(T T XX T U) -1 Y T
[0209] Among them, w: weight vector of X, used to calculate score vector t; c: weight vector of Y, used to calculate score vector u; t: score vector of X, which is the one-dimensional representation obtained by projecting X onto weight vector w; u: score vector of Y, similarly, is the final representation obtained by projecting Y onto c; T: score vector t extracted in each iteration is used as a column of T, so that the columns of T represent the principal components or latent variables extracted from X; U: score vector u extracted in each iteration is used as a column of U. So that the columns of U represent the principal components or latent variables extracted from Y; p: load vector of X, representing the expression of t in the original variable X; q: load vector of Y, representing the expression of u in the original variable Y; E: residual matrix of X, representing the difference between X and its approximation reconstructed by t and p; F: residual matrix of Y, representing the difference between Y and its approximation reconstructed by u and q.
[0210] The PLS method of the present invention is to find the connection between the spectral data and the index value of the detection index to obtain the regression coefficient matrix. The measurement model established by the PLS method can obtain the detection value of the detection index through the information in the spectral matrix.
[0211] In order to reduce modeling costs, reduce model complexity, and improve detection efficiency in the process of measuring multiple physical and chemical properties of jet fuel, so as to quickly, conveniently, and efficiently obtain jet fuel quality data, thereby effectively guiding the production and use of jet fuel and avoiding accident risks caused by quality problems. The present invention establishes and screens multiple physical and chemical property detection models for jet fuel, selects a method with good prediction performance for multiple physical and chemical properties, and establishes a rapid detection model that can simultaneously measure multiple physical and chemical property indicators.
[0212] The present invention adopts the analysis of near-infrared spectral data of representative samples of jet fuel, removes abnormal representative samples, and makes the established model more stable and reliable. On this basis, the calculation of the Euclidean distance in the y vector direction (i.e., the standard value dimension direction) of different samples is added, and the distances in the x and y directions are combined through regularization to more comprehensively evaluate and divide the correction set and the verification set. The detection model established by the present invention using smooth derivatives and characteristic band selection shows high accuracy and stability when determining multiple physical and chemical properties, which can meet the rapid detection model of simultaneous determination of multiple indicators and can realize rapid detection of jet fuel quality.
[0213] In some embodiments of the present invention, step S321 includes:
[0214] The normal spectrum matrix is subjected to multiple convolution operations (the convolution operation applies one function to another function to generate a new function) to alleviate the phenomenon that the response value at a certain wavelength suddenly changes due to external factors such as environmental noise, and to achieve smoothing of the data. The principle formula is as follows:
[0215] Given a data set ls j =[ls 1j … ls zj ], j = 1, 2, ..., J, for each data point ls j A window is set, which consists of h adjacent data points, and the window size is s=2h+1, where h is the number of data points on one side of the window. To smooth the jth point, the data points in the window are fitted to the polynomial:
[0216] H(ls s )=a0+a1ls c +a2ls c 2 +…+a l ls s l
[0217] Wherein, l is the order of the polynomial (set according to actual conditions and set to 5 in the present invention, ls s is the relative position of the data point in the window, a0, a1, a2, ..., a l are the coefficients of the polynomial to be solved.
[0218] After finding the optimal coefficients, the data point ls at the center of the window j The smoothing value of Determined by the following equation:
[0219]
[0220] Use the above method to traverse all data points and get a smoothed data set
[0221]
[0222] In some embodiments of the present invention, the step of performing derivative processing on the smoothing matrix includes:
[0223] For the dataset Perform a second-order derivative operation to obtain the derivative matrix G.
[0224] Figure 5 FIG. 1 is a schematic diagram of a block diagram of an embodiment of the jet fuel multi-index detection system of the present invention. Figure 5 As shown, the jet fuel multi-index detection system includes:
[0225] The model building module 100 builds a detection model using formula (1):
[0226] Y=XB(1)
[0227] Wherein, X is the input matrix of the detection model, and the spectral matrix composed of the spectral values of the near-infrared spectrum is used as the input matrix; Y is the output matrix of the detection model, and the index matrix composed of the index values of multiple detection indexes of the spray paint fuel is used as the output matrix, and the multiple detection indexes include initial distillation point, 10% distillation range, 20% distillation range, 50% distillation range, 90% distillation range, final distillation point, 20°C density, 20°C viscosity, -20°C viscosity, freezing point and flash point; B is a coefficient matrix;
[0228] A training module 200, wherein the training module is configured to train a detection model constructed by a model construction module;
[0229] A spectrum acquisition module 300, wherein the spectrum acquisition module is configured to acquire a near infrared spectrum of the jet fuel to be tested, thereby obtaining a spectrum matrix of the jet fuel to be tested;
[0230] A detection result acquisition module 400, wherein the detection result acquisition module is configured to input the spectrum matrix collected by the spectrum acquisition module into the detection model trained by the training module to obtain an index matrix of the jet fuel, thereby obtaining index values of multiple detection indexes of the jet fuel;
[0231] The training module 200 includes:
[0232] A representative sample selection submodule 210 selects a representative sample corresponding to the jet fuel to be tested;
[0233] The standard value acquisition submodule 220 acquires the standard values of the detection indicators of multiple representative samples obtained by the representative sample selection submodule through the standard method to form a standard indicator matrix;
[0234] The representative sample spectrum acquisition submodule 230 acquires the near infrared spectrum of each representative sample obtained by the representative sample selection submodule, thereby obtaining a spectrum matrix composed of spectrum values of the near infrared spectra of multiple representative samples;
[0235] The characteristic band selection submodule 260 determines one or more characteristic bands for training through the spectrum matrix of multiple representative samples collected by the representative sample spectrum collection submodule and the standard index matrix collected by the standard value collection submodule;
[0236] A training set construction submodule 270 is used to construct a training set, wherein the training set includes a spectral matrix composed of spectral values of representative samples in characteristic bands and a standard index matrix composed of index values of detection indexes of representative samples;
[0237] The training submodule 290 takes the spectral matrix of the training set constructed by the training set construction submodule as input and the standard indicator matrix of the training set as output to train the detection model;
[0238] The characteristic band selection submodule 260 includes:
[0239] A representative sample set construction unit 261 is used to construct a representative sample set, wherein the representative sample set includes a spectrum matrix and a standard index matrix of a plurality of representative samples;
[0240] The training unit 262 randomly selects multiple representative samples from the representative sample set of the representative sample set construction unit multiple times or once to form multiple characteristic band training sets, and sequentially inputs them into the detection model to obtain a coefficient matrix for each training;
[0241] The spectrum variation analysis unit 263 uses the variation coefficient corresponding to each wavelength of the coefficient matrix trained multiple times by the training unit as the spectrum variation coefficient to form a spectrum variation coefficient matrix;
[0242] The noise variation analysis unit 264 randomly generates a noise matrix of the same dimension as the spectral matrix of the characteristic band training set, and the coefficient of variation corresponding to each wavelength of the noise matrix is used as the noise variation coefficient to form a noise variation coefficient matrix;
[0243] The characteristic band analysis unit 265 compares the spectrum variation coefficient matrix and the noise variation coefficient matrix, selects wavelengths whose spectrum variation coefficient is greater than the noise variation coefficient, and obtains one or more characteristic bands.
[0244] In some embodiments of the present invention, the jet fuel multi-index detection system may further include one or more of the following modules:
[0245] The abnormal elimination submodule 240 analyzes the spectrum matrix of multiple representative samples and eliminates abnormal representative samples;
[0246] A baseline correction submodule 250 performs baseline correction on the near infrared spectrum data of a plurality of representative samples;
[0247] The training set division submodule 280 divides the representative samples after the characteristic bands are selected into a calibration set and a validation set.
[0248] The above-mentioned jet fuel multi-index detection methods of the present invention can be applied to the electronic device 1. Figure 6 FIG. 1 is a schematic diagram of the application environment of a preferred embodiment of the jet fuel multi-index detection method of the present invention.
[0249] In this embodiment, the electronic device 1 may be a terminal device with computing functions, such as a server, a smart phone, a tablet computer, a portable computer, or a desktop computer.
[0250] The electronic device 1 includes: a processor 12 and a memory 11 , and may also include a network interface 13 , a communication bus 14 and the like.
[0251] The memory 11 includes at least one type of readable storage medium. The at least one type of readable storage medium may be a non-volatile storage medium such as a flash memory, a hard disk, a multimedia card, a card-type memory, etc. In some embodiments, the readable storage medium may be an internal storage unit of the electronic device 1, such as a hard disk of the electronic device 1. In other embodiments, the readable storage medium may also be an external memory of the electronic device 1, such as a plug-in hard disk equipped on the electronic device 1, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc.
[0252] In this embodiment, the readable storage medium of the memory 11 is generally used to store the jet fuel multi-index detection program 10, representative samples and representative sample data sets installed in the electronic device 1. The memory 11 can also be used to temporarily store data that has been output or is to be output.
[0253] In some embodiments, the processor 12 may be a central processing unit (CPU), a microprocessor or other data processing chip, which is used to run program codes or process data stored in the memory 11, such as executing the jet fuel multi-index detection program 10.
[0254] The network interface 13 may optionally include a standard wired interface, a wireless interface (such as a WI-FI interface), and is generally used to establish a communication connection between the electronic device 1 and other electronic devices.
[0255] The communication bus 14 is used to realize the connection and communication between these components.
[0256] Figure 6 The electronic device 1 is shown only with components 11 - 14 , but it should be understood that implementation of all of the components shown is not required, and more or fewer components may alternatively be implemented.
[0257] Optionally, the electronic device 1 may further include a user interface, which may include an input unit such as a keyboard, a voice input device such as a microphone and other devices with voice recognition function, a voice output device such as a speaker, headphones, etc. Optionally, the user interface may also include a standard wired interface or a wireless interface.
[0258] Optionally, the electronic device 1 may further include a display, which may also be referred to as a display screen or a display unit. In some embodiments, it may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an organic light-emitting diode (OLED) touch device. The display is used to display information processed in the electronic device 1 and to display a visual user interface.
[0259] Optionally, the electronic device 1 further includes a touch sensor. The area provided by the touch sensor for the user to perform a touch operation is called a touch control area. In addition, the touch sensor described here may be a resistive touch sensor, a capacitive touch sensor, etc. Moreover, the touch sensor includes not only a contact touch sensor, but also a proximity touch sensor, etc. In addition, the touch sensor may be a single sensor or a plurality of sensors arranged in an array, for example.
[0260] In addition, the area of the display of the electronic device 1 can be the same as or different from the area of the touch sensor. Optionally, the display and the touch sensor are stacked to form a touch display screen. The device detects touch operations triggered by the user based on the touch display screen.
[0261] Optionally, the electronic device 1 may further include a radio frequency (RF) circuit, a sensor, an audio circuit, etc., which will not be described in detail here.
[0262] In addition, an embodiment of the present invention also provides a computer-readable storage medium, which includes a jet fuel multi-indicator detection program. When the jet fuel multi-indicator detection program is executed by a processor, the steps of the jet fuel multi-indicator detection method of the above-mentioned embodiments are implemented.
[0263] The specific implementation of the computer-readable storage medium of the present invention is substantially the same as the specific implementation of the jet fuel multi-index detection method and electronic device described above, and will not be described in detail herein.
[0264] In order to verify the beneficial effects of the present invention, the following specific examples were carried out:
[0265] The jet fuel multi-index detection method of this embodiment includes:
[0266] 31 representative samples of 3# jet fuel were selected to form a representative sample set;
[0267] The standard values of 11 test indicators of the representative sample set were tested using the standard method specified in GB 6537-2018 No. 3 Jet Fuel. The 11 test indicators are: initial distillation point, 10% distillation range, 20% distillation range, 50% distillation range, 90% distillation range, final distillation point, 20℃ density, 20℃ viscosity, -20℃ viscosity, flash point and freezing point;
[0268] By combining T statistics and F statistics, we can eliminate abnormal representative samples, such as Figure 4 As shown, the abnormal representative samples are representative sample 24 and representative sample 1;
[0269] The spectral data of normal representative samples were preprocessed by SG second-order derivative;
[0270] The characteristic bands are selected by the derivative spectrum matrix after spectral preprocessing of normal representative samples and the standard values of 11 detection indicators, such as Figure 2 As shown, the black dots on both sides of the noise threshold horizontal line are the selected characteristic wavelengths;
[0271] The normal representative samples are divided into a calibration set and a validation set, and the freezing point is used as an example for explanation, as shown in Table 1 below:
[0272] Table 1
[0273]
[0274] The representative samples 4, 16, 22 and 25 were used as validation sets; the other representative samples were used as calibration sets;
[0275] The detection model established by the PLS method is trained using the calibration set;
[0276] The trained detection model is validated by inputting the validation set, including:
[0277] The spectrometer was preheated for 30 minutes, and the wavelength resolution of 12 nm and the wavelength range of 800 nm to 1700 nm were set for spectrum acquisition. The detection was carried out with air as the background, and each representative sample of the validation set was scanned 7 times, and the average value was taken as the spectrum scan result of the time. In order to reduce the influence of factors such as instrument status and environment, each representative sample was tested 5 times, and the average value was taken as the input spectrum variable of the test model. The test results are shown in Tables 2 and 3. The reproducibility of each physical and chemical property index (detection index) comes from each standard method. The detection value is obtained using the jet fuel multi-index detection method of the present invention. The difference between the standard value and the measured value is the error, and the accuracy of the model measurement is measured by the size of the error value.
[0278] Table 2
[0279]
[0280] Table 3
[0281]
[0282]
[0283] It can be seen from Tables 2 and 3 that the errors of the test results of the representative samples of the four validation sets are all within the reproducibility range required by the national standard method, indicating that the jet fuel multi-index detection method of the present invention has accurate measurement performance for 11 indicators of jet fuel and can meet the needs of rapid on-site detection of No. 3 jet fuel. The detection method of the present invention can accurately and reliably complete the rapid simultaneous determination of 11 physical and chemical properties of No. 3 jet fuel, and in actual application, the determination results of the 11 physical and chemical properties of No. 3 jet fuel by the present invention have high accuracy and reliability.
[0284] The model calibration set determination coefficient is used in the process of detection model establishment. Validation set determination coefficient The root mean square error of prediction (RMSEP) and the root mean square error of correction (RMSEC) were used to evaluate the performance of the established detection model, and the residual prediction ratio (RPD) was used to evaluate the prediction accuracy of the detection model. 2 The larger RMSEC value and RMSEP value indicate that the model has a strong predictive ability, while the larger RPD value can reflect the reliability of the model. A reliable model can accurately measure new unknown samples. The results of measuring 11 physical and chemical properties of the jet fuel using the model established by the multi-index detection method of the jet fuel of the present invention are shown in Table 4, and the results of the jet fuel detection using the PLS model established by the full wavelength spectrum are shown in Table 5:
[0285] Table 4
[0286]
[0287]
[0288] Table 5
[0289]
[0290] As shown in Table 4, the calibration set of the detection method of the present invention The values and RMSEC values were in the range of 0.9102-0.9763 and 0.0156-0.8468, respectively. The values and RMSEP values are in the range of 0.8239-0.9557 and 0.3846-1.1354, respectively, and the RPD value range is 1.8229-2.9849; relative to Table 5, the present invention Value and The values were increased by 2.10% to 82.17% and 2.40% to 91.65%, respectively, and the RMSEC value and RMSEP value were reduced by 32.30% to 99.14% and 15.01% to 88.64%, respectively. Therefore, the jet fuel multi-index detection method of the present invention can reduce the interference of external factors on the spectral quality and effectively improve the accuracy and reliability of the jet fuel multi-index determination.
[0291] In this embodiment, abnormal samples are eliminated, spectral data after the abnormal samples are eliminated are smoothed and preprocessed by second-order majority using SG second-order derivative, characteristic bands are selected, and a calibration set and a verification set are constructed. The detection model established by the PLS method is trained by the calibration set, and the above detection model is evaluated by the verification set. The results are shown in Table 4; in the comparative example, abnormal samples are not eliminated, spectral data after the abnormal samples are eliminated are smoothed and preprocessed by second-order majority using SG second-order derivative, and characteristic bands are not selected. The spectral data of the samples are directly used to construct a calibration set and a verification set with a cut point of 6:1. The detection model established by the PLS method is trained by the calibration set, and the above detection model is evaluated by the verification set. The results are shown in Table 5; By comparing Table 4 and Table 5, it can be obviously seen that the accuracy and reliability of the detection method of the present invention are much higher than those of the comparative example.
[0292] In order to reduce the modeling cost, reduce the model complexity, and improve the detection efficiency in the process of measuring multiple physical and chemical properties of 3# jet fuel, so as to quickly, conveniently and efficiently obtain the quality data of 3# jet fuel. Thereby effectively guiding the production and use of 3# jet fuel and avoiding the risk of accidents caused by quality problems. The present invention establishes and screens a model for measuring multiple physical and chemical properties of 3# jet fuel, selects a method with good prediction performance for multiple physical and chemical properties, and establishes a rapid detection model that can simultaneously measure multiple physical and chemical property indicators.
[0293] The present invention analyzes the near infrared spectrum data of the 3# jet fuel sample, removes abnormal samples, and makes the established model more stable and reliable. The calculation of the Euclidean distance in the y vector direction (i.e., the detection index table follows the dimension direction) of different samples is added, and the distances in the x and y directions are combined through regularization to more comprehensively evaluate and divide the data set. The present invention uses the model established by combining the SG second-order derivative with the selected characteristic band to determine 11 physical and chemical properties, which shows high accuracy and stability.
[0294] This application comprehensively considers 11 indicators of jet fuel, and uses a set of fixed preprocessing methods and feature selection methods to meet the rapid detection model of simultaneous determination of multiple indicators, which can realize rapid detection of jet fuel quality.
[0295] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, device, article or method including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, device, article or method. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the existence of other identical elements in the process, device, article or method including the element.
[0296] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages and disadvantages of the embodiments. Through the description of the above implementation modes, those skilled in the art can clearly understand that the above embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course, by hardware, but in many cases the former is a better implementation mode. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a number of instructions for enabling a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0297] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A jet fuel multi-index detection method, characterized in that: include: Constructing a detection model: Constructing a detection model through the following formula (1): Y=XB(1) Wherein, X is the input matrix of the detection model, and the spectral matrix composed of the spectral values of the near-infrared spectrum is used as the input matrix; Y is the output matrix of the detection model, and the index matrix composed of the index values of multiple detection indexes of the spray paint fuel is used as the output matrix, and the multiple detection indexes include initial distillation point, 10% distillation range, 20% distillation range, 50% distillation range, 90% distillation range, final distillation point, 20°C density, 20°C viscosity, -20°C viscosity, freezing point and flash point; B is a coefficient matrix; Obtaining a near infrared spectrum of the jet fuel to be tested, thereby obtaining a spectrum matrix of the jet fuel to be tested; Train the detection model to obtain the coefficient matrix; Inputting the spectrum matrix of the jet fuel to be tested into the trained detection model to obtain the index matrix of the jet fuel, thereby obtaining the index values of multiple detection indexes of the jet fuel; The step of training the detection model includes: Select a representative sample of the jet fuel to be tested; Measuring a plurality of representative samples by a standard method, obtaining standard values of a plurality of detection indicators of the plurality of representative samples, and forming a standard indicator matrix; Obtaining a near infrared spectrum of each representative sample, thereby obtaining a spectrum matrix consisting of spectrum values of near infrared spectra of a plurality of representative samples; One or more characteristic bands for training are determined through spectral matrices of multiple representative samples and a standard indicator matrix; Constructing a training set, wherein the training set includes a spectral matrix composed of spectral values of representative samples in characteristic bands and a standard index matrix composed of index values of detection indexes of representative samples; Train the detection model through the training set; The step of determining one or more characteristic bands for training through the spectral matrix of multiple representative samples and the standard indicator matrix includes: Constructing a representative sample set, wherein the representative sample set includes a spectral matrix and a standard indicator matrix of a plurality of representative samples; Multiple representative samples are randomly selected from the representative sample set multiple times or once to form multiple characteristic band training sets, and are sequentially input into the detection model to obtain a coefficient matrix for each training; The coefficient of variation corresponding to each wavelength of the coefficient matrix trained multiple times is used as the spectral coefficient of variation to form a spectral coefficient of variation matrix; A noise matrix with the same dimension as the spectral matrix of the characteristic band training set is randomly generated, and the coefficient of variation corresponding to each wavelength of the noise matrix is used as the noise coefficient of variation to form a noise coefficient of variation matrix; The spectrum variation coefficient matrix and the noise variation coefficient matrix are compared to screen out wavelengths whose spectrum variation coefficient is greater than the noise variation coefficient to obtain one or more characteristic bands.
2. The jet fuel multi-index detection method according to claim 1, characterized in that: The step of comparing the spectrum variation coefficient matrix and the noise variation coefficient matrix comprises: The spectrum variation coefficient matrix and the noise variation coefficient matrix are concatenated in the same dimension, and the noise variation coefficient threshold is obtained through the noise variation coefficient; The wavenumbers corresponding to the spectral coefficient of variation being greater than the threshold value of the noise coefficient of variation are selected to form the characteristic bands.
3. The jet fuel multi-index detection method according to claim 1, characterized in that: The step of determining one or more characteristic bands for training through the spectral matrix of a plurality of representative samples and the standard indicator matrix includes: Analyze the spectral matrix of multiple representative samples and eliminate abnormal representative samples.
4. The jet fuel multi-index detection method according to claim 3, characterized in that: The step of analyzing the near-spectral matrix of multiple representative samples and removing abnormal representative samples comprises: Randomly select multiple representative samples from the representative sample set to form a first training set; The mean spectral value at each wavelength of the spectral matrix of the first training set is obtained by formula (2), the standard deviation of the spectral value at each wavelength of the spectral matrix of the first training set is obtained by formula (3), and the spectral values of the spectral matrix are standardized by formula (4) using the mean spectral value and the standard deviation of the spectral value at each wavelength of the spectral matrix of the first training set to obtain the standard spectral matrix Among them, μ lsj is the mean spectral value at the jth wavelength, i is the representative sample index, j is the wavelength index, σ lsj is the standard deviation of the spectral value at the jth wavelength, ls ij is the spectrum value of the i-th representative sample at the j-th wavelength, ls′ ij is the standard spectrum value of the i-th representative sample at the j-th wavelength after standardization, LS′ is the standard spectrum matrix, LS′=[ls′ ij ] I×J , I is the total number of representative samples, J is the total number of wavelengths; The covariance matrix of the standard spectral matrix is obtained by formula (5): The covariance matrix is decomposed by formula (6) to obtain the eigenvalues and eigenvectors of each representative sample: ∑CM=V*DM (6) Where DM is a diagonal matrix containing the eigenvalues of the covariance matrix, V is the characteristic matrix, and the columns of v are the corresponding eigenvectors; Select the eigenvectors corresponding to the number of dimensions to be achieved by dimensionality reduction in descending order of eigenvalues to form a projection matrix: PM=[v1,v2,…,v K ] (7) Among them, PM is the projection matrix, K is the number of dimensions to be achieved by dimensionality reduction; The standard spectral matrix is transformed into a reduced-dimensional spectral matrix through the projection matrix using formula (8): DR=LS′*PM (8) Among them, DR is the dimension-reduced spectrum matrix, DR = [dr ik ] I×K ; Obtaining the Mahalanobis distance of the vector corresponding to each representative sample in the dimension-reduced spectrum matrix, and using the Mahalanobis distance as the T statistic, thereby obtaining a T statistic matrix; The first degree of freedom is K, the second degree of freedom is IK-1, the critical value of the T statistic is searched in the T distribution critical table according to the first degree of freedom and the second degree of freedom, and the representative sample corresponding to the T statistic whose difference with the critical value of the T statistic is greater than the first difference range is taken as the abnormal representative sample; Input the standard indicator matrix and the reduced-dimensional spectrum matrix of the first training set into the detection model for training, input the reduced-dimensional spectrum matrix of the first training set into the trained detection model, obtain the prediction indicator matrix composed of the predicted values of the detection indicators of the first training set, obtain the residual indicator matrix composed of the residuals of the standard values and predicted values of the detection indicators through the standard indicator matrix and the prediction indicator matrix of the first training set, and construct the F statistic matrix of the residual indicator matrix through the F statistic; The first degree of freedom is K, the second degree of freedom is IK-1, and the second critical value is searched in the F test critical value table according to the first degree of freedom and the second degree of freedom. The representative sample corresponding to the F statistic whose difference with the second critical value is greater than the second difference range is taken as the abnormal representative sample.
5. The jet fuel multi-index detection method according to claim 3, characterized in that: After the step of analyzing the near-spectral matrices of the plurality of representative samples and removing abnormal representative samples and before the step of determining one or more characteristic bands for training through the spectral matrices of the plurality of representative samples and the standard indicator matrix, the method includes: The near-infrared spectra of normal representative samples after excluding abnormal representative samples were baseline corrected.
6. The jet fuel multi-index detection method according to claim 5, characterized in that: The step of performing baseline correction on the near infrared spectrum of the normal representative sample after removing the abnormal representative sample comprises: Smoothing the spectral matrix of normal representative samples to obtain a smoothed matrix; Performing derivative processing on the smoothing matrix to obtain a derivative matrix composed of derivative values, wherein the derivative processing is first-order derivative processing or high-order derivative processing; Among them, in the step of constructing the training set: The training set includes a derivative matrix composed of derivative values of normal representative samples in characteristic bands and a standard index matrix composed of index values of detection indexes of normal representative samples.
7. The jet fuel multi-index detection method according to claim 1, characterized in that: The step of determining one or more characteristic bands for training through the spectral matrix of a plurality of representative samples and the standard indicator matrix includes: The NIR spectra of several representative samples were baseline corrected.
8. The jet fuel multi-index detection method according to claim 7, characterized in that: The step of performing baseline correction on the near infrared spectra of a plurality of representative samples comprises: Smoothing the spectral matrices of multiple representative samples to obtain a smoothed matrix; Performing derivative processing on the smoothing matrix to obtain a derivative matrix composed of derivative values, wherein the derivative processing is first-order derivative processing or high-order derivative processing; Among them, in the step of constructing the training set: The training set includes a derivative matrix composed of derivative values of representative samples in characteristic bands and a standard index matrix composed of index values of detection indexes of representative samples.
9. The jet fuel multi-index detection method according to any one of claims 6 or 8, characterized in that: The derivative processing is a second-order derivative processing.
10. The jet fuel multi-index detection method according to claim 1, characterized in that: In the step of constructing the detection model: the detection model is constructed by using the PLS method.
11. A jet fuel multi-index detection system, characterized in that: include: The model building module constructs a detection model by the following formula (1): Y=XB(1) Wherein, X is the input matrix of the detection model, and the spectral matrix composed of the spectral values of the near-infrared spectrum is used as the input matrix; Y is the output matrix of the detection model, and the index matrix composed of the index values of multiple detection indexes of the spray paint fuel is used as the output matrix, and the multiple detection indexes include initial distillation point, 10% distillation range, 20% distillation range, 50% distillation range, 90% distillation range, final distillation point, 20°C density, 20°C viscosity, -20°C viscosity, freezing point and flash point; B is a coefficient matrix; A training module, wherein the training module is configured to train a detection model constructed by a model construction module; A spectrum acquisition module, wherein the spectrum acquisition module is configured to acquire a near infrared spectrum of the jet fuel to be tested, thereby obtaining a spectrum matrix of the jet fuel to be tested; A detection result acquisition module, wherein the detection result acquisition module is configured to input the spectrum matrix collected by the spectrum acquisition module into the detection model trained by the training module to obtain an index matrix of the jet fuel, thereby obtaining index values of multiple detection indexes of the jet fuel; The training modules include: A representative sample selection submodule selects representative samples corresponding to the jet fuel to be tested; A standard value collection submodule collects standard values of detection indicators of multiple representative samples obtained by a representative sample selection submodule measured by a standard method to form a standard indicator matrix; A representative sample spectrum acquisition submodule is used to acquire the near-infrared spectrum of each representative sample obtained by the representative sample selection submodule, thereby obtaining a spectrum matrix composed of spectrum values of the near-infrared spectra of multiple representative samples; The characteristic band selection submodule determines one or more characteristic bands for training through the spectrum matrix of multiple representative samples collected by the representative sample spectrum collection submodule and the standard indicator matrix collected by the standard value collection submodule; A training set construction submodule is used to construct a training set, wherein the training set includes a spectral matrix composed of spectral values of representative samples in characteristic bands and a standard index matrix composed of index values of detection indexes of representative samples; The training submodule takes the spectral matrix of the training set constructed by the training set construction submodule as input and the standard indicator matrix of the training set as output to train the detection model; Wherein, the characteristic band selection submodule includes: A representative sample set construction unit is used to construct a representative sample set, wherein the representative sample set includes a spectral matrix and a standard index matrix of a plurality of representative samples; The training unit randomly selects multiple representative samples from the representative sample set of the representative sample set construction unit multiple times or once to form multiple characteristic band training sets, and sequentially inputs them into the detection model to obtain a coefficient matrix for each training; The spectral variation analysis unit uses the variation coefficient corresponding to each wavelength of the coefficient matrix trained multiple times by the training unit as the spectral variation coefficient to form a spectral variation coefficient matrix; The noise variation analysis unit randomly generates a noise matrix with the same dimension as the spectral matrix of the characteristic band training set, and the coefficient of variation corresponding to each wavelength of the noise matrix is used as the noise variation coefficient to form a noise variation coefficient matrix; The characteristic band analysis unit compares the spectrum variation coefficient matrix and the noise variation coefficient matrix, selects the wavelengths whose spectrum variation coefficient is greater than the noise variation coefficient, and obtains one or more characteristic bands.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a jet fuel multi-index detection program. When the jet fuel multi-index detection program is executed by a processor, the steps of the jet fuel multi-index detection method according to any one of claims 1 to 10 are implemented.
13. An electronic device, characterized in that: The method comprises a memory and a processor, wherein the memory comprises a jet fuel multi-index detection program, and when the jet fuel multi-index detection program is executed by the processor, the steps of the jet fuel multi-index detection method according to any one of claims 1 to 10 are implemented.
Citation Information
Patent Citations
Adaptive fast prediction method for crude oil properties based on near infrared spectrum
CN109324014A
Urea detection and analysis method and device based on near-infrared modeling
CN113740293A