[Paper Review] Optimizing Relevance Maps of Vision Transformers Improves Robustness
This paper proposes a finetuning method that optimizes relevance maps in Vision Transformers (ViTs) to improve robustness to domain shifts by focusing model attention on foreground objects rather than background. Using only a few paired images and foreground masks—automatically generated via self-supervised ViT—three loss terms encourage lower background relevance, broader foreground coverage, and high confidence, resulting in significantly improved accuracy on out-of-distribution datasets without sacrificing original accuracy.
It has been observed that visual classification models often rely mostly on the image background, neglecting the foreground, which hurts their robustness to distribution changes. To alleviate this shortcoming, we propose to monitor the model's relevancy signal and manipulate it such that the model is focused on the foreground object. This is done as a finetuning step, involving relatively few samples consisting of pairs of images and their associated foreground masks. Specifically, we encourage the model's relevancy map (i) to assign lower relevance to background regions, (ii) to consider as much information as possible from the foreground, and (iii) we encourage the decisions to have high confidence. When applied to Vision Transformer (ViT) models, a marked improvement in robustness to domain shifts is observed. Moreover, the foreground masks can be obtained automatically, from a self-supervised variant of the ViT model itself; therefore no additional supervision is required.
Motivation & Objective
- To address the issue of ViTs relying excessively on background cues due to dataset biases and spurious correlations.
- To improve model robustness to distribution shifts by manipulating attention mechanisms to focus on foreground objects.
- To develop a finetuning method that requires minimal human-annotated data, using self-supervised foreground masks instead.
- To maintain high classification accuracy on the original training distribution while enhancing generalization to out-of-distribution data.
- To provide a post-hoc, model-agnostic method to improve interpretability and robustness of ViT-based classifiers.
Proposed method
- A finetuning procedure is applied to a pretrained ViT using a small set of image-mask pairs, with three distinct loss components.
- The first loss minimizes relevance scores assigned to background regions, promoting focus on the object.
- The second loss encourages broader coverage of the foreground object in the relevance map, reducing sparse activation.
- The third loss acts as a regularizer to preserve the original model’s classification accuracy on the training distribution.
- Foreground masks are obtained via a self-supervised ViT variant, eliminating the need for human-annotated masks.
- The method is applied post-training and does not require retraining from scratch or architectural changes.
Experimental results
Research questions
- RQ1Can optimizing the relevance map of ViTs reduce reliance on background cues and improve robustness to domain shifts?
- RQ2To what extent can a small number of image-mask pairs improve model generalization without degrading in-domain performance?
- RQ3How effective is self-supervised foreground mask generation in enabling the method without human-annotation overhead?
- RQ4What are the failure cases of the method, and how do they relate to object size, context dependence, or class rarity?
- RQ5Does the method improve interpretability by aligning attention maps more closely with human-recognized object regions?
Key findings
- The method significantly improves classification accuracy on out-of-distribution datasets such as ImageNet-A, ImageNet-R, ImageNet-Sketch, and SI-Score, with notable gains on domain-shifted benchmarks.
- On ImageNet-A, a highly out-of-distribution test set, the method increases robustness while maintaining high confidence in predictions.
- The relevance maps produced by the finetuned model show a marked improvement in focusing on the foreground object, reducing background dominance.
- For classes with small or context-dependent objects, the method leads to the largest performance gains, especially when the original model relied on background cues.
- The method causes minimal accuracy drop on the original ImageNet dataset, demonstrating effective preservation of in-domain performance.
- Failure cases are limited and typically involve rare classes or ambiguous foregrounds, such as pool tables with distracting foreground objects or similar dog breeds like miniature poodles and toy poodles.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.