Method and apparatus for detecting oil admixture
By employing near-infrared-mid-infrared fusion spectroscopy and a discriminant analysis model, the problem of difficult monitoring of the blending of aviation kerosene and diesel fuel has been solved, achieving high-precision detection of oil blending and simplifying the aviation kerosene refining process.
Patent Information
- Application Number
- CN202111233116.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-22
- Publication Date
- 2026-01-02
- Estimated Expiration
- 2041-10-22
AI Technical Summary
Existing technologies are insufficient to effectively distinguish and monitor the blending of aviation kerosene and diesel, leading to increased difficulty and cost in subsequent refining processes.
By employing near-infrared-mid-infrared fusion spectroscopy and combining it with a discriminant analysis model, the absorbance of the near-infrared-mid-infrared fusion spectral characteristic region and the mid-infrared characteristic spectral region of the oil are obtained. Then, using a discriminant analysis model with both linear and nonlinear decision-making capabilities, the oil category is determined.
It achieves high-precision identification of oil adulteration, simplifies the monitoring process, and improves the reliability and accuracy of detection.
Smart Images

Figure CN116067905B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of detection, in particular to a method and device for detecting oil blending. BACKGROUND
[0002] Aviation kerosene is a special fuel for jet engine aircraft. Due to the particularity of the working environment, the performance requirements are very strict, for example, good low-temperature fluidity, large net calorific value and density, fast combustion speed and complete combustion, good stability, etc. These properties are largely dependent on the chemical composition of aviation kerosene, and the chemical composition will differ due to different raw materials and production processes, thereby affecting certain properties of aviation kerosene. At present, aviation kerosene is mainly obtained by conventional petroleum refining process, and its yield accounts for more than 80% of the total yield. Aviation kerosene refining technology is to separate compounds of different boiling points by distillation, condensation and collection, so as to obtain liquefied gas, naphtha, gasoline, kerosene, diesel, lubricating oil, fuel oil and residue oil and other fractions. However, since the boiling range of kerosene (180-310℃) and the boiling range of diesel (180-370℃, light diesel) overlap, when cutting the required aviation kerosene fraction, diesel fraction is easily cut into aviation kerosene fraction, making the subsequent aviation kerosene refining process more difficult and the cost increasing. In order to facilitate the smooth progress of the subsequent process of aviation kerosene and maximize the quality of the finished aviation kerosene, it is necessary to monitor the cutting process of aviation kerosene. The monitoring of the process first needs to seek a method that can distinguish between pure aviation kerosene fraction and aviation kerosene into which diesel fraction is cut. SUMMARY
[0003] The purpose of the embodiments of the present application is to provide a method and device for detecting oil blending.
[0004] In order to achieve the above-mentioned purpose, the first aspect of the present application provides a method for detecting oil blending, comprising: acquiring a near-infrared-mid-infrared fusion spectrum composed of a near-infrared spectrum and a mid-infrared spectrum of a to-be-detected oil sample; acquiring near-infrared characteristic spectral region absorbance and mid-infrared characteristic spectral region absorbance of the near-infrared-mid-infrared fusion spectrum; and determining the category of the to-be-detected oil sample according to the near-infrared characteristic spectral region absorbance and the mid-infrared characteristic spectral region absorbance of the near-infrared-mid-infrared fusion spectrum and a pre-established discriminant analysis model, wherein the discriminant analysis model is generated according to the near-infrared-mid-infrared fusion spectrum, the blending ratio, the near-infrared characteristic spectral region absorbance and the mid-infrared characteristic spectral region absorbance of a plurality of samples of a first oil and a second oil.
[0005] In the embodiments of the present application, the discriminant analysis model is generated according to the following operations:
[0006] obtaining a plurality of samples of the first oil and the second oil;
[0007] obtaining a mid-infrared spectrum and a near-infrared spectrum of each sample in the plurality of samples, and splicing the mid-infrared spectrum and the near-infrared spectrum to obtain a near-infrared-mid-infrared fusion spectrum of the sample;
[0008] obtaining a first near-infrared-mid-infrared fusion spectrum according to formula ①,
[0009] m = xd + (1-x)j ①
[0010] wherein m represents a first near-infrared-mid-infrared spectrum synthesized from a near-infrared-mid-infrared fusion spectrum of the first oil and a near-infrared-mid-infrared fusion spectrum of the second oil, d is the near-infrared-mid-infrared fusion spectrum of the first oil, j is the near-infrared-mid-infrared fusion spectrum of the second oil, x is a blending ratio of the near-infrared-mid-infrared fusion spectrum of the first oil, and 0≤x<1,
[0011] using the first near-infrared-mid-infrared fusion spectrum to generate a library sample spectrum, and setting a corresponding category label value according to the blending ratio of the near-infrared-mid-infrared fusion spectrum of the first oil, for example, setting the category label of the first near-infrared-mid-infrared fusion spectrum synthesized when 0<x<1 as 1, and setting the category label of the first near-infrared-mid-infrared fusion spectrum when x=0 as 3; and
[0012] obtaining near-infrared characteristic spectral region absorbance and mid-infrared characteristic spectral region absorbance of each library sample spectrum, combining the corresponding category label value, and constructing a discriminant analysis model with linear-nonlinear decision-making ability.
[0013] In the embodiments of the present application, in the discriminant analysis model with linear-nonlinear decision-making ability, the linear decision-making ability is provided by the partial least squares method, and the nonlinear method is provided by the extreme learning machine method. The specific steps of integrating the two methods are as follows:
[0014] establishing a partial least squares discriminant analysis model as the linear decision-making part;
[0015] establishing a plurality of extreme learning machine individual (base) learners as the nonlinear decision-making part;
[0016] assigning corresponding weights to the linear decision-making part and the nonlinear decision-making part, respectively denoted as w1 and w2 (0≤w1≤1, 0≤w2≤1, and w1+w2=1, wherein w1 taking 0 indicates that the method only contains the nonlinear decision-making part, and w2 taking 0 indicates that the method only contains the linear decision-making part);
[0017] The final classification decision is made by voting, i.e., multiplying the classification votes obtained by the linear decision part and the nonlinear decision part by the corresponding weights (i.e., w1 and w2), summing the weighted votes of each class, and taking the class corresponding to the maximum value as the final class.
[0018] In the embodiment of the present application, the class label value of the to-be-tested oil sample is calculated according to the following formula, and compared with a threshold (for example, the class label value threshold is 2 in the partial least squares discriminant analysis of the linear decision part) to determine the class of the to-be-tested oil sample as the classification vote of the linear decision part:
[0019] y un = b PLS x un ,
[0020] wherein x un is the near-infrared characteristic spectral region absorbance and the mid-infrared characteristic spectral region absorbance of the to-be-tested oil sample, b PLS = w f T (p f w f T ) -1 q f , b PLS is the regression coefficient of the partial least squares (PLS) algorithm, f is the optimal principal factor number of the partial least squares determined by the cross-validation method, w f is the weight vector of the absorbance matrix of the sample spectrum used by the established discriminant analysis model under f principal components, p f is the load of the absorbance matrix of the sample spectrum used by the established discriminant analysis model under f principal components, and q f is the load of the class label matrix corresponding to the sample spectrum used by the established discriminant analysis model under f principal components.
[0021] In the embodiment of the present application, the class label value of the to-be-tested oil sample is calculated according to the following formula to serve as the classification vote of the nonlinear decision part:
[0022]
[0023] wherein x un is the near-infrared characteristic spectral region absorbance and the mid-infrared characteristic spectral region absorbance of the to-be-tested oil sample, L is the number of hidden layer nodes, w p is the weight of the pth hidden layer node and the input layer node, β p is the weight vector of the pth hidden layer node and the output layer node, b p is the threshold value of the pth hidden layer node, and g(·) is the activation function.
[0024] In the embodiment of the present application, the wave number range of the near-infrared characteristic spectral region is 4366-4752 cm -1 , and the wave number range of the mid-infrared characteristic spectral region is 1541-1662 cm -1 .
[0025] In the embodiment of the present application, the oil sample to be measured is an actual oil sample or an oil sample configured by formula ②,
[0026] m = cd + (1-c)j ③
[0027] In formula ②, m represents a sample obtained by mixing the first oil sample with the second oil sample, d is the first oil sample, j is the second oil sample, and c is the volume ratio of the first oil sample, wherein the value range of c is 0≤c≤x max <1, and when c is 0, m represents a pure second oil sample, wherein the x max is the maximum blending ratio of the first oil.
[0028] In the embodiment of the present application, the method further comprises: performing first-order differential processing on the near-infrared-mid-infrared fusion spectrum of the oil sample to be measured to obtain a differential spectrum of the oil sample to be measured; obtaining the differential absorbance of the near-infrared and mid-infrared characteristic spectral regions in the differential spectrum; and determining the category of the oil sample to be measured according to the differential absorbance and a previously established discriminant analysis model, wherein the discriminant analysis model is generated according to the near-infrared-mid-infrared fusion spectrum of multiple samples of the first oil and the second oil and the blending ratio thereof, the differential spectrum of the near-infrared-mid-infrared fusion spectrum and the differential absorbance of the near-infrared and mid-infrared spectral regions thereof.
[0029] In the embodiment of the present application, the discriminant analysis model is generated according to the following operations:
[0030] Obtaining multiple samples of the first oil and the second oil;
[0031] Obtaining the mid-infrared spectrum and the near-infrared spectrum of each sample in the multiple samples, and splicing the mid-infrared spectrum and the near-infrared spectrum to obtain the near-infrared-mid-infrared fusion spectrum of the sample;
[0032] obtaining a first near-infrared-mid-infrared fusion spectrum according to formula ①,
[0033] m = xd + (1-x)j ②
[0034] wherein m represents a first near-infrared-mid-infrared spectrum synthesized by a near-infrared-mid-infrared spectrum of the first oil and a near-infrared-mid-infrared spectrum of the second oil, d is the first oil near-infrared-mid-infrared spectrum, j is the second oil near-infrared-mid-infrared spectrum, and x is the first oil near-infrared-mid-infrared spectrum blending ratio,
[0035] The first near-infrared-mid-infrared spectrum is used to generate library sample spectra, and a corresponding category label value is set according to the first oil near-infrared-mid-infrared spectrum blending ratio.
[0036] Each of the library sample spectra is subjected to first-order differential processing to obtain a differential spectrum.
[0037] Differential absorbance in a near-infrared and mid-infrared characteristic spectral region of each of the differential spectra is obtained.
[0038] All of the differential absorbance and the category label values corresponding to all of the differential absorbance are associated to construct a discriminant analysis model with linear-nonlinear decision-making capability.
[0039] In the embodiments of the present application, the window width of the first-order differential processing is 19.
[0040] In the embodiments of the present application, the first oil is diesel oil, and the second oil is aviation kerosene.
[0041] The second aspect of the present application provides a device for detecting oil blending, the device comprising: a memory; and a processor configured to execute the above-mentioned method for detecting oil blending.
[0042] The third aspect of the present application provides a machine-readable storage medium, the machine-readable storage medium having instructions stored thereon, wherein the instructions, when executed by a processor, cause the processor to be configured to execute the above-mentioned method for detecting oil blending.
[0043] By the technical solution, the discriminant analysis model can be constructed based on the mixed fusion spectrum synthesized by the near-infrared-mid-infrared fusion spectrum of the known samples of the first oil liquid and the second oil liquid, so that in the case that the known samples (including the samples of the first oil liquid and the second oil liquid) are typical and sufficient, the spectrum of the second oil liquid mixed with the spectrum of the first oil liquid at any proportion can be synthesized, thereby simulating the spectrum of the second oil liquid mixed with the first oil liquid at different proportions. Compared with the method of collecting the samples of the mixed oil liquid to construct the model, the method is more reliable and simple. It is worth noting that the method adopts the near-infrared-mid-infrared fusion spectrum data, and has more detailed spectral detail information, which is beneficial to the construction of the high-precision discriminant analysis model. In addition, the method also combines the linear and nonlinear methods to construct the discriminant analysis model, and the method containing both homogeneous learners (a plurality of same extreme learning machine individual learners) and heterogeneous learners (a plurality of extreme learning machine individual learners and a partial least squares learner) can effectively improve the classification accuracy and enhance the reliability of the method.
[0044] Other features and advantages of the embodiments of the present application will be described in detail in the following specific implementation part. BRIEF DESCRIPTION OF DRAWINGS
[0045] The accompanying drawings are included to provide a further understanding of the embodiments of the present application, and constitute a part of the specification, and are used to explain the embodiments of the present application together with the following specific implementation, but do not constitute a limitation to the embodiments of the present application. In the drawings:
[0046] Figure 1 A flowchart of a method for detecting oil liquid mixing according to the embodiments of the present application is schematically shown;
[0047] Figure 2 Another flowchart of a method for detecting oil liquid mixing according to the embodiments of the present application is schematically shown;
[0048] Figure 3 A structural block diagram of an apparatus for detecting oil liquid mixing according to the embodiments of the present application is schematically shown;
[0049] Figure 4 For the discriminant situation of the training set samples when the method of the present application only contains a linear decision part (i.e. w2=0) in Example 1 (in the figure, the simulated mixed aviation kerosene samples with different proportions of diesel oil below the 2 threshold lines at left A-H are correctly classified, and the simulated mixed aviation kerosene samples with different proportions of diesel oil above the 2 threshold lines at right A-H are not correctly classified); and
[0050] Figure 5The discrimination of the validation set samples when the method of the present application in Example 1 does not contain a linear decision part (i.e. w1 = 0) is shown in the figure (on the left, below the 2 threshold lines, are the classified correctly blended kerosene samples with different proportions of diesel, above the 2 threshold lines are the incorrectly classified blended kerosene samples with different proportions of diesel; on the right, above the 2 threshold lines are the classified correctly kerosene samples, below the 2 threshold lines are the incorrectly classified kerosene samples). DETAILED DESCRIPTION
[0051] In order to make the purposes, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. It should be understood that the specific embodiments described herein are only used to explain and illustrate the embodiments of the present application, and are not used to limit the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of protection of the present application.
[0052] It should be noted that if the embodiments of the present application involve directional indications (such as up, down, left, right, front, back, etc.), the directional indications are only used to explain the relative positional relationship, movement condition, etc. between components in a certain posture (as shown in the drawings), and if the certain posture changes, the directional indications also change accordingly.
[0053] In addition, if the embodiments of the present application involve descriptions such as "first", "second", etc., the descriptions of "first", "second", etc. are only for description purposes, and cannot be understood as indicating or implying the relative importance of the indicated technical features or implicitly indicating the number of the indicated technical features. Therefore, the features limited by "first", "second" can explicitly or implicitly include at least one of the features. In addition, the technical solutions of each embodiment can be combined with each other, but it must be based on the fact that a person of ordinary skill in the art can realize it, and when the combination of technical solutions contradicts each other or cannot be realized, it should be considered that the combination of technical solutions does not exist and is not within the scope of protection claimed by the present application.
[0054] It should be noted that in the following, diesel and kerosene are used as the first oil and the second oil to illustrate the present application, but the solutions of the present application are not limited to diesel and kerosene, and can be applied to the identification of blending of other oil. In addition, the solutions of the present application are not limited to the identification of blending of two kinds of oil, and the identification of blending of any number of oil is feasible.
[0055] Figure 1 A flowchart of a method for detecting oil blending according to an embodiment of the present application is schematically shown. It should be understood that although Figure 1The steps in the flowcharts are shown in sequence according to the arrows, but the steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, the steps are not strictly limited in sequence, and the steps can be executed in other sequences. Moreover, Figure 1 At least part of the steps in the flowcharts can include multiple sub-steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution sequence of the sub-steps or stages is not necessarily sequential, but can be executed alternately or alternately with at least part of other steps or sub-steps or stages of other steps.
[0056] As shown in Figure 1 In an embodiment of the present application, a method for detecting oil blending is provided, which comprises the following steps:
[0057] Step 102: acquiring a near-infrared-mid-infrared fusion spectrum composed of a near-infrared spectrum and a mid-infrared spectrum of a sample of oil to be detected;
[0058] Step 104: acquiring near-infrared characteristic spectral region absorbance and mid-infrared characteristic spectral region absorbance of the near-infrared-mid-infrared fusion spectrum; and
[0059] Step 106: determining a category of the sample of oil to be detected according to the near-infrared characteristic spectral region absorbance and the mid-infrared characteristic spectral region absorbance of the near-infrared-mid-infrared fusion spectrum and a discriminant analysis model established in advance, wherein the discriminant analysis model is generated according to near-infrared-mid-infrared fusion spectra of multiple samples of a first oil and a second oil and blending ratios, near-infrared characteristic spectral region absorbance and mid-infrared characteristic spectral region absorbance thereof.
[0060] As shown in Figure 2 In an embodiment of the present application, a method for detecting oil blending is provided, which comprises the following steps:
[0061] Step 202: performing first-order differential processing on a near-infrared-mid-infrared fusion spectrum of a sample of oil to be detected to obtain a differential spectrum of the sample of oil to be detected;
[0062] Step 204: acquiring differential absorbance of near-infrared and mid-infrared characteristic spectral regions in the differential spectrum; and
[0063] Step 206: determining a category of the sample of oil to be detected according to the differential absorbance and a discriminant analysis model established in advance, wherein the discriminant analysis model is generated according to near-infrared-mid-infrared fusion spectra of multiple samples of a first oil and a second oil and blending ratios, differential spectra of the near-infrared-mid-infrared fusion spectra and differential absorbance of near-infrared and mid-infrared spectral regions thereof.
[0064] In one embodiment, as shown in Figure 3 The processor includes a core, and the core calls corresponding program units in the memory. The core can be set to one or more, and the detection method of the oil blending is realized by adjusting the core parameters. The memory can include a non-permanent memory in a computer readable medium, a random access memory (RAM) and / or a non-volatile memory such as a read-only memory (ROM) or a flash memory (flash RAM), and the memory includes at least one memory chip.
[0065] Those skilled in the art can understand that Figure 3 The structure shown in the figure is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the equipment to which the scheme of the present application is applied. The specific equipment can include more or fewer components than those shown in the figure, or combine certain components, or have a different component arrangement.
[0066] A detection method of aviation kerosene blended with diesel oil based on spectral data fusion, comprising (1) obtaining near-infrared spectrum and mid-infrared spectrum of a plurality of aviation kerosene samples and diesel oil samples, (2) splicing the near-infrared spectrum and the mid-infrared spectrum of each sample to obtain a near-infrared-mid-infrared fusion spectrum, (3) synthesizing a first near-infrared-mid-infrared fusion spectrum by using the obtained near-infrared-mid-infrared fusion spectrum of the aviation kerosene samples and the diesel oil samples, (4) then associating the absorbance of the characteristic spectral region (near-infrared spectral region and mid-infrared spectral region) of the first-order differential spectrum of the first near-infrared-mid-infrared fusion spectrum with the corresponding category label to construct a discriminant analysis model with linear and nonlinear decision-making capabilities (partial least squares method provides linear decision-making capability, and extreme learning machine method provides nonlinear decision-making capability), (5) finally determining the category of the aviation kerosene sample to be tested according to the established discriminant analysis model with linear and nonlinear decision-making capabilities and the absorbance of the characteristic spectral region (near-infrared spectral region and mid-infrared spectral region) of the first-order differential spectrum of the second near-infrared-mid-infrared fusion spectrum of the aviation kerosene sample to be tested. The fusion data of the near-infrared spectrum and the mid-infrared spectrum are used to establish the model, which can enhance the correlation between the spectral variables and the category label values, and is beneficial to the establishment of a high-precision discriminant analysis model. The joint linear and nonlinear classification algorithm and the voting decision strategy can comprehensively utilize the respective advantages of linear and nonlinear algorithms, and ensure the reliability of the method.
[0067] The present application synthesizes a first near-infrared-mid-infrared fusion spectrum by using the near-infrared-mid-infrared fusion spectrum of a known aviation kerosene sample and the near-infrared-mid-infrared fusion spectrum of a diesel sample, generates a spectrum library by using the first near-infrared-mid-infrared fusion spectrum, constructs a discriminant analysis model with linear-nonlinear decision-making ability by combining the library sample spectrum and its corresponding category label value, and determines the category of a to-be-tested aviation kerosene sample mixed with diesel prepared in a laboratory by using the second near-infrared-mid-infrared fusion spectrum of the to-be-tested aviation kerosene sample and the discriminant analysis model with linear-nonlinear decision-making ability.
[0068] For the establishment of the discriminant analysis model, the traditional method for collecting typical modeling samples is quite difficult to implement, and the collected samples are difficult to cover all possible variations of sample spectra, so the robustness of the discriminant analysis model established based on these samples is often not very good.
[0069] Spectrum can reflect the change of the composition of a substance. In theory, when the composition of a substance changes, the spectrum of the substance will also change accordingly, that is, the two will show good consistency. Based on this theory, the synthetic spectrum obtained by linear combination of the spectra of two actual samples in a certain proportion should show good consistency with the spectrum measured after mixing the two samples. Therefore, the synthetic spectrum obtained by linear combination of the spectra of actual samples can well simulate the spectrum of the mixed sample obtained under different proportions of actual samples, and can generate a rich sample spectrum database, laying a foundation for subsequent establishment of a robust discriminant analysis model with a large sample size. The present application synthesizes a first near-infrared-mid-infrared fusion spectrum according to a certain proportion by using the near-infrared-mid-infrared fusion spectrum of an actual aviation kerosene sample and a diesel sample, thereby generating a rich library sample spectrum.
[0070] The measurement mode of the near-infrared spectrum of all samples in the present application is transmission, and a 0.5mm cuvette is selected, the sampling condition is constant temperature 25℃, the scanning range of the spectrometer is 10000-3500cm -1 , the resolution is 4cm -1 , and the cumulative scanning number is 64.
[0071] The measurement mode of the mid-infrared spectrum of all samples in the present application is transmission, and a 0.5mm liquid cell is selected, the sampling condition is constant temperature 25℃, the scanning range of the spectrometer is 3500-400cm -1 , the resolution is 4cm -1 , and the cumulative scanning number is 32.
[0072] The present application uses the second near-infrared-mid-infrared fusion spectrum of the to-be-tested aviation kerosene sample prepared by formula ② to verify the reliability of the discriminant analysis model with linear-nonlinear decision-making ability.
[0073] The first near-infrared-mid-infrared fusion spectrum and the second near-infrared-mid-infrared fusion spectrum are subjected to first-order differential processing to eliminate interference.
[0074] The present application adopts a partial least squares (PLS) method to associate the absorbance of the first near-infrared-mid-infrared fusion spectrum in a characteristic spectral region and the corresponding category label value, and establish a linear decision discriminant analysis model.
[0075] The following briefly introduces the process of establishing a linear discriminant analysis model using a PLS algorithm:
[0076] First, the spectral matrix X (n x m) (in the present application, the near-infrared characteristic spectral region absorbance and the mid-infrared characteristic spectral region absorbance matrix) and the concentration matrix Y (n x 1) (in the present application, the category label value 1 or 3) are decomposed as follows, where n is the number of samples, and m is the number of characteristic spectral region absorbance wavelength points, i.e., the number of sampling points of the absorbance in the characteristic spectral region.
[0077]
[0078]
[0079] Wherein: t k (n x 1) is the score of the kth principal factor of the absorbance matrix X;
[0080] p k (1 x m) is the load of the kth principal factor of the absorbance matrix X;
[0081] u k (n x 1) is the score of the kth principal factor of the concentration matrix Y;
[0082] q k (1 x 1) is the load of the kth principal factor of the concentration matrix Y; f is the number of principal factors. That is, T and U are the score matrices of the X and Y matrices, respectively, P and Q are the load matrices of the X and Y matrices, respectively, E X and E Y are the PLS fitting residual matrices of X and Y, respectively.
[0083] Secondly, T and U are linearly regressed:
[0084] U = TB
[0085] B = (T T T) -1 T T Y
[0086] In prediction, first, the score T un of the unknown sample spectral matrix X un is obtained according to P, and then the concentration prediction value Y un= T un BQ.
[0087] In the actual PLS algorithm, PLS combines the matrix decomposition and regression into one step, i.e. the decomposition of X and Y matrices is carried out simultaneously, and the information of Y is introduced into the X matrix decomposition process, and before calculating each new principal component, the scores of X and Y are exchanged, so that the obtained X principal component is directly associated with Y.
[0088] PLS is calculated by the nonlinear iterative partial least squares algorithm (NIPALS) proposed by H Wold, and the specific algorithm is as follows:
[0089] For the correction process, ignoring the residual matrix E, when the number of principal factors is 1, we have:
[0090] For X = tp T , left multiplication by t T p T = t T X / t T t; right multiplication by p gives: t = Xp / p T p.
[0091] For Y = uq T , left multiplication by u T q T = u T Y / u T u, both sides are divided to get q T u = Y / q T .
[0092] (1) Calculate the weight vector w of the absorbance matrix X
[0093] Take a column of the concentration matrix Y (only one column in the present application) as the initial iteration value of u, replace t with u, and calculate w
[0094] The equation is: X = uw T , and the solution is: w T = u T X / u T u
[0095] (2) Normalize the weight vector w
[0096] w T = w T / ||w T ||
[0097] (3) Calculate the factor score t of the absorbance matrix X from the normalized w
[0098] The equation is: X = tw T , and the solution is: t = Xw / w T w
[0099] (4) Calculate the loading q value of the concentration matrix Y, and use t to replace u to calculate q.
[0100] The equation is: Y = tq T The solution is: q T =t T Y / t T t
[0101] (5) Normalize the load q
[0102] q T =q T / ||q T ||
[0103] (6) Calculate the factor score u of the concentration matrix Y, using q T Calculate u
[0104] The equation is: Y = uq T The solution is: u = Yq / q T q
[0105] (7) Replace t with u and return to step (1) to calculate w. T , by w T Calculate t new This process is repeated iteratively until t converges (‖t). new -t old ‖≤10 -6 ‖t new If the condition is not met, proceed to step (8) for calculation; otherwise, return to step (1).
[0106] (8) Calculate the loading vector p of the absorbance matrix X from the converged t.
[0107] The equation is: X = tp T The solution is: p T =t T Y / t T t
[0108] (9) Normalize the load p
[0109] p T =p T / ||p T ||
[0110] (10) Factor score t of standardized X
[0111] t=t||p||
[0112] (11) Standardized weight vector w
[0113] w = w||p||
[0114] (12) Calculate the intrinsic relationship b between t and u.
[0115] b = u T t / t T t
[0116] (13) Calculate the residual matrix E
[0117] E X =X-tp T
[0118] E Y =Y-btq T
[0119] (14) With E X Instead of X, E Y Replace Y and return to step (1), and so on, to find the principal factors w, t, p, u, q, b of X and Y. Use the cross-validation method to determine the optimal number of principal factors f, and save w. f p f q f (w f p is the weight vector of the absorbance matrix of the sample spectra used in the established discriminant analysis model under the f principal components. f The loadings of the absorbance matrix of the sample spectra used in the established discriminant analysis model under f principal components, q f The loadings of the class label matrix corresponding to the sample spectra used in the established discriminant analysis model under the f principal components.
[0120] This invention employs the Extreme Learning Machine (ELM) method to associate the absorbance of the characteristic spectral region of the first near-infrared-mid-infrared fused spectrum with its corresponding category label value, thereby establishing a nonlinear discriminant analysis model.
[0121] The following is a brief introduction to the process of establishing a nonlinear discriminant analysis model using the ELM algorithm:
[0122] Given any n sample data Where, x i =[x i1 ,x i2 ,…,x im ] T ∈R m Let y be the spectrum of the i-th sample (in this invention, the absorbance in the near-infrared characteristic spectral region and the mid-infrared characteristic spectral region, where m is the number of wavelength points for absorbance in the characteristic spectral region). i =[y i1 ,y i2 ,…,y is ] T ∈R mThe concentration of s components of the ith sample (in the present application, the category label value is 1 or 3, and s = 1) in the whole sample data, the basic input-output relationship of the ELM can be expressed as:
[0123]
[0124] wherein L is the number of hidden layer nodes, p represents the pth hidden layer node, w i p1 p2 pn T and b p are the weights and bias between the input layer and the hidden layer, respectively, β i p1 p2 pn T is the output layer weight, and g(·) is the activation function. The matrix expression of the above formula is as follows:
[0125] Y = Hβ
[0126] wherein represents the random matrix of the hidden layer output in the extreme learning machine, Y = [y p1 p2 pn T is the output matrix of the extreme learning machine, the output layer weight β i = [β1, β2, …, β L ] T is the parameter to be solved, and the unique solution can be obtained according to the Moore-Penrose generalized inverse of the H matrix:
[0127]
[0128] It is not difficult to find that solving the output weight matrix becomes a problem of solving the least square solution, and the training of the extreme learning machine can be completed by only solving the least square solution of the input weight.
[0129] It is worth noting that the multiple ELM individual (base) learner discriminant analysis models are all completed according to the standard construction process of the above-mentioned ELM discriminant analysis model.
[0130] The category identification process of the sample of the aviation kerosene to be tested is as follows:
[0131] (1) Linear decision part
[0132] x un is the absorbance of the feature spectrum region of the sample to be tested, and the saved w f , p f , qf .
[0133] y un = b PLS x un , where b PLS = w f T (p f w f T ) -1 q f , sequentially compare the size relationship of y un and threshold 2 of the category label value, if y un < 2, the unknown sample is determined as the aviation kerosene sample mixed with diesel oil, if y un > 2, the unknown sample is determined as the pure aviation kerosene sample.
[0134] (2) Nonlinear decision part
[0135] x un is the absorbance of the feature spectrum region of the sample to be measured, the saved ELM model parameters w, b, β, g(·) and the application type TYPE (TYPE = 1, indicating that the ELM performs a classification operation) are called to obtain the category label value 1 or 3 of the sample to be measured.
[0136]
[0137] (3) Final decision
[0138] The voting method is adopted for the final classification decision, that is, the classification votes obtained by the linear decision part and the nonlinear decision part of the method of the application are multiplied by the corresponding weights (that is, w1 and w2), and finally the weighted votes of each category are summed, and the category corresponding to the maximum value is the final category.
[0139] The application will be further described in detail by examples below, but the application is not limited thereto.
[0140] Example 1
[0141] A discriminant analysis model with only a linear decision part is established and verified, at this time, the weight of the linear decision part w1 = 1, and the weight of the nonlinear decision part w2 = 0.
[0142] (1) Measurement of spectra of aviation kerosene samples and diesel oil samples
[0143] 49 representative finished aviation kerosene samples, 7 straight-run diesel oil samples and 1 finished diesel oil sample are collected, and the near-infrared spectrum and the mid-infrared spectrum thereof are measured.
[0144] (2) Splicing the near-infrared spectrum and the mid-infrared spectrum of each sample to obtain a near-infrared-mid-infrared fusion spectrum.
[0145] (3) Synthesis of the first near-infrared-mid-infrared fusion spectrum
[0146] The near-infrared-mid-infrared fusion spectrum of the aviation kerosene sample and the diesel sample obtained in step (2) is used to synthesize the first near-infrared-mid-infrared fusion spectrum according to formula ①,
[0147] m = xd + (1-x)j ①
[0148] wherein the blending ratio x of the diesel near-infrared-mid-infrared fusion spectrum ranges from 0.002 to 0.098 (any number less than 1 is reasonable for the upper limit of x, and the lower concentration range is set here mainly to facilitate the determination of the minimum detection limit of the method), and the step size is 0.002, so x has 49 ratio gradients. The present application uses 8 near-infrared-mid-infrared fusion spectra of diesel samples, so ultimately 8 x 49 = 392 first near-infrared-mid-infrared fusion spectra with a label value of 1 will be synthesized. In addition, in the embodiment of the present application, each ratio gradient corresponds to a first near-infrared-mid-infrared fusion spectrum with x = 0 (i.e. a pure aviation kerosene near-infrared-mid-infrared fusion spectrum). In summary, this process will produce 784 first near-infrared-mid-infrared fusion spectra. The 784 first near-infrared-mid-infrared fusion spectra and their corresponding label values will constitute the training set for the construction of the discriminant analysis model described later in the present application.
[0149] (3) Construction of a discriminant analysis model with only linear decision-making capability
[0150] The first near-infrared-mid-infrared fusion spectrum obtained in step (3) is subjected to first-order differential processing with a window width of 19 to obtain the absorbance of the feature interval (including the near-infrared spectral region and the mid-infrared spectral region) of the first differential spectrum, which is then associated with the corresponding class label value to construct the discriminant analysis model. The near-infrared feature spectral region has a wave number range of 4366-4752 cm -1 , and the mid-infrared feature spectral region has a wave number range of 1541-1662 cm -1 .
[0151] (4) Acquisition of the spectrum of the sample to be tested and prediction of the class
[0152] The aviation kerosene sample to be tested is prepared according to formula ② using the aviation kerosene sample and the diesel sample in step (1),
[0153] m = cd + (1-c)j ②
[0154] wherein the volume ratio c of each diesel sample is taken in turn as 0.005, 0.01, 0.02, 0.03, 0.05, 0.07 (the upper limit of c is any value less than 1, and the lower concentration range is set here mainly to facilitate the determination of the minimum detection limit of the method), 48 test aviation kerosene samples are generated in total. Then 48 test samples are obtained when c is taken as 0 (i.e. pure aviation kerosene samples), so as to form a validation set with a sample capacity of 96. The near-infrared-mid-infrared fusion spectrum of the validation set, i.e. the second near-infrared-mid-infrared fusion spectrum, is taken as 4366-4752 cm -1 and 1541-1662 cm -1 The first derivative absorbance of the characteristic spectral region is substituted into the discriminant analysis model to predict the class label value of each sample, and the class of each sample is determined according to the value and the class label threshold.
[0155] (3) Performance evaluation of discriminant analysis model
[0156] The performance of the model is evaluated by the true aviation kerosene recognition rate, the aviation kerosene mixed with diesel recognition rate and the overall recognition rate. Let the number of true aviation kerosene samples be N1, the number of aviation kerosene mixed with diesel samples be N2, the number of correctly identified true aviation kerosene samples be M1, the number of correctly identified aviation kerosene mixed with diesel samples be M2, then the recognition rate P (%) of true aviation kerosene samples = M1 / N1, the recognition rate T (%) of aviation kerosene mixed with diesel samples = M2 / N2, and the overall recognition rate F (%) = (M1+M2) / (N1+N2).
[0157] The relevant statistical results of the training set and the validation set of the discriminant analysis model with linear decision capability are shown in Table 1.
[0158] Table 1
[0159]
[0160] Example 2
[0161] The discriminant analysis model is established and verified according to the method of Example 1, except that the model established is a non-linear decision, i.e. the weight w1 of the linear decision part is 0, and the weight w2 of the non-linear decision part is 1.
[0162] The relevant statistical results of the training set and the validation set of the discriminant analysis model with non-linear decision capability are shown in Table 2.
[0163] Table 2
[0164]
[0165] Example 3
[0166] The discriminant analysis model is established and verified according to the method of Example 1, and the difference is that the established model has both linear decision-making ability and nonlinear decision-making ability, that is, the weights of the linear decision-making part and the nonlinear decision-making part are not 0, and the weight of the linear decision-making part is set as wl=1 / 4 and the weight of the nonlinear decision-making part is set as w2=3 / 4 in this example.
[0167] The relevant statistical results of the training set and the verification set of the discriminant analysis model with linear-nonlinear decision-making ability are shown in Table 3.
[0168] Table 3
[0169]
[0170] Those skilled in the art will understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0171] The present application is described with reference to flowcharts and / or block diagrams according to the methods, devices (systems), and computer program products of the embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of flows and / or blocks in the flowcharts and / or block diagrams can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing apparatus to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing apparatus produce a device that implements the flow Figure 1 one or more flows and / or blocks Figure 1 an apparatus that carries out the function specified in the flow or flows and / or block or blocks.
[0172] These computer program instructions can also be stored in a computer-readable memory that can direct the computer or other programmable data processing apparatus to work in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including instruction apparatus, which implements the flow Figure 1 one or more flows and / or blocks Figure 1 an apparatus that carries out the function specified in the flow or flows and / or block or blocks.
[0173] These computer program instructions can also be loaded into a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 Figure 1
[0174] In one typical configuration, the computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.
[0175] The memory can include non-persistent memory and / or volatile memory, such as random access memory (RAM) about which the processor can execute instructions. The memory can also include non-volatile memory, such as read only memory (ROM), electrically programmable read only memory (EPROM), electrically erasable programmable read only memory (EEPROM), programmable read only memory (PROM), erasable programmable read only memory (EPROM), flash memory, or a combination of non-volatile memories in different types. The memory can also include a compact disk read only memory (CD-ROM), digital versatile disk (DVD), Blu-ray, or another non-transitory computer readable medium, which is non-volatile and non-transitory in nature, but volatile in that it can lose its content if the power to the computer is turned off or if the computer crashes. The memory is an example of a computer readable medium.
[0176] Computer readable media includes permanent and non-permanent, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory (ROM), electrically programmable read only memory (EEPROM), flash memory or other memory technology, compact disk read only memory (CD-ROM), digital versatile disk (DVD), or other optical storage, magnetic cassette, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information accessible to a computing device. According to the definition herein, computer readable media does not include transitory media such as modulated data signals and carriers.
[0177] It should also be noted that the terms "comprising," "including," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements recited, but can also include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element preceded by "comprises a" does not, without more constraints, foreclose the existence of additional identical elements in the process, method, article, or apparatus that includes the element.
[0178] The above merely provides an example of the present application, and is not intended to limit the present application. For those skilled in the art, the present application can have various modifications and changes. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present application shall fall into the scope of claims of the present application.
Claims
1. A method for detecting oil blending, the method comprising: obtaining a near-infrared-mid-infrared fusion spectrum of a sample of oil to be detected, the near-infrared-mid-infrared fusion spectrum comprising a near-infrared spectrum and a mid-infrared spectrum of the sample of oil to be detected; obtaining near-infrared characteristic spectral region absorbance and mid-infrared characteristic spectral region absorbance of the near-infrared-mid-infrared fusion spectrum; and determining a category of the sample of oil to be detected according to the near-infrared characteristic spectral region absorbance and the mid-infrared characteristic spectral region absorbance of the near-infrared-mid-infrared fusion spectrum and a discriminant analysis model previously established, wherein the discriminant analysis model is generated according to near-infrared-mid-infrared fusion spectra of multiple samples of a first oil and a second oil, near-infrared characteristic spectral region absorbance and mid-infrared characteristic spectral region absorbance of the multiple samples, and blending ratios of the multiple samples, and wherein the discriminant analysis model is generated according to the following operations: obtaining the multiple samples of the first oil and the second oil; obtaining a near-infrared spectrum and a mid-infrared spectrum of each of the multiple samples, and splicing the near-infrared spectrum and the mid-infrared spectrum to obtain a near-infrared-mid-infrared fusion spectrum of the sample; obtaining a first near-infrared-mid-infrared fusion spectrum according to formula (1), m=xd+(1-x)j ① wherein m represents the first near-infrared-mid-infrared fusion spectrum synthesized by a near-infrared-mid-infrared fusion spectrum of the first oil and a near-infrared-mid-infrared fusion spectrum of the second oil, d represents the near-infrared-mid-infrared fusion spectrum of the first oil, j represents the near-infrared-mid-infrared fusion spectrum of the second oil, and x represents a blending ratio of the near-infrared-mid-infrared fusion spectrum of the first oil; generating library sample spectra using the first near-infrared-mid-infrared fusion spectrum, and setting corresponding category label values according to the blending ratio of the near-infrared-mid-infrared fusion spectrum of the first oil; and obtaining near-infrared characteristic spectral region absorbance and mid-infrared characteristic spectral region absorbance of each library sample spectrum, combining the near-infrared characteristic spectral region absorbance and the mid-infrared characteristic spectral region absorbance with corresponding category label values, and constructing a discriminant analysis model having linear-nonlinear decision-making capability, wherein in the discriminant analysis model having linear-nonlinear decision-making capability, linear decision-making capability is provided by a partial least squares method, nonlinear decision-making capability is provided by an extreme learning machine method, and the specific steps of integrating the two methods are as follows: establishing a partial least squares discriminant analysis model as the linear decision-making part; establishing multiple extreme learning machine individual learners as the nonlinear decision-making part; assigning corresponding weights to the linear decision-making part and the nonlinear decision-making part; and adopting a voting method for final classification decision-making, i.e., multiplying classification votes obtained by the linear decision-making part and the nonlinear decision-making part by corresponding weights, finally summing weighted votes of each category, and taking a category corresponding to a maximum value as a final category. calculating a category label value of the sample of oil to be detected according to formula (2), and comparing the value with a threshold value to determine a category of the sample of oil to be detected as a classification vote of the linear decision-making part: calculating a category label value of the sample of oil to be detected according to formula (3) as a classification vote of the nonlinear decision-making part: the sample of oil to be detected is an actual sample of oil or a sample of oil configured according to formula (2), m=cd+(1-c)j ② and the method further comprises: 2. The method of claim 1, wherein, y un = b PLS x un , wherein x un is the absorbance of the near-infrared characteristic spectral region and the mid-infrared characteristic spectral region of the oil sample to be measured, wherein b PLS is the regression coefficient of the partial least squares (PLS) algorithm, f is the optimal principal factor number of the partial least squares determined by the cross-validation method, w f is the weight vector of the absorbance matrix of the sample spectrum used by the established discriminant analysis model under f principal components, p f is the load of the absorbance matrix of the sample spectrum used by the established discriminant analysis model under f principal components, q f is the load of the category label matrix corresponding to the sample spectrum used by the established discriminant analysis model under f principal components.
3. The method of claim 1, wherein, wherein x un is the near-infrared characteristic spectral region absorbance and the mid-infrared characteristic spectral region absorbance of the oil sample to be measured, L is the number of hidden layer nodes, w p is the weight of the pth hidden layer node and the input layer node, β p is the weight vector of the pth hidden layer node and the output layer node, b p is the threshold value of the pth hidden layer node, and g(·) is the activation function.
4. The method of claim 1, wherein, The wave number range of the near infrared characteristic spectral region is 4366-4752 cm -1 The wave number range of the mid infrared characteristic spectral region is 1541-1662 cm -1 .
5. The method of claim 1, wherein, In formula 2, m represents a sample obtained after sample mixing of the first oil and the second oil, d is a sample of the first oil, j is a sample of the second oil, and c is a volume ratio of the sample of the first oil, wherein the value range of c is 0≤c≤x max <1, and c is 0, m represents a sample of pure second oil, wherein the x max is the maximum blending ratio of the first oil.
6. The method of claim 1, wherein, performing first-order differential processing on the near-infrared-mid-infrared fusion spectrum of the to-be-tested oil sample to obtain a differential spectrum of the to-be-tested oil sample; obtaining differential absorbance in near-infrared and mid-infrared characteristic spectral regions in the differential spectrum; and determining the category of the to-be-tested oil sample according to the differential absorbance and a discriminant analysis model established in advance, wherein the discriminant analysis model is generated according to near-infrared-mid-infrared fusion spectra of multiple samples of the first oil and the second oil and their blending ratios, differential spectra of the near-infrared-mid-infrared fusion spectra and differential absorbance in near-infrared and mid-infrared spectral regions of the differential spectra.
7. The method of claim 6, wherein, The discriminant analysis model is generated according to the following operations: obtaining multiple samples of the first oil and the second oil; obtaining mid-infrared and near-infrared spectra of each sample in the multiple samples and splicing the mid-infrared and near-infrared spectra to obtain a near-infrared-mid-infrared fusion spectrum of the sample; obtaining a first near-infrared-mid-infrared fusion spectrum according to formula ①, m = xd + (1 - x)j ① wherein m represents a first near-infrared-mid-infrared spectrum synthesized from a near-infrared-mid-infrared fusion spectrum of the first oil and a near-infrared-mid-infrared fusion spectrum of the second oil, d is the near-infrared-mid-infrared fusion spectrum of the first oil, j is the near-infrared-mid-infrared fusion spectrum of the second oil, and x is a blending ratio of the near-infrared-mid-infrared fusion spectrum of the first oil, generating library sample spectra using the first near-infrared-mid-infrared fusion spectrum and setting corresponding category label values according to the blending ratio of the near-infrared-mid-infrared fusion spectrum of the first oil; performing first-order differential processing on each of the library sample spectra to obtain a differential spectrum; obtaining differential absorbance in near-infrared and mid-infrared characteristic spectral regions in each of the differential spectra; associating all of the differential absorbance and category label values corresponding to all of the differential absorbance to construct a discriminant analysis model with linear-nonlinear decision-making capability.
8. The method according to claim 6 or 7, characterized in that, The window width of the first-order differential processing is 19.
9. The method of claim 1, wherein, The first oil is diesel oil and the second oil is aviation kerosene.
10. An apparatus for detecting oil blending, the apparatus comprising: a memory; and a processor configured to perform a method for detecting oil blending according to any one of claims 1 to 9.
11. A machine-readable storage medium having instructions stored thereon, the instructions comprising: The instructions, when executed by the processor, cause the processor to be configured to perform a method for detecting oil blending according to any one of claims 1 to 9.
Citation Information
Patent Citations
Method for predicting single-type crude oil content in mixed crude oil by near infrared spectrum
CN101988895A
Method for detecting corn oil mixed with sesame oil based on two-dimensional near-infrared and intermediate infrared correlation spectroscopy information fusion
CN107561031A
Method for predicting hydrocarbon composition of gasoline fraction of crude oil through near infrared spectrum of crude oil
CN111829976A