{"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/weakly-supervised-deep-anomaly-detection-with","title":"Deep Weakly-supervised Anomaly Detection","arxiv_id":"1910.13601","date":"2019-10-30","proceeding":null,"authors":["Guansong Pang","Chunhua Shen","Huidong Jin","Anton Van Den Hengel"],"abstract":"Recent semi-supervised anomaly detection methods that are trained using small labeled anomaly examples and large unlabeled data (mostly normal data) have shown largely improved performance over unsupervised methods. However, these methods often focus on fitting abnormalities illustrated by the given anomaly examples only (i.e.,, seen anomalies), and consequently they fail to generalize to those that are not, i.e., new types/classes of anomaly unseen during training. To detect both seen and unseen anomalies, we introduce a novel deep weakly-supervised approach, namely Pairwise Relation prediction Network (PReNet), that learns pairwise relation features and anomaly scores by predicting the relation of any two randomly sampled training instances, in which the pairwise relation can be anomaly-anomaly, anomaly-unlabeled, or unlabeled-unlabeled. Since unlabeled instances are mostly normal, the relation prediction enforces a joint learning of anomaly-anomaly, anomaly-normal, and normal-normal pairwise discriminative patterns, respectively. PReNet can then detect any seen/unseen abnormalities that fit the learned pairwise abnormal patterns, or deviate from the normal patterns. Further, this pairwise approach also seamlessly and significantly augments the training anomaly data. Empirical results on 12 real-world datasets show that PReNet significantly outperforms nine competing methods in detecting seen and unseen anomalies. We also theoretically and empirically justify the robustness of our model w.r.t. anomaly contamination in the unlabeled data. The code is available at https://github.com/mala-lab/PReNet.","url_abs":"https://arxiv.org/abs/1910.13601v4","url_pdf":"https://arxiv.org/pdf/1910.13601v4.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":"weakly-supervised-deep-anomaly-detection-with","repo_url":"https://github.com/mala-lab/prenet","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"tf","reach":null},{"paper_slug":"weakly-supervised-deep-anomaly-detection-with","repo_url":"https://github.com/HolyBayes/pro","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok"}},{"paper_slug":"weakly-supervised-deep-anomaly-detection-with","repo_url":"https://github.com/mindspore-ai/contrib/tree/master/application/pro","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"mindspore","reach":null},{"paper_slug":"weakly-supervised-deep-anomaly-detection-with","repo_url":"https://github.com/xuhongzuo/DeepOD","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"anomaly-detection","task_name":"Anomaly Detection"},{"task_slug":null,"task_name":"Relation"},{"task_slug":"relation-prediction","task_name":"Relation Prediction"},{"task_slug":"semi-supervised-anomaly-detection","task_name":"Semi-supervised Anomaly Detection"},{"task_slug":"supervised-anomaly-detection","task_name":"Supervised Anomaly Detection"},{"task_slug":"unsupervised-anomaly-detection","task_name":"Unsupervised Anomaly Detection"},{"task_slug":"weakly-supervised-anomaly-detection","task_name":"Weakly-supervised Anomaly Detection"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=1910.13601","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"1910.13601"}},"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/xuhongzuo/DeepOD","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/mala-lab/prenet","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/HolyBayes/pro","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/mindspore-ai/contrib/tree/master/application/pro","reach":null}],"summary":{"ran_draft_wrong":4,"ran_honours":1,"unverified":1},"by_repo_kind":{"official":{"samples":6,"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":"fb665f919f2218da","entry":"dataLoading","repo":"mala-lab/prenet","repo_kind":"official","path":"utils_new.py","file_url":"https://github.com/mala-lab/prenet/blob/HEAD/utils_new.py","link_basis":"first_harvest_node","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":"fb665f919f2218da"}},{"code_sha256_prefix":"091433f99f04a503","entry":"dataLoading_noheader","repo":"mala-lab/prenet","repo_kind":"official","path":"utils_new.py","file_url":"https://github.com/mala-lab/prenet/blob/HEAD/utils_new.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"091433f99f04a503"}},{"code_sha256_prefix":"a1b2e260beb89af7","entry":"inject_noise","repo":"mala-lab/prenet","repo_kind":"official","path":"data_interpolation.py","file_url":"https://github.com/mala-lab/prenet/blob/HEAD/data_interpolation.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"a1b2e260beb89af7"}},{"code_sha256_prefix":"48cc3fab45d0afc1","entry":"inject_noise_sparse","repo":"mala-lab/prenet","repo_kind":"official","path":"data_interpolation.py","file_url":"https://github.com/mala-lab/prenet/blob/HEAD/data_interpolation.py","link_basis":"first_harvest_node","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":"48cc3fab45d0afc1"}},{"code_sha256_prefix":"5540a5c0ccb0f320","entry":"pair_batch_generation","repo":"mala-lab/prenet","repo_kind":"official","path":"prenet.py","file_url":"https://github.com/mala-lab/prenet/blob/HEAD/prenet.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"5540a5c0ccb0f320"}},{"code_sha256_prefix":"8e114518ec313a58","entry":"pair_batch_generation_sparse","repo":"mala-lab/prenet","repo_kind":"official","path":"prenet.py","file_url":"https://github.com/mala-lab/prenet/blob/HEAD/prenet.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":"8e114518ec313a58"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}