Model calibration method and device, equipment, storage medium and product
By using the Moncatro method and interval to estimate the scores of neural networks in the model calibration method, the point of estimation of the neural network estimation has solved the problem of increasing calculation costs in the existing technologies to increase calculation costs, and realize the computing complexity and improve the model robust model robust. Sexual effect.
Patent Information
- Application Number
- CN202411570920.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-05
- Publication Date
- 2025-01-21
AI Technical Summary
The prior art solves the covariate offset problem through the GRASP method, which requires retraining the neural network model, which increases the computational cost and time overhead, and increases the computational complexity compared to processes such as estimation and adversarial training.
Put forward a model calibration method. By obtaining the first model and calibration sample data set after the training is completed, the Moncatro method is used to reason the calibration sample data set, outputs multiple points to estimate the results and calculates the standard deviation. Calibration results are calibrated.
It significantly reduces computational complexity and resource requirements, reduces the need for retraining, reduces computational costs and time overhead, and improves the robustness of the model.
Smart Images

Figure CN119337955A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a model calibration method, device, equipment, storage medium and product. Background Art
[0002] With the application of deep learning technology, it has demonstrated significant prediction and decision-making capabilities in a variety of business scenarios. However, in actual deployment, the so-called covariate shift problem is often encountered, that is, the statistical characteristics of the training data set are different from the data distribution in the actual application environment. This deviation may seriously affect the performance and reliability of the model.
[0003] At present, the above problems are mainly solved by the GRASP (Greedy Randomized Adaptive Search Procedures, a meta-heuristic algorithm for solving combinatorial optimization problems) method, but this method requires retraining the neural network model, which increases the computational cost and time overhead for the already deployed model. Processes such as density ratio estimation and adversarial training also increase the computational complexity.
[0004] Therefore, how to reduce the computational complexity of the model is a problem that needs to be solved urgently.
[0005] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention
[0006] The main purpose of this application is to provide a model calibration method, device, equipment, storage medium and product, aiming to solve the above problems in related technologies through GRASP (Greedy Randomized Adaptive Search Procedures), a meta-heuristic algorithm for solving combinatorial optimization problems) method, but such methods require retraining of neural network models, which increases the computational cost and time overhead for the deployed models, and processes such as density ratio estimation and adversarial training also increase the technical problem of computational complexity.
[0007] To achieve the above objectives, the present application proposes a model calibration method, which includes: Obtaining a first model after training and a calibration sample data set, wherein the loss function of the first model is a convex function; Based on the first model, the calibration sample data set is inferred by Monte Carlo method, a plurality of point estimation results are output, and a standard deviation of each of the point estimation results is calculated; Calculate the quantile value and the interval estimate based on the calibration sample data set, the point estimation result and the standard deviation; The point estimation result is calibrated with the interval estimation.
[0008] In one embodiment, before the step of calibrating the point estimation result by using the interval estimation, the method further includes: Based on the point estimation result, the standard deviation and the quantile value, a preset number of calibration methods are established, wherein the calibration method is shown in the following formula:
[0009] in, Indicates the convergence point of the current calibration method, re ult represents the point estimation result, is the standard deviation, represents the quantile value; Calculating evaluation indicators of each of the calibration methods; The calibration method corresponding to the maximum value of the evaluation index is used as the first calibration method of the first model.
[0010] In one embodiment, the step of calibrating the point estimation result by using the interval estimation comprises: Get the test set data; Based on the first model, the test set data is inferred by Monte Carlo method to obtain multiple point estimation results corresponding to the test set; Based on the quantile value and the first calibration method, the point estimation result is calibrated using the interval estimation.
[0011] In one embodiment, the calibration sample data set includes a plurality of calibration sample data, and the step of inferring the calibration sample data set by Monte Carlo method based on the first model and outputting a plurality of point estimation results includes: Based on the first model, each of the calibration sample data is processed by different neurons to obtain predicted values output by multiple neurons; For each of the predicted values, when the convex function converges to a minimum point, multiple point estimation results are output.
[0012] In one embodiment, before the step of obtaining the trained first model and the calibration sample data set, the method further includes: Get training set data; The model to be trained is iteratively trained using the training set data, and after the convex function converges to a minimum point, the iterative training is stopped, and a first model that has completed training is output.
[0013] In one embodiment, the step of calculating the quantile value and the interval estimate based on the calibration sample data set, the point estimation result and the standard deviation includes: Calculating a conformal score based on the standard deviation and the point estimation result; Calculating a quantile value based on the conformal score, the quantity value of the calibration sample data set, and a preset error rate; The interval estimate is calculated using the point estimate result, the standard deviation, and the quantile value.
[0014] In addition, to achieve the above purpose, the present application also proposes a model calibration device, the model calibration device comprising: A first acquisition module is used to acquire a first model after training and a calibration sample data set, wherein the loss function of the first model is a convex function; An inference module, configured to infer the calibration sample data set based on the first model by using the Monte Carlo method, output a plurality of point estimation results, and calculate a standard deviation of each of the point estimation results; A calculation module, configured to calculate a quantile value and an interval estimate based on the calibration sample data set, the point estimation result and the standard deviation; A calibration module is used to calibrate the point estimation result with the interval estimation.
[0015] In addition, to achieve the above objectives, the present application also proposes a model calibration device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the model calibration method described above.
[0016] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the model calibration method described above are implemented.
[0017] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the model calibration method described above are implemented.
[0018] The present application proposes a model calibration method, device, equipment, storage medium and product. The present application obtains a first model after training and a calibration sample data set, and uses the Monte Carlo method to infer the calibration sample data set through the first model after training, outputs multiple point estimation results, and calculates the standard deviation of each of the point estimation results, and uses the information of interval estimation to calibrate the point estimation results of the neural network, thereby improving the robustness of the model. By using the Monte Carlo method to generate the standard deviation, there is no need to change the model training architecture, and it is only applied in the inference stage, which significantly reduces the computational complexity and resource requirements. Similarly, the need for retraining is reduced, and the computational cost and time overhead are reduced. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0020] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0021] Figure 1 A schematic diagram of a flow chart provided for the first embodiment of the model calibration method of the present application; Figure 2 A flow chart of the calibration steps involved in the model calibration method of this application; Figure 3 A schematic diagram of the overall architecture involved in the model calibration method of this application; Figure 4 This is a schematic diagram of the interval estimation and quantile value calculation process involved in the model calibration method of this application; Figure 5 This is a schematic diagram of the module structure of the model calibration device according to an embodiment of the present application; Figure 6 Schematic diagram of the device structure of the hardware operating environment involved in the model calibration method in the embodiment of the present application.
[0022] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0023] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0024] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0025] The main solutions of the embodiments of this application are: Obtaining a first model after training and a calibration sample data set, wherein the loss function of the first model is a convex function; Based on the first model, the calibration sample data set is inferred by Monte Carlo method, a plurality of point estimation results are output, and a standard deviation of each of the point estimation results is calculated; Calculate the quantile value and the interval estimate based on the calibration sample data set, the point estimation result and the standard deviation; The point estimation result is calibrated with the interval estimation.
[0026] In related technologies, the above problems are mainly solved through the GRASP (Greedy Randomized Adaptive Search Procedures, a meta-heuristic algorithm for solving combinatorial optimization problems) method. However, this method requires retraining the neural network model, which increases the computational cost and time overhead for the deployed model. The processes such as density ratio estimation and adversarial training also increase the computational complexity.
[0027] The present application proposes a model calibration method, device, equipment, storage medium and product. The present application obtains a first model after training and a calibration sample data set, and uses the Monte Carlo method to infer the calibration sample data set through the first model after training, outputs multiple point estimation results, and calculates the standard deviation of each of the point estimation results, and uses the information of interval estimation to calibrate the point estimation results of the neural network, thereby improving the robustness of the model. By using the Monte Carlo method to generate the standard deviation, there is no need to change the model training architecture, and it is only applied in the inference stage, which significantly reduces the computational complexity and resource requirements. Similarly, the need for retraining is reduced, and the computational cost and time overhead are reduced.
[0028] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, a model calibration device, etc. The following takes the model calibration device as an example to illustrate this embodiment and the following embodiments.
[0029] Based on this, the present application embodiment provides a model calibration method, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the model calibration method of the present application.
[0030] In this embodiment, the model calibration method includes steps S10 to S40: Step S10, obtaining a first model after training and a calibration sample data set, wherein the loss function of the first model is a convex function; It should be noted that the first model is a deep neural network model obtained after training the training sample data set. When predicting the return on investment of carpooling coupons through the model, in the initial stage, the training data set can be obtained through an online randomized controlled trial, which contains 90% office workers and 10% tourists. Such a combination is reasonable on weekdays because office workers are the main users of carpooling services.
[0031] It should be noted that in actual deployment, the model will inevitably produce covariate shift problems, which poses a severe challenge to the application of deep neural networks. Solving this problem can not only improve the adaptability and robustness of the model in different environments, but also help improve the efficiency and accuracy of business decisions. Therefore, developing effective strategies to solve covariate shift is crucial to ensure the reliability and effectiveness of deep learning models in changing environments.
[0032] For example, in actual deployments, especially on weekends and holidays, the structure of the population using ride-sharing services changes significantly. For example, the ratio of office workers to tourists may be balanced at 50%:50%. This change in population ratio leads to covariate shift, that is, the data distribution during model training is inconsistent with the data distribution in the actual application scenario, which may lead to a decrease in the accuracy of model prediction.
[0033] In a feasible implementation manner, before the step of obtaining the first model after training and the calibration sample data set, the step further includes: Get training set data; The model to be trained is iteratively trained using the training set data, and after the convex function converges to a minimum point, the iterative training is stopped, and a first model that has completed training is output.
[0034] It should be noted that, taking the prediction of the return on investment of carpooling coupons as an example, during the training process, the specific data and model distribution are as follows: Training data distribution: 90% office workers, 10% tourists Actual data distribution: 50% office workers, 50% tourists Model: A simple three-layer fully connected neural network (DNN) with user features as input and predicted ROI as output; Loss function: Mean Squared Error (MSE), which is a convex function; Specifically, in the iterative training process of the model, a neural network model is trained on the training set. We assume that its loss function is a convex function. After the model is fully trained on the training data, it will generally converge to the vicinity of the optimal point, that is, the minimum value of the loss function. Finally, the first model that has completed the training is output.
[0035] Step S20, based on the first model, inferring the calibration sample data set by using the Monte Carlo method, outputting a plurality of point estimation results, and calculating the standard deviation of each of the point estimation results; It should be noted that before each model is actually deployed, we first collect a very small-scale data set for one to two days in the actual environment. Then we use this part of the data set as the calibration sample data set for the model, which is very likely to have the same probability distribution as the test set we will face. In this way, even if the distribution of the model's training set is inconsistent with the actual test data, we still ensure that the calibration sample data set and the test set have the same data distribution.
[0036] It should be noted that the Monte Carlo method is a numerical simulation method based on probability and statistical theory, which solves problems through random numbers and statistical experiments. Among them, the point estimation result can be the prediction result of multiple neuron outputs of the model.
[0037] It should be noted that in neural network models, generating standard deviations usually involves ensemble methods or input perturbation variances, but these methods require retraining multiple models, which is inefficient. To solve these problems, we use the Monte Carlo (MC) dropout method, which does not require changing the training architecture of the model and is only applied during the inference phase.
[0038] Monte Carlo Dropout method, that is, regular dropout can be interpreted as a Bayesian approximation of a Gaussian process. This method allows multiple predictions to be generated from a single input by applying a retention probability p to each neuron during inference, thereby creating a different set of active neurons for each prediction. By repeating the input with different neuron activations, we can obtain multiple point estimates of a sample result, and then we can find the mean of these point estimates, and then we can calculate the standard deviation corresponding to the point estimate .
[0039] Specifically, the calibration step flow chart in the embodiment of the present application is as follows: Figure 2 As shown, the steps are as follows: 1. Start training; 2. Train the model; 3. Select the calibration set. 4. Model reasoning; 5. Find the convergence point; 6. Calculate the standard deviation; 7. Calculate quantile values and interval estimates; 8. Select the calibration method; 9. Select the test set; 10. Model reasoning; 11. Calculate the standard deviation; 12. Use interval estimation to calibrate point estimation results.
[0040] Specifically, the overall architecture diagram of this application is as follows: Figure 3 As shown, the corresponding steps of line (line segment) 2-line12 are: Line 2: training model, Line 4: model inference, Line 5: finding convergence point, Line 6: calculating standard deviation, Line 7: calculating quantile value and interval estimate, Line 8: selecting calibration method, Line 10: model inference, Line 11: calculating standard deviation, Line 12: using interval estimate to calibrate point estimate result.
[0041] In a feasible implementation manner, the calibration sample data set includes a plurality of calibration sample data, and the step S20 of inferring the calibration sample data set by Monte Carlo method based on the first model and outputting a plurality of point estimation results includes: Based on the first model, each of the calibration sample data is processed by different neurons to obtain predicted values output by multiple neurons; For each of the predicted values, when the convex function converges to a minimum point, multiple point estimation results are output.
[0042] It should be noted that for each sample data in the calibration sample set, a retention probability p can be applied to each neuron during the inference process, allowing multiple predictions to be generated from a single input, thereby creating a different set of active neurons for each prediction. In this way, multiple predicted values can be output.
[0043] It should be noted that after outputting the predicted value, it is still necessary to calculate through the loss function. When the convex function converges to the minimum point, multiple point estimation results are output.
[0044] Step S30, calculating quantile values and interval estimates based on the calibration sample data set, the point estimation results, and the standard deviation; It should be noted that in this application, the quantile value is calculated by conformal prediction. The reasons for using this method are as follows: Ease of use: This method is easy to operate and does not require any changes to the existing model structure or the loss function of the neural network, reducing the complexity of implementation and application.
[0045] No model adjustment required: This method can be directly applied to existing models without retraining or adjusting the model. This is particularly beneficial for systems that have already been deployed, saving a lot of time and computing resources.
[0046] It should be noted that the quantile value is a numerical point that divides the probability distribution range of a random variable into several equal parts. Commonly used ones include median, quartiles and percentiles.
[0047] It should be noted that interval estimation is an important statistical method that estimates the range of population parameters by calculating confidence intervals and is widely used in various data analysis and decision-making scenarios.
[0048] In a feasible implementation manner, the step S30 of calculating the quantile value and the interval estimate based on the calibration sample data set, the point estimation result and the standard deviation includes: Calculating a conformal score based on the standard deviation and the point estimation result; It should be noted that the conformal score is calculated as follows:
[0049] Where Xcail is the sample value in the calibration set, is the approximate true value of the point estimate, is the point estimation result, is the standard deviation.
[0050] Calculating a quantile value based on the conformal score, the quantity value of the calibration sample data set, and a preset error rate; It should be noted that the preset error rate can be 0.1, 0.3, etc., and can be changed according to user needs without specific limitation.
[0051] The interval estimate is calculated using the point estimate result, the standard deviation, and the quantile value.
[0052] It should be noted that the calculation formulas for quantile values and interval estimates are as follows: Figure 4 As shown, where the interval estimate is C(Xcail) and the quantile value is , n cali is the size of the calibration sample data set, represents the quantity value of the calibration sample data set, and arranges multiple sample data in the calibration sample data set in increasing order of conformal scores. α represents the preset error rate and is a preset value, wherein α∈(0, 1).
[0053] Take the conformal fraction Quantiles as quantile values .
[0054] The calculation formula for interval estimation is: C(Xcail)=
[0055] in, represents the point estimation result, is the standard deviation of the sample data set, is the quantile value.
[0056] Specifically, the validity of the above proof depends on certain prerequisites, namely that the calibration set and the test set have the same data distribution. Next, we explain why this prerequisite is met in the method of this application. Before each model is actually deployed, we first collect a very small-scale data set for one to two days in the actual environment. Then we use this part of the data set as the calibration set of the model, which is very likely to have the same probability distribution as the test set we will face. In this way, even if the distribution of the training set of the model is inconsistent with the actual test data, we still ensure that the calibration set and the test set have the same data distribution, which will not affect the calibration of our point estimation using the conformal prediction method.
[0057] Step S40: calibrating the point estimation result by using the interval estimation.
[0058] It should be noted that before calibrating the point estimation results with interval estimation, the optimal calibration method needs to be selected.
[0059] In a feasible implementation manner, before the step S40 of calibrating the point estimation result by using the interval estimation, the method further includes: Based on the point estimation result, the standard deviation and the quantile value, a preset number of calibration methods are established, wherein the calibration method is shown in the following formula:
[0060] in, Indicates the convergence point of the current calibration method, re ult represents the point estimation result, is the standard deviation, represents the quantile value; It should be noted that which calibration method is verified and selected in the calibration set. For example, if the rating method is AUCC (Area Under Cost Curve, which refers to the area under the ROC curve, an indicator used to measure the performance of the classification model), then for the same neural network, the above three calculation methods can be calculated separately on the calibration set. Then plot the AUCC on the calibration set and see which method gives the largest AUCC. This is the calibration method to choose.
[0061] Calculating evaluation indicators of each of the calibration methods; The calibration method corresponding to the maximum value of the evaluation index is used as the first calibration method of the first model.
[0062] It should be noted that, taking AUCC as an example, the evaluation index can be the area under the AUCC curve. The larger the area, the better the evaluation index. After determining the maximum value of the evaluation index, the calibration method is selected as the calibration method for the final application of the model.
[0063] In a feasible implementation manner, the step S40 of calibrating the point estimation result by using the interval estimation includes: Get the test set data; Based on the first model, the test set data is inferred by Monte Carlo method to obtain multiple point estimation results corresponding to the test set; It should be noted that during the calibration process, the test set data is used for testing, and the trained neural network model is used to perform inference on the test set to obtain a point estimation result.
[0064] It should be noted that the Monte Carlo (MC) dropout method (a regularization method to prevent model overfitting) is used to generate the standard deviation, and then the point estimation result is calibrated through interval estimation.
[0065] Based on the quantile value and the first calibration method, the point estimation result is calibrated using the interval estimation.
[0066] It should be noted that according to the obtained quantile value And the first calibration method uses interval estimation to calibrate the point estimation result, so as to obtain a more accurate point estimation result.
[0067] It should be noted that by proposing a robust neural network calibration method, the covariate shift problem in deep neural networks is solved, the reliability and effectiveness of the model in a changing environment are significantly improved, and strong technical support is provided for the practical application of deep learning models.
[0068] The present application proposes a model calibration method, device, equipment, storage medium and product. The present application obtains a first model after training and a calibration sample data set, and uses the Monte Carlo method to infer the calibration sample data set through the first model after training, outputs multiple point estimation results, and calculates the standard deviation of each of the point estimation results, and uses the information of interval estimation to calibrate the point estimation results of the neural network, thereby improving the robustness of the model. By using the Monte Carlo method to generate the standard deviation, there is no need to change the model training architecture, and it is only applied in the inference stage, which significantly reduces the computational complexity and resource requirements. Similarly, the need for retraining is reduced, and the computational cost and time overhead are reduced.
[0069] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the model calibration method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.
[0070] This application also provides a model calibration device, please refer to Figure 5 , the model calibration device comprises: A first acquisition module 10 is used to acquire a first model after training and a calibration sample data set, wherein the loss function of the first model is a convex function; An inference module 20, configured to perform inference on the calibration sample data set based on the first model by using a Monte Carlo method, output a plurality of point estimation results, and calculate a standard deviation of each of the point estimation results; A calculation module 30, configured to calculate a quantile value and an interval estimate based on the calibration sample data set, the point estimation result and the standard deviation; The calibration module 40 is used to calibrate the point estimation result by using the interval estimation.
[0071] Optionally, the device further comprises: An establishment module is used to establish a preset number of calibration methods based on the point estimation result, the standard deviation and the quantile value, wherein the calibration method is shown in the following formula:
[0072] in, Indicates the convergence point of the current calibration method, re ult represents the point estimation result, is the standard deviation, represents the quantile value; A calculation module, used to calculate the evaluation index of each calibration method; A determination module is used to use the calibration method corresponding to the maximum value of the evaluation index as the first calibration method of the first model.
[0073] Optionally, the calibration module includes: An acquisition unit, used to acquire test set data; An inference unit, configured to infer the test set data based on the first model by using a Monte Carlo method to obtain a plurality of point estimation results corresponding to the test set; A calibration unit is used to calibrate the point estimation result using the interval estimation based on the quantile value and the first calibration method.
[0074] Optionally, the reasoning module includes: A processing unit, configured to process each of the calibration sample data through different neurons based on the first model to obtain predicted values output by multiple neurons; An output unit is used to output multiple point estimation results for each of the predicted values when the convex function converges to a minimum point.
[0075] Optionally, the device further comprises: The second acquisition module is used to acquire training set data; The training module is used to iteratively train the model to be trained using the training set data, stop the iterative training after the convex function converges to the minimum point, and output the first model after the training is completed.
[0076] Optionally, the calculation module includes: A first calculation unit, configured to calculate a conformal score based on the standard deviation and the point estimation result; A second calculation unit, configured to calculate a quantile value based on the conformal score, the quantity value of the calibration sample data set, and a preset error rate; The third calculation unit is used to calculate the interval estimate through the point estimation result, the standard deviation and the quantile value.
[0077] The model calibration device provided by the present application adopts the model calibration method in the above embodiment to solve the technical problem of model calibration. Compared with the prior art, the beneficial effects of the model calibration device provided by the present application are the same as the beneficial effects of the model calibration method provided by the above embodiment, and the other technical features in the model calibration device are the same as the features disclosed in the above embodiment method, which will not be repeated here.
[0078] The present application provides a model calibration device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the model calibration method in the above-mentioned embodiment one.
[0079] Reference below Figure 6 , which shows a schematic diagram of the structure of a model calibration device suitable for implementing an embodiment of the present application. The model calibration device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 6 The model calibration device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0080] like Figure 6 As shown, the model calibration device may include a processing device 1001 (such as a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the model calibration device are also stored. The processing device 1001, ROM1002 and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the model calibration device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows a model calibration device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.
[0081] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0082] The model calibration device provided by the present application adopts the model calibration method in the above embodiment to solve the technical problem of model calibration. Compared with the prior art, the beneficial effects of the model calibration device provided by the present application are the same as the beneficial effects of the model calibration method provided by the above embodiment, and the other technical features in the model calibration device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0083] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0084] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0085] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the model calibration method in the above-mentioned embodiment.
[0086] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM: Random Access Memory), a read-only memory (ROM: Read Only Memory), an erasable programmable read-only memory (EPROM: Erasable Programmable Read Only Memory or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM: CD-Read Only Memory), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency: Radio Frequency), etc., or any suitable combination of the above.
[0087] The computer-readable storage medium may be included in the model calibration device; or may exist independently without being assembled into the model calibration device.
[0088] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the model calibration device, the model calibration device: Obtaining a first model after training and a calibration sample data set, wherein the loss function of the first model is a convex function; Based on the first model, the calibration sample data set is inferred by Monte Carlo method, a plurality of point estimation results are output, and a standard deviation of each of the point estimation results is calculated; Calculate the quantile value and the interval estimate based on the calibration sample data set, the point estimation result and the standard deviation; The point estimation result is calibrated with the interval estimation.
[0089] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0090] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0091] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0092] The readable storage medium provided in the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned model calibration method, and can solve the technical problem of model calibration. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in the present application are the same as the beneficial effects of the model calibration method provided in the above-mentioned embodiment, and will not be described in detail here.
[0093] The present application also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the steps of the model calibration method as described above are implemented.
[0094] The computer program product provided in this application can solve the technical problem of model calibration. Compared with the prior art, the beneficial effects of the computer program product provided in this application are the same as the beneficial effects of the model calibration method provided in the above embodiment, which will not be repeated here.
[0095] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A model calibration method, characterized in that: The method comprises: Obtaining a first model after training and a calibration sample data set, wherein the loss function of the first model is a convex function; Based on the first model, the calibration sample data set is inferred by Monte Carlo method, a plurality of point estimation results are output, and a standard deviation of each of the point estimation results is calculated; Calculate the quantile value and the interval estimate based on the calibration sample data set, the point estimation result and the standard deviation; The point estimation result is calibrated with the interval estimation.
2. The method according to claim 1, characterized in that Before the step of calibrating the point estimation result by using the interval estimation, the method further includes: Based on the point estimation result, the standard deviation and the quantile value, a preset number of calibration methods are established, wherein the calibration method is shown in the following formula: in, Indicates the convergence point of the current calibration method, re ult represents the point estimation result, is the standard deviation, represents the quantile value; Calculating evaluation indicators of each of the calibration methods; The calibration method corresponding to the maximum value of the evaluation index is used as the first calibration method of the first model.
3. The method according to claim 2, characterized in that The step of calibrating the point estimation result by using the interval estimation comprises: Get the test set data; Based on the first model, the test set data is inferred by Monte Carlo method to obtain multiple point estimation results corresponding to the test set; Based on the quantile value and the first calibration method, the point estimation result is calibrated using the interval estimation.
4. The method according to claim 1, characterized in that The calibration sample data set includes a plurality of calibration sample data, and the step of inferring the calibration sample data set by Monte Carlo method based on the first model and outputting a plurality of point estimation results includes: Based on the first model, each of the calibration sample data is processed by different neurons to obtain predicted values output by multiple neurons; For each of the predicted values, when the convex function converges to a minimum point, multiple point estimation results are output.
5. The method according to claim 1, characterized in that Before the step of obtaining the first model after training and the step of calibrating the sample data set, the method further includes: Get training set data; The model to be trained is iteratively trained using the training set data, and after the convex function converges to a minimum point, the iterative training is stopped, and a first model that has completed training is output.
6. The method according to claim 1, characterized in that The step of calculating the quantile value and the interval estimate based on the calibration sample data set, the point estimation result and the standard deviation comprises: Calculating a conformal score based on the standard deviation and the point estimation result; Calculating a quantile value based on the conformal score, the quantity value of the calibration sample data set, and a preset error rate; The interval estimate is calculated using the point estimate result, the standard deviation, and the quantile value.
7. A model calibration device, characterized in that: The device comprises: A first acquisition module is used to acquire a first model after training and a calibration sample data set, wherein the loss function of the first model is a convex function; An inference module, configured to infer the calibration sample data set based on the first model by using the Monte Carlo method, output a plurality of point estimation results, and calculate a standard deviation of each of the point estimation results; A calculation module, configured to calculate a quantile value and an interval estimate based on the calibration sample data set, the point estimation result and the standard deviation; A calibration module is used to calibrate the point estimation result with the interval estimation.
8. A model calibration device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the model calibration method according to any one of claims 1 to 6.
9. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the model calibration method according to any one of claims 1 to 6 are implemented.
10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the model calibration method according to any one of claims 1 to 6 are implemented.