A method for adding samples to a calibration set for near-infrared detection of distillate properties
By automatically updating the distillate oil calibration set samples and utilizing near-infrared spectral data and principal component analysis, the problem of reduced prediction accuracy caused by changes in distillate oil properties was solved, enabling stable control and optimization of production in refining and chemical enterprises.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-21
- Publication Date
- 2026-03-27
AI Technical Summary
In refining and chemical enterprises, changes in the properties of distillate oils lead to a decrease in the accuracy of model predictions, especially in the sparse region where the prediction error increases, affecting production control and product quality.
By automatically adding new samples in the sparse region to the calibration set, principal component analysis is performed using near-infrared spectral data to establish an n-dimensional block diagram, calculate the trend of spectral gradient angle changes, and determine whether the samples are similar, thus achieving automatic sample updating.
This improves the accuracy of model predictions, adapts to changes in operating conditions, and ensures stable production control and product quality.
Smart Images

Figure CN116465854B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of oil property rapid detection and analysis in the field of petroleum chemical industry, and particularly to a method for automatically adding calibration set samples based on near-infrared spectrum rapid analysis technology and facing distillate oil property detection. BACKGROUND
[0002] In the field of oil analysis, the near-infrared spectrum analysis technology has the advantages of maturity, rapidness, non-destructiveness and the like compared with traditional analysis methods, and thus the technology is more and more applied in the analysis of oil properties. In order to predict the properties of oil by using the technology, a calibration set close to the to-be-detected sample needs to be established.
[0003] In the production of a refining and chemical enterprise, distillate oil is widely present and needs to be detected in real time so as to control and optimize. As an intermediate product, the distillate oil is different from a final product with unchanging quality requirements, and the properties of the distillate oil often change in different working condition ranges. For example, after a refining and chemical enterprise changes crude oil or changes a processing process, the properties of the distillate oil will change to different degrees. Therefore, after a period of time, the distribution of new samples deviates from the distribution area of calibration set samples around the to-be-detected sample. When the calibration set samples around the to-be-detected sample are few and are in a sparse area, the prediction effect of the model (especially when a similar sample modeling method is used) will be poor, the prediction error will increase, and the production control and product quality will be affected.
[0004] Therefore, it is necessary to continuously update the calibration set of the model, and add new oil samples in the sparse area into the calibration set so as to ensure the prediction accuracy of the model. Currently, some enterprises adopt a method of periodically manually updating the calibration set, but the prediction accuracy cannot be guaranteed in a period of time after a long time of one-time updating. Automatically adding the samples in the sparse area into the calibration set can effectively avoid the above problems. SUMMARY
[0005] In view of the above problems, the present application discloses a calibration set sample adding method facing near-infrared detection of distillate oil properties, which can automatically add new samples to the calibration set so as to ensure the prediction accuracy of the model and facilitate production control.
[0006] The present application adopts the following technical solutions:
[0007] (1) Collecting near-infrared spectrum of the distillate oil sample, and performing conventional pretreatment on the sample spectrum data;
[0008] (2) Performing principal component analysis on the pretreated spectrum data, selecting the first n principal components, and drawing an n-dimensional principal component distribution graph;
[0009] (3) Establishing an n-dimensional fixed frame with the new sample as the center in the principal component distribution graph;
[0010] (4) Count the number of similar samples in n-dimensional box and compare with threshold value, judge whether the sample is in dense area, if the number of similar samples is greater than threshold value, the new sample is in dense area, not added to the calibration set, return to step (1); otherwise, go to step (5) and consider adding to the calibration set;
[0011] (5) Calculate the gradient vector g of sample spectrum x according to the following formula s :
[0012] g s (x)=(x 2 -x 1 ,x 3 -x 2 ,...,x l -x l-1 )
[0013] Where x i (i=1,2,...,l) is the absorbance corresponding to the i-th wave number point of spectrum x, and l is the maximum wave number point;
[0014] (6) Calculate the gradient vector spectrum gradient angle α t1 of the gradient vectors of the spectra x t2 collected at two different times t1 and t2 according to the following formula gs :
[0015]
[0016] (7) Calculate the gradient angle change trend k t0 of the current sample spectrum x 0i :
[0017] k 0i =α gs (x t0 ,x ti )-α gs (x t0 ,x t(i+1) )
[0018] x ti is arranged in reverse order according to the sampling time, i=1,2,...;
[0019] (8) The following method is used to judge whether the trend change is the same:
[0020] If there are more than αm samples with the same angle sign in adjacent m samples x t1 ,x t2 ,...x tm , it is considered that the trend change is the same, go to step (9), otherwise, discard the sample, go to step (1);
[0021] (9) automatically add samples in sparse areas to the model calibration set.
[0022] Preferably, the spectral pretreatment includes baseline correction, derivation and vector normalization.
[0023] In the present application, the number n of principal components is 2 or 3: when n = 2, a two-dimensional plane frame diagram is established; when n = 3, a three-dimensional solid frame diagram is established.
[0024] Preferably, when n = 2, the aspect ratio of the two-dimensional plane frame diagram is 2:1; when n = 3, the length-width-height ratio of the three-dimensional solid frame diagram is 3:2:1.
[0025] In the present application, the following method is used to determine whether the trend changes are the same: if the signs of the included angles of am samples in adjacent m samples are the same, it is considered that the trend changes are the same, wherein m ≥ 10, α ≥ 0.7.
[0026] Beneficial effects:
[0027] The application discloses a correction set sample adding method for near-infrared detection of properties of fraction oil, which can effectively avoid the situation that the prediction accuracy is reduced due to the deviation of new samples from the distribution area of original correction set samples after modeling for a period of time, can update the correction set in a timely manner, ensures the prediction accuracy of the model, is particularly suitable for production working condition changes of a refining enterprise, and has important application value for real-time control and optimization of production of the enterprise. BRIEF DESCRIPTION OF DRAWINGS
[0028] Figure 1 The application discloses a correction set sample adding method for near-infrared detection of properties of fraction oil, which can effectively avoid the situation that the prediction accuracy is reduced due to the deviation of new samples from the distribution area of original correction set samples after modeling for a period of time, can update the correction set in a timely manner, ensures the prediction accuracy of the model, is particularly suitable for production working condition changes of a refining enterprise, and has important application value for real-time control and optimization of production of the enterprise.
[0029] Specific implementation process
[0030] The application discloses a correction set sample adding method for near-infrared detection of properties of fraction oil, which can effectively avoid the situation that the prediction accuracy is reduced due to the deviation of new samples from the distribution area of original correction set samples after modeling for a period of time, can update the correction set in a timely manner, ensures the prediction accuracy of the model, is particularly suitable for production working condition changes of a refining enterprise, and has important application value for real-time control and optimization of production of the enterprise.
[0031] The application discloses a correction set sample adding method for near-infrared detection of properties of fraction oil, which can effectively avoid the situation that the prediction accuracy is reduced due to the deviation of new samples from the distribution area of original correction set samples after modeling for a period of time, can update the correction set in a timely manner, ensures the prediction accuracy of the model, is particularly suitable for production working condition changes of a refining enterprise, and has important application value for real-time control and optimization of production of the enterprise.
[0032] The case implementation process is as shown in Figure 1 The specific implementation process is as follows:
[0033] Scan the enterprise naphtha sample to obtain near-infrared spectral data, and intercept the absorbance data of the 4000-4800 cm -1 Wave number section with large amount of near-infrared spectral information, and pre-process the intercepted data, including baseline correction, first-order inverse, and vector normalization.
[0034] Perform principal component analysis on the pre-processed sample spectral data, and select the first n principal components in the analysis results for analysis. In this embodiment, n = 3 is selected, that is, after selecting 3 principal components, the overall characteristics of the distillate oil can be covered. After analysis, the spectral distribution of the distillate oil is not uniform. In fact, the initial boiling point properties of the corresponding distillate oil are also not uniform. According to statistics, the initial boiling point of naphtha ranges from 37°C to 69°C, which is a wide range, and most of them are in the middle and front end, with fewer at the end, as shown in Table 1.
[0035] Table 1 Naphtha final boiling point distribution statistics
[0036] Serial number Segment range (°C) Number 1 [37-45) 190 2 [45-53) 297 3 [53-61) 344 4 [61-69] 66
[0037] To determine whether the new sample is in the sparse area, a three-dimensional frame is established in the three-dimensional space, the length of the three-dimensional frame is 0.3, the width is 0.2, and the height is 0.1. The similarity sample threshold is 50. The 51 distillate oil samples collected from December 2022 to January 2023 are judged.
[0038] First, calculate the gradient g of the spectrum x of the 51 distillate oil samples according to the following formula s :
[0039] g s (x)=(x 2 -x 1 ,x 3 -x 2 ,...,x l -x l-1 )
[0040] Where x i (i = 1, 2,..., l) is the absorbance corresponding to the i-th wave number point of the spectrum x, and l is the maximum wave number point. Calculate the gradient vectors of the spectra x t1 and x t2 collected at two different times t1 and t2, and the spectrum gradient angle a gs :
[0041]
[0042] Calculate the current sample spectrum xt0 Gradient angle change trend k 0i , where x ti is the spectrum arranged in reverse order according to the sampling time, i = 1, 2,..., m:
[0043] k 0i = α gs (x t0 , x ti ) - α gs (x t0 , x t(i+1) )
[0044] The following method is used to determine whether the trend changes are the same, that is: if the included angle signs of more than αm samples among the adjacent m samples are the same, it is considered that the trend changes are the same. In this embodiment, m = 10 and α = 0.8 are taken. That is, among the 10 samples closest in time to this sample in front, if it is found that the change trends of the included angles of more than 8 samples are the same, then this sample is included in the correction set, otherwise it is discarded.
[0045] After judgment, it is found that 48 samples are in the sparse area and 3 samples are abnormal samples. Therefore, the 48 samples are added to the correction set.
[0046] Based on the updated correction set, a model is established to predict the final boiling point of 28 samples from February 1, 2023 to the end of February 2023, to illustrate the influence of adding correction set samples on the prediction accuracy of samples.
[0047] First, the near-infrared spectra of the samples to be measured and the fractionated oil samples in the correction set are obtained. After conventional pretreatment, principal component analysis is carried out to find similar samples. Then, according to the similar samples, a model is established by partial least squares method to predict the properties of 28 samples to be measured. The prediction results are shown in Table 2 respectively.
[0048] Table 2 Model prediction results of the initial boiling point of naphtha after update<00001According to Table 2, the prediction standard deviation of 28 samples is 0.85℃, and according to Table 3, the prediction standard deviation reaches 2.68℃. It can be seen that the prediction deviation of the updated model is reduced, which can better adapt to the influence of enterprise working condition changes, and the prediction accuracy is significantly improved.
Claims
1. A method for adding calibration set samples for near-infrared detection of distillate oil properties, characterized in that... This method addresses the changes in oil samples during refining and chemical production by automatically adding new oil samples located in the sparse region of the calibration set to the calibration set to ensure the accuracy of model predictions. It includes the following steps: (1) Collect near-infrared spectra of distillate oil samples and perform routine preprocessing on the sample spectral data; (2) Perform principal component analysis on the preprocessed spectral data, select the first n principal components, and draw an n-dimensional principal component distribution map; (3) Establish an n-dimensional fixed frame centered on the new sample in the principal component distribution map; (4) Count the number of similar samples within the n-dimensional box and compare it with the threshold to determine whether the sample is in a dense area. If the number of similar samples is greater than the threshold, the new sample is in a dense area and is not added to the calibration set. Return to step (1); otherwise, go to step (5). (5) Calculate the gradient vector g of the sample spectrum x using the following formula. s : g s (x)=(x 2 -x 1 ,x 3 -x 2 ,...,x l -x l-1 ) Where x i Let be the absorbance at the i-th wavenumber point of spectrum x, where i = 1, 2, ..., l; l is the maximum wavenumber point. (6) Calculate the spectra x collected at two different times t1 and t2 using the following formula. t1 and spectrum x t2 Gradient vector spectral gradient angle α gs : in <g s (x t1 ),g s (x t2 )> represents g s (x t1 ) and g s (x t2 The inner product operation of ||·||2 denotes the 2-norm; (7) Calculate the current sample spectrum x t0 gradient angle variation trend k 0i : k 0i =α gs (x t0 ,x ti )-α gs (x t0 ,x t(i+1) )x ti The spectra are arranged in reverse order of sampling time, i = 1, 2, ...; (8) Use the following method to determine whether the trend changes are the same: If there are m neighboring samples x t1 ,x t2 ,...x tm If there are more than αm samples with the same angle sign, then the trend change is considered to be the same and go to step (9); otherwise, discard the sample and go to step (1), m≥10, α≥0.7; (9) Automatically add samples in the sparse region to the model calibration set.
2. The method for adding calibration set samples for near-infrared detection of distillate oil properties according to claim 1, characterized in that... The spectral preprocessing includes baseline correction, derivatives, and vector normalization.
3. The method for adding calibration set samples for near-infrared detection of distillate oil properties according to claim 1, characterized in that... n can be 2 or 3: when n = 2, a two-dimensional planar diagram is created; when n = 3, a three-dimensional solid diagram is created.
4. The method for adding calibration set samples for near-infrared detection of distillate oil properties according to claim 1, characterized in that... When n=2, the aspect ratio of the two-dimensional planar block diagram is 2:1; when n=3, the aspect ratio of the three-dimensional block diagram is 3:2:1.
Citation Information
Patent Citations
Method for automatically adding calibration set sample
CN107271400A
Distillate oil near infrared spectrum on-line property detection method for working condition switching
CN116756582A