{"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/detecting-anomalous-inputs-to-dnn-classifiers","title":"A General Framework For Detecting Anomalous Inputs to DNN Classifiers","arxiv_id":"2007.15147","date":"2020-07-29","proceeding":null,"authors":["Jayaram Raghuram","Varun Chandrasekaran","Somesh Jha","Suman Banerjee"],"abstract":"Detecting anomalous inputs, such as adversarial and out-of-distribution (OOD) inputs, is critical for classifiers (including deep neural networks or DNNs) deployed in real-world applications. While prior works have proposed various methods to detect such anomalous samples using information from the internal layer representations of a DNN, there is a lack of consensus on a principled approach for the different components of such a detection method. As a result, often heuristic and one-off methods are applied for different aspects of this problem. We propose an unsupervised anomaly detection framework based on the internal DNN layer representations in the form of a meta-algorithm with configurable components. We proceed to propose specific instantiations for each component of the meta-algorithm based on ideas grounded in statistical testing and anomaly detection. We evaluate the proposed methods on well-known image classification datasets with strong adversarial attacks and OOD inputs, including an adaptive attack that uses the internal layer representations of the DNN (often not considered in prior work). Comparisons with five recently-proposed competing detection methods demonstrates the effectiveness of our method in detecting adversarial and OOD inputs.","url_abs":"https://arxiv.org/abs/2007.15147v3","url_pdf":"https://arxiv.org/pdf/2007.15147v3.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":"detecting-anomalous-inputs-to-dnn-classifiers","repo_url":"https://github.com/jayaram-r/adversarial-detection","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"anomaly-detection","task_name":"Anomaly Detection"},{"task_slug":"image-classification","task_name":"Image Classification"},{"task_slug":"unsupervised-anomaly-detection","task_name":"Unsupervised Anomaly Detection"},{"task_slug":"image-classification","task_name":"image-classification"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2007.15147","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2007.15147"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+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/jayaram-r/adversarial-detection","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"unverified":4},"by_repo_kind":{"official":{"samples":4,"ran":0,"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":0,"samples":[{"code_sha256_prefix":"2737b6a2e4410c2a","entry":"bhattacharya_coeff","repo":"jayaram-r/adversarial-detection","repo_kind":"official","path":"expts/plot_layer_stats.py","file_url":"https://github.com/jayaram-r/adversarial-detection/blob/HEAD/expts/plot_layer_stats.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"2737b6a2e4410c2a"}},{"code_sha256_prefix":"6d6b0a89408bd010","entry":"combine_and_save","repo":"jayaram-r/adversarial-detection","repo_kind":"official","path":"expts/generate_samples_custom.py","file_url":"https://github.com/jayaram-r/adversarial-detection/blob/HEAD/expts/generate_samples_custom.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"6d6b0a89408bd010"}},{"code_sha256_prefix":"b72af4b9b2c9b75e","entry":"log_transform_data","repo":"jayaram-r/adversarial-detection","repo_kind":"official","path":"expts/helpers/density_model_layer_statistics.py","file_url":"https://github.com/jayaram-r/adversarial-detection/blob/HEAD/expts/helpers/density_model_layer_statistics.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"b72af4b9b2c9b75e"}},{"code_sha256_prefix":"0c9e4fefa0d08c76","entry":"select_covar_types","repo":"jayaram-r/adversarial-detection","repo_kind":"official","path":"expts/helpers/density_model_layer_statistics.py","file_url":"https://github.com/jayaram-r/adversarial-detection/blob/HEAD/expts/helpers/density_model_layer_statistics.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"0c9e4fefa0d08c76"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}