Back to the Basics - Revisiting Out-of-Distribution Detection Baselines


Created: =dateformat(this.file.ctime,"dd MMM yyyy, hh:mm a") | Modified: =dateformat(this.file.mtime,"dd MMM yyyy, hh:mm a") Tags: knowledge,

Annotations


  • out-of-distribution(OOD) image detection that are compatible withany already trained classifier, relying on only itspredictions or learned representations. * show annotation

  • simply flag as OOD images whoseaverage distance to their K nearest neighbors islarge (in the representation space of an image clas-sifier trained on the in-distribution data) * show annotation

  • Rather than a complex density estimator (e.g. normal-izing flows), GAN, diffusion, or autoencoder architecture,we can simply leverage the K nearest neighbors of any ex-ample x and their distance to x as a crude estimate of thelocal density around x * show annotation

  • We follow the commonchoice of cosine distance as an effective similarity metricfor learned image representations * show annotation

  • score how OOD a given image x is, we take the averagedistance between x and each of its K nearest neighbors(KNN) from the training data * show annotation

  • Compu-tation of KNN Distance can be accelerated via a multitudeof approximate KNN algorithms * show annotation

  • Another crude estimate for the local density around x (basedon Gaussian mixture approximation instead of nonparamet-ric nearest neighbors) can be obtained via the MahalanobisDistance, which has recently become popular for OOD im-age detection * show annotation

  • compute Mahalanobis Distance in the embed-ding space of a trained neural image classifier. * show annotation

  • KNN Distance only con-siders the learned model embeddings z and not the modelpredicted class probabilities p. To determine if these predic-tions provide additional value for KNN-based OOD detec-tion, we consider two alternative variants * show annotation

  • same as the KNN Distance method, except we com-pute distance in a higher-dimensional vector space in whichthe image embeddings z are concatenated with the predictedprobabilities p * show annotation

  • based onthe cross-entropy between the predicted class probabilitiesfor image x and the average predicted class probability vec-tor amongst the K nearest neighbors of x in the training set * show annotation

  • tudy suggests the KNN Distance deservesgreater consideration for practical out-of-distribution imagedetection pipelines. * show annotation

  • straightforward to im-plement, conceptually well-grounded, highly interpretable,amenable to various computational shortcuts/approxima-tions, and capable of leveraging any classification model * show annotation