{"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/crosstransformers-spatially-aware-few-shot","title":"CrossTransformers: spatially-aware few-shot transfer","arxiv_id":"2007.11498","date":"2020-07-22","proceeding":"NeurIPS 2020 12","authors":["Carl Doersch","Ankush Gupta","Andrew Zisserman"],"abstract":"Given new tasks with very little data$-$such as new classes in a classification problem or a domain shift in the input$-$performance of modern vision systems degrades remarkably quickly. In this work, we illustrate how the neural network representations which underpin modern vision systems are subject to supervision collapse, whereby they lose any information that is not necessary for performing the training task, including information that may be necessary for transfer to new tasks or domains. We then propose two methods to mitigate this problem. First, we employ self-supervised learning to encourage general-purpose features that transfer better. Second, we propose a novel Transformer based neural network architecture called CrossTransformers, which can take a small number of labeled images and an unlabeled query, find coarse spatial correspondence between the query and the labeled images, and then infer class membership by computing distances between spatially-corresponding features. The result is a classifier that is more robust to task and domain shift, which we demonstrate via state-of-the-art performance on Meta-Dataset, a recent dataset for evaluating transfer from ImageNet to many other vision datasets.","url_abs":"https://arxiv.org/abs/2007.11498v5","url_pdf":"https://arxiv.org/pdf/2007.11498v5.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":"crosstransformers-spatially-aware-few-shot","repo_url":"https://github.com/google-research/meta-dataset","is_official":1,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"tf","reach":null},{"paper_slug":"crosstransformers-spatially-aware-few-shot","repo_url":"https://github.com/lucidrains/cross-transformers-pytorch","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"crosstransformers-spatially-aware-few-shot","repo_url":"https://github.com/vinuni-vishc/Few-Shot-Cosine-Transformer","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"crosstransformers-spatially-aware-few-shot","repo_url":"https://github.com/vinuni-vishc/few-shot-transformer","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"NOASSERTION"}},{"paper_slug":"crosstransformers-spatially-aware-few-shot","repo_url":"https://github.com/MindCode-4/code-11/tree/main/cross-transformers-spatially-aware-few-shot-transfer","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"mindspore","reach":null},{"paper_slug":"crosstransformers-spatially-aware-few-shot","repo_url":"https://github.com/MindCode-4/code-6/tree/main/delving-deeper-into-convolutional","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"mindspore","reach":null}],"tasks":[{"task_slug":"self-supervised-learning","task_name":"Self-Supervised Learning"}],"methods":[{"method_slug":"absolute-position-encodings","method_name":"Absolute Position Encodings"},{"method_slug":"adam","method_name":"Adam"},{"method_slug":"attention","method_name":"Attention"},{"method_slug":"bpe","method_name":"BPE"},{"method_slug":"crosstransformers","method_name":"CrossTransformers"},{"method_slug":"dense-connections","method_name":"Dense Connections"},{"method_slug":"dropout","method_name":"Dropout"},{"method_slug":"label-smoothing","method_name":"Label Smoothing"},{"method_slug":"layer-normalization","method_name":"Layer Normalization"},{"method_slug":"linear-layer","method_name":"Linear Layer"},{"method_slug":"multi-head-attention","method_name":"Multi-Head Attention"},{"method_slug":"position-wise-feed-forward-layer","method_name":"Position-Wise Feed-Forward Layer"},{"method_slug":"residual-connection","method_name":"Residual Connection"},{"method_slug":"softmax","method_name":"Softmax"},{"method_slug":"transformer","method_name":"Transformer"}],"datasets_introduced":[],"methods_introduced":[{"slug":"crosstransformers","name":"CrossTransformers","full_name":"CrossTransformers"}],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2007.11498","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2007.11498"}},"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/google-research/meta-dataset","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/MindCode-4/code-6/tree/main/delving-deeper-into-convolutional","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/lucidrains/cross-transformers-pytorch","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/vinuni-vishc/few-shot-transformer","reach":{"status":"ok","spdx":"NOASSERTION"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/MindCode-4/code-11/tree/main/cross-transformers-spatially-aware-few-shot-transfer","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/vinuni-vishc/Few-Shot-Cosine-Transformer","reach":null}],"summary":{"ran":3,"ran_honours":2,"unverified":1},"by_repo_kind":{"listed":{"samples":3,"ran":3,"repositories":2},"community":{"samples":3,"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":2,"samples":[{"code_sha256_prefix":"b853d61344e2e673","entry":"CTX","repo":"vinuni-vishc/Few-Shot-Cosine-Transformer","repo_kind":"listed","path":"methods/CTX.py","file_url":"https://github.com/vinuni-vishc/Few-Shot-Cosine-Transformer/blob/HEAD/methods/CTX.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"b853d61344e2e673"}},{"code_sha256_prefix":"fbc03a7cd28cb716","entry":"CrossTransformer","repo":"lucidrains/cross-transformers-pytorch","repo_kind":"listed","path":"cross_transformers_pytorch/cross_transformers_pytorch.py","file_url":"https://github.com/lucidrains/cross-transformers-pytorch/blob/HEAD/cross_transformers_pytorch/cross_transformers_pytorch.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"fbc03a7cd28cb716"}},{"code_sha256_prefix":"44dc6d9430e110d2","entry":"MetaTemplate","repo":"vinuni-vishc/Few-Shot-Cosine-Transformer","repo_kind":"listed","path":"methods/CTX.py","file_url":"https://github.com/vinuni-vishc/Few-Shot-Cosine-Transformer/blob/HEAD/methods/CTX.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"44dc6d9430e110d2"}},{"code_sha256_prefix":"d27f84ceb30afcc3","entry":"gray_loader","repo":"skrish13/CrossTransformers-PyTorch","repo_kind":"community","path":"dataset.py","file_url":"https://github.com/skrish13/CrossTransformers-PyTorch/blob/HEAD/dataset.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"d27f84ceb30afcc3"}},{"code_sha256_prefix":"8f03e823e1ea61e9","entry":"pil_loader","repo":"skrish13/CrossTransformers-PyTorch","repo_kind":"community","path":"dataset.py","file_url":"https://github.com/skrish13/CrossTransformers-PyTorch/blob/HEAD/dataset.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"8f03e823e1ea61e9"}},{"code_sha256_prefix":"ab5055d91c86b111","entry":"accimage_loader","repo":"skrish13/CrossTransformers-PyTorch","repo_kind":"community","path":"dataset.py","file_url":"https://github.com/skrish13/CrossTransformers-PyTorch/blob/HEAD/dataset.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"ab5055d91c86b111"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}