Abstract
Despite the significant improvements that representation learning via self-supervision has led to when learning from unlabeled data, no methods exist that explain what influences the learned representation. We address this need through our proposed approach, RELAX, which is the first approach for attribution-based explanations of representations. Our approach can also model the uncertainty in its explanations, which is essential to produce trustworthy explanations. RELAX explains representations by measuring similarities in the representation space between an input and masked out versions of itself, providing intuitive explanations and significantly outperforming the gradient-based baseline. We provide theoretical interpretations of RELAX and conduct a novel analysis of feature extractors trained using supervised and unsupervised learning, providing insights into different learning strategies. Finally, we illustrate the usability of RELAX in multi-view clustering and highlight that incorporating uncertainty can be essential for providing low-complexity explanations, taking a crucial step towards explaining representations.
Introduction
In recent years, self-supervised representation learning (e.g., SimCLR, SwAV) has revolutionized how models are trained on unlabeled data. These models map images into a high-dimensional latent space where similar concepts cluster together. However, while we can measure downstream performance, we have lacked tools to visualize which specific features in an image the model actually encodes.
Existing Explainable AI (XAI) methods like Grad-CAM or RISE are almost exclusively prediction-based, answering why a model made a specific classification. In representation learning, where class labels are absent, we need to answer a different question: "Which pixels are responsible for this specific embedding?" RELAX (REpresentation LeArning eXplainability) is the first attribution-based framework designed to solve this problem.
The RELAX Framework
RELAX utilizes a similarity-based masking approach to identify feature importance. The core logic is that if an important part of an image is masked, the resulting representation should diverge significantly from the original.
The process involves generating thousands of random, smooth masks and applying them to the input image. Both the original and masked versions are passed through a feature extractor to produce embeddings. RELAX then calculates the cosine similarity between these vectors. An importance map is created by taking a weighted average of the masks, where the weights are these similarity scores. To ensure efficiency, the authors developed a one-pass version using running mean and variance estimators, avoiding the need to store thousands of masks.
Uncertainty Quantification with U-RELAX
A key innovation of this work is the ability to model uncertainty within explanations. By calculating the variance of similarity scores across different masks, the framework estimates how certain the model is about its attribution. The authors introduce U-RELAX, which filters out high-uncertainty regions to produce cleaner, more faithful explanations.
This filtering process strips away "hallucinated" importance in the background, leaving only the most robust features that consistently influence the representation across different masking patterns.
Insights into Learning Strategies
RELAX allows for a novel analysis of different learning paradigms. Qualitatively, the research shows that self-supervised models often focus on different features than supervised models, even when their downstream performance is comparable. SSL models sometimes exhibit more distributed attention across multiple objects in a scene, whereas supervised models may focus more narrowly on class-discriminative features. Furthermore, the method is versatile enough to explain "classic" handcrafted features like HOG, providing a bridge between traditional computer vision and modern deep learning.
Key Results and Evaluation
The authors evaluated RELAX across several benchmarks, including ImageNet, PASCAL VOC, and MS COCO.
- Localization: RELAX consistently outperformed gradient-based baselines (adapted for representations) across metrics such as the Pointing Game and Relevance Rank.
- Faithfulness: In monotonicity tests—where pixels are removed in order of importance—RELAX showed a more significant and stable drop in similarity, indicating it correctly identifies critical features.
- Human Preference: In a user study, RELAX and U-RELAX were preferred in 83% of cases compared to standard saliency maps.
Conclusion
RELAX represents a crucial step toward making representation learning transparent. By moving beyond prediction-based explanations and incorporating uncertainty quantification, it provides a robust tool for debugging and trusting models trained on unlabeled data. Future work may address the computational cost of the thousands of forward passes required and explore automated hyperparameter selection for mask resolution.
Summary updated