{"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/learning-to-imagine-diversify-memory-for","title":"Learning to Imagine: Diversify Memory for Incremental Learning using Unlabeled Data","arxiv_id":"2204.08932","date":"2022-04-19","proceeding":"CVPR 2022 1","authors":["Yu-Ming Tang","Yi-Xing Peng","Wei-Shi Zheng"],"abstract":"Deep neural network (DNN) suffers from catastrophic forgetting when learning incrementally, which greatly limits its applications. Although maintaining a handful of samples (called `exemplars`) of each task could alleviate forgetting to some extent, existing methods are still limited by the small number of exemplars since these exemplars are too few to carry enough task-specific knowledge, and therefore the forgetting remains. To overcome this problem, we propose to `imagine` diverse counterparts of given exemplars referring to the abundant semantic-irrelevant information from unlabeled data. Specifically, we develop a learnable feature generator to diversify exemplars by adaptively generating diverse counterparts of exemplars based on semantic information from exemplars and semantically-irrelevant information from unlabeled data. We introduce semantic contrastive learning to enforce the generated samples to be semantic consistent with exemplars and perform semanticdecoupling contrastive learning to encourage diversity of generated samples. The diverse generated samples could effectively prevent DNN from forgetting when learning new tasks. Our method does not bring any extra inference cost and outperforms state-of-the-art methods on two benchmarks CIFAR-100 and ImageNet-Subset by a clear margin.","url_abs":"https://arxiv.org/abs/2204.08932v1","url_pdf":"https://arxiv.org/pdf/2204.08932v1.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":"learning-to-imagine-diversify-memory-for","repo_url":"https://github.com/TOM-tym/Learn-to-Imagine","is_official":1,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"contrastive-learning","task_name":"Contrastive Learning"},{"task_slug":"diversity","task_name":"Diversity"},{"task_slug":"incremental-learning","task_name":"Incremental Learning"}],"methods":[{"method_slug":"contrastive-learning","method_name":"Contrastive Learning"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2204.08932","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2204.08932"}},"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/TOM-tym/Learn-to-Imagine","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":4,"unverified":4},"by_repo_kind":{"official":{"samples":8,"ran":4,"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":"f7311a4ad1603f3d","entry":"cosine_similarity","repo":"TOM-tym/Learn-to-Imagine","repo_kind":"official","path":"CIFAR100/inclearn/lib/distance.py","file_url":"https://github.com/TOM-tym/Learn-to-Imagine/blob/HEAD/CIFAR100/inclearn/lib/distance.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"f7311a4ad1603f3d"}},{"code_sha256_prefix":"9f13ed2fb6c8ca34","entry":"get_optimizer","repo":"TOM-tym/Learn-to-Imagine","repo_kind":"official","path":"CIFAR100/inclearn/lib/factory.py","file_url":"https://github.com/TOM-tym/Learn-to-Imagine/blob/HEAD/CIFAR100/inclearn/lib/factory.py","link_basis":"harvester_set","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":"9f13ed2fb6c8ca34"}},{"code_sha256_prefix":"bf7ca0703632a724","entry":"icarl_selection","repo":"TOM-tym/Learn-to-Imagine","repo_kind":"official","path":"CIFAR100/inclearn/lib/herding.py","file_url":"https://github.com/TOM-tym/Learn-to-Imagine/blob/HEAD/CIFAR100/inclearn/lib/herding.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"bf7ca0703632a724"}},{"code_sha256_prefix":"34d0cb89ddcd7cdd","entry":"squared_euclidian_distance","repo":"TOM-tym/Learn-to-Imagine","repo_kind":"official","path":"CIFAR100/inclearn/lib/distance.py","file_url":"https://github.com/TOM-tym/Learn-to-Imagine/blob/HEAD/CIFAR100/inclearn/lib/distance.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"34d0cb89ddcd7cdd"}},{"code_sha256_prefix":"ca7e3b6e42185525","entry":"closest_to_mean","repo":"TOM-tym/Learn-to-Imagine","repo_kind":"official","path":"CIFAR100/inclearn/lib/herding.py","file_url":"https://github.com/TOM-tym/Learn-to-Imagine/blob/HEAD/CIFAR100/inclearn/lib/herding.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":"ca7e3b6e42185525"}},{"code_sha256_prefix":"3d5de0b8dd899437","entry":"compute_gram_matrix","repo":"TOM-tym/Learn-to-Imagine","repo_kind":"official","path":"CIFAR100/inclearn/models/Imagine.py","file_url":"https://github.com/TOM-tym/Learn-to-Imagine/blob/HEAD/CIFAR100/inclearn/models/Imagine.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":"3d5de0b8dd899437"}},{"code_sha256_prefix":"1e3aea8df18626bf","entry":"random","repo":"TOM-tym/Learn-to-Imagine","repo_kind":"official","path":"CIFAR100/inclearn/lib/herding.py","file_url":"https://github.com/TOM-tym/Learn-to-Imagine/blob/HEAD/CIFAR100/inclearn/lib/herding.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":"1e3aea8df18626bf"}},{"code_sha256_prefix":"cda650e8fe4290fa","entry":"stable_cosine_distance","repo":"TOM-tym/Learn-to-Imagine","repo_kind":"official","path":"CIFAR100/inclearn/lib/distance.py","file_url":"https://github.com/TOM-tym/Learn-to-Imagine/blob/HEAD/CIFAR100/inclearn/lib/distance.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":"cda650e8fe4290fa"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}