Contextual Vision Transformers for Robust Representation Learning
Not on the map. Why?
Abstract (arXiv)
We introduce Contextual Vision Transformers (ContextViT), a method designed to generate robust image representations for datasets experiencing shifts in latent factors across various groups. Derived from the concept of in-context learning, ContextViT incorporates an additional context token to encapsulate group-specific information. This integration allows the model to adjust the image representation in accordance with the group-specific context. Specifically, for a given input image, ContextViT maps images with identical group membership into this context token, which is appended to the input image tokens. Additionally, we introduce a context inference network to predict such tokens on-the-fly, given a batch of samples from the group. This enables ContextViT to adapt to new testing distributions during inference time. We demonstrate the efficacy of ContextViT across a wide range of applications. In supervised fine-tuning, we show that augmenting pre-trained ViTs with our proposed context conditioning mechanism results in consistent improvements in out-of-distribution generalization on iWildCam and FMoW. We also investigate self-supervised representation learning with ContextViT. Our experiments on the Camelyon17 pathology imaging benchmark and the JUMP-CP microscopy imaging benchmark demonstrate that ContextViT excels in learning stable image featurizations amidst distribution shift, consistently outperforming its ViT counterpart.
Key facts. Cited by 10 papers in the map (data through 7 Oct 2026). Builds on 42 of its 64 references that are in the map. First posted on arXiv 30 May 2023.
Builds on
42 of 64 references.
References · 42
- 2017Attention Is All You Needcited by 59,932
- 2015Deep Residual Learning for Image Recognitioncited by 51,809
- 2014Adam: A Method for Stochastic Optimizationcited by 36,960
- 2021Learning Transferable Visual Models From Natural Language Supervisioncited by 33,456
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2023DINOv2: Learning Robust Visual Features without Supervisioncited by 7,764
- 2021Masked Autoencoders Are Scalable Vision Learnerscited by 7,339
- 2021Emerging Properties in Self-Supervised Vision Transformerscited by 6,893
- 2016Layer Normalizationcited by 5,579
- 2021Prefix-Tuning: Optimizing Continuous Prompts for Generationcited by 3,878
- 2019Benchmarking Neural Network Robustness to Common Corruptions and Perturbationscited by 2,857
- 2019Invariant Risk Minimizationcited by 1,832
30 more
- 2017Improved Regularization of Convolutional Neural Networks with Cutoutcited by 1,623
- 2017Deep Setscited by 1,394
- 2020WILDS: A Benchmark of in-the-Wild Distribution Shiftscited by 1,366
- 2022Model soups: averaging weights of multiple fine-tuned models improves accuracy without increasing inference timecited by 1,366
- 2021Transformers in Vision: A Surveycited by 1,009
- 2021An Explanation of In-context Learning as Implicit Bayesian Inferencecited by 915
- 2018Albumentations: fast and flexible image augmentationscited by 558
- 2020Improving robustness against common corruptions by covariate shift adaptationcited by 427
- 2021MEMO: Test Time Robustness via Adaptation and Augmentationcited by 376
- 2017Functional Map of the Worldcited by 338
- 2022Masked Siamese Networks for Label-Efficient Learningcited by 301
- 2016Revisiting Batch Normalization For Practical Domain Adaptationcited by 285
- 2020Evaluating Prediction-Time Batch Normalization for Robustness under Covariate Shiftcited by 235
- 2014Efficient Object Localization Using Convolutional Networkscited by 226
- 2020Adaptive Risk Minimization: Learning to Adapt to Domain Shiftcited by 183
- 2021On the Robustness of Vision Transformers to Adversarial Examplescited by 167
- 2022Finetune like you pretrain: Improved finetuning of zero-shot vision modelscited by 149
- 2022Multi-class Token Transformer for Weakly Supervised Semantic Segmentationcited by 138
- 2021Towards Robust Vision Transformercited by 137
- 2022Revisiting Weakly Supervised Pre-Training of Visual Perception Modelscited by 116
- 2021TokenPose: Learning Keypoint Tokens for Human Pose Estimationcited by 106
- 2021Extending the WILDS Benchmark for Unsupervised Adaptationcited by 85
- 2022Structured Prompting: Scaling In-Context Learning to 1,000 Examplescited by 81
- 2021The iWildCam 2021 Competition Datasetcited by 77
- 2022What do Vision Transformers Learn? A Visual Explorationcited by 75
- 2022Optimizing Relevance Maps of Vision Transformers Improves Robustnesscited by 41
- 2022Context-Aware Robust Fine-Tuningcited by 27
- 2022How to Fine-Tune Vision Models with SGDcited by 23
- 2020Be Like Water: Robustness to Extraneous Variables Via Adaptive Feature Normalizationcited by 5
- 2022Mixed-effects transformers for hierarchical adaptationcited by 2
Built on by
Citing papers per year: 2023: 5; 2024: 2; 2025: 2; 2026: 1.
10 papers.
- 2024How to Build the Virtual Cell with Artificial Intelligence: Priorities and Opportunitiescited by 50
- 2023Channel Vision Transformers: An Image Is Worth 1 x 16 x 16 Wordscited by 33
- 2023ContriMix: Scalable stain color augmentation for domain generalization without domain labels in digital pathologycited by 7
- 2023Morphological Profiling for Drug Discovery in the Era of Deep Learningcited by 3
- 2025C3R: Channel Conditioned Cell Representations for unified evaluation in microscopy imagingcited by 2
- 2023Context is Environmentcited by 1
- 2023Towards Context-Aware Domain Generalization: Understanding the Benefits and Limits of Marginal Transfer Learningcited by 0
- 2024EDADepth: Enhanced Data Augmentation for Monocular Depth Estimationcited by 0
- 2025Out-of-distribution evaluations of channel agnostic masked autoencoders in fluorescence microscopycited by 0
- 2026Who Needs Labels? Adapting Vision Foundation Models With the Metadata You Already Havecited by 0
- 2026Who Needs Labels? Adapting Vision Foundation Models With the Metadata You Already Have3 Jun 2026
- 2025C3R: Channel Conditioned Cell Representations for unified evaluation in microscopy imaging24 May 2025
- 2025Out-of-distribution evaluations of channel agnostic masked autoencoders in fluorescence microscopy24 Mar 2025
- 2024How to Build the Virtual Cell with Artificial Intelligence: Priorities and Opportunities18 Sep 2024
- 2024EDADepth: Enhanced Data Augmentation for Monocular Depth Estimation10 Sep 2024
- 2023Towards Context-Aware Domain Generalization: Understanding the Benefits and Limits of Marginal Transfer Learning15 Dec 2023
- 2023Morphological Profiling for Drug Discovery in the Era of Deep Learning13 Dec 2023
- 2023Channel Vision Transformers: An Image Is Worth 1 x 16 x 16 Words28 Sep 2023
- 2023Context is Environment18 Sep 2023
- 2023ContriMix: Scalable stain color augmentation for domain generalization without domain labels in digital pathology7 Jun 2023