summaries: This paper tests methods for training a classifier for predicting trustworthiness-- formulated here as predicting whether a given image will be classified correctly or not by an target classifier -- on large scale datasets and finds that using existing loss functions like uncertainty estimates/focal loss on this binary classification task cannot detect untrustworthy samples, all samples are classified as positive resulting in 100% FPR (0% TNR). They attempt to fix this shortcoming by introducing a steep slope loss which essentially separates features w.r.t. correct and incorrect predictions from each other, and the loss is bounded in its magnitude. The paper extensively tests whether its possible to predict trustworthiness with two oracle/target classifier combinations on Imagenet and its stylized/adversarial test sets. The paper proposes the steep slope loss for learning trustworthiness under a supervised training setup. A pre-trained neural network is further trained on the steep slope loss to learn trustworthiness as a binary classification problem. The approach is evaluated on ImageNet for a ResNet and a ViT model. In addition, evaluations on MNIST and CIFAR-10 are provided for comparisons with the related work. In all experiments, the proposed approach shows good performance.  The paper proposes Steep Slope loss, a loss function that is designed to improve performance in the binary classification task of prediction trustworthiness. The paper reports that common loss functions used in this domain such as cross-entropy loss, focal loss, and true classification probability loss (TCP), all suffer from an issue where correct predictions tend to dominate over incorrect predictions, due to issues of class imbalance and evaluations on simple datasets where classifiers have achieved very high accuracy.   Steep Slope loss solves this issue by controlling the slope parameters on both the negative and positive classification thresholds with two hyperparameters that control the derivative and gradient updates for datapoints that are correctly classified and incorrectly classified separately. These two controlled slopes are a function of the signed distance of the output of the classifier from the hyperplane of classification.  The paper evaluates this loss on the MNIST, CIFAR, and Imagenet datasets and shows empirical improvements on multiple binary classification metrics such as AUPRC, AUROC, and FPR95, and importantly, SS loss shows marked improvements in the TNR, therefore being more robust to detecting incorrectly classified points. The authors find that past trustworthiness predicting methods are prone to overfitting to the training set where correct predictions are dominant. The label imbalance makes the trustworthiness predictors over-confident to even incorrect predictions. To solve the problem, this work proposes a new training loss named steep slope loss, which aims at improving the generalizability of trustworthiness predictors. The intuition behind this is to emphasize the negative class during training. The experiments are conducted in ImageNet. The results show the shortcomings of past methods with cross-entropy loss, focal loss, and TCP loss and then demonstrate the effectiveness of the proposed method. 
abstractText: Understanding the trustworthiness of a prediction yielded by a classifier is critical for the safe and effective use of AI models. Prior efforts have been proven to be reliable on small-scale datasets. In this work, we study the problem of predicting trustworthiness on real-world large-scale datasets, where the task is more challenging due to high-dimensional features, diverse visual concepts, and a large number of samples. In such a setting, we observe that the trustworthiness predictors trained with prior-art loss functions, i.e., the cross entropy loss, focal loss, and true class probability confidence loss, are prone to view both correct predictions and incorrect predictions to be trustworthy. The reasons are two-fold. Firstly, correct predictions are generally dominant over incorrect predictions. Secondly, due to the data complexity, it is challenging to differentiate the incorrect predictions from the correct ones on real-world large-scale datasets. To improve the generalizability of trustworthiness predictors, we propose a novel steep slope loss to separate the features w.r.t. correct predictions from the ones w.r.t. incorrect predictions by two slide-like curves that oppose each other. The proposed loss is evaluated with two representative deep learning models, i.e., Vision Transformer and ResNet, as trustworthiness predictors. We conduct comprehensive experiments and analyses on ImageNet, which show that the proposed loss effectively improves the generalizability of trustworthiness predictors. The code and pre-trained trustworthiness predictors for reproducibility are available at https://github.com/luoyan407/predict_trustworthiness.
authors.name: Yan Luo
authors.name: Yongkang Wong
authors.name: Mohan S Kankanhalli
authors.name: Qi Zhao
references.authors: Daniel Leidner Christoph Borst Alexander Dietrich Michael Beetz Alin Albu-Schäffer
references.title: Classifying compliant manipulation tasks for automated planning in robotics
references.venue: In IEEE/RSJ International Conference on Intelligent Robots and Systems,
references.authors: Antoine Caté Lorenzo Perozzi Erwan Gloaguen Martin Blouin
references.title: Machine learning as a tool for geologists
references.venue: The Leading Edge,
references.authors: José Antonio Sanz Mikel Galar Aranzazu Jurio Antonio Brugos Miguel Pagola Humberto Bustince
references.title: Medical diagnosis of cardiovascular diseases using an interval-valued fuzzy rule-based classification system
references.venue: Applied Soft Computing,
references.authors: Alex Krizhevsky Ilya Sutskever Geoffrey E Hinton
references.title: ImageNet classification with deep convolutional neural networks
references.venue: In Advances in Neural Information Processing Systems,
references.authors: Kaiming He Xiangyu Zhang Shaoqing Ren Jian Sun
references.title: Deep residual learning for image recognition
references.venue: In IEEE Conference on Computer Vision and Pattern Recognition,
references.authors: Mingxing Tan Quoc V. Le
references.title: EfficientNet: Rethinking model scaling for convolutional neural networks
references.venue: In International Conference on Machine Learning,
references.authors: Alexey Dosovitskiy Lucas Beyer Alexander Kolesnikov Dirk Weissenborn Xiaohua Zhai Thomas Unterthiner Mostafa Dehghani Matthias Minderer Georg Heigold Sylvain Gelly Jakob Uszkoreit Neil Houlsby
references.title: An image is worth 16x16 words: Transformers for image recognition at scale
references.venue: In International Conference on Learning Representations,
references.authors: Heinrich Jiang Been Kim Melody Guan Maya Gupta
references.title: To trust or not to trust a classifier
references.venue: In Advances in Neural Information Processing Systems,
references.authors: Charles Corbière Nicolas Thome Avner Bar-Hen Matthieu Cord Patrick Pérez
references.title: Addressing failure prediction by learning model confidence
references.venue: In Advances in Neural Information Processing Systems,
references.authors: Yann LeCun Léon Bottou Yoshua Bengio Patrick Haffner
references.title: Gradient-based learning applied to document recognition
references.venue: Proceedings of the IEEE,
references.authors: Jia Deng Wei Dong Richard Socher Li-Jia Li Kai Li Li Fei-Fei
references.title: ImageNet: A large-scale hierarchical image database
references.venue: In IEEE Conference on Computer Vision and Pattern Recognition,
references.authors: Mitra Basu Tin Kam Ho
references.title: Data complexity in pattern recognition
references.venue: Springer Science & Business Media,
references.authors: Dan Hendrycks Kevin Gimpel
references.title: A baseline for detecting misclassified and out-of-distribution examples in neural networks
references.venue: In International Conference on Learning Representations,
references.authors: Foster J. Provost Tom Fawcett Ron Kohavi
references.title: The case against accuracy estimation for comparing induction algorithms
references.venue: In Proceedings of the Fifteenth International Conference on Machine Learning,
references.authors: Ian Goodfellow Jonathon Shlens Christian Szegedy
references.title: Explaining and harnessing adversarial examples
references.venue: In International Conference on Learning Representations,
references.authors: Anh Nguyen Jason Yosinski Jeff Clune
references.title: Deep neural networks are easily fooled: High confidence predictions for unrecognizable images
references.venue: In IEEE Conference on Computer Vision and Pattern Recognition,
references.authors: Kevin P Murphy
references.title: Machine learning: a probabilistic perspective
references.venue: MIT press,
references.authors: Tsung-Yi Lin Priya Goyal Ross Girshick Kaiming He Piotr Dollár
references.title: Focal loss for dense object detection
references.venue: In IEEE International Conference on Computer Vision,
references.authors: Vladimir N Vapnik
references.title: An overview of statistical learning theory
references.venue: IEEE Transactions on Neural Networks,
references.authors: Mehryar Mohri Afshin Rostamizadeh Ameet Talwalkar
references.title: Foundations of machine learning
references.venue: MIT press,
references.authors: David R Cox
references.title: Regression models and life-tables
references.venue: Journal of the Royal Statistical Society: Series B (Methodological),
references.authors: Weiyang Liu Yandong Wen Zhiding Yu Meng Yang
references.title: Large-margin softmax loss for convolutional neural networks
references.venue: In International Conference on Machine Learning,
references.authors: Yarin Gal Zoubin Ghahramani
references.title: Dropout as a Bayesian approximation: Representing model uncertainty in deep learning
references.venue: In International Conference on Machine Learning,
references.authors: Jooyoung Moon Jihyo Kim Younghak Shin Sangheum Hwang
references.title: Confidence-aware learning for deep neural networks
references.venue: In International Conference on Machine Learning,
references.authors: Chen Huang Yining Li Chen Change Loy Xiaoou Tang
references.title: Learning deep representation for imbalanced classification
references.venue: In IEEE Conference on Computer Vision and Pattern Recognition,
references.authors: Yiru Wang Weihao Gan Jie Yang Wei Wu Junjie Yan
references.title: Dynamic curriculum learning for imbalanced data classification
references.venue: In IEEE/CVF International Conference on Computer Vision,
references.authors: Kaidi Cao Colin Wei Adrien Gaidon Nikos Arechiga Tengyu Ma
references.title: Learning imbalanced datasets with label-distribution-aware margin loss
references.venue: In Advances in Neural Information Processing Systems,
references.authors: Yin Cui Menglin Jia Tsung-Yi Lin Yang Song Serge Belongie
references.title: Class-balanced loss based on effective number of samples
references.venue: In IEEE/CVF Conference on Computer Vision and Pattern Recognition,
references.authors: Jaehyung Kim Jongheon Jeong Jinwoo Shin
references.title: M2m: Imbalanced classification via majorto-minor translation
references.venue: In IEEE/CVF Conference on Computer Vision and Pattern Recognition,
references.authors: Koby Crammer Jaz Kandola Yoram Singer
references.title: Online classification on a budget
references.venue: In Advances in Neural Information Processing Systems,
references.authors: Yahav Bechavod Christopher Jung Steven Z. Wu
references.title: Metric-free individual fairness in online learning
references.venue: In Advances in Neural Information Processing Systems,
references.authors: Robert Geirhos Patricia Rubisch Claudio Michaelis Matthias Bethge Felix A. Wichmann Wieland Brendel
references.title: ImageNet-trained CNNs are biased towards texture; increasing shape bias improves accuracy and robustness
references.venue: In International Conference on Learning Representations,
references.authors: Cassidy Laidlaw Soheil Feizi
references.title: Functional adversarial attacks
references.venue: In Advances in Neural Information Processing Systems,
references.authors: Dan Hendrycks Thomas Dietterich
references.title: Benchmarking neural network robustness to common corruptions and perturbations
references.venue: In International Conference on Learning Representations,
references.authors: S. Kullback R.A. Leibler
references.title: On Information and Sufficiency
references.venue: The Annals of Mathematical Statistics,
references.authors: Anil Bhattacharyya
references.title: On a measure of divergence between two multinomial populations
references.venue: Sankhyā: The Indian Journal of Statistics,
references.authors: Alex Krizhevsky
references.title: Learning multiple layers of features from tiny images
references.venue: Master’s thesis, University of Toronto,
references.authors: Yonatan Geifman Ran El-Yaniv
references.title: Selective classification for deep neural networks
references.venue: In Advances in Neural Information Processing Systems,
sections.heading: 1 Introduction
sections.text: Classification is a ubiquitous learning problem that categorizes objects according to input features. It is widely used in a range of applications, such as robotics [1], environment exploration [2], medical diagnosis [3], etc. In spite of the successful development of deep learning methods in recent decades, high-performance classifiers would still have a chance to make mistakes due to the improvability of models and the complexity of real-world data [4, 5, 6, 7].
  To assess whether the prediction yielded by a classifier can be trusted or not, there are growing efforts towards learning to predict trustworthiness [8, 9]. These methods are evaluated on small-scale datasets, e.g., MNIST [10], where the data is relatively simple and existing classifiers have achieved high accuracy (> 99%). As a result, there are a dominant proportion of correct predictions and the trustworthiness predictors are prone to classify incorrect predictions as trustworthy predictions. The characteristics that the simple data is easy-to-classify aggravate the situation. To further understand the prowess of predicting trustworthiness, we study this problem on the real-world large-scale datasets, i.e., ImageNet [11]. This is a challenging theme for classification in terms of boundary complexity, class ambiguity, and feature dimensionality [12]. As a result, failed predictions are inevitable.
  35th Conference on Neural Information Processing Systems (NeurIPS 2021).
  A general illustration of predicting trustworthiness [9, 13] is shown in Fig. 1a. The trustworthiness predictor [13] that is based on the maximum confidence have been proven to be unreliable [8, 14, 15, 16]. Instead, Corbiere et al. [9] propose the true class probability (TCP) that uses the confidence w.r.t. the ground-truth class to determine whether to trust the classifier’s prediction or not. Nevertheless, the classification confidence is sensitive to the data. As shown in Fig. 1b, TCP predicts that all the incorrect predictions (0.9% in predictions) are trustworthy on MNIST [10] and predicts that all the incorrect predictions (∼16% in predictions) are trustworthy on ImageNet [11]. To comprehensively understand this problem, we follow the learning scheme used in [9] and use two state-of-the-art backbones, i.e., ViT [7] and ResNet [5], as the trustworthiness predictors. For simplicity, we call the “trustworthiness predictor" an oracle. We find that the oracles trained with cross entropy loss [17], focal loss [18], and TCP confidence loss [9] on ImageNet are prone to overfit the training samples, i.e., the true positive rate (TPR) is close to 100% while the true negative rate (TNR) is close to 0%. To improve the generalizability of oracles, we propose a novel loss function named the steep slope loss. The proposed steep slope loss consists of two slide-like curves that cross with each other and face in the opposite direction to separate the features w.r.t. trustworthy and untrustworthy predictions. It is tractable to control the slopes by indicating the heights of slides. In this way, the proposed loss is able to be flexible and effective to push the features w.r.t. correct and incorrect predictions to the well-classified regions.
  Predicting trustworthiness is similar to as well as different from conventional classification tasks. On one hand, predicting trustworthiness can be formulated as a binary classification problem. On the other hand, task-specific semantics are different between the classification task and predicting trustworthiness. The classes are referred to visual concepts, such as dog, cat, etc., in the classification task, while the ones in predicting trustworthiness are abstract concepts. The trustworthiness could work on top of the classes in the classification task. In other words, the classes in the classification task are specific and closed-form, while trustworthiness is open-form and is related to the classes in the classification task.
  The contribution of this work can be summarized as follows.
  • We study the problem of predicting trustworthiness with widely-used classifiers on ImageNet. Specifically, we observe that a major challenge of this learning task is that the cross entropy loss, focal loss, and TCP loss are prone to overfit the training samples, where correct predictions are dominant over incorrect predictions.
  • We propose the steep slope loss function that improves the generalizability of trustworthiness predictors. We conduct comprehensive experiments and analyses, such as performance on both small-scale and large-scale datasets, analysis of distributions separability, comparison to the class-balanced loss, etc., which verify the efficacy of the proposed loss.
  • To further explore the practicality of the proposed loss, we train the oracle on the ImageNet training set and evaluate it on two variants of ImageNet validation set, i.e., the stylized validation set and the adversarial validation set. The two variants’ domains are quite different
  from the domain of the training set. We find that the learned oracle is able to consistently differentiate the trustworthy predictions from the untrustworthy predictions.
