SlowGuess/NeurIPS_2023_OCR huggingface dataset:
Figure 7: Experiments on different choices of thresholds. The results presented are based on 8 repeated runs with different random seeds.
(e)  $\tau_{\mathrm{BD}}(0.9)$ ,  $\tau_{\mathrm{IDM}}(0.9)$
1. B&I class (Figure 9). As we have discussed in our main text, the prediction accuracy on the B&I class are always the lowest among all classes. By training with filtered examples in  $\mathcal{D}_{\mathrm{train}}$  rather than the entire training set, the B&I class of examples can be classified with a remarkably improved accuracy.
2. Bnd class (Figure 10). This class of examples are located at boundaries in the latent space of validation set, but not necessarily have been misclassified. Therefore, their performance baseline (training with the entire  $\mathcal{D}_{\mathrm{train}}$ ) is relatively high. The improvement is clear but not as much as on the other two classes.
3. IDM class (Figure 11). For this class of examples, similar mistakes have been made in the validation set, yet those examples are not necessarily located in the boundaries—the misclassification may be caused by ambiguity in decision boundary, imperfectness of either the model or the dataset. The primal prediction accuracy on this class of examples is lower than the Bnd class but higher than the B&I class, training with filtered  $\mathcal{D}_{\mathrm{train}}$  also clearly improve the performance on this class of examples.
(a) BNNs
(b) MCD
Figure 8: The top  $25\%$  uncertain examples identified by different methods. Legend of each figure provides the accuracy and proportion of each class. As the classifier can not make correct predictions on the OOD examples, it's always better for uncertainty estimators to flag more OOD examples.
(c) DE
Table 4: DAUC is not the only choice in identifying OOD examples. On the Dirty-MNIST dataset, DAUC, Outlier-AE and the IForest can identify most outliers in the test dataset. (Given threshold = 1.0 for those two benchmark methods).
Method	Precision	Recall	F1-Score
DAUC	1.0000 ± 0.0000	1.0000 ± 0.0000	1.0000 ± 0.0000
Outlier-AE	1.0000 ± 0.0000	1.0000 ± 0.0000	1.0000 ± 0.0000
IForest [54]	0.9998 ± 0.0004	1.0000 ± 0.0000	0.9999 ± 0.0002
C.3 Alternative Approach in Flagging OOD
As we have mentioned in the main text, although DAUC has a unified framework in understanding all three types of uncertainty the uncertainty caused by OOD examples can also be identified by off-the-shelf algorithms. We compare DAUC to two existing outlier detection methods in Table 4, where all methods achieve good performance on the Dirty-MNIST dataset. Our implementation is based on Alibi Detect [53].
(a) Covtype
Figure 9: Experiments on the B&I class (reported in the main text). The results presented are based on 10 repeated runs with different random seeds.
(b)Digits
(c) Spam
C.4 Experiments on Dirty-CIFAR-10
Dataset Discription In this experiment, we introduce a revised version of the CIFAR-10 dataset to test DAUC's scalability. Similar to the Dirty-MNIST dataset [41], we use linear combinations of the latent representation to construct the "boundary" class. In the original CIFAR-10 Dataset, each of the 10 classes of objects has 6000 training examples. We split the training set into training set  $(40\%)$ , validation set  $(40\%)$  and test set  $(20\%)$ . To verify the performance of DAUC in detecting OOD examples, we randomly remove one of those 10 classes (denoted with class- $i$ ) during training
(a) Covtype
(b) Digits
Figure 10: Experiments on the Bnd class. The results presented are based on 10 repeated runs with different random seeds.
(c) Spam
Figure 11: Experiments on the IDM class. The results presented are based on 10 repeated runs with different random seeds.
and manually concatenate OOD examples with the test dataset, with label  $i$ . In our experiment, we use 1000 MNIST digits as the OOD examples, with zero-padding to make those digits share the same input shape as the CIFAR-10 images. Combining those boundary examples, OOD examples and the vanilla CIFAR-10 examples, we get a new benchmark, dubbed as Dirty-CIFAR-10, for quantitative evaluation of DAUC.
Quantify the performance of DAUC on Dirty-CIFAR-10 Quantitatively, we evaluate the performance of DAUC in categorizing all three classes of uncertain examples. Results of averaged performance and standard deviations based on 8 repeated runs are provided in Table 5.
Table 5: Quantitative results on the Dirty-CIFAR-10 dataset. DAUC scales well and is able to categorize all three classes of uncertain examples. Results presented in the table are based on 8 repeated runs with different random seeds.
Category	Precision	Recall	F1-Score
OOD	0.986 ± 0.003	0.959 ± 0.052	0.972 ± 0.027
Bnd	0.813 ± 0.002	0.975 ± 0.000	0.887 ± 0.001
IDM	0.688 ± 0.041	0.724 ± 0.017	0.705 ± 0.027
Categorize Uncertain Predictions on Dirty-CIFAR-10 Similar to Sec. 4.3 and Figure 5, we can categorize uncertain examples flagged by BNNs, MCD, and DE using DAUC—see Figure 12. We find that in the experiment with CIFAR-10, DE tends to discover more OOD examples as top uncertain examples. Differently, although BNNs flag fewer OOD examples as top-uncertain, they continuously discover those OOD examples and are able to find most of them for the top  $50\%$  uncertainty. On the contrary, MCD performs the worst among all three methods, similar to the result is drawn from the DMNIST experiment. On the other hand, while BNN is good at identifying OOD examples, it flags less uncertain examples in the Bnd and IDM classes. DE is the most apt at flagging both Bnd and
IDM examples and categorizes far fewer examples into the Other class. These observations are well aligned with the experiment results we had with DMNIST in Sec. 4.3, showing the scalability of DAUC to large-scale image datasets.
Figure 12: Experiments on the CIFAR-10 dataset. Results of applying DAUC in categorizing different uncertainty estimation methods. First row: comparisons of the numbers in different classes of examples. Second row: comparisons on the proportion of different classes of flagged examples to the total number of identified uncertain examples. Different methods tend to identify different certain types of uncertain examples. The results presented are based on 8 repeated runs with different random seeds.
D.1 Code
Our code is available at https://github.com/vanderschaarlab/DAUC.
D.2.1 Bandwidth
In our experiments, we use (z-score) normalized latent representations and bandwidth 1.0. In the inverse direction, as the sample sizes are much smaller, a bandwidth of 0.01 is used as the recommended setting. There is a vast body of research on selecting a good bandwidth for Kernel Density Estimation models [55-57] and using these to adjust DAUC's bandwidth to a more informed choice may further improve performance.
D.3 Inverse Direction: Quantile Threshold q
As depicted in Appendix A.2, a natural choice of  $q$  is to use the validation accuracy. We use this heuristic approach in our experiments for the inverse direction.
D.4 Model Structure
In our experiments, we implement MCD and DE with 3-layer-CNNs with ReLU activation. Our experiments on BNNs are based on the IBM UQ360 software [58]. More details of the convolutional network structure are provided in Table 6.
D.5 Implementation of Kernel Density Estimation and Repeat Runs
Our implementation of KDE models is based on sklearn's KDE package [59]. Gaussian kernels are used as default settings. We experiment with 8-10 random seeds and report the averaged results and standard deviations. In our experiments, we find using different kernels in density estimation provides highly correlated scores. We calculate the Spearman's  $\rho$  correlation between scores DAUC gets over 5 runs with Gaussian, Tophat, and Exponential kernels under the same bandwidth. Changing the kernel brings highly correlated scores (all above 0.86) for DAUC and, hence, has a minor impact on
Table 6: Network Structure
Layer	Unit	Activation	Pooling
Conv 1	(1,32,3,1,1)	ReLU()	MaxPool2d(2)
Conv 2	(32,64,3,1,1)	ReLU()	MaxPool2d(2)
Conv 3	(64,64,3,1,1)	ReLU()	MaxPool2d(2)
FC	(64 × 3 × 3,40)	ReLU()	-
Out	(40,NClass)	SoftMax()	-
DAUC's performance. We preferred KDE since the latent representation is relatively low-dimensional. We found that a low-dim latent space (e.g., 10) works well for all experiments (including CIFAR-10).
D.6 Hardware
All results reported in our paper are conducted with a machine with 8 Tesla K80 GPUs and 32 Intel(R) E5-2640 CPUs. The computational cost is mainly in density estimation, and for low-dim representation space, such an estimation can be efficient: running time for DAUC on the Dirty-MNIST dataset with KDE is approximately 2 hours.
Assumptions and Limitations
In this work, we introduced the confusion density matrix that allows us to categorize suspicious examples at testing time. Crucially, this density matrix relies on kernel density estimations in the latent space  $\mathcal{H}$  associated with the model  $f$  through Assumption 1. We note this assumption generally holds for most modern uncertainty estimation methods.
While the core contribution of this work is to introduce the concept of confusion density matrix for uncertainty categorization, the density estimators leveraged in the latent space can be further improved. We leave this to future work.
While previous works on uncertainty quantification (UQ) focused on the discovery of uncertain examples, in this work, we propose a practical framework for categorizing uncertain examples that are flagged by UQ methods. We demonstrated that such a categorization can be used for UQ method selection — different UQ methods are good at figuring out different uncertainty sources. Moreover, we show that for the inverse direction, uncertainty categorization can improve model performance.
With our proposed framework, many real-world application scenarios can be potentially benefit. e.g., in Healthcare, a patient marked as uncertain that categorized as OOD — preferably identified by Deep Ensemble, as we have shown — should be treated carefully when applying regular medical experience; and an uncertain case marked as IDM — preferably identified by MCD — can be carefully compared with previous failure cases for a tailored and individualized medication.