Aspects of this technology are described in Pathiraja, Bimsara, Malitha Gunawardhana, and Muhammad Haris Khan. “Multiclass Confidence and Localization Calibration for Object Detection.” In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 19734-19743, 2023. The article was published online and is incorporated herein by reference in its entirety (see https://arxiv.org/abs/2306.08271).
The present disclosure relates to methods and systems for training a deep neural network (DNN) for multi-class object detection including predicting a bounding box and a class label with a confidence score for the input image. The method and system are particularly suited for safety critical features in vehicles and medical detection systems.
The development of self-driving car technology involves situations where aspects of human trust and acceptance are important considerations. Trust and safety are key elements for critical systems such as autonomous vehicles. That is, the users must trust that the driving agent is intelligent enough to safely drive in complex and unpredictable traffic environments. A system that is perceived as not trustworthy may not be used in the proper way or not at all, see Sara Mahmoud, Erik Billing, Henrik Svensson, Serge Thill, “Where to from here? On the future development of autonomous vehicles from a cognitive systems perspective,” Cognitive Systems Research, Volume 76, 2022, Pages 63-77. The field of autonomous vehicles needs to address the user perception of a trustworthy system.
One of the challenges for perception is the need for training on large amounts of data to learn how to handle the input data, which has significant consequences for self-driving cars. The nature of the sensory data to be collected is more than just dispersed images of objects but a composition of real world scenes and scenarios. In addition, the sensory data will include objects that a self-driving car will encounter.
There are various safety-critical applications of computer vision systems in which wrong predictions can lead to disastrous consequences. Safety-critical applications include healthcare diagnosis and legal research tools, as well as self-driving cars. Such safety-critical applications as car and pedestrian detection, road and lane detection, traffic light detection, and road scenes require precise detection. In self-driving cars, if the perception component wrongly detects a stop sign as a speed limit sign with high confidence, it can potentially lead to disastrous outcomes.
Deep neural networks (DNNs) are the backbone of many top-performing systems due to their high predictive performance across several challenging domains, including computer vision and natural language processing. See Kaiming He, Georgia Gkioxari, Piotr Dollar, and Ross Girshick. Mask r-cnn. In The IEEE International Conference on Computer Vision (ICCV), October 2017; Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 770-778, 2016; Olaf Ronneberger, Philipp Fischer, and Thomas Brox. Unet: Convolutional networks for biomedical image segmentation. In International Conference on Medical image computing and computer-assisted intervention, pages 234-241. Springer, 2015; Zhi Tian, Chunhua Shen, Hao Chen, and Tong He. Fcos: Fully convolutional one-stage object detection. In Proceedings of the IEEE international conference on computer vision, pages 9627-9636, 2019; Xizhou Zhu, Weijie Su, Lewei Lu, Bin Li, Xiaogang Wang, and Jifeng Dai. Deformable {detr}: Deformable transformers for end-to-end object detection. In International Conference on Learning Representations, 2021; Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. Language models are few-shot learners. Advances in neural information processing systems, 33:1877-1901, 2020; and Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv: 1810.04805, 2018.
However, some recent works report that DNNs are susceptible to making overconfident predictions, which leaves them miscalibrated. See Chuan Guo, Geoff Pleiss, Yu Sun, and Kilian Q Weinberger. On calibration of modern neural networks. In International Conference on Machine Learning, pages 1321-1330. PMLR, 2017; Marton Havasi, Rodolphe Jenatton, Stanislav Fort, Jeremiah Zhe Liu, Jasper Snoek, Balaji Lakshminarayanan, Andrew M Dai, and Dustin Tran. Training independent subnetworks for robust prediction. arXiv preprint arXiv: 2010.06610, 2020; Yaniv Ovadia, Emily Fertig, Jie Ren, Zachary Nado, David Sculley, Sebastian Nowozin, Joshua Dillon, Balaji Lakshminarayanan, and Jasper Snoek. Can you trust your model's uncertainty? evaluating predictive uncertainty under dataset shift. Advances in neural information processing systems, 32, 2019; and Florian Wenzel, Jasper Snoek, Dustin Tran, and Rodolphe Jenatton. Hyperparameter ensembles for robustness and uncertainty quantification. Advances in Neural Information Processing Systems, 33:6514-6527, 2020, each incorporated herein by reference in their entirety. This not only spurs a mistrust in their predictions, but more importantly, could lead to disastrous consequences in several safety-critical applications, such as healthcare diagnosis, self-driving cars, and legal research tools. See Michael W Dusenberry, Dustin Tran, Edward Choi, Jonas Kemp, Jeremy Nixon, Ghassen Jerfel, Katherine Heller, and Andrew M Dai. Analyzing the role of model uncertainty for electronic health records. In Proceedings of the ACM Conference on Health. Inference, and Learning, pages 204-213, 2020; Monika Sharma, Oindrila Saha, Anand Sriraman, Ramya Hebbalaguppe, Lovekesh Vig, and Shirish Karande. Crowd-sourcing for chromosome segmentation and deep classification. In Proceedings of the IEEE conference on computer vision and pattern recognition workshops, pages 34-41, 2017; Sorin Grigorescu, Bogdan Trasnea, Tiberiu Cocias, and Gigel Macesanu. A survey of deep learning techniques for autonomous driving. Journal of Field Robotics, 37(3):362-386, 2020; and Ronald Yu and Gabriele Spina Alì. What's inside the black box? ai challenges for lawyers and researchers. Legal Information Management, 19(1):2-13, 2019.
Several strategies have been proposed for improving model calibration. A simple calibration technique is a post-processing step that re-scales the outputs of a trained model using parameters which are learnt on a hold-out portion of the training set. Despite being easy to implement, these post-processing approaches are restrictive. They assume the availability of a hold-out set, which is not always possible in many real-world settings. Another route to reducing calibration error is train-time calibration techniques, which intervene at the training time by involving all model parameters. Typically train-time calibration methods feature an auxiliary loss term that is added to the application-specific loss function to regularize predictions. See Ramya Hebbalaguppe, Jatin Prakash, Neelabh Madan, and Chetan Arora. A stitch in time saves nine: A train-time regularizing loss for improved neural network calibration. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 16081-16090, June 2022; Aviral Kumar, Sunita Sarawagi, and Ujjwal Jain. Trainable calibration measures for neural networks from kernel mean embeddings. In International Conference on Machine Learning, pages 2805-2814. PMLR, 2018; Bingyuan Liu, Ismail Ben Ayed, Adrian Galdran, and Jose Dolz. The devil is in the margin: Margin-based label smoothing for network calibration. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 80-88, June 2022; Jishnu Mukhoti, Viveka Kulharia, Amartya Sanyal, Stuart Golodetz, Philip Torr, and Puneet Dokania. Calibrating deep neural networks using focal loss. Advances in Neural Information Processing Systems, 33:15288-15299, 2020.
Post-processing calibration methods re-scale the outputs of a trained model using some parameters that are learned on the hold-out portion of the training set. Temperature scaling (TS), which is an adaptation of Platt scaling, is a prominent example of post-processing calibration. See John Platt et al. Probabilistic outputs for support vector machines and comparisons to regularized likelihood methods. Advances in large margin classifiers, 10(3):61-74, 1999. It divides the logits (pre-softmax activations) from a trained network with a fixed temperature parameter (T>0) that is learned using a holdout validation set. A limitation of TS is that it decreases the confidence of the whole (confidence) vector, including the confidence of the correct class. Beyond using a single temperature parameter (T), some works uses a matrix (M) to transform the logits. The matrix (M) is also learnt using a hold-out validation set. Dirichlet calibration (DC) employed Dirichlet distributions to generalize the Beta-calibration method, originally proposed for binary classification, to a multi-class setting. See Meelis Kull, Telmo Silva Filho, and Peter Flach. Beta calibration: a well-founded and easily implemented improvement on logistic calibration for binary classifiers. In Artificial Intelligence and Statistics, pages 623-631. PMLR, 2017. DC is realized as an extra layer in a neural network whom input is log-transformed class probabilities. A differentiable approximation of expected calibration error (ECE) and utilizes it in a meta-learning framework to obtain well-calibrated models has been proposed. See Ondrej Bohdal, Yongxin Yang, and Timothy Hospedales. Meta-calibration: Meta-learning of model calibration using differentiable expected calibration error. arXiv preprint arXiv: 2106.09613, 2021. A class-distribution-aware calibration using temperature scaling (TS) and label smoothing (LS) for long-tailed visual recognition has been achieved. See Mobarakol Islam, Lalithkumar Seenivasan, Hongliang Ren, and Ben Glocker. Class-distribution-aware calibration for long-tailed visual recognition. arXiv preprint ar Xiv: 2109.05263, 2021; and Christian Szegedy, Vincent Vanhoucke, Sergey Ioffe, Jon Shlens, and ZbigniewWojna. Rethinking the inception architecture for computer vision. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 2818-2826, 2016. The majority of the aforementioned work address in-domain calibration. Recently, gradual perturbation of the hold-out validation set for simulating out-of-domain prior to learning the temperature parameter (T) was proposed. See Christian Tomani, Sebastian Gruber, Muhammed Ebrar Erdem, Daniel Cremers, and Florian Buettner. Post-hoc uncertainty calibration for domain drift scenarios. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 10124-10132, 2021. Despite being easy-to-implement and effective, TS methods require a hold-out validation set, which is not readily available in many realistic scenarios.
Train-time calibration techniques include Brier score, which is considered one of the earliest attempts for calibrating binary probabilistic forecast. See Glenn W Brier et al. Verification of forecasts expressed in terms of probability. Monthly weather review, 78(1):1-3, 1950. Some works report that models trained with negative loglikelihood (NLL) are prone to making overconfident predictions. A dominant class in train-time methods typically propose an auxiliary loss term that is used in conjunction with NLL. For instance, the Shanon entropy was utilized to penalize overconfident predictions. See Gabriel Pereyra, George Tucker, Jan Chorowski, Łukasz Kaiser, and Geoffrey Hinton. Regularizing neural networks by penalizing confident output distributions. arXiv preprint arXiv: 1701.06548, 2017. Similarly, label smoothing was shown to also improve calibration. See Rafael Müller, Simon Kornblith, and Geoffrey E Hinton. When does label smoothing help? Advances in neural information processing systems, 32, 2019; and Szegedy et al. Recently, a margin into the label smoothing technique was introduced to obtain well-calibrated models. While re-visiting focal loss (FL), it was. demonstrated that it is capable of implicitly calibrating DNNs. See Tsung-Yi Lin, Priyal Goyal, Ross Girshick, Kaiming He, and Piotr Dollár. Focal loss for dense object detection. IEEE transactions on pattern analysis and machine intelligence, 2018. The difference between confidence and accuracy (DCA) as an auxiliary loss term with the Cross-Entropy loss to achieve model calibration has been used. See Gongbo Liang, Yu Zhang, Xiaoqin Wang, and Nathan Jacobs. Improved trainable calibration method for neural networks on medical imaging classification. In British Machine Vision Conference (BMVC), 2020. Likewise, Kumar et al. developed MMCE loss for calibrating DNNs, which is formulated using a reproducible kernel in Hilbert space. See Arthur Gretton. Introduction to rkhs, and some simple kernel algorithms. Adv. Top. Mach. Learn. Lecture Conducted from University College London, 16:5-3, 2013. Most of these methods only calibrate the confidence of the predicted label ignoring the confidences of non-predicted classes. An auxiliary loss term for calibrating the whole confidence vector has been proposed.
Many probabilistic approaches stem from Bayesian formalism, which assumes a prior distribution over the neural network (NN) parameters, and training data is leveraged to obtain the posterior distribution over the NN parameters. See José M Bernardo and Adrian F M Smith. Bayesian theory, volume 405. John Wiley & Sons, 2009. This posterior is then used to estimate the predictive uncertainty. The exact Bayesian inference is computationally intractable. Consequently, approximate inference methods have been developed, including variational inference, and stochastic expectation propagation. See Charles Blundell, Julien Cornebise, Koray Kavukcuoglu, and DaanWierstra. Weight uncertainty in neural network. In International conference on machine learning, pages 1613-1622. PMLR, 2015; Christos Louizos and Max Welling. Structured and efficient variational deep learning with matrix gaussian posteriors. In International conference on machine learning, pages 1708-1716. PMLR, 2016; and José Miguel Hernández-Lobato and Ryan Adams. Probabilistic backpropagation for scalable learning of Bayesian neural networks. In International conference on machine learning, pages 1861-1869. PMLR, 2015. A non-probabilistic approach is ensemble learning that can be used to quantify uncertainty. It uses the empirical variance of the network predictions. Ensembles can be created with the differences in model hyperparameters, random initialization of weights and random shuffling of training data, dataset shift, and Monte Carlo (MC) dropout. See Wenzel et al.; Balaji Lakshminarayanan, Alexander Pritzel, and Charles Blundell. Simple and scalable predictive uncertainty estimation using deep ensembles. Advances in neural information processing systems, 30, 2017; Ovadia et al; Yarin Gal and Zoubin Ghahramani. Dropout as a Bayesian approximation: Representing model uncertainty in deep learning. In international conference on machine learning, pages 1050-1059. PMLR, 2016; and Zhilu Zhang, Adrian V Dalca, and Mert R Sabuncu. Confidence calibration for convolutional neural networks using structured dropout. arXiv preprint arXiv: 1906.09551, 2019.
Almost all prior work for addressing calibration is targeted at the classification task, and no noticeable study has been published that strives to improve the calibration of object detection methods, especially for out-of-domain predictions.
Visual object detection methods account for a major and critical part of many vision-based decision-making systems. Moreover, most of the current calibration techniques only aim at reducing calibration error for in-domain predictions. However, in many realistic settings, it is likely that, after model deployment, the incoming data distribution could continuously change from the training data distribution. In essence, the model should be well-calibrated for both in-domain and out-of-domain predictions.
An object is a train-time calibration method aimed at jointly calibrating multiclass confidence and bounding box localization. An object is a solution to the problem of calibrating object detectors which are inherently miscalibrated for both in-domain and out-domain predictions.
There is a need for calibration of deep learning-based object detection methods. Object detection methods have a problem that they are intrinsically mis-calibrated. Also, besides displaying noticeable calibration errors for in-domain predictions, they are also poorly calibrated for out-of-domain predictions. Further, conventional calibration techniques for classification are sub-optimal for object detection.
Accordingly it is one object of the present disclosure to provide a method and system of training a deep neural network (DNN) for multi-class object detection using an object detection system.
An aspect is a method of training a deep neural network (DNN) for multi-class object detection using an object detection system, the object detection system including a camera and a controller having the DNN, the method can include capturing an image by the camera; receiving, by the controller, the image; predicting, using the DNN, at least one bounding box and a class label with a confidence score for the image; calibrating the DNN by a multi-class confidence calibration, and a bounding box localization calibration; and outputting, by the controller, a calibrated image with the object bounding box, the corresponding class label, and a respective confidence score, wherein the confidence score is a probability associated with the predicted class label.
A further aspect is a vehicle safety-critical control system that can include a camera capturing an image; a controller receiving the image and configured with a deep neural network; the DNN configured to predict at least one bounding box and a class label with a confidence score for the image; the controller further configured to calibrate the prediction by the DNN by a multi-class confidence calibration, and a bounding box localization calibration; and the controller further configured to output a calibrated image with the object bounding box, the corresponding class label, and a respective confidence score, wherein the confidence score is a probability associated with the predicted class label.
A non-transitory computer-readable storage medium including computer executable instructions, wherein the instructions, when executed by a computer, cause the computer to perform a method that can include receiving an image; predicting, using a deep neural network (DNN), at least one bounding box and a class label with a confidence score for the image; calibrating the DNN by a multi-class confidence calibration, and a bounding box localization calibration; and outputting a calibrated image with the object bounding box, the corresponding class label, and a respective confidence score, wherein the confidence score is a probability associated with the predicted class label.
The foregoing general description of the illustrative embodiments and the following detailed description thereof are merely exemplary aspects of the teachings of this disclosure and are not restrictive.
A more complete appreciation of the invention and many of the attendant advantages thereof will be readily obtained as the same becomes better understood by reference to the following detailed description when considered in connection with the accompanying drawings, wherein:
The presently disclosed train-time calibration method for object detection can be evaluated using calibration error (ECE %) of DNN-based detectors in both in-domain and out-domain scenarios. In the present disclosure, a location-dependent calibration, termed as detection ECE (D-ECE) is preferentially used.
Aspects of the present disclosure include a train-time calibration approach that jointly calibrates predictive multiclass confidence and bounding box localization.
In an embodiment, a train-time calibration method for object detection includes an auxiliary loss term, which jointly calibrates multiclass confidences and bounding box localization. The embodiment leverages predictive uncertainty in multiclass confidences and bounding box localization. The auxiliary loss term is differentiable, operates on minibatches, and can be utilized with other task-specific loss functions.
Extensive experiments test the auxiliary loss term on challenging datasets, featuring several in-domain and out-of-domain scenarios. The train-time calibration method consistently reduces the calibration error across DNN-based object detection paradigms, including FCOS and Deformable DETR, both in in-domain and out-of-domain predictions.
The development of self-driving cars is one of the most challenging research areas in robotics, made more difficult by the fact that mistakes may cost lives. Automation in self-driving cars is often defined by the Society of Automotive Engineers' (SAE) levels of autonomy ranging from zero to five.
Situations in which a car may operate autonomously under certain conditions start at level three. At this level, the human driver remains ready to take over when the system fails to proceed. Despite being an active topic of industrial and academic research, there are presently no widely accepted solutions that reach Level 5.
A perception-decision-making architecture for a self-driving car may be broken down into sub-systems. A perception system links an agent to the environment through different types of sensor sub-systems such as cameras, LIDAR, radar, GPS and odometers.
The controller 424 may send operation signals to the steering system 432, braking system 434, and transmission system 436, either independently or in combination. For example, in some vehicles, brakes and transmission may be operated in conjunction to control speed of the vehicle, such as slowing or accelerating the vehicle. Some vehicles may be equipped with driver assist features such as automatic parking that may involve control of steering and braking. In all control conditions, the controller 424 may monitor the environment to check for presence of objects and/or persons, and control motion of the vehicle accordingly, for purposes of safety and avoid vehicle damage.
The controller 424 may be any processing device configured for external connection to various sensors and actuators. In addition, the controller 424 may be a function of the SoC 320 of
Many challenges may occur in the perception system. Detecting and recognizing traffic lights and road signs is one challenge for self-driving cars. Weather conditions, for example, may cause difficulties in detecting traffic lights and road signs or the signal changes in lights and road signs in rain, snow or fog.
A perfectly calibrated model for image classification outputs class confidences that match with the predictive accuracy. If the accuracy is less than the confidence, then the model is overconfident and if the accuracy is higher than the confidence, then the model is underconfident. Let =
(xi, y*t)
denote a dataset consisting of N examples drawn from a joint distribution
(
,
), where
is an input space and
is the label space. For each sample xi∈
, y*i∈
={1, 2, . . . K} is the corresponding ground truth class label. Let s∈
be the vector containing the predicted confidences of all K classes, and si[y] be the confidence predicted for a class y on a given input example xi. The model is said to be perfectly calibrated when, for each sample (x, y)∈
:
Contrary to image classification, in object detection, the dataset contains the ground-truth annotations for each object in an image, specifically the object localization information and the associated object categories. Let b*∈=[0,1]4 be the bounding box annotation of the object and y* be the corresponding class label. The prediction from an object detection model consists of a class label ŷ, with a confidence score ŝ and a bounding box {circumflex over (b)}. Unlike image classification, for object detection, precision is used instead of accuracy for calibration. Therefore, an object detector is perfectly calibrated when:
It is useful to measure miscalibration for image classification and object detection. For image classification, the expected calibration error (ECE) is used to measure the miscalibration of a model. The ECE measures the expected deviation of the predictive accuracy from the estimated confidence:
See Guo et al.; Küppers et al.; and Mahdi Pakdaman Naeini, Gregory Cooper, and Milos Hauskrecht. Obtaining well calibrated probabilities using bayesian binning. In Twenty-Ninth AAAI Conference on Artificial Intelligence, 2015, each incorporated herein by reference in their entirety.
As ŝ is a continuous random variable, the ECE is approximated by binning the confidence space of ŝ into N equally spaced bins. Therefore, ECE is approximated by:
where |I(n)| is the number of examples in the nth bin, and || is the total number of examples. acc(n) and conf(n) denote the average accuracy and average confidence in the nth bin, respectively. Although the ECE measure can be used for measuring miscalibration of object detectors, it fails to reflect the calibration improvement when additional box coordinates are used for calibration since the ECE considers confidence of each example independent of the box properties to apply binning and to calculate an average precision. In one embodiment, a location-dependent calibration is used, termed as detection ECE (D-ECE). It is defined as the expected deviation of the observed precision with respect to the given box properties.
Similar to ECE, the multidimensional D-ECE is calculated by partitioning both the confidence and box property spaces in each dimension k into Nk equally spaced bins.
Thus, D-ECE is given by:
where Ntotal is the total number of bins. prec(n) and conf(n) denote the average precision and confidence in each bin, respectively.
A baseline architecture for the MCCL is a CNN-based object detector, namely fully convolutional one-stage object detector (FCOS).
Four convolutional layers are added after the feature maps 504 of the backbone networks respectively for classification 512 and regression branches 516. Lcls is focal loss and Lreg is the IOU loss. Npos denotes the number of positive samples and λ being 1 is the balance weight for Lreg. The summation is calculated over all locations on the feature maps Fi. 1{c*
A single layer branch 514 is added in parallel with the classification branch to predict the “center-ness” of a location 2. The center-ness depicts the normalized distance from the location to the center of the object that the location is responsible for.
The inference of FCOS is includes, given input images, forward it through the network and obtain the classification scores px;y and the regression prediction tx;y for each location on the feature maps Fi. Choose the location with px;y>0:05 as positive samples and invert Eq. (1) to obtain the predicted bounding boxes.
A train-time calibration method is disclosed that at its core is an enhanced auxiliary loss function. This enhanced auxiliary loss formulation aims at jointly calibrating the multiclass confidence and bounding box localization during training. It is based on the fact that, the conventional object detectors (based on DNNs) predict a confidence vector along with the bounding box parameters.
Multiclass classification is a problem of classifying instances into one of three or more classes. Multiclass confidence is a confidence that each class confidence matches a predictive accuracy.
Bounding box localization is a location of the bounding box in an image.
The two key quantities to the loss function are (1) the predictive certainty in class logits and the bounding box localization and, (2) the class-wise confidence after computing class-wise logits mean (termed mean logits based class-wise confidence hereafter) and mean bounding box localization. The predictive certainty in class-wise logits is used in-tandem with the mean logits based class-wise confidence to calibrate the multi-class confidence scores. While the predictive certainty in the bounding box prediction is used to calibrate the bounding box localization. Instead of inputting the class-wise logits and predicted bounding box parameters to the classification loss and regression loss in task-specific detection losses, the class-wise mean logits and mean bounding box parameters are input, respectively. The mean logits based class-wise confidence, mean bounding box parameters, and the certainty in both class logits and bounding box localization is computed.
In particular, the Quantifying means and certainties are quantified. For the nth positive location, quantify the mean logits based class-wise confidence and class-wise certainty in logits cn∈
as well as the mean bounding box parameters
A Monte Carlo (MC) dropout method is used to quantify predictive uncertainty both in class confidences and the bounding localization. See Gal et al. The MC dropout method allows creating a distribution over both outputs from a typical DNN-based object detector. However, the naive implementation of the MC dropout method can incur high computational cost for large datasets and network architectures during model training. Subsequently, the MCCL method uses an efficient implementation of the MC dropout method that greatly reduces this computational overhead.
Given an input sample image, the MCCL method performs N stochastic forward passes by applying the Monte-Carlo (MC) dropout method. The MC dropout method generates a distribution over class logits and bounding box localization. Assuming one-stage object detector (e.g., Tian et al.), a dropout layer is inserted before the classification layer 512 and the regression layer 516. Let zn∈ and rn∈
encode the distributions over class-wise logit scores and bounding box parameters, respectively, corresponding to the nth positive location obtained after performing N, MC forward passes.
The mean logits based class-wise confidence is obtained by first taking the mean along the first dimension of zn to get class-wise mean logits and then applying the softmax. To obtain class-wise certainty cn, first estimate the uncertainty dn∈
by computing the variance along the first dimension of zn. Then, apply tanh over dn and subtract it from 1 as: cn=1−tanh(dn), where tanh is used to scale the uncertainty dn∈[0, inf) between 0 and 1.
Similarly, the mean bounding box parameters
Then, estimate the (joint) uncertainty μn as:
The certainty gn in the nth positive bounding box localization is then computed as: gn=1−tanh(un).
These estimated mean logits are leveraged based class-wise confidence, class-wise certainty and the certainty in bounding box localization to formulate the two components of the enhanced auxiliary loss: multi-class confidence calibration (MCC), and localization calibration (LC). The MCC method computes the difference between the fused mean confidence and certainty with the accuracy. The LC calculates the deviation between the predicted mean bounding box overlap (with the ground truth) and the predictive certainty of the bounding box. Both quantities are computed over a mini-batch during training.
In particular, to achieve multi-class confidence calibration (MCC), the mean logits based class-wise confidence and class-wise certainty are leveraged and fused by computing class-wise mean. The resulting vector is termed as the multiclass fusion of mean confidence and certainty. Then, calculate the absolute difference between the fused vector and the accuracy as:
where M=Nb×Npos. Nb is the number of samples in the minibatch and Npos represents the number of positive locations. ql,n[k]=1 if k is the ground truth class of the bounding box predicted for the nth location in the lth sample. vl,n[k]=(MCC is capable of calibrating the confidence of both the predicted label and non-predicted labels. It penalizes the model if, for a given class k, the fusion (of mean logits based class-wise confidence and certainty in class-wise logits) across a minibatch deviates from the average occurrence of this class across minibatch.
The localization component (LC) is calibrated by leveraging the certainty in bounding box prediction. Next the absolute difference between the mean bounding box overlap (with the ground truth) and the certainty in the bounding box prediction is computed:
where Nposl denotes the number of positive bounding box regions in the lth sample.
Both MCC and
LC operate over the mini-batches, and are combined to get an auxiliary loss term
MCCL-aux.
where β is a hyperparameter to control the relative contribution of LC to the overall loss
MCCL-aux.
Datasets: The in-domain calibration performance is evaluated using the following five datasets: Sim10K, KITTI, Cityscapes (CS), COCO, and PASCAL VOC (2012). See Matthew Johnson-Roberson, Charles Barto, Rounak Mehta, Sharath Nittur Sridhar, Karl Rosaen, and Ram Vasudevan. Driving in the matrix: Can virtual worlds replace human-generated annotations for real world tasks? In 2017 IEEE International Conference on Robotics and Automation (ICRA), pages 746-753. IEEE, 2017; Andreas Geiger, Philip Lenz, and Raquel Urtasun. Are we ready for autonomous driving? the kitti vision benchmark suite. In Computer Vision and Pattern Recognition (CVPR). 2012 IEEE Conference on, pages 3354-3361. IEEE, 2012; Marius Cordts, Mohamed Omran, Sebastian Ramos, Timo Rehfeld, Markus Enzweiler, Rodrigo Benenson, Uwe Franke, Stefan Roth, and Bernt Schiele. The cityscapes dataset for semantic urban scene understanding. In Proc. of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2016; Tsung-Yi Lin, Michael Maire, Serge J. Belongie, Lubomir D. Bourdev, Ross B. Girshick, James Hays, Pietro Perona, Deva Ramanan, Piotr Doll'a r, and C. Lawrence Zitnick. Microsoft COCO: common objects in context. CoRR, abs/1405.0312, 2014; and M. Everingham, S. M. A. Eslami, L. Van Gool, C. K. I. Williams, J. Winn, and A. Zisserman. The pascal visual object classes challenge: A retrospective. International Journal of Computer Vision, 111(1):98-136, January 2015, each incorporated herein by reference in their entirety.
Several of these datasets include labeled object classes, for use in training machine learning models for object detection. The Cityscapes dataset includes classes for flat surfaces, humans, vehicles, constructions, objects, nature, sky, and void. The KITTI dataset includes classes for cars, pedestrians, and cyclists. The PASCAL VOC dataset includes classes for person, animal, vehicle, and indoor objects. The animal class includes bird, cat, cow, dog, horse, and sheep. The vehicle class includes aeroplane, bicycle, boat, bus, car, motorbike, and train. The indoor object class includes bottle, chair, dining table, potted plant, sofa, and tv/monitor.
Sim10K contains synthetic images of the car category, and offers 10K images which are split into 8K for training, 1K for validation and 1K for testing. See Johnson-Roberson et al. Cityscapes is an urban driving scene dataset and consists of 8 object categoriesIt has 2975 training images and 500 validation images, which are used for evaluation. KITTI is similar to Cityscapes as it contains images of road scenes with a wide view of the area, except that KITTI images were captured with a different camera setup. Car class is used for experiments. Train2017 version of MS-COCO is used and it offers 118K training images, 5K validation images, and 41K test images. See Lin et al. PASCAL VOC 2012 consists of 5,717 training and 5,823 validation images, and provides bounding box annotations for 20 classes. For evaluating out-of-domain calibration performance, use Sim10K to CS, KITTI to CS, CS to Foggy-CS, COCO to Cor-COCO, CS to BDD100K, VOC to Clipart1k, VOC to Watercolor2k, and VOC to Comic2k. See Fisher Yu, Wenqi Xian, Yingying Chen, Fangchen Liu, Mike Liao, Vashisht Madhavan, and Trevor Darrell. Bdd100k: A diverse driving video database with scalable annotation tooling. arXiv preprint arXiv: 1805.04687, 2(5):6, 2018; Naoto Inoue, Ryosuke Furuta, Toshihiko Yamasaki, and Kiyoharu Aizawa. Cross-domain weakly-supervised object detection through progressive domain adaptation. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2018, each incorporated herein by reference in their entirety. Foggy Cityscapes (CS-F) dataset is developed using Cityscapes dataset by simulating foggy weather leveraging the depth maps in Cityscapes with three levels of foggy weather. See Christos Sakaridis, Dengxin Dai, and Luc Van Gool. Semantic foggy scene understanding with synthetic data. International Journal of Computer Vision, 126(9):973-992, 2018; incorporated herein by reference in its entirety. Cor-COCO is a corrupted version of MS-COCO val2017 dataset for out-of-domain evaluation, and is constructed by introducing random corruptions with severity levels defined in Hendrycks et al. See Dan Hendrycks and Thomas Dietterich. Benchmarking neural network robustness to common corruptions and perturbations. International Conference on Learning Representations (ICLR), 2019, incorporated herein by reference in its entirety. Clipart1k contains 1K images, which are split into 800 for training and 200 for validation, and shares 20 object categories with PASCAL VOC. See Inoue et al. Both Comic2k and Watercolor2k are comprised of 1K training images and 1K test images, and share 6 categories with Pascal VOC. BDD100k offers 70K training images, 20K test images and 10K validation images. See Fisher Yu, Haofeng Chen, XinWang, Wenqi Xian, Yingying Chen, Fangchen Liu, Vashisht Madhavan, and Trevor Darrell. Bdd100k: A diverse driving dataset for heterogeneous multitask learning. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pages 2636-2645, 2020, incorporated herein by reference in its entirety. The validation set is used for out-of-domain evaluation.
Implementation Details: All experiments are performed using Tesla V100 GPUs. COCO experiments use 8 GPUs and follow training configurations reported in Tian et al. Experiments on all other datasets utilize 4 GPUs and follow training configurations listed in Hsu et al. See Cheng-Chun Hsu, Yi-Hsuan Tsai, Yen-Yu Lin, and Ming-Hsuan Yang. Every pixel matters: Center-aware feature alignment for domain adaptive object detector. In European Conference on Computer Vision, pages 733-748. Springer, 2020, incorporated herein by reference in its entirety. β chosen for Equation (10) is from {0.01, 1}.
Evaluation metrics: The D-ECE metric is defined in Equation (6) at IoU of 0.5 to measure calibration performance. Note that, in addition to classification scores, the metric takes into account the calibration of center-x, center-y, width, and height of the predicted box. Detection performance is reported using mAP and AP @0.5 metrics.
Baselines: The train-time calibration method is compared against models trained with task-specific losses of a CNN-based object detector, namely FCOS, and ViT-based object detector, namely Deformable DETR. See Tian et al. and Zhu et al. The method is then compared with the temperature scaling post-hoc method and further with the recently proposed auxiliary loss functions for classification, including MDCA and AvUC. See Heggalaguppe et al.; and Ranganath Krishnan and Omesh Tickoo. Improving model calibration with accuracy versus uncertainty optimization. Advances in Neural Information Processing Systems, 2020, each incorporated herein by reference in their entirety.
In-domain experiments: The in-domain performance is compared on five challenging datasets with the models trained with task-specific loss of FCOS in Table 1. The results reveal that the disclosed train-time calibration method (MCCL) consistently improves the calibration performance of the task-specific losses. Notably, when added to the task-specific loss of FCOS, our MCCL reduces the D-ECE by 5.86% and 1.76% in VOC and CS datasets, respectively.
Out-of-domain experiments: Table 2 and Table 3 report out-of-domain performance on eight challenging shifts. It can be seen that the MCCL method is capable of consistently improving the calibration performance in all shift scenarios. There is a major decrease in D-ECE of 2.91% in Sim10K to CS shift. Similarly, there is a reduction in D-ECE by a visible margin of 2.47% for CS to CS-foggy (CS-F).
Comparison with post-hoc method: Temperature scaling (TS) is chosen as post-hoc calibration for comparison. The temperature parameter T is optimized using a holdout validation set to re-scale the logits of the trained model (FCOS). Table 5 compares the performance of TS with the MCCL method on COCO, Sim10K, CS and COCO corrupted datasets. TS performs inferior to the MCCL method and to the baseline. This could be because when there are multiple dense prediction maps, as in FCOS, it is likely that a single temperature parameter T will not be optimal for the corresponding logit vectors.
Test accuracy/precision: In addition to consistently reducing D-ECE, the MCCL method also preserves the mAP or AP@0.5 in almost all cases. In the in-domain experiments (Table 1), the maximum reduction in AP@0.5 is only 0.98% in the Sim10K dataset. In the out-of-domain experiments (Table 2 & Table 3), it mostly remains same in KITTI to CS, CS to BDD100K, VOC to watercolor, and VOC to comic shifts.
Overcoming under overconfidence: Confidence histogram (
Confidence values of incorrect detections: The confidence of the MCCL method is evaluated in the case of incorrect predictions (
With another baseline: Table 4 reports results with ViT-based object detector, namely Deformable DETR. See Zhu et al. Compared to FCOS, the Deformable DETR, is already a relatively strong baseline in calibration error. The MCCL method reduces the calibration error (D-ECE) for both in-domain and out-of-domain predictions. The major improvement (2.44% reduction in D-ECE) in calibration performance is observable for KITTI in-domain predictions.
Impact of each component in MCCL: The result of ablation experiments is reported for validating the performance contribution of different components in the MCCL method (Table 5). Moreover, the calibration performance of two train-time calibration losses is reported for image classification: MDCA and AvUC. The following trends are shown in Table 5. The calibration performance of the MCCL method is due to providing not only the class-wise mean logits and mean bounding box parameters to classification loss and regression loss of detection-specific loss, respectively, (MCCL w/o LC &
MCC). Both
MCC and
LC are integral components of the MCCL method. They are complementary to each other and their proposed combination is vital to delivering the best calibration performance. For instance, in Sim10K to CS shift, the proposed combination of
MCC and
LC achieves a significant reduction in D-ECE compared to MCC and LC alone. Further, the classification-based calibration losses are sub-optimal for calibrating object detection methods.
LC &
MCC)
LC)
MCC)
D-ECE convergence:
Impact on location-dependent calibration:
MCDO overhead & its Tradeoff analysis: Table 6 reveals that, in the MCCL implementation, upon increasing Monte-Carlo dropout (MCDO) passes N={3, 5, 10, 15},there is a little overhead in time cost over N=1. Table 7 shows the impact of varying the number of MC dropout passes (N) on calibration performance. Upon increasing the N, there is improved calibration, especially in OOD scenario.
The present disclosure provides a method and system that exploit a train-time technique for calibrating DNN-based object detection methods. One aspect of the method/system is an auxiliary loss which targets jointly calibrating multiclass confidence and box localization after leveraging respective predictive uncertainties. The method and system of the present disclosure can consistently reduce the calibration error of object detectors from two different DNN-based object detection paradigms for both in-domain and out-of-domain detections.
The above-described hardware description is a non-limiting example of corresponding structure for performing the functionality described herein.
Numerous modifications and variations of the present disclosure are possible in light of the above teachings. It is therefore to be understood that the invention may be practiced otherwise than as specifically described herein.
This application claims the benefit of priority to provisional application No. 63/581,710 filed Sep. 11, 2023, the entire contents of which are incorporated herein by reference.
Number | Date | Country | |
---|---|---|---|
63581710 | Sep 2023 | US |