sections.heading: 2 Preliminaries
sections.text: In this section, we first recap how a deep learning model learns in the image classification task. Then, we show how the task of predicting trustworthiness connects to the classification task.
  Supervised Learning for Classification. In classification tasks, given a training sample, i.e., image x ∈ Rm and corresponding ground-truth label y ∈ Y = {1, . . . ,K}, we assume that samples are drawn i.i.d. from an underlying distribution. The goal of the learning task is to learn to find a classifier f (cls)(·; θ′) with training samples for classification. θ′ is the set of parameters of the classifier. Let f (cls) θ′ (·) = f (cls)(·; θ′). The optimization problem is defined as
  f ∗(cls) θ′ = argmin
  f (cls)
  θ′
  R̂(f (cls)θ′ , ` (cls), Dtr), (1)
  where f∗(cls)θ′ is the learned classifier, R̂ is the empirical risk, `(cls) is a loss function for classification, and Dtr is the set of training samples.
  Supervised Learning for Predicting Trustworthiness. In contrast to the learning task for classification, which is usually a multi-class single-label classification task [4, 5, 6, 7], learning to predict trustworthiness is a binary classification problem, where the two classes are positive (i.e., trustworthy) or negative (i.e., untrustworthy). Similar to [9], given a pair (x, y) and a classifier f (cls)θ′ , we define the ground-truth label o for predicting trustworthiness as
  o = { 1, if argmax f (cls)θ′ (x) = y 0, otherwise
  (2)
  In other words, the classifier correctly predicts the image’s label so the prediction is trustworthy in hindsight, otherwise the prediction is untrustworthy.
  The learning task for predicting trustworthiness follows a similar learning framework in the classification task. Let fθ(·) be an oracle (i.e., a trustworthiness predictor). A generic loss function ` : Rm×R → R≥0, where R≥0 is a non-negative space and m is the number of classes. Given training samples (x, y) ∈ Dtr, the optimization problem for predicting trustworthiness is defined as
  f∗θ = argmin fθ
  1
  |Dtr| |Dtr|∑ i=1 `(fθ(xi), oi), (3)
  where |Dtr| is the cardinality of Dtr. Particularly, we consider two widely-used loss functions for classification and the loss function used for training trustworthiness predictors as baselines. They are the cross entropy loss [17], focal loss [18], and TCP confidence loss [9]. Let p(o = 1|θ,x) = 1/(1 + exp(−z)) be the trustworthiness confidence, where z ∈ R is the descriminative feature produced by the oracle, i.e., z = fθ(x). The three loss functions can be written as
  `CE(fθ(x), o) = −o · log p(o = 1|θ,x)− (1− o) · log(1− p(o = 1|θ,x)), (4) `Focal(fθ(x), o) = −o · (1− p(o = 1|θ,x))γ log p(o = 1|θ,x)−
  (1− o) · (p(o = 1|θ,x))γ log(1− p(o = 1|θ,x)), (5)
  `TCP (fθ(x), y) = (fθ(x)− p(ŷ = y|θ′,x))2. (6) In the focal loss, γ is a hyperparameter. In the TCP confidence loss, ŷ is the predicted label and p(ŷ = y|θ′,x) is the classification probability w.r.t. the ground-truth class. Consequently, the learned oracle would yield z to generate the trustworthiness confidence. In the cases of `CE and `Focal, the oracle considers a prediction is trustworthy if the corresponding trustworthiness confidence is greater than the positive threshold 0.5, i.e., p(o = 1|θ,x) > 0.5. The predictions whose trustworthiness confidences are equal to or lower than the negative threshold 0.5 are viewed to be untrustworthy. In the case of `TCP , the positive threshold is also 0.5, but the negative threshold correlates to the number of classes in the classification task. It is defined as 1/K in [9].
sections.heading: 3 Methodology
sections.text: In this section, we first introduce the overall learning framework for predicting trustworthiness. Then, we narrow down to the proposed steep slope loss function. At last, we provide the generalization bound that is related to the proposed steep slope loss function.
sections.heading: 3.1 Overall Design
sections.text: Corbière et al. [9] provide a good learning scheme for predicting trustworthiness. Briefly, it first trains a classifier with the training samples. Then, the classifier is frozen and the confidence network (i.e., trustworthiness predictor) is trained (or fine-tuned) with the training samples. In general, we follows this learning scheme.
  This work focuses on the trustworthiness on the predictions yielded by the publicly available pretrained classifiers, i.e., ViT [7] and ResNet [5]. We use the pre-trained backbones as the backbones of the oracles for general purposes. In this sense, the set of the oracle’s parameters can be split into two parts, one is related to the backbone and the other one is related to the head, i.e., θ = {θbackbone, θhead}. θbackbone is used to generated the intermediate feature xout and θhead = {w, b} are usually the weights of a linear function to generate the discriminative feature z = w>xout + b. With the classifier, the oracle, a pre-defined loss, and the training samples, we can optimize problem (3) to find the optimal parameters for the oracle.
sections.heading: 3.2 Steep Slope Loss
sections.text: The conceptual workflow of the proposed steep slope loss is shown in Fig. 2a. The core idea is that we exploit the graph characteristics of the exponential function and the softsign function to establish two slides such that the features z w.r.t. the positive class ride down the positive slide to the right bottom and the features z w.r.t. the negative class ride down the negative slide to the left bottom. z is defined as the signed distance to the hyperplane (i.e., oracle head). Given an image x, z = fθ(x) can be broken down into
  z = w>xout + b
  ‖w‖ , xout = fθbackbone(x). (7)
  The signed distance to the hyperplane has a geometric interpretation: its sign indicates in which half-space xout is and its absolute value indicates how far xout is away from the hyperplane.
  It is desired that the signed distance of xout with ground-truth label o = 1 (o = 0) tends towards +∞ (−∞) as much as possible. To this end, we define the steep slope (SS) loss function as follows
  `SS(fθ(x), o) = o · ( exp ( α+z
  1 + |z|
  ) − exp(−α+) ) ︸ ︷︷ ︸
  Positive slide
  +(1− o) · ( exp ( −α−z 1 + |z| ) − exp(−α−) ) ︸ ︷︷ ︸
  Negative slide
  (8)
  where α+, α− ∈ R+ control the slope of the positive slide and the negative slide, respectively. If z w.r.t. the positive class is on the left-hand side of z = 0, minimizing the loss would push the point on the hill down to the bottom, i.e., the long tail region indicating the well-classified region. Similarly, z
  w.r.t. the negative class would undergo a similar process. exp(−α+) and exp(−α−) are vertical shifts for the positive and negative slides such that `ss has a minimum value 0. Note that the proposed steep slope loss is in the range [0,maximum{exp(α+) − exp(−α+), exp(α−) − exp(−α−)}], whereas the cross entropy loss and the focal loss are in the range [0,+∞). The proposed steep slope loss can work with the output of the linear function as well. This is because the signed distance and the output of the linear function have a proportional relationship with each other, i.e., w
  >xout+b ‖w‖ ∝ w >xout+ b.
  Essentially, as shown in Fig. 2b, the cross entropy loss, focal loss, and steep slope loss work in a similar manner to encourage z w.r.t. the positive class to move the right-hand side of the positive threshold 0 and encourage z w.r.t. the negative class to move the left-hand side of the negative threshold 0, which is analogous to the sliding motion. The proposed steep slope loss is more tractable to control the steepness of slopes than the cross entropy loss and focal loss. This leads to an effective learning to yield discriminative feature for predicting trustworthiness.
sections.heading: 3.3 Generalization Bound
sections.text: With the proposed steep slope loss, we are interested in the generalization bound of trustworthiness predictors. For simplicity, we simplify a trustworthiness predictor as f ∈ F , where F is a finite hypothesis set. The risk of predicting trustworthiness is defined asR(f) = E(x,y)∼P [`SS(f(x), o)], where P is the underlying joint distribution of (x, o). As P is inaccessible, a common practice is to use empirical risk minimization (ERM) to approximate the risk [19], i.e.,R̂D(f) = 1|D| ∑|D| i=1 `SS(f(xi), oi).
  The following theorem provides an insight into the correlation between the generalization bound and the loss function in the learning task for predicting trustworthiness. Theorem 3.1. Denote maximum{exp(α+)− exp(−α+), exp(α−)− exp(−α−)} as `maxSS . `SS ∈ [0, `maxSS ]. Assume F is a finite hypothesis set, for any δ > 0, with probability at least 1 − δ, the following inequality holds for all f ∈ F:
  |R(f)− R̂D(f)| ≤ `maxSS
  √ log |F|+ log 2δ
  2|D|
  The proof sketch is similar to the generalization bound provided in [20] and the detailed proof is provided in the appendix A.
  A desired characteristic of the proposed steep slope loss is that it is in a certain range determined by α+ and α−, as discussed in Section 3.2. This leads to the generalization bound shown in Theorem 3.1. The theorem implies that given a generic classifier, as the number of training samples increases, the empirical risk would be close to the true risk with a certain probability. On the other hand, the cross entropy loss, focal loss, and TCP loss are not capped in a certain range. They do not fit under Hoeffding’s inequality to derive the generalization bounds.
sections.heading: 4 Related Work
sections.text: Loss Function. Loss function is the key to search for optimal parameters and has been extensively studied in a range of learning tasks [9, 18, 21, 22]. Specifically, the cross entropy loss may be the most widely-used loss for classification [21], however, it is not optimal for all cases. Lin et al. [18] propose the focal loss to down-weight the loss w.r.t. well-classified examples and focus on minimizing the loss w.r.t. misclassified examples by reshaping the cross entropy loss function. Liu et al. [22] introduce the large margin softmax loss that is based on cosine similarity between the weight vectors and the feature vectors. Nevertheless, it requires more hyperparameters and entangles with the linear function in the last layer of the network. Similar to the idea of focal loss, the proposed steep slope loss is flexible to reshape the function graphs to improve class imbalance problem. TCP’s confidence loss is used to train the confidence network for predicting trustworthiness [9]. We adopt TCP as a baseline.
  Trustworthiness Prediction. Understanding trustworthiness of a classifier has been studied in the past decade [8, 9, 13, 23, 24]. Hendrycks and Gimpel [13] aim to detect the misclassified examples according to maximum class probability. This method depends on the ranking of confidence scores and is proved to be unreliable [8]. Monte Carlo dropout (MCDropout) intends to understand trustworthiness through the lens of uncertainty estimation [23]. However, it is difficult to distinguish
  the trustworthy prediction from the incorrect but overconfident predictions [9]. Jiang et al. [8] propose a confidence measure named trust score, which is based on the distance between the classifier and a modified nearest-neighbor classifier on the test examples. The shortcomings of the method are the poor scalability and computationally expensive. Recently, instead of implementing a standalone trustworthiness predictor, Moon et al. [24] use the classifier’s weights to compute the correctness ranking. The correctness ranking is taken into account in the loss function such that the classification accuracy is improved. This method relies on pairs of training samples for computing the ranking. Moreover, it is unclear if the classifier improved by the correctness ranking outperforms the pretrained classifier when applying the method on large-scale datasets, e.g., ImageNet. In contrast, the learning scheme to train the trustworthiness predictor (i.e., confidence network) in [9] is standard and does not affect the classifiers. Its efficacy has been verified on small-scale datasets. In this work, we follows the learning scheme used in [9] and focus on predicting trustworthiness on complex dataset.
  Imbalanced Classification. In classification task, the ratio of correct predictions to incorrect predictions is expected to be large due to the advance in deep learning methods. This is aligned with the nature of imbalanced classification [25, 26, 27, 28, 29], which generally employ re-sampling and re-weighting strategies to solve the problem. However, predicting trustworthiness is different from imbalanced classification as it is not aware of the visual concepts but the correctness of the predictions, whereas the classification task relies on the visual concepts. Specifically, the re-sampling based methods [25, 26, 29] may not be suitable for the problem of predicting trustworthiness. It is difficult to determine if a sample is under-represented (over-represented) and should be over-sampled (under-sampled). The re-weighting based methods [26, 28] can be applied to any generic loss functions, but they hinge on some hypothesis related to imbalanced data characteristics. For instance, the class-balanced loss [28] is based on the effective number w.r.t. a class, which presumes number of samples is known. However, the number of samples w.r.t. a class is not always assessible, e.g., in the online learning scheme [30, 31]. Instead of assuming some hypothesis, we follow the standard learning scheme for predicting trustworthiness [8, 9].
sections.heading: 5 Experiment & Analysis
sections.text: In this section, we first introduce the experimental set-up. Then, we report the performances of baselines and the proposed steep slope loss on ImageNet, followed by comprehensive analyses.
  Experimental Set-Up. We use ViT B/16 [7] and ResNet-50 [5] as the classifiers, and the respective backbones are used as the oracles’ backbones. We denote the combination of oracles and classifiers as 〈O, C〉. There are four combinations in total, i.e., 〈ViT, ViT〉, 〈ViT, RSN〉, 〈RSN, ViT〉, and 〈RSN, RSN〉, where RSN stands for ResNet. In this work, we adopt three baselines, i.e., the cross entropy loss [21], focal loss [18], and TCP confidence loss [9], for comparison purposes.
  The experiment is conducted on ImageNet [11], which consists of 1.2 million labeled training images and 50000 labeled validation images. It has 1000 visual concepts. Similar to the learning scheme in [9], the oracle is trained with training samples and evaluated on the validation set. During the training process of the oracle, the classifier works in the evaluation mode so training the oracle would not affect the parameters of the classifier. Moreover, we conduct the analyses about how well the learned oracle generalizes to the images in the unseen domains. To this end, we apply the widely-used style transfer method [32] and the functional adversarial attack method [33] to generate two variants of the validation set, i.e., stylized validation set and adversarial validation set. Also, we adopt ImageNet-C [34] for evaluation, which is used for evaluating robustness to common corruptions.
  The oracle’s backbone is initialized by the pre-trained classifier’s backbone and trained by fine-tuning using training samples and the trained classifier. Training the oracles with all the loss functions uses the same hyperparameters, such as learning rate, weight decay, momentum, batch size, etc. The details for the training process and the implementation are provided in Appendix B.
  For the focal loss, we follow [18] to use γ = 2, which leads to the best performance for object detection. For the proposed loss, we use α+ = 1 and α− = 3 for the oracle that is based on ViT’s backbone, while we use α+ = 2 and α− = 5 for the oracle that is based on ResNet’s backbone.
  Following [9], we use FPR-95%-TPR, AUPR-Error, AUPR-Success, and AUC as the metrics. FPR95%-TPR is the false positive rate (FPR) when true positive rate (TPR) is equal to 95%. AUPR is the area under the precision-recall curve. Specifically, AUPR-Success considers the correct prediction
  as the positive class, whereas AUPR-Error considers the incorrect prediction as the positive class. AUC is the area under the receiver operating characteristic curve, which is the plot of TPR versus FPR. Moreover, we use TPR and true negative rate (TNR) as additional metrics because they assess overfitting issue, e.g., TPR=100% and TNR=0% imply that the trustworthiness predictor is prone to view all the incorrect predictions to be trustworthy.
  Performance on Large-Scale Dataset. The result on ImageNet are reported in Table 1. We have two key observations. Firstly, training with the cross entropy loss, focal loss, and TCP confidence loss lead to overfitting the imbalanced training samples, i.e., the dominance of trustworthy predictions. Specifically, TPR is higher than 99% while TNR is less than 1% in all cases. Secondly, the performance of predicting trustworthiness is contingent on both the oracle and the classifier. When a high-performance model (i.e., ViT) is used as the oracle and a relatively low-performance model (i.e., ResNet) is used as the classifier, cross entropy loss and focal loss achieve higher TNRs than the loss functions with the other combinations. In contrast, the two losses with 〈ResNet, ViT〉 lead to the lowest TNRs (i.e., 0%).
  Despite the combinations of oracles and classifiers, the proposed steep slope loss can achieve significantly higher TNRs than using the other loss functions, while it achieves desirable performance on FPR-95%-TPR, AUPR-Success, and AUC. This verifies that the proposed loss is effective to improve the generalizability for predicting trustworthiness. Note that the scores of AUPR-Error and TPR yielded by the proposed loss are lower than that of the other loss functions. Recall that AUPR-Error aims to inspect how easy to detect failures and depends on the negated trustworthiness confidences w.r.t. incorrect predictions [9]. The AUPR-Error correlates to TPR and TNR. When TPR is close to 100% and TNR is close to 0%, it indicates the oracle is prone to view all the predictions to be trustworthy. In other words, almost all the trustworthiness confidences are on the right-hand side of p(o = 1|θ,x) = 0.5. Consequently, when taking the incorrect prediction as the positive class, the negated confidences are smaller than -0.5. On the other hand, the oracle trained with the proposed loss intends to yield the ones w.r.t. incorrect predictions that are smaller than 0.5. In general, the negated confidences w.r.t. incorrect predictions are greater than the ones yielded by the other loss functions. In summary, a high TPR score and a low TNR score leads to a high AUPR-Error.
  To intuitively understand the effects of all the loss functions, we plot the histograms of trustworthiness confidences w.r.t. true positive (TP), false positive (FP), true negative (TN), and false negative (FN) in Fig. 3. The result confirms that the oracles trained with the baseline loss functions are prone to predict overconfident trustworthiness for incorrect predictions, while the oracles trained with the proposed loss can properly predict trustworthiness for incorrect predictions.
  Separability between Distributions of Correct Predictions and Incorrect Predictions. As observed in Fig. 3, the confidences w.r.t. correct and incorrect predictions follow Gaussian-like distributions. Hence, we can compute the separability between the distributions of correct and incorrect predictions from a probabilistic perspective. Given the distribution of correct predictions N1(µ1, σ21) and the distribution of correct predictions N2(µ2, σ22), we use the average Kullback–Leibler (KL) divergence d̄KL(N1,N2) [35] and Bhattacharyya distance dB(N1,N2) [36] to measure the separability. More details and the quantitative results are reported in Appendix G. In short, the proposed loss leads to larger separability than the baseline loss functions. This implies that the proposed loss is more effective to differentiate incorrect predictions from correct predictions.
  Performance on Small-Scale Datasets. We also provide comparative experimental results on smallscale datasets, i.e., MNIST [10] and CIFAR-10 [37]. The results are reported in Table 2. The proposed loss outperforms TCP† on metric FPR-95%-TPR on both MNIST and CIFAR-10, and additionally achieved good performance on metrics AUPR-Error and TNR on CIFAR-10. This shows the proposed loss is able to adapt to relatively simple data. More details can be found in Appendix B.1.
  Generalization to Unseen Domains. In practice, the oracle may run into the data in the domains that are different from the ones of training samples. Thus, it is interesting to find out how well the learned oracles generalize to the unseen domain data. Using the oracles trained with the ImageNet training set (i.e., the ones used in Table 1), we evaluate it on the stylized ImageNet validation set [32], adversarial ImageNet validation set [33], and corrupted ImageNet validation set [34]. 〈ViT, ViT〉 is used in the experiment.
  The results on the stylized ImageNet, adversarial ImageNet, and ImageNet-C are reported in Table 3, More results on ImageNet-C are reported in Table A1. As all unseen domains are different from the
  one of the training set, the classification accuracies are much lower than the ones in Table 1. The adversarial validation set is also more challenging than the stylized validation set and the corrupted validation set. As a result, the difficulty affects the scores across all metrics. The oracles trained with the baseline loss functions are still prone to recognize the incorrect prediction to be trustworthy. The proposed loss consistently improves the performance on FPR-95%-TPR, AUPR-Sucess, AUC, and TNR. Note that the adversarial perturbations are computed on the fly [33]. Instead of truncating the sensitive pixel values and saving into the images files, we follow the experimental settings in [33] to evaluate the oracles on the fly. Hence, the classification accuracies w.r.t. various loss function are slightly different but are stably around 6.14%.
  Selective Risk Analysis. Risk-coverage curve is an important technique for analyzing trustworthiness through the lens of the rejection mechanism in the classification task [9, 38]. In the context of predicting trustworthiness, selective risk is the empirical loss that takes into account the decisions, i.e., to trust or not to trust the prediction. Correspondingly, coverage is the probability mass of the non-rejected region. As can see in Fig. 4a, the proposed loss leads to significantly lower risks, compared to the other loss functions. We present the risk-coverage curves w.r.t. all the combinations of oracles and classifiers in Appendix E. They consistently exhibit similar pattern.
  Ablation Study. In contrast to the compared loss functions, the proposed loss has more hyperparameters to be determined, i.e., α+ and α−. As the proportion of correct predictions is usually larger than that of incorrect predictions, we would prioritize α− over α+ such that the oracle is able to recognize a certain amount of incorrect predictions. In other words, we first search for α− by freezing α+, and then freeze α− and search for α+. Fig. 4b and 4c show how the loss, TPR, and TNR vary with various α−. In this analysis, the combination 〈ViT, ViT〉 is used and α+ = 1. We can see that
  α− = 3 achieves the optimal trade-off between TPR and TNR. We follow a similar search strategy to determine α+ = 2 and α− = 5 for training the oracle with ResNet backbone.
  Effects of Using z = w>xout + b. Using the signed distance as z, i.e., z = w >xout+b ‖w‖ , has a geometric interpretation as shown in Fig. 2a. However, the main-stream models [5, 6, 7] use z = w>xout + b. Therefore, we provide the corresponding results in appendix F, which are generated by the proposed loss taking the output of the linear function as input. In comparison with the results of using z = w
  >xout+b ‖w‖ , using z = w >xout + b yields comparable scores of FPR95%-TPR, AUPR-Error, AUPR-Success, and AUC. Also, TPR and TNR are moderately different between z = w
  >xout+b ‖w‖ and z = w >xout + b, when α+ and α− are fixed. This implies that TPR and TNR are sensitive to ‖w‖. This is because the normalization by ‖w‖ would make z more dispersed in value than the variant without normalization. In other words, the normalization leads to long-tailed distributions while no normalization leads to short-tailed distributions. Given the same threshold, TNR (TPR) is determined by the location of the distribution of negative (positive) examples and the extent of short/long tails. Our analysis on the histograms generated with and without ‖w‖ normalization verifies this point.
  Steep Slope Loss vs. Class-Balanced Loss. We compare the proposed loss to the class-balanced loss [28], which is based on a re-weighting strategy. The results are reported in Appendix H. Overall, the proposed loss outperforms the class-balanced loss, which implies that the imbalance characteristics of predicting trustworthiness is different from that of imbalanced data classification.
sections.heading: 6 Conclusion
sections.text: In this work, we study the problem of predicting trustworthiness on a large-scale dataset. We observe that the oracle, i.e., trustworthiness predictor, trained with the cross entropy loss, focal loss, and TCP confidence loss lean towards viewing incorrect predictions to be trustworthy due to overfitting. To improve the generalizability of the oracles, we propose the steep slope loss that encourages the features w.r.t. correct predictions and incorrect predictions to be separated from each other. We evaluate the proposed loss on ImageNet through the lens of the trustworthiness metrics, selective classification metric, and separability of distributions, respectively. Experimental results show that the proposed loss is effective in improving the generalizability of trustworthiness predictors.
sections.heading: 7 Societal Impact
sections.text: Learning high-accuracy models is a long-standing goal in machine learning. Nevertheless, due to the complexity of real-world data, there is still a gap between state-of-the-art classification models and a perfect one. Hence, there is a critical need to understand the trustworthiness of classification models, i.e., differentiate correct predictions and incorrect predictions, in order to safely and effectively apply the models in real-world tasks. Models with the proposed loss achieve considerably better performance with various trustworthiness metrics. They also show generalizability with both indistribution and out-of-distribution images at a large scale. In addition, while existing trustworthiness models focus on a high TPR and tend to view all incorrect predictions to be trustworthy (i.e., TNR close to 0), false positives may lead to high consequent cost in some real-world scenarios such as critical applications in medicine (e.g., a false positive leading to unnecessary and invasive tests or treatment such as biopsies or surgery, or harmful side effects in medicine) and security (e.g., counter terrorism). It is thus of great importance for a trustworthiness model to flexibly trade off between TPR and TNR. To this end, the proposed loss allows the underlying distributions of positive and negative examples to be more separable, enabling a more effective trade-off between them.
  Acknowledgments and Disclosure of Funding
  This research was funded in part by the NSF under Grants 1908711, 1849107, and in part supported by the National Research Foundation, Singapore under its Strategic Capability Research Centres Funding Initiative. Any opinions, findings and conclusions or recommendations expressed in this material are those of the author(s) and do not reflect the views of National Research Foundation, Singapore.
title: Learning to Predict Trustworthiness with Steep Slope Loss