{"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/contextual-squeeze-and-excitation-for","title":"Contextual Squeeze-and-Excitation for Efficient Few-Shot Image Classification","arxiv_id":"2206.09843","date":"2022-06-20","proceeding":null,"authors":["Massimiliano Patacchiola","John Bronskill","Aliaksandra Shysheya","Katja Hofmann","Sebastian Nowozin","Richard E. Turner"],"abstract":"Recent years have seen a growth in user-centric applications that require effective knowledge transfer across tasks in the low-data regime. An example is personalization, where a pretrained system is adapted by learning on small amounts of labeled data belonging to a specific user. This setting requires high accuracy under low computational complexity, therefore the Pareto frontier of accuracy vs. adaptation cost plays a crucial role. In this paper we push this Pareto frontier in the few-shot image classification setting with a key contribution: a new adaptive block called Contextual Squeeze-and-Excitation (CaSE) that adjusts a pretrained neural network on a new task to significantly improve performance with a single forward pass of the user data (context). We use meta-trained CaSE blocks to conditionally adapt the body of a network and a fine-tuning routine to adapt a linear head, defining a method called UpperCaSE. UpperCaSE achieves a new state-of-the-art accuracy relative to meta-learners on the 26 datasets of VTAB+MD and on a challenging real-world personalization benchmark (ORBIT), narrowing the gap with leading fine-tuning methods with the benefit of orders of magnitude lower adaptation cost.","url_abs":"https://arxiv.org/abs/2206.09843v3","url_pdf":"https://arxiv.org/pdf/2206.09843v3.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":"contextual-squeeze-and-excitation-for","repo_url":"https://github.com/mpatacchiola/contextual-squeeze-and-excitation","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"few-shot-image-classification","task_name":"Few-Shot Image Classification"},{"task_slug":"few-shot-learning","task_name":"Few-Shot Learning"},{"task_slug":"image-classification","task_name":"Image Classification"},{"task_slug":"transfer-learning","task_name":"Transfer Learning"},{"task_slug":"image-classification","task_name":"image-classification"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/few-shot-image-classification-on-meta-dataset","task":"Few-Shot Image Classification","dataset":"Meta-Dataset","model":"UpperCaSE-EfficientNetB0","rank_in_archive_order":5,"of":22,"metrics":{"Accuracy":"76.1"},"uses_additional_data":false},{"leaderboard":"/sota/few-shot-image-classification-on-meta-dataset","task":"Few-Shot Image Classification","dataset":"Meta-Dataset","model":"UpperCaSE-ResNet50","rank_in_archive_order":7,"of":22,"metrics":{"Accuracy":"74.9"},"uses_additional_data":false},{"leaderboard":"/sota/image-classification-on-vtab-1k-1","task":"Image Classification","dataset":"VTAB-1k","model":"UpperCaSE-EfficientNetB0","rank_in_archive_order":23,"of":34,"metrics":{"Top-1 Accuracy":"58.4"},"uses_additional_data":false},{"leaderboard":"/sota/image-classification-on-vtab-1k-1","task":"Image Classification","dataset":"VTAB-1k","model":"UpperCaSE-ResNet50","rank_in_archive_order":25,"of":34,"metrics":{"Top-1 Accuracy":"56.6"},"uses_additional_data":false}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2206.09843","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2206.09843"}},"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":"deterministic:regex_extraction","url":"https://github.com/mpatacchiola/contextual-squeeze-and-excitation","reach":null}],"summary":{"ran_honours":1,"ran_draft_wrong":2},"by_repo_kind":{"official":{"samples":3,"ran":3,"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":"180ce251fbb5b1ad","entry":"shuffle","repo":"mpatacchiola/contextual-squeeze-and-excitation","repo_kind":"official","path":"run_metadataset.py","file_url":"https://github.com/mpatacchiola/contextual-squeeze-and-excitation/blob/HEAD/run_metadataset.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":2,"contract_check":"HONOURS","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"180ce251fbb5b1ad"}},{"code_sha256_prefix":"44dc42dfd8570862","entry":"prepare_task","repo":"mpatacchiola/contextual-squeeze-and-excitation","repo_kind":"official","path":"run_metadataset.py","file_url":"https://github.com/mpatacchiola/contextual-squeeze-and-excitation/blob/HEAD/run_metadataset.py","link_basis":"first_harvest_node","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":"44dc42dfd8570862"}},{"code_sha256_prefix":"c45c8d2bc5ca679d","entry":"topk","repo":"mpatacchiola/contextual-squeeze-and-excitation","repo_kind":"official","path":"run_metadataset.py","file_url":"https://github.com/mpatacchiola/contextual-squeeze-and-excitation/blob/HEAD/run_metadataset.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"c45c8d2bc5ca679d"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}