{"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/memory-wrap-a-data-efficient-and","title":"Memory Wrap: a Data-Efficient and Interpretable Extension to Image Classification Models","arxiv_id":"2106.01440","date":"2021-06-01","proceeding":null,"authors":["Biagio La Rosa","Roberto Capobianco","Daniele Nardi"],"abstract":"Due to their black-box and data-hungry nature, deep learning techniques are not yet widely adopted for real-world applications in critical domains, like healthcare and justice. This paper presents Memory Wrap, a plug-and-play extension to any image classification model. Memory Wrap improves both data-efficiency and model interpretability, adopting a content-attention mechanism between the input and some memories of past training samples. We show that Memory Wrap outperforms standard classifiers when it learns from a limited set of data, and it reaches comparable performance when it learns from the full dataset. We discuss how its structure and content-attention mechanisms make predictions interpretable, compared to standard classifiers. To this end, we both show a method to build explanations by examples and counterfactuals, based on the memory content, and how to exploit them to get insights about its decision process. We test our approach on image classification tasks using several architectures on three different datasets, namely CIFAR10, SVHN, and CINIC10.","url_abs":"https://arxiv.org/abs/2106.01440v2","url_pdf":"https://arxiv.org/pdf/2106.01440v2.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":"memory-wrap-a-data-efficient-and","repo_url":"https://github.com/KRLGroup/memory-wrap","is_official":1,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"image-classification","task_name":"Image Classification"},{"task_slug":"image-classification","task_name":"image-classification"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2106.01440","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2106.01440"}},"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/KRLGroup/memory-wrap","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":2,"unverified":9},"by_repo_kind":{"official":{"samples":11,"ran":2,"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":"4304a326c593f8db","entry":"drop_connect","repo":"KRLGroup/memory-wrap","repo_kind":"official","path":"paper/architectures/efficientnet.py","file_url":"https://github.com/KRLGroup/memory-wrap/blob/HEAD/paper/architectures/efficientnet.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":"4304a326c593f8db"}},{"code_sha256_prefix":"8737c82de631cffc","entry":"swish","repo":"KRLGroup/memory-wrap","repo_kind":"official","path":"paper/architectures/efficientnet.py","file_url":"https://github.com/KRLGroup/memory-wrap/blob/HEAD/paper/architectures/efficientnet.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":"8737c82de631cffc"}},{"code_sha256_prefix":"336b26ec3a7c916c","entry":"get_explanation_accuracy","repo":"KRLGroup/memory-wrap","repo_kind":"official","path":"paper/explanation_accuracy.py","file_url":"https://github.com/KRLGroup/memory-wrap/blob/HEAD/paper/explanation_accuracy.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":"336b26ec3a7c916c"}},{"code_sha256_prefix":"054756e8a316dc45","entry":"major_voting_baseline","repo":"KRLGroup/memory-wrap","repo_kind":"official","path":"paper/eval_dir_mv.py","file_url":"https://github.com/KRLGroup/memory-wrap/blob/HEAD/paper/eval_dir_mv.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":"054756e8a316dc45"}},{"code_sha256_prefix":"556d97d0147c715d","entry":"set_seed","repo":"KRLGroup/memory-wrap","repo_kind":"official","path":"paper/VIT/train_memory_vit.py","file_url":"https://github.com/KRLGroup/memory-wrap/blob/HEAD/paper/VIT/train_memory_vit.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":"556d97d0147c715d"}},{"code_sha256_prefix":"396cfa296f2b6833","entry":"split_dataset","repo":"KRLGroup/memory-wrap","repo_kind":"official","path":"paper/VIT/train_memory_vit.py","file_url":"https://github.com/KRLGroup/memory-wrap/blob/HEAD/paper/VIT/train_memory_vit.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":"396cfa296f2b6833"}},{"code_sha256_prefix":"30e4e5a2d89e2664","entry":"undo_normalization_CIFAR10","repo":"KRLGroup/memory-wrap","repo_kind":"official","path":"paper/datasets.py","file_url":"https://github.com/KRLGroup/memory-wrap/blob/HEAD/paper/datasets.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":"30e4e5a2d89e2664"}},{"code_sha256_prefix":"edcd76ca7ab8dd93","entry":"undo_normalization_CINIC10","repo":"KRLGroup/memory-wrap","repo_kind":"official","path":"paper/datasets.py","file_url":"https://github.com/KRLGroup/memory-wrap/blob/HEAD/paper/datasets.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":"edcd76ca7ab8dd93"}},{"code_sha256_prefix":"34c08d4c54fc20d2","entry":"undo_normalization_SVHN","repo":"KRLGroup/memory-wrap","repo_kind":"official","path":"paper/datasets.py","file_url":"https://github.com/KRLGroup/memory-wrap/blob/HEAD/paper/datasets.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":"34c08d4c54fc20d2"}},{"code_sha256_prefix":"7ac8b84a748525a0","entry":"wrn28_10","repo":"KRLGroup/memory-wrap","repo_kind":"official","path":"paper/architectures/wide_resnet.py","file_url":"https://github.com/KRLGroup/memory-wrap/blob/HEAD/paper/architectures/wide_resnet.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":"7ac8b84a748525a0"}},{"code_sha256_prefix":"e98169cd39e1845e","entry":"wrn28_2","repo":"KRLGroup/memory-wrap","repo_kind":"official","path":"paper/architectures/wide_resnet.py","file_url":"https://github.com/KRLGroup/memory-wrap/blob/HEAD/paper/architectures/wide_resnet.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":"e98169cd39e1845e"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}