{"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/catching-both-gray-and-black-swans-open-set","title":"Catching Both Gray and Black Swans: Open-set Supervised Anomaly Detection","arxiv_id":"2203.14506","date":"2022-03-28","proceeding":"CVPR 2022 1","authors":["Choubo Ding","Guansong Pang","Chunhua Shen"],"abstract":"Despite most existing anomaly detection studies assume the availability of normal training samples only, a few labeled anomaly examples are often available in many real-world applications, such as defect samples identified during random quality inspection, lesion images confirmed by radiologists in daily medical screening, etc. These anomaly examples provide valuable knowledge about the application-specific abnormality, enabling significantly improved detection of similar anomalies in some recent models. However, those anomalies seen during training often do not illustrate every possible class of anomaly, rendering these models ineffective in generalizing to unseen anomaly classes. This paper tackles open-set supervised anomaly detection, in which we learn detection models using the anomaly examples with the objective to detect both seen anomalies (`gray swans') and unseen anomalies (`black swans'). We propose a novel approach that learns disentangled representations of abnormalities illustrated by seen anomalies, pseudo anomalies, and latent residual anomalies (i.e., samples that have unusual residuals compared to the normal data in a latent space), with the last two abnormalities designed to detect unseen anomalies. Extensive experiments on nine real-world anomaly detection datasets show superior performance of our model in detecting seen and unseen anomalies under diverse settings. Code and data are available at: https://github.com/choubo/DRA.","url_abs":"https://arxiv.org/abs/2203.14506v1","url_pdf":"https://arxiv.org/pdf/2203.14506v1.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":"catching-both-gray-and-black-swans-open-set","repo_url":"https://github.com/choubo/dra","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":"supervised-anomaly-detection","task_name":"Supervised Anomaly Detection"},{"task_slug":"supervised-defect-detection","task_name":"Supervised Defect Detection"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/supervised-anomaly-detection-on-mvtec-ad","task":"Supervised Anomaly Detection","dataset":"MVTec AD","model":"DRA","rank_in_archive_order":6,"of":8,"metrics":{"Detection AUROC":"95.9"},"uses_additional_data":true}],"syntology":{"syntology_url":"https://syntology.ai/paper/2203.14506","atlas_url":"https://app.syntology.ai/?focus=2203.14506","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2203.14506"}},"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/choubo/dra","reach":null}],"summary":{"ran":3,"unverified":3},"by_repo_kind":{"official":{"samples":6,"ran":3,"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":6,"samples":[{"code_sha256_prefix":"13cb8623ea6dc2b8","entry":"CompositeHead","repo":"choubo/dra","repo_kind":"official","path":"modeling/net.py","file_url":"https://github.com/choubo/dra/blob/HEAD/modeling/net.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"AGPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"13cb8623ea6dc2b8"}},{"code_sha256_prefix":"7c97c4992dfbb78f","entry":"HolisticHead","repo":"choubo/dra","repo_kind":"official","path":"modeling/net.py","file_url":"https://github.com/choubo/dra/blob/HEAD/modeling/net.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"AGPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"7c97c4992dfbb78f"}},{"code_sha256_prefix":"359eebae70f7d930","entry":"PlainHead","repo":"choubo/dra","repo_kind":"official","path":"modeling/net.py","file_url":"https://github.com/choubo/dra/blob/HEAD/modeling/net.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"AGPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"359eebae70f7d930"}},{"code_sha256_prefix":"34cb7b74c28ebcbe","entry":"DRA","repo":"choubo/dra","repo_kind":"official","path":"modeling/net.py","file_url":"https://github.com/choubo/dra/blob/HEAD/modeling/net.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"AGPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"34cb7b74c28ebcbe"}},{"code_sha256_prefix":"5c87497b562b5b9b","entry":"FeatureRESNET18","repo":"choubo/dra","repo_kind":"official","path":"modeling/net.py","file_url":"https://github.com/choubo/dra/blob/HEAD/modeling/net.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"AGPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"5c87497b562b5b9b"}},{"code_sha256_prefix":"41526e37b6afbc18","entry":"build_feature_extractor","repo":"choubo/dra","repo_kind":"official","path":"modeling/net.py","file_url":"https://github.com/choubo/dra/blob/HEAD/modeling/net.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"AGPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"41526e37b6afbc18"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}