{"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/scale-aware-contrastive-reverse-distillation","title":"Scale-Aware Contrastive Reverse Distillation for Unsupervised Medical Anomaly Detection","arxiv_id":"2503.13828","date":"2025-03-18","proceeding":null,"authors":["Chunlei Li","Yilei Shi","Jingliang Hu","Xiao Xiang Zhu","Lichao Mou"],"abstract":"Unsupervised anomaly detection using deep learning has garnered significant research attention due to its broad applicability, particularly in medical imaging where labeled anomalous data are scarce. While earlier approaches leverage generative models like autoencoders and generative adversarial networks (GANs), they often fall short due to overgeneralization. Recent methods explore various strategies, including memory banks, normalizing flows, self-supervised learning, and knowledge distillation, to enhance discrimination. Among these, knowledge distillation, particularly reverse distillation, has shown promise. Following this paradigm, we propose a novel scale-aware contrastive reverse distillation model that addresses two key limitations of existing reverse distillation methods: insufficient feature discriminability and inability to handle anomaly scale variations. Specifically, we introduce a contrastive student-teacher learning approach to derive more discriminative representations by generating and exploring out-of-normal distributions. Further, we design a scale adaptation mechanism to softly weight contrastive distillation losses at different scales to account for the scale variation issue. Extensive experiments on benchmark datasets demonstrate state-of-the-art performance, validating the efficacy of the proposed method. Code is available at https://github.com/MedAITech/SCRD4AD.","url_abs":"https://arxiv.org/abs/2503.13828v1","url_pdf":"https://arxiv.org/pdf/2503.13828v1.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":"scale-aware-contrastive-reverse-distillation","repo_url":"https://github.com/medaitech/scrd4ad","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"anomaly-detection","task_name":"Anomaly Detection"},{"task_slug":"knowledge-distillation","task_name":"Knowledge Distillation"},{"task_slug":"self-supervised-learning","task_name":"Self-Supervised Learning"},{"task_slug":"unsupervised-anomaly-detection","task_name":"Unsupervised Anomaly Detection"}],"methods":[{"method_slug":"attention","method_name":"Attention"},{"method_slug":"softmax","method_name":"Softmax"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2503.13828","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2503.13828"}},"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/MedAITech/SCRD4AD","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/medaitech/scrd4ad","reach":{"status":"ok"}}],"summary":{"ran":3,"ran_draft_wrong":4,"ran_honours":1,"unverified":7},"by_repo_kind":{"official":{"samples":11,"ran":6,"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":15,"samples":[{"code_sha256_prefix":"d42ae3fd7fcd5024","entry":"BasicBlock","repo":"medaitech/scrd4ad","repo_kind":"official","path":"models/rd4ad_mlp.py","file_url":"https://github.com/medaitech/scrd4ad/blob/HEAD/models/rd4ad_mlp.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"d42ae3fd7fcd5024"}},{"code_sha256_prefix":"6d8a817f41286a76","entry":"Bottleneck","repo":"medaitech/scrd4ad","repo_kind":"official","path":"models/rd4ad_mlp.py","file_url":"https://github.com/medaitech/scrd4ad/blob/HEAD/models/rd4ad_mlp.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"6d8a817f41286a76"}},{"code_sha256_prefix":"6aadf008ed78087b","entry":"ResNet","repo":"medaitech/scrd4ad","repo_kind":"official","path":"models/rd4ad_mlp.py","file_url":"https://github.com/medaitech/scrd4ad/blob/HEAD/models/rd4ad_mlp.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"6aadf008ed78087b"}},{"code_sha256_prefix":"2a80220dabcb742a","entry":"conv1x1","repo":"medaitech/scrd4ad","repo_kind":"official","path":"models/de_resnet.py","file_url":"https://github.com/medaitech/scrd4ad/blob/HEAD/models/de_resnet.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":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"2a80220dabcb742a"}},{"code_sha256_prefix":"600ff2c45e0de056","entry":"conv3x3","repo":"medaitech/scrd4ad","repo_kind":"official","path":"models/de_resnet.py","file_url":"https://github.com/medaitech/scrd4ad/blob/HEAD/models/de_resnet.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":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"600ff2c45e0de056"}},{"code_sha256_prefix":"f6b944f50d3f15ae","entry":"count_parameters","repo":null,"repo_kind":null,"path":null,"file_url":null,"link_basis":"identical_code_first_harvested_elsewhere","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":null,"inline_ok":false,"mcp_get_code":{"code_sha256":"f6b944f50d3f15ae"}},{"code_sha256_prefix":"fed42b3e4edc5ea3","entry":"deconv2x2","repo":"medaitech/scrd4ad","repo_kind":"official","path":"models/de_resnet.py","file_url":"https://github.com/medaitech/scrd4ad/blob/HEAD/models/de_resnet.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":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"fed42b3e4edc5ea3"}},{"code_sha256_prefix":"a1db6c55cfde6e19","entry":"get_logger","repo":null,"repo_kind":null,"path":null,"file_url":null,"link_basis":"identical_code_first_harvested_elsewhere","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":null,"inline_ok":false,"mcp_get_code":{"code_sha256":"a1db6c55cfde6e19"}},{"code_sha256_prefix":"1b028c8edbfb44fe","entry":"BN_layer","repo":"medaitech/scrd4ad","repo_kind":"official","path":"models/rd4ad_mlp.py","file_url":"https://github.com/medaitech/scrd4ad/blob/HEAD/models/rd4ad_mlp.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"1b028c8edbfb44fe"}},{"code_sha256_prefix":"e1a6a678c9e39ac8","entry":"RdadAttenMax","repo":"medaitech/scrd4ad","repo_kind":"official","path":"models/rd4ad_mlp.py","file_url":"https://github.com/medaitech/scrd4ad/blob/HEAD/models/rd4ad_mlp.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"e1a6a678c9e39ac8"}},{"code_sha256_prefix":"c48d7d1257a35ba2","entry":"_resnet","repo":"medaitech/scrd4ad","repo_kind":"official","path":"models/rd4ad_mlp.py","file_url":"https://github.com/medaitech/scrd4ad/blob/HEAD/models/rd4ad_mlp.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"c48d7d1257a35ba2"}},{"code_sha256_prefix":"012c39548e5a5e70","entry":"conv1x1","repo":null,"repo_kind":null,"path":null,"file_url":null,"link_basis":"identical_code_first_harvested_elsewhere","language":"python","status":"unverified","verification_level":0,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":null,"inline_ok":false,"mcp_get_code":{"code_sha256":"012c39548e5a5e70"}},{"code_sha256_prefix":"9ec14cd0fc7f9260","entry":"conv3x3","repo":null,"repo_kind":null,"path":null,"file_url":null,"link_basis":"identical_code_first_harvested_elsewhere","language":"python","status":"unverified","verification_level":0,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":null,"inline_ok":false,"mcp_get_code":{"code_sha256":"9ec14cd0fc7f9260"}},{"code_sha256_prefix":"ab1ead1a4f71a4b1","entry":"de_wide_resnet50_2","repo":"medaitech/scrd4ad","repo_kind":"official","path":"models/rd4ad_mlp.py","file_url":"https://github.com/medaitech/scrd4ad/blob/HEAD/models/rd4ad_mlp.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"ab1ead1a4f71a4b1"}},{"code_sha256_prefix":"3b380873fb807e88","entry":"wide_resnet50_2","repo":"medaitech/scrd4ad","repo_kind":"official","path":"models/rd4ad_mlp.py","file_url":"https://github.com/medaitech/scrd4ad/blob/HEAD/models/rd4ad_mlp.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"3b380873fb807e88"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}