Kernel PCA for Out-of-Distribution Detection

Kun Fang, Qinghua Tao, Kexin Lv, M. He, Xiaolin Huang +1 more
2/1/2024
41 citations

Official code: fanghenshaometeor/ood-kernel-pca (8 stars, Python, last commit 2025-06-17).

Abstract

Out-of-Distribution (OoD) detection is vital for the reliability of Deep Neural Networks (DNNs). Existing works have shown the insufficiency of Principal Component Analysis (PCA) straightforwardly applied on the features of DNNs in detecting OoD data from In-Distribution (InD) data.

Show full abstract

The failure of PCA suggests that the network features residing in OoD and InD are not well separated by simply proceeding in a linear subspace, which instead can be resolved through proper non-linear mappings. In this work, we leverage the framework of Kernel PCA (KPCA) for OoD detection, and seek suitable non-linear kernels that advocate the separability between InD and OoD data in the subspace spanned by the principal components. Besides, explicit feature mappings induced from the devoted task-specific kernels are adopted so that the KPCA reconstruction error for new test samples can be efficiently obtained with large-scale data. Extensive theoretical and empirical results on multiple OoD data sets and network structures verify the superiority of our KPCA detector in efficiency and efficacy with state-of-the-art detection performance.

View on arXivView PDF

Code Implementations(1)

[NeurIPS 2024] Kernel PCA for Out-of-Distribution Detection

83Python, ShellDec 1, 20231 years ago
kernel-pcaout-of-distribution-detection

Similar Papers

Cite this paper

@article{fang2024kernel,
  title  = {Kernel PCA for Out-of-Distribution Detection},
  author = {Kun Fang and Qinghua Tao and Kexin Lv and M. He and Xiaolin Huang and Jie Yang},
  year   = {2024},
  eprint = {2402.02949},
  archivePrefix = {arXiv},
  doi    = {10.48550/arXiv.2402.02949},
  url    = {https://arxiv.org/abs/2402.02949},
  journal = {NEURIPS 2024 2024}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2402.02949.svg)](https://codeofpaper.com/paper/2402.02949)

Discussion