{"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/memseg-a-semi-supervised-method-for-image","title":"MemSeg: A semi-supervised method for image surface defect detection using differences and commonalities","arxiv_id":"2205.00908","date":"2022-05-02","proceeding":null,"authors":["Minghui Yang","Peng Wu","Jing Liu","Hui Feng"],"abstract":"Under the semi-supervised framework, we propose an end-to-end memory-based segmentation network (MemSeg) to detect surface defects on industrial products. Considering the small intra-class variance of products in the same production line, from the perspective of differences and commonalities, MemSeg introduces artificially simulated abnormal samples and memory samples to assist the learning of the network. In the training phase, MemSeg explicitly learns the potential differences between normal and simulated abnormal images to obtain a robust classification hyperplane. At the same time, inspired by the mechanism of human memory, MemSeg uses a memory pool to store the general patterns of normal samples. By comparing the similarities and differences between input samples and memory samples in the memory pool to give effective guesses about abnormal regions; In the inference phase, MemSeg directly determines the abnormal regions of the input image in an end-to-end manner. Through experimental validation, MemSeg achieves the state-of-the-art (SOTA) performance on MVTec AD datasets with AUC scores of 99.56% and 98.84% at the image-level and pixel-level, respectively. In addition, MemSeg also has a significant advantage in inference speed benefiting from the end-to-end and straightforward network structure, which better meets the real-time requirement in industrial scenarios.","url_abs":"https://arxiv.org/abs/2205.00908v1","url_pdf":"https://arxiv.org/pdf/2205.00908v1.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":"memseg-a-semi-supervised-method-for-image","repo_url":"https://github.com/ELongking/Memseg-Implementation","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}},{"paper_slug":"memseg-a-semi-supervised-method-for-image","repo_url":"https://github.com/TooTouch/MemSeg","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"memseg-a-semi-supervised-method-for-image","repo_url":"https://github.com/areylng/MemSeg","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}},{"paper_slug":"memseg-a-semi-supervised-method-for-image","repo_url":"https://github.com/ntkhoa95/MemSeg-Defect-Detection","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":"anomaly-detection","task_name":"Anomaly Detection"},{"task_slug":"defect-detection","task_name":"Defect Detection"},{"task_slug":"robust-classification","task_name":"Robust classification"}],"methods":[{"method_slug":"speed","method_name":"SPEED"}],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/anomaly-detection-on-mvtec-ad","task":"Anomaly Detection","dataset":"MVTec AD","model":"MemSeg","rank_in_archive_order":25,"of":148,"metrics":{"Detection AUROC":"99.56","FPS":"31.3","Segmentation AUROC":"98.84"},"uses_additional_data":true}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2205.00908","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2205.00908"}},"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/ELongking/Memseg-Implementation","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/areylng/MemSeg","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/ntkhoa95/MemSeg-Defect-Detection","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/TooTouch/MemSeg","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"unverified":6},"by_repo_kind":{"listed":{"samples":6,"ran":0,"repositories":2}},"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":"65ccd9c3a0376427","entry":"compute_pro","repo":"TooTouch/MemSeg","repo_kind":"listed","path":"metrics/pro_curve_util.py","file_url":"https://github.com/TooTouch/MemSeg/blob/HEAD/metrics/pro_curve_util.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":"65ccd9c3a0376427"}},{"code_sha256_prefix":"92626665be140960","entry":"generate_toy_dataset","repo":"TooTouch/MemSeg","repo_kind":"listed","path":"metrics/generic_util.py","file_url":"https://github.com/TooTouch/MemSeg/blob/HEAD/metrics/generic_util.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":"92626665be140960"}},{"code_sha256_prefix":"9321cc2548fee949","entry":"heatmap_on_image","repo":"ntkhoa95/MemSeg-Defect-Detection","repo_kind":"listed","path":"inference_cpu.py","file_url":"https://github.com/ntkhoa95/MemSeg-Defect-Detection/blob/HEAD/inference_cpu.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"9321cc2548fee949"}},{"code_sha256_prefix":"1d82542315664ba0","entry":"minmax_scaling","repo":"ntkhoa95/MemSeg-Defect-Detection","repo_kind":"listed","path":"inference_cpu.py","file_url":"https://github.com/ntkhoa95/MemSeg-Defect-Detection/blob/HEAD/inference_cpu.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"1d82542315664ba0"}},{"code_sha256_prefix":"7e4d7de3fdbdb1bc","entry":"parse_cfg","repo":"ntkhoa95/MemSeg-Defect-Detection","repo_kind":"listed","path":"conversion.py","file_url":"https://github.com/ntkhoa95/MemSeg-Defect-Detection/blob/HEAD/conversion.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"7e4d7de3fdbdb1bc"}},{"code_sha256_prefix":"92db361050fcd08d","entry":"trapezoid","repo":"TooTouch/MemSeg","repo_kind":"listed","path":"metrics/generic_util.py","file_url":"https://github.com/TooTouch/MemSeg/blob/HEAD/metrics/generic_util.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":"92db361050fcd08d"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}