{"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/ganomaly-semi-supervised-anomaly-detection","title":"GANomaly: Semi-Supervised Anomaly Detection via Adversarial Training","arxiv_id":"1805.06725","date":"2018-05-17","proceeding":null,"authors":["Samet Akcay","Amir Atapour-Abarghouei","Toby P. Breckon"],"abstract":"Anomaly detection is a classical problem in computer vision, namely the\ndetermination of the normal from the abnormal when datasets are highly biased\ntowards one class (normal) due to the insufficient sample size of the other\nclass (abnormal). While this can be addressed as a supervised learning problem,\na significantly more challenging problem is that of detecting the\nunknown/unseen anomaly case that takes us instead into the space of a\none-class, semi-supervised learning paradigm. We introduce such a novel anomaly\ndetection model, by using a conditional generative adversarial network that\njointly learns the generation of high-dimensional image space and the inference\nof latent space. Employing encoder-decoder-encoder sub-networks in the\ngenerator network enables the model to map the input image to a lower dimension\nvector, which is then used to reconstruct the generated output image. The use\nof the additional encoder network maps this generated image to its latent\nrepresentation. Minimizing the distance between these images and the latent\nvectors during training aids in learning the data distribution for the normal\nsamples. As a result, a larger distance metric from this learned data\ndistribution at inference time is indicative of an outlier from that\ndistribution - an anomaly. Experimentation over several benchmark datasets,\nfrom varying domains, shows the model efficacy and superiority over previous\nstate-of-the-art approaches.","url_abs":"http://arxiv.org/abs/1805.06725v3","url_pdf":"http://arxiv.org/pdf/1805.06725v3.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":"ganomaly-semi-supervised-anomaly-detection","repo_url":"https://github.com/openvinotoolkit/anomalib","is_official":1,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}},{"paper_slug":"ganomaly-semi-supervised-anomaly-detection","repo_url":"https://github.com/samet-akcay/ganomaly","is_official":0,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"ganomaly-semi-supervised-anomaly-detection","repo_url":"https://github.com/YeongHyeon/GANomaly","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"tf","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"ganomaly-semi-supervised-anomaly-detection","repo_url":"https://github.com/aarthipriyar/GAN","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"ganomaly-semi-supervised-anomaly-detection","repo_url":"https://github.com/danbochman/GANomaly-TF2","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"tf","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"ganomaly-semi-supervised-anomaly-detection","repo_url":"https://github.com/llien30/GANomaly","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}},{"paper_slug":"ganomaly-semi-supervised-anomaly-detection","repo_url":"https://github.com/rickyHong/GANomaly-repl","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"ganomaly-semi-supervised-anomaly-detection","repo_url":"https://github.com/ucbtns/medgan","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"anomaly-detection","task_name":"Anomaly Detection"},{"task_slug":"decoder","task_name":"Decoder"},{"task_slug":null,"task_name":"Generative Adversarial Network"},{"task_slug":"semi-supervised-anomaly-detection","task_name":"Semi-supervised Anomaly Detection"},{"task_slug":"supervised-anomaly-detection","task_name":"Supervised Anomaly Detection"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=1805.06725","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"1805.06725"}},"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/aarthipriyar/GAN","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/YeongHyeon/GANomaly","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/ucbtns/medgan","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/rickyHong/GANomaly-repl","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/danbochman/GANomaly-TF2","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/openvinotoolkit/anomalib","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/samet-akcay/ganomaly","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/llien30/GANomaly","reach":{"status":"ok"}}],"summary":{"unverified":23},"by_repo_kind":{"named_in_paper":{"samples":4,"ran":0,"repositories":1},"listed":{"samples":19,"ran":0,"repositories":3}},"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":"987e51bd5d0d4f05","entry":"annotation_to_bboxes_ltwh","repo":"danbochman/GANomaly-TF2","repo_kind":"listed","path":"dataloader/annotation_utils.py","file_url":"https://github.com/danbochman/GANomaly-TF2/blob/HEAD/dataloader/annotation_utils.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":"987e51bd5d0d4f05"}},{"code_sha256_prefix":"99382519a0bea945","entry":"augment","repo":"danbochman/GANomaly-TF2","repo_kind":"listed","path":"dataloader/augmentations.py","file_url":"https://github.com/danbochman/GANomaly-TF2/blob/HEAD/dataloader/augmentations.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":"99382519a0bea945"}},{"code_sha256_prefix":"784683e6a5654175","entry":"auprc","repo":"rickyHong/GANomaly-repl","repo_kind":"listed","path":"lib/evaluate.py","file_url":"https://github.com/rickyHong/GANomaly-repl/blob/HEAD/lib/evaluate.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":"784683e6a5654175"}},{"code_sha256_prefix":"0fd8eb2f687fa0dd","entry":"auprc","repo":"samet-akcay/ganomaly","repo_kind":"named_in_paper","path":"lib/evaluate.py","file_url":"https://github.com/samet-akcay/ganomaly/blob/HEAD/lib/evaluate.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":"0fd8eb2f687fa0dd"}},{"code_sha256_prefix":"46ae5523f95a4bb5","entry":"bboxes_included_in_crop","repo":"danbochman/GANomaly-TF2","repo_kind":"listed","path":"dataloader/cogwheel_slicer.py","file_url":"https://github.com/danbochman/GANomaly-TF2/blob/HEAD/dataloader/cogwheel_slicer.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":"46ae5523f95a4bb5"}},{"code_sha256_prefix":"dd25489eddcd9d2b","entry":"center_and_scale","repo":"danbochman/GANomaly-TF2","repo_kind":"listed","path":"dataloader/preprocessing.py","file_url":"https://github.com/danbochman/GANomaly-TF2/blob/HEAD/dataloader/preprocessing.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":"dd25489eddcd9d2b"}},{"code_sha256_prefix":"5f267024749fe99d","entry":"dat2canvas","repo":"YeongHyeon/GANomaly","repo_kind":"listed","path":"source/tf_process.py","file_url":"https://github.com/YeongHyeon/GANomaly/blob/HEAD/source/tf_process.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":"5f267024749fe99d"}},{"code_sha256_prefix":"0b760551a0644d97","entry":"display_precision_recall_curve","repo":"danbochman/GANomaly-TF2","repo_kind":"listed","path":"eval_utils/visualization_utils.py","file_url":"https://github.com/danbochman/GANomaly-TF2/blob/HEAD/eval_utils/visualization_utils.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":"0b760551a0644d97"}},{"code_sha256_prefix":"a32f5b6f251d152b","entry":"evaluate","repo":"rickyHong/GANomaly-repl","repo_kind":"listed","path":"lib/evaluate.py","file_url":"https://github.com/rickyHong/GANomaly-repl/blob/HEAD/lib/evaluate.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":"a32f5b6f251d152b"}},{"code_sha256_prefix":"15c45ecba2721176","entry":"evaluate","repo":"samet-akcay/ganomaly","repo_kind":"named_in_paper","path":"lib/evaluate.py","file_url":"https://github.com/samet-akcay/ganomaly/blob/HEAD/lib/evaluate.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":"15c45ecba2721176"}},{"code_sha256_prefix":"ed42ab65f58ce81e","entry":"get_cifar_anomaly_dataset","repo":"rickyHong/GANomaly-repl","repo_kind":"listed","path":"lib/data.py","file_url":"https://github.com/rickyHong/GANomaly-repl/blob/HEAD/lib/data.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":"ed42ab65f58ce81e"}},{"code_sha256_prefix":"a6ddb2558bc17387","entry":"get_mnist_anomaly_dataset","repo":"rickyHong/GANomaly-repl","repo_kind":"listed","path":"lib/data.py","file_url":"https://github.com/rickyHong/GANomaly-repl/blob/HEAD/lib/data.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":"a6ddb2558bc17387"}},{"code_sha256_prefix":"aa166086c035e6eb","entry":"gray2rgb","repo":"YeongHyeon/GANomaly","repo_kind":"listed","path":"source/tf_process.py","file_url":"https://github.com/YeongHyeon/GANomaly/blob/HEAD/source/tf_process.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":"aa166086c035e6eb"}},{"code_sha256_prefix":"65c5eb22e03c7d55","entry":"img_slice_and_label","repo":"danbochman/GANomaly-TF2","repo_kind":"listed","path":"dataloader/cogwheel_slicer.py","file_url":"https://github.com/danbochman/GANomaly-TF2/blob/HEAD/dataloader/cogwheel_slicer.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":"65c5eb22e03c7d55"}},{"code_sha256_prefix":"8a2f4a14a4eff7ff","entry":"l1_loss","repo":"rickyHong/GANomaly-repl","repo_kind":"listed","path":"lib/loss.py","file_url":"https://github.com/rickyHong/GANomaly-repl/blob/HEAD/lib/loss.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":"8a2f4a14a4eff7ff"}},{"code_sha256_prefix":"602022135f879cb7","entry":"l2_loss","repo":"rickyHong/GANomaly-repl","repo_kind":"listed","path":"lib/loss.py","file_url":"https://github.com/rickyHong/GANomaly-repl/blob/HEAD/lib/loss.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":"602022135f879cb7"}},{"code_sha256_prefix":"22a02f2c65cda9f1","entry":"load_annotation_file","repo":"danbochman/GANomaly-TF2","repo_kind":"listed","path":"dataloader/annotation_utils.py","file_url":"https://github.com/danbochman/GANomaly-TF2/blob/HEAD/dataloader/annotation_utils.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":"22a02f2c65cda9f1"}},{"code_sha256_prefix":"3a96b9b27dddc30c","entry":"load_data","repo":"rickyHong/GANomaly-repl","repo_kind":"listed","path":"lib/data.py","file_url":"https://github.com/rickyHong/GANomaly-repl/blob/HEAD/lib/data.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":"3a96b9b27dddc30c"}},{"code_sha256_prefix":"fff66175b188911e","entry":"load_data","repo":"samet-akcay/ganomaly","repo_kind":"named_in_paper","path":"lib/data.py","file_url":"https://github.com/samet-akcay/ganomaly/blob/HEAD/lib/data.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":"fff66175b188911e"}},{"code_sha256_prefix":"625a1b73ba18c9b3","entry":"necessary_overlap_region","repo":"danbochman/GANomaly-TF2","repo_kind":"listed","path":"dataloader/cogwheel_slicer.py","file_url":"https://github.com/danbochman/GANomaly-TF2/blob/HEAD/dataloader/cogwheel_slicer.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":"625a1b73ba18c9b3"}},{"code_sha256_prefix":"a2c76c01c3578d6f","entry":"roc","repo":"samet-akcay/ganomaly","repo_kind":"named_in_paper","path":"lib/evaluate.py","file_url":"https://github.com/samet-akcay/ganomaly/blob/HEAD/lib/evaluate.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":"a2c76c01c3578d6f"}},{"code_sha256_prefix":"726767c6e03cf190","entry":"roc","repo":"rickyHong/GANomaly-repl","repo_kind":"listed","path":"lib/evaluate.py","file_url":"https://github.com/rickyHong/GANomaly-repl/blob/HEAD/lib/evaluate.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":"726767c6e03cf190"}},{"code_sha256_prefix":"9d292fa4e629c34e","entry":"stack_and_expand","repo":"danbochman/GANomaly-TF2","repo_kind":"listed","path":"dataloader/preprocessing.py","file_url":"https://github.com/danbochman/GANomaly-TF2/blob/HEAD/dataloader/preprocessing.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":"9d292fa4e629c34e"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}