{"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/csi-novelty-detection-via-contrastive","title":"CSI: Novelty Detection via Contrastive Learning on Distributionally Shifted Instances","arxiv_id":"2007.08176","date":"2020-07-16","proceeding":"NeurIPS 2020 12","authors":["Jihoon Tack","Sangwoo Mo","Jongheon Jeong","Jinwoo Shin"],"abstract":"Novelty detection, i.e., identifying whether a given sample is drawn from outside the training distribution, is essential for reliable machine learning. To this end, there have been many attempts at learning a representation well-suited for novelty detection and designing a score based on such representation. In this paper, we propose a simple, yet effective method named contrasting shifted instances (CSI), inspired by the recent success on contrastive learning of visual representations. Specifically, in addition to contrasting a given sample with other instances as in conventional contrastive learning methods, our training scheme contrasts the sample with distributionally-shifted augmentations of itself. Based on this, we propose a new detection score that is specific to the proposed training scheme. Our experiments demonstrate the superiority of our method under various novelty detection scenarios, including unlabeled one-class, unlabeled multi-class and labeled multi-class settings, with various image benchmark datasets. Code and pre-trained models are available at https://github.com/alinlab/CSI.","url_abs":"https://arxiv.org/abs/2007.08176v2","url_pdf":"https://arxiv.org/pdf/2007.08176v2.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":"csi-novelty-detection-via-contrastive","repo_url":"https://github.com/alinlab/CSI","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"anomaly-detection","task_name":"Anomaly Detection"},{"task_slug":"contrastive-learning","task_name":"Contrastive Learning"},{"task_slug":"novelty-detection","task_name":"Novelty Detection"},{"task_slug":"out-of-distribution-detection","task_name":"Out-of-Distribution Detection"},{"task_slug":"representation-learning","task_name":"Representation Learning"},{"task_slug":"unsupervised-anomaly-detection","task_name":"Unsupervised Anomaly Detection"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/anomaly-detection-on-anomaly-detection-on-2","task":"Anomaly Detection","dataset":"Anomaly Detection on Anomaly Detection on Unlabeled ImageNet-30 vs Flowers-102","model":"CSI","rank_in_archive_order":2,"of":5,"metrics":{"Network":"ResNet-18","ROC-AUC":"94.7"},"uses_additional_data":false},{"leaderboard":"/sota/anomaly-detection-on-anomaly-detection-on","task":"Anomaly Detection","dataset":"Anomaly Detection on Unlabeled CIFAR-10 vs LSUN (Fix)","model":"CSI","rank_in_archive_order":6,"of":8,"metrics":{"Network":"ResNet-18","ROC-AUC":"90.3"},"uses_additional_data":false},{"leaderboard":"/sota/anomaly-detection-on-anomaly-detection-on-1","task":"Anomaly Detection","dataset":"Anomaly Detection on Unlabeled ImageNet-30 vs CUB-200","model":"CSI","rank_in_archive_order":5,"of":5,"metrics":{"Network":"ResNet-18","ROC-AUC":"71.5"},"uses_additional_data":false},{"leaderboard":"/sota/anomaly-detection-on-one-class-cifar-10","task":"Anomaly Detection","dataset":"One-class CIFAR-10","model":"CSI","rank_in_archive_order":12,"of":36,"metrics":{"AUROC":"94.3"},"uses_additional_data":false},{"leaderboard":"/sota/anomaly-detection-on-one-class-cifar-100","task":"Anomaly Detection","dataset":"One-class CIFAR-100","model":"CSI","rank_in_archive_order":6,"of":15,"metrics":{"AUROC":"89.6"},"uses_additional_data":false},{"leaderboard":"/sota/anomaly-detection-on-one-class-imagenet-30","task":"Anomaly Detection","dataset":"One-class ImageNet-30","model":"CSI","rank_in_archive_order":4,"of":11,"metrics":{"AUROC":"91.6"},"uses_additional_data":false},{"leaderboard":"/sota/anomaly-detection-on-unlabeled-cifar-10-vs","task":"Anomaly Detection","dataset":"Unlabeled CIFAR-10 vs CIFAR-100","model":"CSI","rank_in_archive_order":7,"of":13,"metrics":{"AUROC":"89.3","Network":"ResNet-18"},"uses_additional_data":false}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2007.08176","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2007.08176"}},"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":"deterministic:regex_extraction","url":"https://github.com/alinlab/CSI","reach":null}],"summary":{"ran_draft_wrong":1},"by_repo_kind":{"official":{"samples":1,"ran":1,"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":1,"samples":[{"code_sha256_prefix":"bb8ab909ec16a7ce","entry":"NT_xent","repo":"alinlab/CSI","repo_kind":"official","path":"training/contrastive_loss.py","file_url":"https://github.com/alinlab/CSI/blob/HEAD/training/contrastive_loss.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"bb8ab909ec16a7ce"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}