{"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/self-supervised-out-of-distribution-detection-1","title":"Natural Synthetic Anomalies for Self-Supervised Anomaly Detection and Localization","arxiv_id":"2109.15222","date":"2021-09-30","proceeding":null,"authors":["Hannah M. Schlüter","Jeremy Tan","Benjamin Hou","Bernhard Kainz"],"abstract":"We introduce a simple and intuitive self-supervision task, Natural Synthetic Anomalies (NSA), for training an end-to-end model for anomaly detection and localization using only normal training data. NSA integrates Poisson image editing to seamlessly blend scaled patches of various sizes from separate images. This creates a wide range of synthetic anomalies which are more similar to natural sub-image irregularities than previous data-augmentation strategies for self-supervised anomaly detection. We evaluate the proposed method using natural and medical images. Our experiments with the MVTec AD dataset show that a model trained to localize NSA anomalies generalizes well to detecting real-world a priori unknown types of manufacturing defects. Our method achieves an overall detection AUROC of 97.2 outperforming all previous methods that learn without the use of additional datasets. Code available at https://github.com/hmsch/natural-synthetic-anomalies.","url_abs":"https://arxiv.org/abs/2109.15222v3","url_pdf":"https://arxiv.org/pdf/2109.15222v3.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":"self-supervised-out-of-distribution-detection-1","repo_url":"https://github.com/hmsch/natural-synthetic-anomalies","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"self-supervised-out-of-distribution-detection-1","repo_url":"https://github.com/SimonThomine/MixedTeacher","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}},{"paper_slug":"self-supervised-out-of-distribution-detection-1","repo_url":"https://github.com/matt-baugh/nnood","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"anomaly-classification","task_name":"Anomaly Classification"},{"task_slug":"anomaly-detection","task_name":"Anomaly Detection"},{"task_slug":"anomaly-segmentation","task_name":"Anomaly Segmentation"},{"task_slug":"data-augmentation","task_name":"Data Augmentation"},{"task_slug":"out-of-distribution-detection","task_name":"Out-of-Distribution Detection"},{"task_slug":"self-supervised-anomaly-detection","task_name":"Self-Supervised Anomaly Detection"},{"task_slug":"supervised-anomaly-detection","task_name":"Supervised Anomaly Detection"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/anomaly-classification-on-goodsad","task":"Anomaly Classification","dataset":"GoodsAD","model":"NSA","rank_in_archive_order":5,"of":11,"metrics":{"AUPR":"71.8","AUROC":"67.3"},"uses_additional_data":false},{"leaderboard":"/sota/anomaly-detection-on-aebad-s","task":"Anomaly Detection","dataset":"AeBAD-S","model":"NSA","rank_in_archive_order":6,"of":8,"metrics":{"Detection AUROC":"56.7","Segmentation AUPRO":"45.9"},"uses_additional_data":false},{"leaderboard":"/sota/anomaly-detection-on-aebad-v","task":"Anomaly Detection","dataset":"AeBAD-V","model":"NSA","rank_in_archive_order":5,"of":7,"metrics":{"Detection AUROC":"64.6"},"uses_additional_data":false},{"leaderboard":"/sota/anomaly-detection-on-mvtec-ad","task":"Anomaly Detection","dataset":"MVTec AD","model":"NSA","rank_in_archive_order":78,"of":148,"metrics":{"Detection AUROC":"97.2","Segmentation AUPRO":"91.0","Segmentation AUROC":"96.3"},"uses_additional_data":true}],"syntology":{"syntology_url":"https://syntology.ai/paper/2109.15222","atlas_url":"https://app.syntology.ai/?focus=2109.15222","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2109.15222"}},"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/SimonThomine/MixedTeacher","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/hmsch/natural-synthetic-anomalies","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/matt-baugh/nnood","reach":{"status":"ok"}}],"summary":{"ran_draft_wrong":2,"ran":3,"unverified":3},"by_repo_kind":{"official":{"samples":8,"ran":5,"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":"2a80220dabcb742a","entry":"conv1x1","repo":"hmsch/natural-synthetic-anomalies","repo_kind":"official","path":"model/resnet.py","file_url":"https://github.com/hmsch/natural-synthetic-anomalies/blob/HEAD/model/resnet.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"2a80220dabcb742a"}},{"code_sha256_prefix":"600ff2c45e0de056","entry":"conv3x3","repo":"hmsch/natural-synthetic-anomalies","repo_kind":"official","path":"model/resnet.py","file_url":"https://github.com/hmsch/natural-synthetic-anomalies/blob/HEAD/model/resnet.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"600ff2c45e0de056"}},{"code_sha256_prefix":"f1171b6bfcc3e531","entry":"conv3x3transpose","repo":"hmsch/natural-synthetic-anomalies","repo_kind":"official","path":"model/resnet.py","file_url":"https://github.com/hmsch/natural-synthetic-anomalies/blob/HEAD/model/resnet.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"f1171b6bfcc3e531"}},{"code_sha256_prefix":"920324b9e7cc6816","entry":"denorm","repo":"hmsch/natural-synthetic-anomalies","repo_kind":"official","path":"experiments/plotting_utils.py","file_url":"https://github.com/hmsch/natural-synthetic-anomalies/blob/HEAD/experiments/plotting_utils.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"920324b9e7cc6816"}},{"code_sha256_prefix":"4249ba1d2f75de1b","entry":"pro_score","repo":"hmsch/natural-synthetic-anomalies","repo_kind":"official","path":"experiments/mvtec_tasks.py","file_url":"https://github.com/hmsch/natural-synthetic-anomalies/blob/HEAD/experiments/mvtec_tasks.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"4249ba1d2f75de1b"}},{"code_sha256_prefix":"c9a1e40bd3ae032c","entry":"patch_ex","repo":"hmsch/natural-synthetic-anomalies","repo_kind":"official","path":"self_sup_data/self_sup_tasks.py","file_url":"https://github.com/hmsch/natural-synthetic-anomalies/blob/HEAD/self_sup_data/self_sup_tasks.py","link_basis":"harvester_set","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":"c9a1e40bd3ae032c"}},{"code_sha256_prefix":"1fd37b302358846f","entry":"test_real_anomalies","repo":"hmsch/natural-synthetic-anomalies","repo_kind":"official","path":"experiments/chest_xray_tasks.py","file_url":"https://github.com/hmsch/natural-synthetic-anomalies/blob/HEAD/experiments/chest_xray_tasks.py","link_basis":"harvester_set","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":"1fd37b302358846f"}},{"code_sha256_prefix":"ad009c113a7defdc","entry":"test_real_anomalies","repo":"hmsch/natural-synthetic-anomalies","repo_kind":"official","path":"experiments/mvtec_tasks.py","file_url":"https://github.com/hmsch/natural-synthetic-anomalies/blob/HEAD/experiments/mvtec_tasks.py","link_basis":"harvester_set","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":"ad009c113a7defdc"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}