{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/kernel-pca-for-out-of-distribution-detection","title":"Kernel PCA for Out-of-Distribution Detection","arxiv_id":"2402.02949","date":"2024-02-05","proceeding":null,"authors":["Kun Fang","Qinghua Tao","Kexin Lv","Mingzhen He","Xiaolin Huang","Jie Yang"],"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. 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.","url_abs":"https://arxiv.org/abs/2402.02949v3","url_pdf":"https://arxiv.org/pdf/2402.02949v3.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"kernel-pca-for-out-of-distribution-detection","repo_url":"https://github.com/fanghenshaometeor/ood-kernel-pca","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}},{"paper_slug":"kernel-pca-for-out-of-distribution-detection","repo_url":"https://github.com/fanghenshaometeor/ood-kpca-extension","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"ood-detection","task_name":"Out of Distribution (OOD) Detection"},{"task_slug":"out-of-distribution-detection","task_name":"Out-of-Distribution Detection"}],"methods":[{"method_slug":"pca","method_name":"PCA"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2402.02949","atlas_url":"https://app.syntology.ai/?focus=2402.02949","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2402.02949"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/fanghenshaometeor/ood-kernel-pca","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/fanghenshaometeor/ood-kpca-extension","reach":null}],"summary":{"ran_fixture":2,"ran_honours":1,"ran_draft_wrong":1,"unverified":1},"by_repo_kind":{"listed":{"samples":3,"ran":2,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":5,"samples":[{"code_sha256_prefix":"e1dfe697d81dc165","entry":"fpr_and_fdr_at_recall","repo":null,"repo_kind":null,"path":null,"file_url":null,"link_basis":"identical_code_first_harvested_elsewhere","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":null,"inline_ok":false,"mcp_get_code":{"code_sha256":"e1dfe697d81dc165"}},{"code_sha256_prefix":"5dcd5cdb8a08e275","entry":"iterate_data_react","repo":"fanghenshaometeor/ood-kpca-extension","repo_kind":"listed","path":"utils_ood.py","file_url":"https://github.com/fanghenshaometeor/ood-kpca-extension/blob/HEAD/utils_ood.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"5dcd5cdb8a08e275"}},{"code_sha256_prefix":"d4acb3120a027622","entry":"stable_cumsum","repo":null,"repo_kind":null,"path":null,"file_url":null,"link_basis":"identical_code_first_harvested_elsewhere","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":null,"inline_ok":false,"mcp_get_code":{"code_sha256":"d4acb3120a027622"}},{"code_sha256_prefix":"48e491ddc2c394f5","entry":"val_ood_fuse","repo":"fanghenshaometeor/ood-kpca-extension","repo_kind":"listed","path":"utils_ood.py","file_url":"https://github.com/fanghenshaometeor/ood-kpca-extension/blob/HEAD/utils_ood.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"48e491ddc2c394f5"}},{"code_sha256_prefix":"914e5f1ab3d0dfdf","entry":"get_measures","repo":"fanghenshaometeor/ood-kpca-extension","repo_kind":"listed","path":"utils_ood.py","file_url":"https://github.com/fanghenshaometeor/ood-kpca-extension/blob/HEAD/utils_ood.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"914e5f1ab3d0dfdf"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}