{"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/sgood-substructure-enhanced-graph-level-out","title":"SGOOD: Substructure-enhanced Graph-Level Out-of-Distribution Detection","arxiv_id":"2310.10237","date":"2023-10-16","proceeding":null,"authors":["Zhihao Ding","Jieming Shi","Shiqi Shen","Xuequn Shang","Jiannong Cao","Zhipeng Wang","Zhi Gong"],"abstract":"Graph-level representation learning is important in a wide range of applications. Existing graph-level models are generally built on i.i.d. assumption for both training and testing graphs. However, in an open world, models can encounter out-of-distribution (OOD) testing graphs that are from different distributions unknown during training. A trustworthy model should be able to detect OOD graphs to avoid unreliable predictions, while producing accurate in-distribution (ID) predictions. To achieve this, we present SGOOD, a novel graph-level OOD detection framework. We find that substructure differences commonly exist between ID and OOD graphs, and design SGOOD with a series of techniques to encode task-agnostic substructures for effective OOD detection. Specifically, we build a super graph of substructures for every graph, and develop a two-level graph encoding pipeline that works on both original graphs and super graphs to obtain substructure-enhanced graph representations. We then devise substructure-preserving graph augmentation techniques to further capture more substructure semantics of ID graphs. Extensive experiments against 11 competitors on numerous graph datasets demonstrate the superiority of SGOOD, often surpassing existing methods by a significant margin. The code is available at https://github.com/TommyDzh/SGOOD.","url_abs":"https://arxiv.org/abs/2310.10237v2","url_pdf":"https://arxiv.org/pdf/2310.10237v2.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":"sgood-substructure-enhanced-graph-level-out","repo_url":"https://github.com/tommydzh/sgood","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"out-of-distribution-detection","task_name":"Out-of-Distribution Detection"},{"task_slug":"representation-learning","task_name":"Representation Learning"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2310.10237","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2310.10237"}},"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/tommydzh/sgood","reach":{"status":"ok"}}],"summary":{"ran":7},"by_repo_kind":{"official":{"samples":7,"ran":7,"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":7,"samples":[{"code_sha256_prefix":"8b3e3876eaff3c4c","entry":"append_ppr_graph","repo":"tommydzh/sgood","repo_kind":"official","path":"data_loader.py","file_url":"https://github.com/tommydzh/sgood/blob/HEAD/data_loader.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"8b3e3876eaff3c4c"}},{"code_sha256_prefix":"862f530f70ee4e85","entry":"get_motif_type_to_node_type_index_map","repo":"tommydzh/sgood","repo_kind":"official","path":"supergraph_utils.py","file_url":"https://github.com/tommydzh/sgood/blob/HEAD/supergraph_utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"862f530f70ee4e85"}},{"code_sha256_prefix":"34664e472317e283","entry":"get_scores","repo":"tommydzh/sgood","repo_kind":"official","path":"utils.py","file_url":"https://github.com/tommydzh/sgood/blob/HEAD/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"34664e472317e283"}},{"code_sha256_prefix":"537673d8db8a1d1f","entry":"get_scores_multi_cluster","repo":"tommydzh/sgood","repo_kind":"official","path":"utils.py","file_url":"https://github.com/tommydzh/sgood/blob/HEAD/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"537673d8db8a1d1f"}},{"code_sha256_prefix":"9d7343b2c4d084dd","entry":"get_scores_one","repo":"tommydzh/sgood","repo_kind":"official","path":"utils.py","file_url":"https://github.com/tommydzh/sgood/blob/HEAD/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"9d7343b2c4d084dd"}},{"code_sha256_prefix":"98fcdb87317bef35","entry":"init_structural_encoding","repo":"tommydzh/sgood","repo_kind":"official","path":"data_loader.py","file_url":"https://github.com/tommydzh/sgood/blob/HEAD/data_loader.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"98fcdb87317bef35"}},{"code_sha256_prefix":"6ca33a1df50d0c83","entry":"read_graph_file","repo":"tommydzh/sgood","repo_kind":"official","path":"data_loader.py","file_url":"https://github.com/tommydzh/sgood/blob/HEAD/data_loader.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"6ca33a1df50d0c83"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}