{"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/compositional-few-shot-class-incremental","title":"Compositional Few-Shot Class-Incremental Learning","arxiv_id":"2405.17022","date":"2024-05-27","proceeding":null,"authors":["Yixiong Zou","Shanghang Zhang","Haichen Zhou","Yuhua Li","Ruixuan Li"],"abstract":"Few-shot class-incremental learning (FSCIL) is proposed to continually learn from novel classes with only a few samples after the (pre-)training on base classes with sufficient data. However, this remains a challenge. In contrast, humans can easily recognize novel classes with a few samples. Cognitive science demonstrates that an important component of such human capability is compositional learning. This involves identifying visual primitives from learned knowledge and then composing new concepts using these transferred primitives, making incremental learning both effective and interpretable. To imitate human compositional learning, we propose a cognitive-inspired method for the FSCIL task. We define and build a compositional model based on set similarities, and then equip it with a primitive composition module and a primitive reuse module. In the primitive composition module, we propose to utilize the Centered Kernel Alignment (CKA) similarity to approximate the similarity between primitive sets, allowing the training and evaluation based on primitive compositions. In the primitive reuse module, we enhance primitive reusability by classifying inputs based on primitives replaced with the closest primitives from other classes. Experiments on three datasets validate our method, showing it outperforms current state-of-the-art methods with improved interpretability. Our code is available at https://github.com/Zoilsen/Comp-FSCIL.","url_abs":"https://arxiv.org/abs/2405.17022v1","url_pdf":"https://arxiv.org/pdf/2405.17022v1.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":"compositional-few-shot-class-incremental","repo_url":"https://github.com/zoilsen/comp-fscil","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"class-incremental-learning","task_name":"Class Incremental Learning"},{"task_slug":"few-shot-class-incremental-learning","task_name":"Few-Shot Class-Incremental Learning"},{"task_slug":"incremental-learning","task_name":"Incremental Learning"},{"task_slug":"class-incremental-learning-1","task_name":"class-incremental learning"}],"methods":[{"method_slug":"base","method_name":"BASE"},{"method_slug":"set","method_name":"SET"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":null,"atlas_url":"https://app.syntology.ai/?focus=2405.17022","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2405.17022"}},"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/zoilsen/comp-fscil","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_draft_wrong":3,"ran":6,"unverified":6},"by_repo_kind":{"official":{"samples":15,"ran":9,"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":"d9def42110729a85","entry":"conv1x1","repo":"zoilsen/comp-fscil","repo_kind":"official","path":"models/resnet18_encoder.py","file_url":"https://github.com/zoilsen/comp-fscil/blob/HEAD/models/resnet18_encoder.py","link_basis":"harvester_set","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":"d9def42110729a85"}},{"code_sha256_prefix":"de92832114f71d8c","entry":"conv1x1","repo":"zoilsen/comp-fscil","repo_kind":"official","path":"models/resnet12.py","file_url":"https://github.com/zoilsen/comp-fscil/blob/HEAD/models/resnet12.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"de92832114f71d8c"}},{"code_sha256_prefix":"160bb14bd76201b4","entry":"conv3x3","repo":"zoilsen/comp-fscil","repo_kind":"official","path":"models/resnet18_encoder.py","file_url":"https://github.com/zoilsen/comp-fscil/blob/HEAD/models/resnet18_encoder.py","link_basis":"harvester_set","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":"160bb14bd76201b4"}},{"code_sha256_prefix":"fac5364e2f53c6db","entry":"conv3x3","repo":"zoilsen/comp-fscil","repo_kind":"official","path":"models/resnet20_cifar.py","file_url":"https://github.com/zoilsen/comp-fscil/blob/HEAD/models/resnet20_cifar.py","link_basis":"harvester_set","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":"fac5364e2f53c6db"}},{"code_sha256_prefix":"e5b7c79b0b62af96","entry":"conv3x3","repo":"zoilsen/comp-fscil","repo_kind":"official","path":"models/resnet12.py","file_url":"https://github.com/zoilsen/comp-fscil/blob/HEAD/models/resnet12.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"e5b7c79b0b62af96"}},{"code_sha256_prefix":"3f0e2ea167ccd1bf","entry":"get_base_dataloader","repo":"zoilsen/comp-fscil","repo_kind":"official","path":"dataloader/data_utils.py","file_url":"https://github.com/zoilsen/comp-fscil/blob/HEAD/dataloader/data_utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"3f0e2ea167ccd1bf"}},{"code_sha256_prefix":"422a6083ee9c106d","entry":"load_state_dict_from_url","repo":"zoilsen/comp-fscil","repo_kind":"official","path":"models/resnet18_encoder.py","file_url":"https://github.com/zoilsen/comp-fscil/blob/HEAD/models/resnet18_encoder.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"422a6083ee9c106d"}},{"code_sha256_prefix":"f36ac42575cd46ee","entry":"norm_layer","repo":"zoilsen/comp-fscil","repo_kind":"official","path":"models/resnet12.py","file_url":"https://github.com/zoilsen/comp-fscil/blob/HEAD/models/resnet12.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"f36ac42575cd46ee"}},{"code_sha256_prefix":"8327880f0b76f9db","entry":"set_gpu","repo":"zoilsen/comp-fscil","repo_kind":"official","path":"utils.py","file_url":"https://github.com/zoilsen/comp-fscil/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":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"8327880f0b76f9db"}},{"code_sha256_prefix":"ddaa52a660b55402","entry":"base_train","repo":"zoilsen/comp-fscil","repo_kind":"official","path":"models/base/helper.py","file_url":"https://github.com/zoilsen/comp-fscil/blob/HEAD/models/base/helper.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":"ddaa52a660b55402"}},{"code_sha256_prefix":"684d8ecbca8220ab","entry":"count_acc","repo":"zoilsen/comp-fscil","repo_kind":"official","path":"utils.py","file_url":"https://github.com/zoilsen/comp-fscil/blob/HEAD/utils.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":"684d8ecbca8220ab"}},{"code_sha256_prefix":"91defe5d31d82cad","entry":"get_dataloader","repo":"zoilsen/comp-fscil","repo_kind":"official","path":"dataloader/data_utils.py","file_url":"https://github.com/zoilsen/comp-fscil/blob/HEAD/dataloader/data_utils.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":"91defe5d31d82cad"}},{"code_sha256_prefix":"fa6d7dbb6906a211","entry":"replace_base_fc","repo":"zoilsen/comp-fscil","repo_kind":"official","path":"models/base/helper.py","file_url":"https://github.com/zoilsen/comp-fscil/blob/HEAD/models/base/helper.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":"fa6d7dbb6906a211"}},{"code_sha256_prefix":"dc5f16fd17d2ba25","entry":"set_up_datasets","repo":"zoilsen/comp-fscil","repo_kind":"official","path":"dataloader/data_utils.py","file_url":"https://github.com/zoilsen/comp-fscil/blob/HEAD/dataloader/data_utils.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":"dc5f16fd17d2ba25"}},{"code_sha256_prefix":"7e0029dd3479294e","entry":"test","repo":"zoilsen/comp-fscil","repo_kind":"official","path":"models/base/helper.py","file_url":"https://github.com/zoilsen/comp-fscil/blob/HEAD/models/base/helper.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":"7e0029dd3479294e"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}