SlowGuess/NeurIPS_2023_OCR huggingface dataset:
In Figure 1, we provide relation maps of three samples from ImageNet, using 10 checkpoints of MAE-Large [13]. The three samples each represent clean data, data with a label error, and outlier data. From the figure, samples show different relation map patterns. Specifically, the relation map of a clean data sample exhibits a majority of positive relations with relatively small variability. We note that there are gray-colored relations in high variability regions (0.2<std), indicating that the model resolves conflicting relations at convergence. On the other hand, the relation map of the sample with a label error demonstrates a majority of negative relations. Notably, high variance relations result in largely negative relations at convergence, suggesting that conflicts intensify. Lastly, the relation map of the outlier data sample reveals that relations are close to 0 during training. These relation maps can serve as a model-based fingerprint of the data, which our algorithm effectively exploits to identify problematic data. We provide additional data relational maps for various models in Appendix E.1.
In this section, we experimentally verify the effectiveness of our approach in detecting label errors and outliers. We provide implementation details, including hyperparameter settings in Appendix C.1. We provide qualitative results including detected label errors and outlier samples in Appendix E.2.
4.1 Label error detection
4.1.1 Setting
Datasets We conduct label error detection experiments on large-scale datasets: ImageNet [43], ESC-50 [37], and SST2 [55]. ImageNet consists of about 1.2M image data from 1,000 classes. ESC-50 consists of 2,000 5-second environmental audio recordings organized into 50 classes. SST2 is a binary text sentiment classification dataset, consisting of 67k movie review sentences. We also conduct experiments on MNLI [55] and provide results in Appendix, Table 13.
Following Pruthi et al. [39], we construct a noisy training set by flipping labels of certain percentages of correctly classified training data with the top-2 prediction of the trained model. We use different neural network architectures for constructing a noisy training set and detecting label errors to avoid possible correlation. We leave a more detailed procedure for constructing the noisy training set in Appendix C.2. When training the MAE-Large model [13] on ImageNet with  $8\%$  label noise, the validation top1-accuracy decreases by  $1.7\%$  compared to the performance of the model trained on the orig
(a) Label noise ratio  $(\%)$
Figure 5: Label error detection performance on ImageNet with MAE-Large according to (a) label noise ratios and (b) the number of data. We obtain the results in (b) with  $8\%$  label noise. We report performance values of all methods in Appendix D.3, with Tables 10 and 11.
(b) The number of data (log-scale)
inal training set, as reported in Appendix Table 8. The decrease becomes more significant with  $15\%$  label noise, with a drop of  $4.4\%$ , highlighting the importance of label noise detection and cleaning.
Baselines We compare our method (Relation) to six baselines that are suitable for large-scale datasets. We consider fine-tuned loss from pre-trained models (Loss) [5], prediction probability margin score (Margin) [33], and the influence-based approach called TracIn [39]. We also evaluate model-agnostic scoring methods: Entropy, Least-confidence, and Confidence-weighted Entropy (CWE) [24]. For a fair comparison, we evaluate methods using a single converged neural network in our main experiments, while also providing results with a temporal ensemble suggested by [39] in Appendix D.1.
Metric We evaluate the detection performance based on label noisiness scores by each method. We note that detecting label errors is an imbalanced detection problem, which makes the AUROC metric prone to being optimistic and misleading [7]. In this respect, we mainly report the AP (average precision) and TNR95 (TNR at 0.95 TPR), and provide AUROC results in Appendix D.3.
4.1.2 Results and analysis
ImageNet We measure the label error detection performance on ImageNet with the synthetic label noise by training an MAE-Large model [13]. Note that the model does not have access to information about the changed clean labels during the entire training process. Figure 5 (a) shows the detection performance over a wide range of label noise ratios from  $4\%$  to  $15\%$ . As shown in the figure, our approach achieves the best AP and TNR95 performance compared to the baselines. Especially, our method maintains a high TNR95 over a wide range of noise ratios, indicating that the number of data that need to be reviewed by human annotators is significantly smaller when cleaning the dataset. In Figure 9, we present detected label error samples by our algorithm.
It is worth noting that our method relies on the number of data for constructing a relation graph. To measure the sensitivity of our algorithm to the number of data, we evaluate the detection performance using a reduced number of data with uniform random sampling. Figure 5 (b) shows the detection performance on  $8\%$  label noise with MAE-Large. From the figure, we find that our algorithm maintains the best detection performance even with  $1\%$  of the data (12k). This demonstrates that our algorithm is effective even when only a small portion of the training data is available, such as continual learning or federated learning [35, 32]. In Table 1 (a), we provide detection performance for different scales of MAE models on  $8\%$  label noise. The table shows our approach achieves the best AP with MAE-Base, verifying the robustness of our approach to the network scales. From the table, we note that larger models are more robust to label noise and show better detection performance.
Speech and language domains We apply our method to speech and language domain datasets: ESC-50 [37] and SST2 [55]. We design the label noise detection settings identical to the previous ImageNet section. Specifically, we train the AST model [10] for ESC-50 and the RoBERTa-Base model [30] for SST2 under the  $10\%$  label noise setting. Table 1 (b) shows our approach achieves the best AP and TNR95 on the speech and language datasets, demonstrating the generality of our approach across various data types.
Table 1: Label error detection performance on ImageNet with  $8\%$  label noise. Baseline refers to the best performance among the six baselines considered in Figure 5. In Table (c), the evaluation metric is AP. We report the performance of all baselines in Appendix D.3, with Tables 12 to 14.
(a) Model architecture scales
Scale	Metric	Baseline	Relation
Base	AP	0.477	0.514
TNR95	0.488	0.672
Large	AP	0.484	0.526
TNR95	0.521	0.695
(b) Speech/language domains
Dataset	Metric	Baseline	Relation
ESC50	AP	0.739	0.779
TNR95	0.793	0.847
SST2	AP	0.861	0.881
TNR95	0.850	0.870
(c) Realistic label noise scenario
Model	Baseline	Relation
MAE	0.708	0.733
BEIT	0.719	0.737
ConvNeXt	0.713	0.735
ConvNeXt-22k	0.724	0.744
Realistic label noise The ImageNet validation set is known to contain numerous label errors [34]. To tackle this issue, Beyer et al. [4] cleaned the labels with human experts and corrected around  $29\%$  of the labels via multi-labeling. With this re-labeled validation set, we conduct experiments under the realistic label noise, with the task of detecting the data samples with changed labels. We measure the detection performance with MAE-Large [13], BEIT-Large [1], and ConvNeXt-Large [31] models. To examine the impact of pre-training on external data, we also include ConvNeXt pre-trained on ImageNet-22k, denoted as ConvNeXt-22k. We construct the relation graph using only the validation set, considering scenarios where the training data are not available. Table 1 (c) verifies that our approach outperforms the best baseline across various models. The results on ConvNeXt-22k indicate that pre-training on external data improves the detection performance.
Memorization issue We investigate the impact of large neural networks' ability to memorize label errors on detection performance [61]. In the left figure of Figure 6, we find that the AP score decreases as the training progresses after 30 epochs with MAE-Large which converges at 50 epochs. The right figure of Figure 6 plots the precision-recall curves, where we observe that precision increases at low recall area but decreases at mid-level recall  $(\sim 0.5)$  as the training progresses. This suggests that training has both positive and negative effects on detecting label noise, and we speculate that memorization
is one cause. Leveraging these observations, we improve detection AP by  $3.6\%$  p by using a temporal ensemble of models [25]. We provide a more detailed description and results in Appendix D.1.
Figure 6: Label error detection performance of relation graph throughout the MAE-Large training process on ImageNet with  $8\%$  label noise.
4.2 Outlier/OOD detection
Baselines We consider the following representative outlier scoring approaches: Maximum Softmax Probability (MSP) [14], Max Logit [15], Mahalanobis [26], Energy score [29], ReAct [49], KL-Matching [15], and KNN [50]. We tune the KNN method's hyperparameter  $k$  based on the paper's guidance as  $k = 1000 \times \alpha$ , where  $\alpha$  represents the ratio of training data used for OOD detection. We also evaluate outlier detection approaches, Iterative sampling [48] and Local outlier factor [56].
OOD detection Following Sun et al. [50], we evaluate OOD detection performance on the ImageNet validation set consisting of 50k in-distribution data samples, along with four distinct OOD datasets: Places [62], SUN [58], iNaturalist [53], and Textures [6]. Each of these OOD datasets consists of 10k data samples except for Textures which has 5,640 data samples. We also combine these four datasets, denoted as ALL, and measure the overall OOD detection performance on this dataset.
Figure 7 shows OOD detection performance of MAE-Large on ALL outlier dataset. Note that our approach and KNN both rely on the number of training data samples  $(|S|)$  for outlier score calculation. We examine the effect of training set size by measuring the performance with a reduced number of data using uniform random sampling. Figure 7 verifies that our approach outperforms other baselines while maintaining performance even with  $0.4\%$  of the training dataset (5k). Note that KNN requires hyperparameter tuning according to the training set size, whereas our approach uses the identical
Figure 7: OOD detection performance on ImageNet (ALL) with MAE-Large. Unary-best refers to the best performance among the methods that do not rely on the training data for outlier score calculation. We provide performance values of all baselines in Appendix D.4, with Table 15.
Unary-best KNN Relation (ours)
Figure 8: The detection AP of the MAE-Large model across a range of kernel temperatures  $t$ . The dashed blue line means the performance of the best baseline.
Baseline-best Relation (ours)
Table 2: Outlier detection performance with Vit-Base on noisy ImageNet-100. Some OOD scoring methods (Mahalanobis, ReAct, KL-Matching) are excluded from the comparison because they require a clean training dataset which is not available in the outlier detection setup.
(a) ImageNet-100 with SUN
Method	AUROC	AP	TNR95
MSP	0.708	0.335	0.032
Max Logit	0.499	0.216	0.011
Energy	0.417	0.106	0.010
KNN	0.990	0.899	0.960
Iterative sampling	0.973	0.687	0.903
Local outlier factor	0.986	0.850	0.941
Relation (Ours)	0.993	0.906	0.971
(b) ImageNet-100 with iNaturalist
Method	AUROC	AP	TNR95
MSP	0.706	0.309	0.040
Max Logit	0.469	0.171	0.012
Energy	0.375	0.075	0.012
KNN	0.993	0.923	0.972
Iterative sampling	0.979	0.734	0.922
Local outlier factor	0.990	0.890	0.958
Relation (Ours)	0.995	0.940	0.982
hyperparameter ( $t = 1$ ) regardless of the size. In Appendix D.4, Tables 15 and 16, we provide OOD detection results on four individual OOD datasets as well as the performance with ResNet-50 [12], where our approach achieves the best OOD detection performance over the nine baselines considered.
Outlier detection We perform outlier detection experiments following the methodology by Wang et al. [56], where the training set contains outlier data with random labels. We construct the noisy ImageNet-100 training sets by using iNaturalist [53] and SUN [58] datasets. We train a ViT-Base model [8] from scratch on these noisy training datasets, and measure outlier detection performance using the trained model. For a more detailed description, please refer to Appendix C.3.
Table 2 shows the outlier detection results on two outlier datasets. As indicated, our method achieves the best performance in both outlier settings, demonstrating its effectiveness in outlier detection. It is worth noting that the considered OOD scoring methods (MSP, Max Logit, Energy) do not achieve good outlier detection performance. We speculate that this is due to the overfitting of the neural network's predictions on outliers.
Detecting outliers in validation set We further utilize our method for identifying outliers in the validation set by retrieving data samples with the highest outlier score (Section 3.3). In Figure 10, we present samples detected by our algorithm from ImageNet and SST2. In the figure, we observe that these samples are not suitable for measuring the predictive performance on labels, which should be excluded from the evaluation dataset.
Temperature  $t$  In Equation (3), we introduced a temperature  $t$ , where a large value of  $t$  increases the influence of large relation values in our algorithm. We conduct sensitivity analysis on  $t$  with MAE-Large on ImageNet under 8% label noise. Figure 8 shows the effect of the temperature value
Figure 9: Detected data samples with label errors (marked in red) from ImageNet (top) and SST2 (bottom). We present samples with conflicting relations next to the detected samples and denote the corresponding relation value in parenthesis. We present more samples in Appendix E.2, Figure 14.
Hartebeest (-0.794)
Hartebeest (-0.768)
"entertaining and informative documentary"
Positive (-0.850)
"entertaining movie"
Positive (-0.846)
fascinating and timely content
Positive "leather p
Positive "give a backbone to the company"
Figure 10: Data samples with the highest outlier scores by our method on ImageNet (top) and SST2 (bottom) validation sets. We denote the assigned labels above each data sample. We present more outlier samples in Appendix E.2, Figure 15 and Table 18.
Negative "the israeli/palestinian conflict as"
on our detection algorithm's performance. From the figure, we observe that the label error detection performance increases as the  $t$  value increases, saturating at  $t = 6$ . In the case of OOD detection, we achieve the best performance at around  $t = 1$ . Our algorithm outperforms the best baseline over a wide range of hyperparameters, demonstrating the robustness of our algorithm to the hyperparameter.
Similarity kernel design We present an empirical analysis of the kernel design choices. Specifically, we replace the cosine similarity term in Equation (3) as the RBF kernel and evaluate the detection performance. We further conduct an ablation study on compatibility terms (Equation (4)). Table 3 summarizes the label error detection performance with different kernel functions on ImageNet with  $8\%$  noise ratio. The table shows that our approach largely outperforms the best baseline even with the RBF
kernel. Also, we find that our approach without the compatibility term shows comparable AP performance while significantly outperforming baselines in TNR95. These results demonstrate the generality and utility of our relational structure-based framework, which is not limited to a specific kernel design.
Table 3: Comparison of similarity kernel designs. Baseline represents the best baseline performance. The term  $c$  denotes our compatibility term in Equation (4). Note,  $Cos \cdot c$  is the kernel function considered in our main experiments, and  $RBF / Cos$  refers to our method without the compatibility term  $c$ .
Metric	Baseline	RBF	Cos	RBF · c	Cos · c
AP	0.484	0.470	0.471	0.525	0.526
TNR95	0.521	0.668	0.671	0.703	0.695
In this paper, we propose a novel data relation function and graph algorithms for detecting label errors and outlier data using the relational structure of data in the feature embedding space. Our approach achieves state-of-the-art performance in both label error and outlier/OOD detection tasks, as demonstrated through extensive experiments on large-scale benchmarks. Furthermore, we introduce a data contextualization tool based on our data relation that can aid in data diagnosis. Our algorithms and tools can facilitate the analysis of large-scale datasets, which is crucial for the development of robust machine-learning systems.
We are grateful to Jinuk Kim for helpful discussions. This work was supported by SNU-NAVER Hyperscale AI Center, Institute of Information & Communications Technology Planning & Evaluation (IITP) grant funded by the Korea government (MSIT) [No. 2020-0-00882, (SW STAR LAB) Development of deployable learning intelligence via self-sustainable and trustworthy machine learning and NO.2021-0-01343, Artificial Intelligence Graduate School Program (Seoul National University)], and Basic Science Research Program through the National Research Foundation of Korea (NRF) funded by the Ministry of Education (RS-2023-00274280). Hyun Oh Song is the corresponding author.
[1] H. Bao, L. Dong, and F. Wei. Beit: Bert pre-training of image transformers. In ICLR, 2022.
[2] E. Barshan, M.-E. Brunet, and G. K. Dziugaite. Relatif: Identifying explanatory training samples via relative influence. In AISTATS, 2020.
[3] S. Basu, P. Pope, and S. Feizi. Influence functions in deep learning are fragile. In ICLR, 2021.
[4] L. Beyer, O. J. Henaff, A. Kolesnikov, X. Zhai, and A. v. d. Oord. Are we done with imagenet? arXiv preprint arXiv:2006.07159, 2020.
[5] D. Chong, J. Hong, and C. D. Manning. Detecting label errors using pre-trained language models. arXiv preprint arXiv:2205.12702, 2022.
[6] M. Cimpoi, S. Maji, I. Kokkinos, S. Mohamed, and A. Vedaldi. Describing textures in the wild. In CVPR, 2014.
[7] J. Davis and M. Goadrich. The relationship between precision-recall and roc curves. In ICML, 2006.
[8] A. Dosovitskiy, L. Beyer, A. Kolesnikov, D. Weissenborn, X. Zhai, T. Unterthiner, M. Dehghani, M. Minderer, G. Heigold, S. Gelly, et al. An image is worth 16x16 words: Transformers for image recognition at scale. In ICLR, 2021.
[9] A. Ghorbani and J. Zou. Data shapley: Equitable valuation of data for machine learning. In ICML, 2019.
[10] Y. Gong, Y.-A. Chung, and J. Glass. Ast: Audio spectrogram transformer. In Interspeech, 2021.
[11] J. Hartmanis. Computers and intractability: a guide to the theory of np-completeness (michael r. garey and david s. johnson). Siam Review, 24(1), 1982.
[12] K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning for image recognition. In CVPR, 2016.
[13] K. He, X. Chen, S. Xie, Y. Li, P. Dollár, and R. Girshick. Masked autoencoders are scalable vision learners. In CVPR, 2022.
[14] D. Hendrycks and K. Gimpel. A baseline for detecting misclassified and out-of-distribution examples in neural networks. In ICLR, 2017.
[15] D. Hendrycks, S. Basart, M. Mazeika, M. Mostajabi, J. Steinhardt, and D. Song. Scaling out-of-distribution detection for real-world settings. In ICML, 2022.
[16] W. Hu, Z. Li, and D. Yu. Simple and effective regularization methods for training on noisily labeled data with generalization guarantee. In ICLR, 2021.
[17] A. Ilyas, S. M. Park, L. Engstrom, G. Leclerc, and A. Madry. Datamodels: Predicting predictions from training data. In ICML, 2022.
[18] L. Jiang, Z. Zhou, T. Leung, L.-J. Li, and L. Fei-Fei. Mentornet: Learning data-driven curriculum for very deep neural networks on corrupted labels. In ICML, 2018.
[19] N. Karim, M. N. Rizve, N. Rahnavard, A. Mian, and M. Shah. Unicon: Combating label noise through uniform selection and contrastive learning. In CVPR, 2022.
[20] B. W. Kernighan and S. Lin. An efficient heuristic procedure for partitioning graphs. The Bell system technical journal, 49(2), 1970.
[21] J.-H. Kim, J. Kim, S. J. Oh, S. Yun, H. Song, J. Jeong, J.-W. Ha, and H. O. Song. Dataset condensation via efficient synthetic-data parameterization. In ICML, 2022.
[46] B. Sluban, D. Gamberger, and N. Lavrac. Ensemble-based noise detection: noise ranking and visual performance evaluation. Data mining and knowledge discovery, 28(2), 2014.
[47] H. O. Song, Y. Xiang, S. Jegelka, and S. Savarese. Deep metric learning via lifted structured feature embedding. In CVPR, 2016.
[48] M. Sugiyama and K. Borgwardt. Rapid distance-based outlier detection via sampling. In NeurIPS, 2013.
[49] Y. Sun, C. Guo, and Y. Li. React: Out-of-distribution detection with rectified activations. In NeurIPS, 2021.
[50] Y. Sun, Y. Ming, X. Zhu, and Y. Li. Out-of-distribution detection with deep nearest neighbors. In ICML, 2022.
[51] S. Swayamdipta, R. Schwartz, N. Lourie, Y. Wang, H. Hajishirzi, N. A. Smith, and Y. Choi. Dataset cartography: Mapping and diagnosing datasets with training dynamics. In EMNLP, 2020.
[52] M. Toneva, A. Sordoni, R. T. d. Combes, A. Trischler, Y. Bengio, and G. J. Gordon. An empirical study of example forgetting during deep neural network learning. In ICLR, 2019.
[53] G. Van Horn, O. Mac Aodha, Y. Song, Y. Cui, C. Sun, A. Shepard, H. Adam, P. Perona, and S. Belongie. The inaturalist species classification and detection dataset. In CVPR, 2018.
[54] V. Vasudevan, B. Caine, R. Gontijo-Lopes, S. Fridovich-Keil, and R. Roelofs. When does dough become a bagel? analyzing the remaining mistakes on imagenet. In NeurIPS, 2022.
[55] A. Wang, A. Singh, J. Michael, F. Hill, O. Levy, and S. R. Bowman. Glue: A multi-task benchmark and analysis platform for natural language understanding. In ICLR, 2019.
[56] Y. Wang, W. Liu, X. Ma, J. Bailey, H. Zha, L. Song, and S.-T. Xia. Iterative learning with open-set noisy labels. In CVPR, 2018.
[57] Z.-F. Wu, T. Wei, J. Jiang, C. Mao, M. Tang, and Y.-F. Li. Ngc: A unified framework for learning with open-world noisy data. In ICCV, 2021.
[58] J. Xiao, J. Hays, K. A. Ehinger, A. Oliva, and A. Torralba. Sun database: Large-scale scene recognition from abbey to zoo. In CVPR, 2010.
[59] J. Yang, K. Zhou, Y. Li, and Z. Liu. Generalized out-of-distribution detection: A survey. arXiv preprint arXiv:2110.11334, 2021.
[60] B. Yekkekhkany, A. Safari, S. Homayouni, and M. Hasanlou. A comparison study of different kernel functions forsvm-based classification of multi-temporal polarimetry sar data. The International Archives of Photogrammetry, Remote Sensing and Spatial Information Sciences, 2014.
[61] C. Zhang, S. Bengio, M. Hardt, B. Recht, and O. Vinyals. Understanding deep learning (still) requires rethinking generalization. Communications of the ACM, 64(3), 2021.
[62] B. Zhou, A. Lapedriza, A. Khosla, A. Oliva, and A. Torralba. Places: A 10 million image database for scene recognition. IEEE transactions on pattern analysis and machine intelligence, 40(6), 2017.
A Algorithm analysis
A.1 Proof
In this section, we provide proof for Proposition 1. Recall that Algorithm 1 updates an estimated noisy set  $\mathcal{N}$  at a set-level as  $\mathcal{N} = \{i\mid s[i] > \lambda \}$ . We can conduct Algorithm 1 with a single node update at each iteration using the criterion  $s[i] > \lambda$ , referred to as a sample-level version of Algorithm 1. Specifically, let us define  $v\in \mathbb{R}^n$  such that  $v[i] = -1$  for  $i\in \mathcal{N}$  and  $v[i] = 1$  for else. Then the algorithm moves a sample  $k$  to another partition at each iteration, where  $k = \operatorname{argmax}_{i\in \mathcal{T}}v[i](s[i] - \lambda)$ . The algorithm stops when  $v[k](s[k] - \lambda)\leq 0$ .
Proof. The change in the objective value of Equation (2) by moving data  $i$  from  $\mathcal{T}\backslash \mathcal{N}$  to  $\mathcal{N}$  is
$$
\sum_ {j \in \mathcal {T} \backslash \mathcal {N}} w (i, j) - \sum_ {j \in \mathcal {N}} w (i, j) - \lambda , \tag {5}
$$
where the change by moving data  $i$  from  $\mathcal{N}$  to  $\mathcal{T}\backslash \mathcal{N}$  is
$$
\sum_ {j \in \mathcal {N}} w (i, j) - \sum_ {j \in \mathcal {T} \backslash \mathcal {N}} w (i, j) + \lambda .
$$