Bias-Reduced Uncertainty Estimation for Deep Neural Classifiers

1 INTRODUCTION . The deployment of deep learning models in applications with demanding decision-making components such as autonomous driving or medical diagnosis hinges on our ability to monitor and control their statistical uncertainties . Conceivably , the Bayesian framework offers a principled approach to infer uncertainties from a model ; however , there are computational hurdles in implementing it for deep neural networks ( Gal & Ghahramani , 2016 ) . Presently , practically feasible ( say , for image classification ) uncertainty estimation methods for deep learning are based on signals emerging from standard ( non Bayesian ) networks that were trained in a standard manner . The most common signals used for uncertainty estimation are the raw softmax response ( Cordella et al. , 1995 ) , some functions of softmax values ( e.g. , entropy ) , signals emerging from embedding layers ( Mandelbaum & Weinshall , 2017 ) , and the MC-dropout method ( Gal & Ghahramani , 2016 ) that proxies a Bayesian inference using dropout sampling applied at test time . These methods can be quite effective , but no conclusive evidence on their relative performance has been reported . A recent NIPS paper provides documentation that an ensemble of softmax response values of several networks performs better than the other approaches ( Lakshminarayanan et al. , 2017 ) . In this paper , we present a method of confidence estimation that can consistently improve all the above methods , including the ensemble approach of Lakshminarayanan et al . ( 2017 ) . Given a trained classifier and a confidence score function ( e.g. , generated by softmax response activations ) , our algorithm will learn an improved confidence score function for the same classifier . Our approach is based on the observation that confidence score functions extracted from ordinary deep classifiers tend to wrongly estimate confidence , especially for highly confident instances . Such erroneous estimates constitute a kind of artifact of the training process with an stochastic gradient descent ( SGD ) based optimizers . During this process , the confidence in “ easy ” instances ( for which we expect prediction with high confidence ) is quickly and reliably assessed during the early SGD epochs . Later on , when the optimization is focused on the “ hard ” points ( whose loss is still large ) , the confidence estimates of the easy points become impaired . Uncertainty estimates are ultimately provided in terms of probabilities . Nevertheless , as previously suggested ( Geifman & El-Yaniv , 2017 ; Mandelbaum & Weinshall , 2017 ; Lakshminarayanan et al. , 2017 ) , in a non-Bayesian setting ( as we consider here ) it is productive to decouple uncertainty estimation into two separate tasks : ordinal ranking according to uncertainty , and probability calibration . Noting that calibration ( of ordinal confidence ranking ) already has many effective solutions ( Naeini et al. , 2015 ; Platt et al. , 1999 ; Zadrozny & Elkan , 2002 ; Guo et al. , 2017 ) , our main focus here is on the core task of ranking uncertainties . We thus adopt the setting of Lakshminarayanan et al . ( 2017 ) , and others ( Geifman & El-Yaniv , 2017 ; Mandelbaum & Weinshall , 2017 ) , and consider uncertainty estimation for classification as the following problem . Given labeled data , the goal is to learn a pair ( f , κ ) , where f ( x ) is a classifier and κ ( x ) is a confidence score function . Intuitively , κ should assign lower confidence values to points that are misclassified by f , relative to correct classifications ( see Section 2 for details ) . We propose two methods that can boost known confidence scoring functions for deep neural networks ( DNNs ) . Our first method devises a selection mechanism that assigns for each instance an appropriate early stopped model , which improves that instance ’ s uncertainty estimation . The mechanism selects the early-stopped model for each individual instance from among snapshots of the network ’ s weights that were saved during the training process . This method requires an auxiliary training set to train the selection mechanism , and is quite computationally intensive to train . The second method approximates the first without any additional examples . Since there is no consensus on the appropriate performance measure for scoring functions , we formulate such a measure based on concepts from selective prediction ( Geifman & El-Yaniv , 2017 ; Wiener & El-Yaniv , 2015 ) . We report on extensive experiments with four baseline methods ( including all those mentioned above ) and four image datasets . The proposed approach consistently improves all baselines , often by a wide margin . For completeness , we also validate our results using probably-calibrated uncertainty estimates of our method that are calibrated with the well-known Platt scaling technique ( Platt et al. , 1999 ) and measured with the negative log-likelihood and Brier score Brier ( 1950 ) . 2 PROBLEM SETTING . In this work we consider uncertainty estimation for a standard supervised multi-class classification problem . We note that in our context uncertainty can be viewed as negative confidence and vice versa . We use these terms interchangeably . Let X be some feature space ( e.g. , raw image pixels ) and Y = { 1 , 2 , 3 , . . . , k } , a label set for the classes . Let P ( X , Y ) be an unknown source distribution over X × Y . A classifier f is a function f : X → Y whose true risk w.r.t . P is R ( f |P ) = EP ( X , Y ) [ ` ( f ( x ) , y ) ] , where ` : Y × Y → R+ is a given loss function , for example , the 0/1 error . Given a labeled set Sm = { ( xi , yi ) } mi=1 ⊆ ( X × Y ) sampled i.i.d . from P ( X , Y ) , the empirical risk of the classifier f is r̂ ( f |Sm ) =∆ 1m ∑m i=1 ` ( f ( xi ) , yi ) . We consider deep neural classification models that utilize a standard softmax ( last ) layer for multi-class classification . Thus , for each input x ∈ X , the vector f ( x ) = ( f ( x ) 1 , . . . , f ( x ) k ) ∈ Rk is the softmax activations of the last layer . The model ’ s predicted class ŷ = ŷf ( x ) = argmaxi∈Y f ( x ) i . Consider the training process of a deep model f through T epochs using any mini-batch SGD optimization variant . For each 1 ≤ i ≤ T , we denote by f [ i ] a snapshot of the partially trained model immediately after epoch i . For a multi-class model f , we would like to define a confidence score function , κ ( x , i , |f ) , where x ∈ X , and i ∈ Y . The function κ should quantify confidence in predicting that x is from class i , based on signals extracted from f . A κ-score function should induce a partial order over points in X , and thus is not required to distinguish between points with the same score . For example , for any softmax classifier f , the vanilla confidence score function is κ ( x , i|f ) =∆ f ( x ) i ( i.e. , the softmax response values themselves ) . Perhaps due to the natural probabilistic interpretation of the softmax function ( all values are non-negative and sum to 1 ) , this vanilla κ has long been used as a confidence estimator . Note , however , that we are not concerned with the standard probabilistic interpretation ( which needs to be calibrated to properly quantify probabilities ( Guo et al. , 2017 ) ) . An optimal κ ( for f ) should reflect true loss monotonicity in the sense that for every two labeled instances ( x1 , y1 ) ∼ P ( X , Y ) , and ( x2 , y2 ) ∼ P ( X , Y ) , κ ( x1 , ŷf ( x ) |f ) ≤ κ ( x2 , ŷf ( x ) |f ) ⇐⇒ PrP [ ŷf ( x1 ) 6= y1 ] ≥ PrP [ ŷf ( x2 ) 6= y2 ] . ( 1 ) 3 PERFORMANCE EVALUATION OF CONFIDENCE SCORES BY SELECTIVE CLASSIFICATION . In the domain of ( deep ) uncertainty estimation there is currently no consensus on how to measure performance ( of ordinal estimators ) . For example , Lakshminarayanan et al . ( 2017 ) used the Brier score and the negative-log-likelihood to asses their results , while treating κ values as absolute scores . In Mandelbaum & Weinshall ( 2017 ) the area under the ROC curve was used for measuring performance . In this section we propose a meaningful and unitless performance measure for κ functions , which borrows elements from other known approaches . In order to define a performance measure for κ functions , we require a few concepts from selective classification ( El-Yaniv & Wiener , 2010 ; Wiener & El-Yaniv , 2011 ) . As noted in ( Geifman & ElYaniv , 2017 ) , any κ function can be utilized to construct a selective classifier ( i.e. , a classifier with a reject option ) . Thus , selective classification is a natural application of confidence score functions based on which it is convenient and meaningful to assess performance . The structure of this section is as follows . We first introduce the ( well known ) terms selective classifier , selective risk and coverage . Then we introduce the risk-coverage curve . We propose to measure the performance of a κ function as the area under the risk-coverage curve ( AURC ) of a selective classifier induced by κ . The proposed measure is a normalization of AURC where we subtract the AURC of the best κ in hindsight . The benefit of the proposed normalization is that it allows for meaningful comparisons accross problems . We term the this normalized metric “ excess AURC ” ( E-ARUC ) and it will be used throughout the paper for performance evaluation of κ functions . A selective classifier is a pair ( f , g ) , where f is a classifier , and g : X → { 0 , 1 } is a selection function , which serves as a binary qualifier for f as follows , ( f , g ) ( x ) =∆ { f ( x ) , if g ( x ) = 1 ; reject , if g ( x ) = 0 . The performance of a selective classifier is quantified using coverage and risk . Coverage , defined to be φ ( f , g ) =∆ EP [ g ( x ) ] , is the probability mass of the non-rejected region in X . The selective risk of ( f , g ) is R ( f , g ) =∆ EP [ ` ( f ( x ) , y ) g ( x ) ] φ ( f , g ) . These two measures can be empirically evaluated over any finite labeled set Sm ( not necessarily the training set ) in a straightforward manner . Thus , the empirical selective risk is , r̂ ( f , g|Sm ) =∆ 1 m ∑m i=1 ` ( f ( xi ) , yi ) g ( xi ) φ̂ ( f , g|Sm ) , ( 2 ) where φ̂ is the empirical coverage , φ̂ ( f , g|Sm ) =∆ 1m ∑m i=1 g ( xi ) . The overall performance profile of a family of selective classifiers ( optimized for various coverage rates ) can be measured using the risk-coverage curve ( RC-curve ) , defined to be the selective risk as a function of coverage . Given a classifier f and confidence score function κ defined for f , we define an empirical performance measure for κ using an independent set Vn of n labeled points . The performance measure is defined in terms of the following selective classifier ( f , g ) ( where f is our given classifier ) , and the selection functions g is defined as a threshold over κ values , gθ ( x|κ , f ) = 1 [ κ ( x , ŷf ( x ) |f ) > θ ] . Let Θ be the set of all κ values of points in Vn , Θ = ∆ { κ ( x , ŷf ( x ) |f ) : ( x , y ) ∈ Vn } ; for now we assume that Θ contains n unique points , and later we note how to deal with duplicate values . The performance of κ is defined to be the area under the ( empirical ) RC-curve ( AURC ) of the pair ( f , g ) computed over Vn , AURC ( κ , f |Vn ) = 1 n ∑ θ∈Θ r̂ ( f , gθ|Vn ) . Intuitively , a better κ will induce a better selective classifier that will tend to reject first the points that are misclassified by f . Accordingly , the associated RC-curve will decrease faster ( with decreasing coverage ) and the AURC will be smaller . For example , in Figure 1 we show ( in blue ) the RC-curve of classifier f obtained by training a DNN trained over the CIFAR-100 dataset . The κ induced by f is the softmax response confidence score , κ ( x ) = maxi f ( x ) i . The RC-curve in the figure is calculated w.r.t . to an independent labeled set Vn of n = 10 , 000 points from CIFAR-100 . Each point on the curve is the empirical selective risk ( 2 ) of a selective classifier ( f , gθ ) such that θ ∈ Θ . As can be seen , the selective risk is monotonically increasing with coverage . For instance , at full coverage = 1 , the risk is approximately 0.29 . This risk corresponds to a standard classifier ( that always predicts and does not reject anything ) . The risk corresponding to coverage = 0.5 is approximately 0.06 and corresponds to a selective classifier that rejects half of the points ( those whose confidence is least ) . Not surprisingly , its selective risk is significantly lower than the risk obtained at full coverage . An optimal in hindsight confidence score function for f , denoted by κ∗ , will yield the optimal risk coverage curve . This optimal function rates all misclassified points ( by f ) lower than all correctly classified points . The selective risk associated with κ∗ is thus zero at all coverage rates below 1− r̂ ( f |Vn ) . The reason is that the optimal function rejects all misclassified points at such rates . For example , in Figure 1 we show the RC-curve ( black ) obtained by relying on κ∗ , which reaches zero at coverage of 1− 0.29 = 0.71 ( red dot ) ; note that the selective risk at full coverage is 0.29 . Since the AURC of all RC-curves for f induced by any confidence scoring function will be larger than the AURC of κ∗ , we normalize by AURC ( κ∗ ) to obtain a unitless performance measure . To compute the AURC of κ∗ , we compute the discrete integral of r̂ ( w.r.t . κ∗ ) from the coverage level of 1− r̂ ( f |Vn ) ( 0 errors ) to 1 ( nr̂ errors ) . Thus , AURC ( κ∗ , f |Vn ) = 1 n r̂n∑ i=1 i n ( 1− r̂ ) + i . ( 3 ) We approximate ( 3 ) using the following integral : AURC ( κ∗ , f |Vn ) ≈ ∫ r̂ 0 x 1− r̂ + x dx = x− ( 1− r̂ ) ln ( 1− r̂ + x ) ∣∣∣∣r̂ 0 = r̂ + ( 1− r̂ ) ln ( 1− r̂ ) . For example , the gray area in Figure 1 is the AURC of κ∗ , which equals 0.04802 ( and approximated by 0.04800 using the integral ) . To conclude this section , we define the Excess-AURC ( E-AURC ) as E-AURC ( κ , f |Vn ) = AURC ( κ , f |Vn ) − AURC ( κ∗ , f |Vn ) . E-AURC is a unitless measure in [ 0 , 1 ] , and the optimal κ will have E-AURC = 0 . E-AURC is used as our main performance measure .

Summary: The proposed methodology draws on the connection between boosting in ensemble learning and SGD for training DNNs, whereby misclassified instances are implicitly targeted in later training iterations once easier examples have been classified correctly. The authors observe that this incurs a trade-off in which easily-classified examples become susceptible to overfitting at later stages in the training procedure when the network parameters adapt to fit more complex examples. Two early stopping algorithms are proposed in order to mitigate this issue. The first approach, PES, is more robust, but too computationally expensive to be applied in practice; on the other hand, AES approximates the former procedure by directly assuming that easier training examples will be learnt earlier on in the training procedure. The proposed technique is shown to calibrate the confidence scores obtained from state-of-the-art approaches for training deep nets, resulting in substantial performance improvements with respect to the proposed E-AURC metric.