Method and system for calibrating instrument and apparatus by using improved order-preserving regression algorithm
Through the improved order-saving regression algorithm, the problems of large manpower and material consumption and low accuracy in the existing instrument calibration methods are solved, and automated and accurate instrument calibration is realized, which is suitable for multiple fields, ensuring the stability of calibration results and consistency.
Patent Information
- Application Number
- CN202411201947.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-29
- Publication Date
- 2024-12-06
AI Technical Summary
The existing instrument calibration methods require a lot of manpower and material resources to participate, and there is a problem of poor calculations, large errors, and the inability to detect calibration errors on a regular basis. Traditional numerical optimization methods perform poorly when the data volume is insufficient or the assumptions are not met. Non-parameterized methods If the binning calibration is not set on the sparse dataset, it is not effective.
Using the improved order-saving regression algorithm, smooth order-saving regression training is carried out by defining the expected calibration function of instrument observations, obtaining the trained calibration function, and deploying it to the actual operating equipment for real-time calibration, using data bucketing , adjacent pairing adjustment and linear interpolation calculation ensure the monotonicity and smoothness of the calibration function.
It realizes automated instrument calibration, reduces manual operation requirements, reduces labor and material costs, improves calibration accuracy and reliability, and is suitable for measurement accuracy under different environments and usage conditions, ensuring the stability and consistency of calibration results.
Smart Images

