Calibrating uncertainties of neural networks
The method optimizes uncertainty calibration for neural networks by using a separate calibration data set and distance metric error function, addressing the inefficiencies and inaccuracies in existing methods, resulting in high accuracy and efficiency for neural network uncertainty calibration in regression tasks.
Patent Information
- Application Number
- PCT/EP2024/057367
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-03-31
- Filing Date
- 2024-03-20
- Publication Date
- 2024-10-03
AI Technical Summary
Neural networks used for regression tasks, particularly in safety-critical applications like advanced driver assistance systems, face challenges in accurately calibrating uncertainties, leading to potential over-fitting and high computational costs, as well as sensitivity to outliers and misassigned variables in existing calibration methods.
A method that separates uncertainty calibration from neural network training, using a distinct calibration data set and optimizing scaling based on a distance metric error function to achieve high accuracy and efficiency, allowing precise calibration of uncertainties for regression tasks.
This approach provides high accuracy and computational efficiency in calibrating uncertainties, making it suitable for resource-constrained systems like driver assistance, enabling precise and efficient uncertainty scaling for improved prediction reliability.
Smart Images

Figure EP2024057367_03102024_PF_FP_ABST
Abstract
Description
[0001] Description
[0002] Calibration of uncertainties of neural networks
[0003] The present invention relates to a method, in particular a computer-implemented method for calibrating at least one uncertainty of a neural network, which neural network is designed to output a statement and an uncertainty associated with the statement as a function of input data, a computer program for carrying out the method according to the invention and a computer-readable medium on which the computer program is stored.
[0004] When using neural networks for regression or classification, it is often important to determine not only the prediction result but also the uncertainty associated with that prediction. This is especially true in safety-critical situations.
[0005] A prominent example in this context is advanced driver assistance systems (ADAS), where neural networks can be used, for example, to process input data from various sensors, such as radar, lidar, or ultrasonic sensors, as well as cameras. ADAS functions typically provided by ADAS systems can either support the driver while retaining control of the vehicle, or, depending on the level of automation, fully automated driving can be realized.Examples of ADAS functions include various methods for detecting objects or obstacles on the road, methods for detecting lane boundaries and / or keeping the vehicle in a lane, methods for detecting rain on the windshield, or even methods for assisting or executing a parking maneuver. The input data from the respective ADAS sensors used can be subject to a variety of problems, such as insufficient sensor resolution, problematic weather conditions, or rarely occurring scenarios. In addition, certain objects may be obscured by other objects and thus not visible in the input data. In all of these cases, knowledge of the uncertainty of the respective prediction is crucial.
[0006] For example, DE 102020215860A1 discloses a method for correcting input image data from a plurality of cameras of an all-round vision system that is impaired by rain, light, and / or dirt. In this method, input image data captured by the cameras is processed by a trained neural network, which also outputs an uncertainty for the determined image correction. A similar method for correcting input image data from a camera is disclosed in DE 102020215859A1.
[0007] However, neural networks, especially those used for regression tasks—i.e., networks that output continuous values as prediction results—tend to have inaccurate and therefore not directly usable uncertainties. Calibration or adjustment of the uncertainties is therefore required to increase accuracy.
[0008] For example, DE102019217300A1 discloses a method for training a neural network to output a prediction and associated uncertainty, in which the determined uncertainty is taken into account by the loss function. This ensures that the network determines well-calibrated uncertainties when the distribution of the data to be processed resembles the distribution of the training data.
[0009] A method specifically for calibrating uncertainties in regression has become known from "Accurate Uncertainties for Deep Learning Using Calibrated Regression" by V. Kuleshov et al., published on arXiv: 1807.00263, 2018 (DOI: https: / / doi.org / 10.48550 / arXiv.1807.00263). However, this method carries the risk of overfitting. Furthermore, it is based on isotonic regression and is therefore comparatively computationally intensive.
[0010] Another method for calibrating uncertainties is described in "Well-calibrated Model Uncertainty with Temperature Scaling for Dropout Variational Inference" by MH Laves et al., published on arXiv: 1909.13550, 2019 (DOI: https: / / doi.org / 10.48550 / arXiv.1909.13550). This method is less computationally intensive, but it can be very sensitive to outliers and misassigned variables, which can be particularly relevant for real-world datasets.
[0011] It would therefore be desirable to have a method for calibrating uncertainties for regression tasks that is characterized by high accuracy and high computational efficiency.
[0012] Therefore, the object underlying the invention is to provide a method for calibrating uncertainties in a regression, which is characterized by high accuracy and high computational efficiency.
[0013] The object underlying the invention is achieved by the method according to claim 1, the computer program according to claim 11 and the computer program product according to claim 12.
[0014] With regard to the method, the object underlying the invention is achieved by a method, in particular a computer-implemented method, for calibrating at least one uncertainty of a neural network for performing a regression, which neural network is designed to output a statement and an uncertainty associated with the statement depending on input data. The method comprises the following method steps:
[0015] - Providing calibration data for the neural network,
[0016] - Providing an indication of the uncertainty for all calibration data, - Generating a statement and associated uncertainty for all calibration data by processing the calibration data using the neural network in accordance with parameters for the neural network,
[0017] - comparing the generated uncertainty with a deviation of the generated statement from the indication using at least one error function in the form of a distance metric, taking into account a scaling for the error function, and
[0018] - Optimize scaling based on the comparison.
[0019] According to the invention, the calibration of the uncertainties is separated from the training of the neural network and is instead downstream of it. The calibration of the uncertainties is carried out using a, in particular separate,
[0020] Calibration data set.
[0021] In a regression, a continuous value is output using the neural network. The interpretation of the respective outputs and uncalibrated uncertainties for a regression differs significantly from the case of a classification.
[0022] In the context of the present invention, a distance metric is understood to be a metric or distance function for a metric space that assigns a non-negative, real value to two elements or points of a space. A distance metric is symmetric and satisfies the triangle inequality.
[0023] The inventive approach offers the advantage of high accuracy combined with resource efficiency. This makes it particularly suitable for use in embedded systems, such as those frequently used in driver assistance systems. Scaling allows for precise calibration for all predicted uncertainties. Calibration can be performed quickly, efficiently, and precisely. Furthermore, after calibration is complete, scaling can be taken into account for all uncertainties predicted by the calibrated neural network.
[0024] According to an advantageous embodiment, the neural network is a trained neural network. The method according to the invention can be part of a training method for training the neural network, or it can be a separate method running separately from the training method.
[0025] It is advantageous if the statement is a statement about the position of an object, a statement about optical flow, depth information regarding an object, or a statement about a lane boundary. However, other statements predictable with a neural network are also possible and fall within the scope of the present invention.
[0026] An advantageous embodiment of the method includes that the error function is a mean square deviation or an absolute deviation.
[0027] It is advantageous to minimize the error function. Therefore, the scaling that minimizes the error function is determined. The error function can be optimized using any optimization method, for example, a gradient method or the least squares method.
[0028] It is also advantageous if the scaling involves one or more constant scaling factors, a scaling vector, or a scaling matrix. Even using a single constant scaling factor, a precise calibration for all uncertainties can be achieved. However, it is also possible to use multiple scaling factors, a scaling vector, or a scaling matrix for the calibration in order to account for any differences in the uncertainties for different statements. It is also advantageous if the scaling is selected depending on at least one influencing variable for the statement. The influencing variable is preferably a scene influencing variable or a
[0029] Object influencing factor. For example, different scalings can be determined and used for different influencing factors and / or different scalings can be determined and used for different value ranges of the influencing factors.
[0030] A scene influencing factor, for example, concerns the modalities of the input data for the neural network, such as the calibration data. In the case of a driver assistance system, in which information about the vehicle's surroundings is collected by various ADAS sensors, this could be visibility conditions such as rain or fog, or the illumination of the vehicle's surroundings, especially at night.
[0031] Object influencing factors are, for example, a property of the object, such as a color, geometry or size of the object.
[0032] In an advantageous embodiment, a calibration rule is determined, which is taken into account in particular when using the neural network to output the statement and the uncertainty. The calibration rule preferably relates to a multiplication with the scaling, ie with one or more constant scaling factors, a scaling vector or a
[0033] Scaling matrix.
[0034] In a further advantageous embodiment, the uncertainty is normalized; in particular, the uncertainty is normalized to a geometric dimension of the object, in particular a length, width, height, area, or volume of the object. The normalized uncertainty can then be compared with a likewise and identically normalized deviation of the generated statement from the indication using an error function. By normalizing the uncertainties, for example in the case of object localization, the uncertainties for each statement can be correctly calibrated regardless of the respective object size and object class. In this way, different object sizes, aspect ratios, geometric dimensions, and sizes of bounding boxes can be taken into account for the calibration, and it can be avoided that larger objects or bounding boxes have a negative influence on the calibration for smaller objects or bounding boxes.
[0035] The method according to the invention for calibrating at least one uncertainty of a neural network is preferably used for driver assistance systems. However, the method can also be used in other areas, for example, in computer vision or for medical imaging procedures.
[0036] The invention additionally relates to the use of a neural network calibrated by means of the method according to the invention according to one of the described embodiments for executing at least one ADAS function. For example, the ADAS function can be object detection by means of an object detector comprising a neural network calibrated according to the invention. In this case, statements about at least one object, for example a position or geometric size of the object, are determined using at least one ADAS sensor, for example a camera. In this example, the object is again in particular another road user in the vehicle's surroundings, a roadway boundary, an object in the vehicle's surroundings, or a traffic sign.In addition to the statement, an uncertainty is also output for the statement made and the uncertainty is multiplied by the scaling, for example in the form of a scaling factor, to obtain a calibrated uncertainty.
[0037] The object underlying the invention is further achieved by a computer program with instructions which, when executed by a computer, cause the computer to execute the inventive method according to one of the described embodiments, as well as by a computer program product on which the inventive computer program is stored. The invention is explained in more detail with reference to the following figures. It shows:
[0038] Fig. 1 shows a first advantageous embodiment of the method according to the invention, and
[0039] Fig. 2 shows an object detection using a neural network calibrated according to the invention.
[0040] In the figures, identical elements are given the same reference numerals.
[0041] The advantageous embodiment illustrated in Fig. 1 assumes a pre-trained neural network (NN) for performing a regression. The neural network (NN) serves to determine a statement p about an object 0 and an uncertainty a associated with the statement. In this case, the statement is the position of object 0.
[0042] The uncertainties a output by a neural network (NN) are typically subject to errors and do not correspond to the actual uncertainty. To enable a precise prediction of the uncertainty a, the uncertainties a must be calibrated, which can be performed using the method according to the invention. After calibration, the uncertainty a can be advantageously interpreted probabilistically; for example, statements such as the presence of the correct value in a predicted uncertainty interval can be made in 95% of cases.
[0043] For calibration purposes, calibration data Ikai are first provided for the neural network NN, along with an indication Ind for all calibration data Ikai. The calibration data Ikai are processed by the neural network, and a statement p and associated uncertainty a are generated based on the calibration data Ikai. This generated uncertainty a is compared with a deviation of the generated statement p and the indication Ind using at least one error function Error, and the parameters are optimized based on the comparison.
[0044] The error function is a distance metric for which the scaling s is taken into account, which is a constant, scalar value for the configuration shown here. An error function Error based on a mean square deviation is then given for N detections, for example, by and an error function Error based on an absolute deviation by
[0045] Here A = \Ind - [i\ is the absolute deviation, i.e. the difference between the indication and the predicted statement p.
[0046] The scaling s is then selected or optimized using a suitable optimization method, such as a gradient method or a least squares method, such that the error function Error is minimized. Based on the optimized scaling s, a calibration rule KAL is determined, which can be considered when using the neural network for predictions. This is schematically illustrated in Fig. 2 for the case of object detection using an object detector for a driver assistance system.
[0047] Using one or more ADAS sensors, information about a vehicle's surroundings, and in particular about at least one object 0 in the vehicle's surroundings, is acquired. This information is provided to the neural network NN as input. The neural network NN is designed to use the input to make a statement about the position P of the at least one object and to output an uncertainty o associated with the position. In addition to the position P of the object, which can be given, for example, by its center coordinates, a statement about a size of the object 0 can also be made, for example, a length, width, height, area, or volume of the object 0. From the uncertainty o output by the network NN, a calibrated uncertainty Okai is calculated using the calibration rule KAL, whereby the following applies to the configuration shown here: a kcü = sa.
Claims
Patent claims 1. Method, in particular a computer-implemented method for calibrating at least one uncertainty (o) of a neural network (NN) for performing a regression, which neural network (NN) is designed to output a statement (p) and an uncertainty (o) associated with the statement depending on input data, comprising the method steps: - Providing calibration data (Ikai) for the neural network (NN), - Providing an indication (Ind) regarding the uncertainty (o) for all calibration data (Ikai), - Generating a statement and associated uncertainty for all calibration data by processing the calibration data using the neural network (NN) in accordance with parameters for the neural network (NN), - comparing the generated uncertainty (o) with a deviation of the generated statement from the indication (Ind) using at least one error function (Error) in the form of a distance metric, wherein a scaling (s) is taken into account for the error function (Error), and - Optimize the scaling (s) based on the comparison.
2. The method according to claim 1, wherein the neural network (NN) is a trained neural network (NN).
3. Method according to claim 1 or 2, wherein the statement (p) is a statement about a position (P) of an object (0), a statement about an optical flow, depth information regarding an object (0) or a statement about a lane boundary.
4. Method according to at least one of the preceding claims, wherein the error function (Error) is a mean square deviation or an absolute deviation.
5. Method according to one of the preceding claims, wherein the error function (Error) is minimized.
6. Method according to one of the preceding claims, wherein the scaling (s) is one or more constant scaling factors, a scaling vector or a scaling matrix.
7. Method according to one of the preceding claims, wherein the scaling (s) is selected as a function of at least one influencing variable statement.
8. Method according to one of the preceding claims, wherein a calibration rule (KAL) is determined, which is taken into account in particular when using the neural network (NN) to output the statement (p) and the uncertainty (o).
9. Method according to one of the preceding claims, wherein the uncertainty (o) is normalized, in particular wherein the uncertainty (o) is normalized to a geometric size of the object (0), in particular a length, width, height, area or volume of the object (0).
10. Use of a neural network (NN) calibrated according to the method according to one of the preceding claims for executing at least one ADAS function.
11. A computer program comprising instructions which, when executed by a computer, cause the computer to carry out the method according to any one of claims 1 to 9.
12. A computer program product on which the computer program according to Claim 11 is stored.
Citation Information
Patent Citations
Correction of camera images in case of rain, light exposure and dirt
DE102020215859A1
Correction of images from a 360° camera system in case of rain, light exposure and dirt.
DE102020215860A1
Method for training an artificial neural network, computer program, storage medium, device, artificial neural network and application of the artificial neural network
DE102019217300A1
Method, apparatus and computer program for an uncertainty assessment of an image classification
DE102021202813A1