Figure CN119089408A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of automatic calibration, and in particular relates to an improved rank-preserving regression algorithm for use in an instrument calibration method and system. Background Art
[0002] In general, instrument calibration can be regarded as the process of converting the instrument's predicted value into the true value. The most intuitive method is to manually measure the observed signal, estimate the observation error and manually calibrate it regularly. The existing numerical optimization calibration methods can be divided into two categories: parametric and non-parametric. Platt used the SVM method, which is a traditional parametric method that attempts to calibrate the probability by fitting a sigmoid function. Beta-calibration further increases flexibility on this basis, assuming that the score is beta distributed.
[0003] The most popular nonparametric calibration method is monotone regression, where the goal is to find a monotone increasing function that minimizes the mean squared error between the observed and true values. For example, a common algorithm for monotone regression is the paired adjusted value (PAV) algorithm. Other common calibration methods include binning calibration, where the main idea is to bin the samples and calibrate the predicted probability of each bin.
[0004] Through the above analysis, the problems and defects of the prior art are as follows:
[0005] Manual calibration requires a lot of manpower and material resources, and there may be problems such as imprecise calculations, large errors, and inability to regularly and autonomously discover calibration errors. For traditional numerical optimization calibration methods, the parametric methods mentioned above require parameters to meet certain distribution assumptions, and may perform poorly when the amount of data is insufficient or the assumptions are not met. Non-parametric methods also have many limitations. For example, one limitation of the binning calibration method is that the number of bins needs to be set correctly. However, on sparse data sets, binning and binning methods may not work well if they are not set properly. Summary of the invention
[0006] In order to overcome the problems existing in the related art, the disclosed embodiment of the present invention provides an improved rank-preserving regression algorithm for an instrument calibration method and system.
[0007] The technical solution is as follows: An improved rank-preserving regression algorithm is used for an instrument calibration method, comprising:
[0008] S1, defines the calibration function to be calibrated in the expectation of the instrument observation value according to the numerical response space of the joint distribution of the instrument;
[0009] S2, the calibration function to be calibrated is trained by smoothing and preserving order regression through regression calibration algorithm to obtain the final calibration function after training;
[0010] S3, deploying the final calibration function after training to the actual running device, and performing real-time calibration on the input signal of the actual running device.
[0011] In step S1, a calibration function to be calibrated in the expectation of the instrument observation value is defined, including:
[0012] Let D = {(x i , y)} is the numerical response space of the instrument, x i is the input value or feature value of the i-th sample, y i is the instrument output signal value of the i-th sample; X = {x i} is the input space or feature space that affects the observed value, Y = {y i} is the observed label space, the threshold range y min ≤y i ≤y max ,y min is the lower bound of the instrument signal value, y max is the upper bound of the instrument signal value; under the condition of a given input signal x, the expectation of the instrument observation value is defined as:
[0013]
[0014] The calibration function to be calibrated is defined as:
[0015] f(x)→[y min ,y max ]
[0016] In the formula, E[] is the expected number mean, y is the random variable of the instrument signal value, P() is the probability, ε is the error accuracy, and f(x) is the function to be calibrated;
[0017] In step S2, before the calibration function to be calibrated, a training data set is given:
[0018]
[0019] Where T is the given training data set, i is the i-th data sample, and y i Observe the signal for the instrument. is the real signal, N is the number of data sets; define a data bucket, the number of data in each bucket is n, then the number of buckets K is
[0020] Furthermore, a smoothing order-preserving regression training is performed through a regression calibration algorithm to obtain the final calibration function after training, including: data bucketing, adjacent pairing adjustment, and interpolation calculation; data bucketing sorts and partitions the training data set according to the observed values; adjacent pairing adjustment uses the PAV algorithm to ensure that the calibration value is monotonically increasing, and merges and adjusts adjacent buckets; interpolation calculation uses a linear interpolation strategy to calculate the slope and bias of the calibration function.
[0021] Further, the data is bucketed, including:
[0022] (1) According to the instrument observation signal y i Sort the training data set T to obtain ordered training data: in, Initialize an empty list library Q1 to record the intermediate information of each bucket. For each bucket k, 0≤k≤K-1, perform the following calculations to divide the bucket data:
[0023] S k ={i|nk≤i≤n(k+1)}
[0024] In the formula, S k The collection divided into buckets;
[0025] (2) Calculation of predicted extreme values:
[0026] l k =min i∈S y i
[0027] u k =max i∈s y i
[0028] In the formula, l k For all instrument observation values y in the kth data bucket i The minimum value of u k For all instrument observation values y in the kth data bucket i The maximum value of
[0029] (3) Data volume and true mean calculation:
[0030] c k =|S k |
[0031]
[0032] In the formula, c k is the amount of data in the kth bucket, |S k | is the number of calculations, v k is the true mean of the kth bucket;
[0033] (4)Enter the table:
[0034] Q1.append((l k ,u k , v k , c k ))
[0035] In the formula, Q1 is an empty list library, and append() is the list insertion operation of data.
[0036] Furthermore, the adjacent buckets are merged and adjusted, including: after bucketing, applying order-preserving regression to ensure that the posterior calibration value of each bucket in the empty list library Q1 is monotonically increasing, and using the adjacent pairing violator algorithm PAV, the specific calculation method is as follows:
[0037] Define a new list library Q2 as the adjusted bucketed data, for each group of bucketed data k in Q1;
[0038] Step 1, initialization assignment: l = l k , u=u k , v = v k , c=c k ;
[0039] In the formula, l is the minimum value, u is the maximum value, v is the amount of data, and c is the overall mean;
[0040] Step 2: If the new list library Q2 is empty, the data is directly stored in the library: Q2.append((l, u, v, k)), and the calculation of the next group of bucket data is skipped; if it is not empty, go to step 3;
[0041] Step 3: Select the bucket result t=(l t ,u t , v t , c t );
[0042] In the formula, l t is the minimum value of the tail bucket data t, u t is the maximum value of the tail bucket data t, v t is the amount of data in the tail bucket t, c t is the mean of the tail bucket data t;
[0043] Step 4: If v≤v t Repeat the following steps to merge the buckets:
[0044] l=l t
[0045]
[0046] C=c+c t
[0047] The results of bucket t are removed from the new list library Q2:
[0048] Q2.remove((l t ,u t , v t , c t ))
[0049] In the formula, remove() is the removal operation of the data table;
[0050] Reselect the bucket results at the tail of Q2:
[0051] t=(l t ,u t , v t , c t )
[0052] Step 5: Add the bucketed data that meets the conditions into the table: Q2.append((l, u, v, c)).
[0053] Furthermore, the interpolation calculation uses a linear interpolation strategy to calculate the slope and bias of the calibration function, including: defining a deployment list library Q3 used for the final actual business deployment, for each adjacent two sets of data (l i ,u i , v i , c i )、(l i+1 ,u i+1 , v i+1 , c i+1 ) to obtain the final calibration function; where, i , l i+1 are the minimum values of two adjacent groups of data buckets, u i ,u i+1 are the maximum values of two adjacent groups of data buckets, v i , v i+1 are the data volumes of two adjacent groups of data buckets, c i , c i+1 are the means of two adjacent groups of data buckets respectively; the specific steps are:
[0054] The first step is to calculate the new bucket extreme value:
[0055]
[0056] In the formula, m i , m i+1 All are defined intermediate variables;
[0057] The second step is to calculate the slope and bias of the linear interpolation calibration:
[0058]
[0059] b=v i -a·m i
[0060] Where a is the slope of the linear interpolation calibration, and b is the bias;
[0061] The third step is to enter the bucketed linear interpolation data into the table:
[0062] Q3.append((m i , m i+1 , a, b))
[0063] According to the deployment list library Q3, the calibration function f is obtained:
[0064] f(x)=a i x+b i , if l i ≤x≤u i and(l i ,u i , a i , b i )
[0065] Where f(x) is the calibration function given an input feature x, and a i , b i are the linear calibration slope and bias of the i-th bucket respectively, and x is the input feature.
[0066] In step S3, Q3 and f(x) are deployed to the actual operating equipment to perform real-time calibration on the instrument input signal.
[0067] Another object of the present invention is to provide an improved rank-preserving regression algorithm for an instrument calibration system, which is implemented by the improved rank-preserving regression algorithm for an instrument calibration method, and the system comprises:
[0068] A calibration function definition module to be calibrated, used to define the calibration function to be calibrated in the expectation of the instrument observation value according to the numerical response space of the joint distribution of the instrument;
[0069] A calibration module, used for performing smoothing order-preserving regression training on a calibration function to be calibrated using a smoothing order-preserving regression calibration algorithm to obtain a final calibration function after training;
[0070] The actual operation scenario deployment module is used to deploy the final calibration function after training to the actual operation device and perform real-time calibration on the input signal of the actual operation device.
[0071] Furthermore, the operating equipment includes intelligent instruments, sensors and control system equipment
[0072] In combination with all the above-mentioned technical solutions, the beneficial effects of the present invention are as follows: the present invention realizes the numerical calibration of instruments and meters through automated means, reduces the need for manual operation, reduces the cost of manpower and material resources, and avoids the errors and inaccuracies that may be caused by manual calibration.
[0073] Secondly, by using the improved rank-preserving regression algorithm, this method can effectively deal with the signal segmentation deviation problem caused by instrument aging or environmental noise, and significantly improve the accuracy and reliability of calibration.
[0074] In specific applications, the present invention can be applied to multiple fields such as intelligent instruments, sensors and control system equipment to ensure measurement accuracy under different environments and usage conditions. Through steps such as bucketing and adjacent pairing adjustment, the method can handle the problem of loose and unstable signal value range distribution, ensure the monotonicity and smoothness of the calibration function, and thus improve the stability and consistency of the calibration results.
[0075] In addition, the present invention only needs to store a small amount of parameters after system training, can realize real-time calibration in actual use, has low computational consumption, and is suitable for efficient application in industrial scenarios. Through the smoothing order-preserving regression calibration algorithm, the calibration function can be dynamically updated to adapt to changes in environmental noise and instrument usage conditions, ensuring calibration accuracy in long-term use.
[0076] The present invention realizes efficient, accurate and automated instrument calibration through an improved rank-preserving regression algorithm, and has broad application prospects and practical value. BRIEF DESCRIPTION OF THE DRAWINGS
[0077] The accompanying drawings herein are incorporated in and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description, serve to explain the principles of the present disclosure;
[0078] Figure 1 This is a flow chart of a method for using an improved rank-preserving regression algorithm for instrument calibration provided by an embodiment of the present invention;
[0079] Figure 2 It is a diagram of a smoothing order-preserving regression calibration training process of a smoothing order-preserving regression calibration algorithm provided by an embodiment of the present invention;
[0080] Figure 3 is a schematic diagram of the calibration module deployment work provided by an embodiment of the present invention;
[0081] Figure 4 Schematic diagram of a system to be calibrated using an improved rank-preserving regression algorithm provided by an embodiment of the present invention for instrument calibration;
[0082] In the figure: 1. Calibration function definition module; 2. Calibration module; 3. Actual operation scenario deployment module. DETAILED DESCRIPTION
[0083] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific embodiments of the present invention are described in detail below in conjunction with the accompanying drawings. In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention can be implemented in many other ways different from those described herein, and those skilled in the art can make similar improvements without violating the connotation of the present invention, so the present invention is not limited by the specific implementation disclosed below.
[0084] Definitions of key terms related to the present invention:
[0085] Calibration: A measure is perfectly calibrated if, for a set of samples with a given true value p, the proportion of observations is close to p (or the numerical error is less than some error unit).
[0086] Isotonic Regression: A numerical analysis method, a non-parametric method for data fitting, which ensures that the fitting function is monotonic and is used in research such as statistical inference and multidimensional scaling.
[0087] Automatic Calibration: Calibrate the instrument values through automated means to ensure its measurement accuracy.
[0088] The innovation of the present invention lies in that: the present invention improves the accuracy and efficiency of the calibration process by introducing an improved rank-preserving regression algorithm; by optimizing data processing and algorithm calculation, the measurement errors of instruments can be corrected more accurately, human intervention and error accumulation in the calibration process are reduced, the reliability and consistency of the calibration results are significantly improved, and the present invention has broad application prospects.
[0089] The present invention proposes a numerical calibration method for instruments and meters, which uses the difference between instrument test signals and actual real signals to achieve automatic calibration based on an improved rank-preserving regression algorithm, alleviates the signal segmentation deviation problem caused by instrument device aging or environmental noise, and significantly improves calibration accuracy and efficiency of use in industrial scenarios.
[0090] Among them, for the automated calibration method: the present invention proposes an automated calibration method, which can be applied to multiple projects and products such as intelligent instruments, sensors, control system equipment, etc., to reduce manual operation costs and reduce the impact of environmental noise and human factors on instrument results.
[0091] Smoothed order-preserving regression calibration algorithm: The present invention adopts a smoothed order-preserving regression calibration algorithm, which includes three stages: data bucketing, adjacent pairing adjustment, and interpolation calculation. Data bucketing sorts and partitions the training data set according to the observed values to adapt to different usage scenarios and noise environments; adjacent pairing adjustment ensures that the calibration value is monotonically increasing through the PAV algorithm, and merges and adjusts adjacent buckets; the interpolation strategy derives a monotonic and smooth calibration function, which simplifies the computational complexity in actual business deployment, and specifically adopts a linear interpolation strategy to calculate the slope and bias of the calibration function.
[0092] Real-time calibration function: The calibration function can take effect in real time in the actual running equipment, and calibrate the instrument input signal in real time to ensure the accuracy of the observation value of the instrument in different environments and usage conditions.
[0093] The present invention can be applied to multiple projects and product applications including intelligent instruments, sensors, control system equipment, etc., and can quickly and accurately complete the numerical signal calibration operation, reducing the influence of environmental noise, human factors, etc. on the instrument results;
[0094] The present invention solves the problem of loose and unstable distribution of instrument signals in different value ranges; the automatic calibration of the present invention greatly reduces the cost of manual operation; the present invention only needs to store a small amount of parameters after system training, and real-time calibration can be completed during prediction and actual use, with low computing consumption.
[0095] Embodiment 1, as Figure 1 As shown, the improved rank-preserving regression algorithm provided by the embodiment of the present invention is used in the instrument calibration method, which includes:
[0096] S1, defines the calibration function to be calibrated in the expectation of the instrument observation value according to the numerical response space of the joint distribution of the instrument;
[0097] S2, performing smoothing rank-preserving regression calibration algorithm on the calibration function to be calibrated to perform smoothing rank-preserving regression training to obtain the final calibration function after training;
[0098] S3, deploying the final calibration function after training to the actual running device, and performing real-time calibration on the input signal of the actual running device.
[0099] In step S1, the calibration problem definition is included:
[0100] Let D = {(x i , y)} is the numerical response space of the instrument,, x i is the input value or feature value of the i-th sample, y i is the instrument output signal value of the i-th sample; where X = {x i} is the input space or feature space that affects the observed value (all factors that affect the observed value, such as real signal input and environmental noise), Y = {y i} is the observed label space (without loss of generality, define its threshold range y min ≤y i ≤y max ,y min is the lower bound of the instrument signal value, y max is the upper bound of the instrument signal value); under the condition of a given input signal x, the expectation of the instrument observation value is defined as:
[0101]
[0102] In particular, define a calibration function: f(x)→[y min ,y max ], then the instrument calibration problem can be defined as finding an optimal calibration function f * :
[0103] f * =argmin f ∫(E[Y|X=x]-f(x)) 2 dx
[0104] However, it is not possible to obtain f through direct mathematical optimization methods. * Because the instrument is a black box by default, its mathematical model cannot be obtained through mathematical analysis. It can only be obtained from the joint distribution D = {(x i , y)} are used for a posteriori calibration. Second, in real instrumentation applications, environmental noise or different usage conditions of the instrument may change over time, resulting in inaccurate observations, which means that the joint distribution D may also change in the same way. Therefore, the calibration function f * It is not static and needs to be updated regularly over time.
[0105] In step S2, the smoothing order-preserving regression calibration algorithm is performed, such as Figure 2 As shown; that is, the smoothing order-preserving regression module receives samples and updates the online optimal calibration function f * For immediate response prediction calibration, the optimal calibration function can be directly implemented in the rank-preserving regression module.
[0106] Specifically include:
[0107] Given a training dataset: Where yi is the instrument observation signal, is a real signal (depending on the specific usage conditions, for example, a simulated signal with a known real value can be used as input), and N is the number of data sets. Define a data bucket, and the number of data in each bucket is n (needs to be given in advance), then the number of buckets K is
[0108] The smoothing rank-preserving regression training process is divided into three parts: data bucketing, adjacent pairing adjustment, and interpolation calculation.
[0109] Phase 1: Data bucketing.
[0110] (1) First, sort the training data set T according to the instrument observation signal yi to obtain ordered training data: in Initialize an empty list library denoted as Q1 to record the intermediate information of each bucket. For each bucket k (where 0≤k≤K-1), perform the following calculation:
[0111] Bucket data division: S k ={i|nk≤i≤n(k+1)}; where S k The collection divided into buckets;
[0112] (2) Prediction extreme value calculation: k =min i∈S y i ,u k =max i∈S y i ; In the formula, l k For all instrument observation values y in the kth data bucket i The minimum value of u k For all instrument observation values y in the kth data bucket i The maximum value of
[0113] (3) Data volume and true mean calculation: In the formula, c k is the amount of data in the kth bucket, |S k | is the number of calculations, v k is the true mean of the kth bucket;
[0114] (4) Enter the table: Q1.append((l k ,u k , v k , c k )); In the formula, Q1 is an empty list library, and append() is the list insertion operation of data.
[0115] Due to the variety of instrument usage scenarios and noise environments, bucketing can automatically perform partition calibration according to the density of the predicted signal, and better deal with signal inaccuracy caused by loose and unstable value range distribution.
[0116] Phase 2: Adjustment of adjacent buckets.
[0117] After bucketing, order-preserving regression can be applied to ensure that the posterior calibration value of each bucket in the list library Q1 is monotonically increasing. The present invention adopts the pair-adjacent-violator algorithm PAV (pair-adjacent-violator algorithm) with high computational efficiency. However, the original PAV algorithm needs to be modified to be applicable to the bucketing scenario. For two adjacent buckets, if the monotonicity of the values is violated, they will be merged to generate a new bucket. The specific calculation method is as follows:
[0118] Define the new list library Q2 as the adjusted bucketed data. For each group of bucketed data k in Q1:
[0119] Step 1, initialization assignment: l = l k , u=u k , v = v k , c=c k ;
[0120] In the formula, l is the minimum value, u is the maximum value, v is the amount of data, and c is the overall mean;
[0121] Step 2: If the new list library Q2 is empty, the data is directly stored in the library: Q2.append((l, u, v, k)), and the calculation of the next group of bucket data is skipped; if it is not empty, go to step 3;
[0122] Step 3: Select the bucket result t=(l t ,u t , v t , c t );
[0123] In the formula, l t is the minimum value of the tail bucket data t, u t is the maximum value of the tail bucket data t, v t is the amount of data in the tail bucket t, c t is the mean of the tail bucket data t;
[0124] Step 4: If v≤v t Repeat the following steps to merge the buckets:
[0125] l=l t
[0126]
[0127] C=c+c t
[0128] The results of bucket t are removed from the new list library Q2:
[0129] Q2.remove((l t ,u t , v t , c t ))
[0130] In the formula, remove() is the removal operation of the data table;
[0131] Reselect the bucket results at the tail of Q2:
[0132] t=(l t ,u t , v t , c t )
[0133] Step 5: Add the bucketed data that meets the conditions into the table: Q2.append((l, u, v, c)).
[0134] Stage 3: Interpolation calculation.
[0135] Finally, an interpolation strategy is used to derive a monotonic and smooth calibration function. Among them, smooth rank-preserving regression has no restrictions on the choice of interpolation strategy. For simplicity, this invention only shows the linear interpolation strategy.
[0136] Define the deployment list library Q3 used for the final actual business deployment. For each adjacent two sets of data (l i ,u i , v i , c i )、(l i+1 ,u i+1 , v i+1 , c i+1 ) to obtain the final calibration function; where, i , l i+1 are the minimum values of two adjacent groups of data buckets, u i ,u i+1 are the maximum values of two adjacent groups of data buckets, v i , v i+1 are the data volumes of two adjacent groups of data buckets, c i , c i+1 are the means of two adjacent groups of data buckets respectively; the specific steps are:
[0137] The first step is to calculate the new bucket extreme value: In the formula, mi , m i+1 All are defined intermediate variables;
[0138] The second step is to calculate the slope and bias of the linear interpolation calibration: b=v i -a·m i ; Where a is the slope of the linear interpolation calibration and b is the bias;
[0139] The third step is to enter the bucketed linear interpolation data into the table: Q3.append((m i , m i+1 , a, b)); According to the deployment list library Q3, the calibration function f is obtained: f(x) = a i x+b i , if l i ≤x≤u i and(l i ,u i , a i , b i ) where f(x) is the calibration function for a given input feature x, a i , b i are the linear calibration slope and bias of the i-th bucket respectively, and x is the input feature.
[0140] According to the deployment list library Q3, the final calibration function f can be obtained:
[0141] f(x)=a i x+b i , if l i ≤x≤u i and(l i ,u i , a i , b i );
[0142] In step S3, Q3 and f(x) can be deployed to the actual operating equipment to perform real-time calibration on the instrument input signal, such as Figure 3 The calibration module deployment working diagram is shown in the figure.
[0143] Example 2, as another implementation, in step S2, the linear interpolation strategy is adopted in stage three, but the present invention does not specifically limit the interpolation calculation of the specific regression method, and can be replaced by various interpolation algorithms or models, for example, other non-parametric or parametric interpolation models such as polynomial interpolation. It can be expanded or refined according to the constraints on computing resources, memory usage and calibration accuracy of actual applications.
[0144] Embodiment 3, as Figure 4As shown, the improved rank-preserving regression algorithm provided by the embodiment of the present invention is used in the instrument calibration system and includes:
[0145] A calibration function definition module 1 to be calibrated is used to define a calibration function to be calibrated in the expectation of the instrument observation value according to the numerical response space of the joint distribution of the instrument;
[0146] Calibration module 2, used for performing smoothing order-preserving regression calibration algorithm on the calibration function to be calibrated to perform smoothing order-preserving regression training to obtain the final calibration function after training;
[0147] The actual operation scenario deployment module 3 is used to deploy the final calibration function after training to the actual operation device and perform real-time calibration on the input signal of the actual operation device.
[0148] The present invention improves production efficiency, accuracy and reliability: through the automated calibration method, the need for manual operation is reduced, and production efficiency is significantly improved. The improved rank-preserving regression algorithm can effectively deal with the problem of signal segmentation deviation, and improves the accuracy and reliability of calibration; and reduces costs: reduces manpower and material costs, and reduces expenses on manual calibration of instruments and meters.
[0149] The present invention has a smoothing order-preserving regression algorithm: the existing calibration method has limitations in dealing with signal segmentation deviation and noise problems. The present invention effectively solves these problems through an improved order-preserving regression algorithm, filling the gap in the instrument calibration algorithm level.
[0150] The present invention solves the problem of automated calibration and signal segmentation deviation. Compared with traditional calibration methods, which mostly rely on manual operation and have problems of large errors and low efficiency, the present invention overcomes this problem through an automated calibration method. The problem of signal segmentation deviation caused by instrument aging or environmental noise has always been a difficult problem in the field of calibration. The present invention effectively alleviates this problem through an improved rank-preserving regression algorithm.
[0151] Compared with traditional methods, this solution has the following advantages in instrument calibration:
[0152]
[0153]
[0154] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any modifications, equivalent substitutions and improvements made by any technician familiar with the technical field within the technical scope disclosed by the present invention and within the spirit and principles of the present invention should be covered within the protection scope of the present invention.
Claims
1. An improved rank-preserving regression algorithm is used for instrument calibration method, characterized in that: The method includes: S1, defines the calibration function to be calibrated in the expectation of the instrument observation value according to the numerical response space of the joint distribution of the instrument; S2, the calibration function to be calibrated is trained by smoothing and preserving order regression through regression calibration algorithm to obtain the final calibration function after training; S3, deploying the final calibration function after training to the actual running device, and performing real-time calibration on the input signal of the actual running device.
2. The improved rank-preserving regression algorithm according to claim 1 is used for the instrument calibration method, characterized in that: In step S1, a calibration function to be calibrated in the expectation of the instrument observation value is defined, including: Let D = {(x i ,y i )} is the numerical response space of the instrument, x i is the input value or feature value of the i-th sample, y i is the instrument output signal value of the i-th sample; X = {x i } is the input space or feature space that affects the observed value, Y = {y i } is the observed label space, the threshold range ymi n ≤y i ≤yma x ,ymi n is the lower bound of the instrument signal value, yma x is the upper bound of the instrument signal value; under the condition of a given input signal x, the expectation of the instrument observation value is defined as: The calibration function to be calibrated is defined as: f(x)→[y min ,y max ] Where E[] is the expected mean value, y is the random variable of the instrument signal value, P() is the probability, ε is the error accuracy, and f(x) is the function to be calibrated.
3. The improved rank-preserving regression algorithm according to claim 1 is used for the instrument calibration method, characterized in that: In step S2, before the calibration function to be calibrated, a training data set is given: Where T is the given training data set, i is the i-th data sample, and y i Observe the signal for the instrument. is the real signal, N is the number of data sets; define a data bucket, the number of data in each bucket is n, then the number of buckets K is 4. The improved rank-preserving regression algorithm for instrument calibration method according to claim 3 is characterized in that: The smoothing order-preserving regression training is performed through the regression calibration algorithm to obtain the final calibration function after training, including: data bucketing, adjacent pairing adjustment, and interpolation calculation; data bucketing sorts and partitions the training data set according to the observed values; adjacent pairing adjustment uses the PAV algorithm to ensure that the calibration value is monotonically increasing, and merges and adjusts adjacent buckets; interpolation calculation uses a linear interpolation strategy to calculate the slope and bias of the calibration function.
5. The improved rank-preserving regression algorithm for instrument calibration method according to claim 4 is characterized in that: Data bucketing, including: (1) According to the instrument observation signal y i Sort the training data set T to obtain ordered training data: in, Initialize an empty list library Q1 to record the intermediate information of each bucket. For each bucket k, 0≤k≤K-1, perform the following calculations to divide the bucket data: S k ={i|nk≤i≤n(k+1)} In the formula, S k The collection divided into buckets; (2) Calculation of predicted extreme values: L k =min i∈S y i u k =max i∈S y i In the formula, l k For all instrument observation values y in the kth data bucket i The minimum value of u k For all instrument observation values y in the kth data bucket i The maximum value of (3) Data volume and true mean calculation: c k =|S k | In the formula, c k is the amount of data in the kth bucket, |S k | is the number of calculations, v k is the true mean of the kth bucket; (4)Enter the table: Q1.append((l k ,u k ,v k ,c k )) In the formula, Q1 is an empty list library, and append() is the list insertion operation of data.
6. The improved rank-preserving regression algorithm for instrument calibration method according to claim 5 is characterized in that: Merge and adjust adjacent buckets, including: after bucketing, apply order-preserving regression to ensure that the posterior calibration value of each bucket in the empty list library Q1 is monotonically increasing, and use the adjacent pairing violator algorithm PAV. The specific calculation method is as follows: Define a new list library Q2 as the adjusted bucketed data, for each group of bucketed data k in Q1; Step 1, initialization assignment: l = l k , u=u k , v = v k , c=c k ; In the formula, l is the minimum value, u is the maximum value, v is the amount of data, and c is the overall mean; Step 2: If the new list library Q2 is empty, the data is directly stored in the library: Q2.append((l, u, v, k)), and the calculation of the next group of bucket data is skipped; if it is not empty, go to step 3; Step 3: Select the bucket result t=(l t ,u t , v t , c t ); In the formula, l t is the minimum value of the tail bucket data t, u t is the maximum value of the tail bucket data t, v t is the amount of data in the tail bucket t, c t is the mean of the tail bucket data t; Step 4: If v≤v t Repeat the following steps to merge the buckets: l=l t C=c+c t The results of bucket t are removed from the new list library Q2: Q2.remove((l t ,u t ,v t ,c t )) In the formula, remove() is the removal operation of the data table; Reselect the bucket results at the tail of Q2: t=(l t ,u t ,v t ,c t ) Step 5: Add the bucketed data that meets the conditions into the table: Q2.append((l, u, v, c)).
7. The improved rank-preserving regression algorithm for instrument calibration method according to claim 4 is characterized in that: The interpolation calculation uses a linear interpolation strategy to calculate the slope and bias of the calibration function, including: defining the deployment list library Q3 used for the final actual business deployment, for each adjacent two sets of data (l i ,u i , v i , c i )、(l i+1 ,u i+1 , v i+1 , c i+1 ) to obtain the final calibration function; where, i , l i+1 are the minimum values of two adjacent groups of data buckets, u i ,u i+1 are the maximum values of two adjacent groups of data buckets, v i , v i+1 are the data volumes of two adjacent groups of data buckets, c i , c i+1 are the means of two adjacent groups of data buckets respectively; the specific steps are: The first step is to calculate the new bucket extreme value: In the formula, m i , m i+1 All are defined intermediate variables; The second step is to calculate the slope and bias of the linear interpolation calibration: b=v i -a·m i Where a is the slope of the linear interpolation calibration, and b is the bias; The third step is to enter the bucketed linear interpolation data into the table: Q3.append((m i ,m i+1 ,a,b)) According to the deployment list library Q3, the calibration function f is obtained: f(x)=a i x+b i ,if l i ≤x≤u i and(l i ,u i ,a i ,b i ) Where f(x) is the calibration function given an input feature x, a i , b i are the linear calibration slope and bias of the i-th bucket respectively, and x is the input feature.
8. The improved rank-preserving regression algorithm for instrument calibration method according to claim 7 is characterized in that: In step S3, Q3 and f(x) are deployed to the actual operating equipment to perform real-time calibration on the instrument input signal.
9. An improved rank-preserving regression algorithm is used in an instrument calibration system, characterized in that: The system is implemented by using the improved rank-preserving regression algorithm described in any one of claims 1 to 8 for an instrument calibration method, and the system comprises: A calibration function definition module (1) to be calibrated is used to define the calibration function to be calibrated in the expectation of the instrument observation value according to the numerical response space of the joint distribution of the instrument; A calibration module (2) is used to perform smoothing rank-preserving regression training on a calibration function to be calibrated using a smoothing rank-preserving regression calibration algorithm to obtain a final calibration function after training; The actual operation scenario deployment module (3) is used to deploy the final calibration function after training to the actual operation device and perform real-time calibration on the input signal of the actual operation device.
10. The improved rank-preserving regression algorithm according to claim 9 is used in an instrument calibration system, characterized in that: The operating equipment includes intelligent instruments, sensors and control system equipment.
