SSAM: Self-Supervised Association Modeling for Test-Time Adaption

Yaxiong Wang, Zhenqiang Zhang, Lechao Cheng, Zhun Zhong, Dan Guo, Meng WangarXiv 2025 · OpenReview

Abstract

Test-time adaption (TTA) has witnessed important progress in recent years, the prevailing methods typically first encode the image and the text and design strategies to model the association between them. Meanwhile, the image encoder is usually frozen due to the absence of explicit supervision in TTA scenarios. We identify a critical limitation in this paradigm: While test-time images often exhibit distribution shifts from training data, existing methods persistently freeze the image encoder due to the absence of explicit supervision during adaptation. This practice overlooks the image encoder's crucial role in bridging distribution shift between training and test. To address this challenge, we propose SSAM (Self-Supervised Association Modeling), a new TTA framework that enables dynamic encoder refinement through dual-phase association learning. Our method operates via two synergistic components: 1) Soft Prototype Estimation (SPE), which estimates probabilistic category associations to guide feature space reorganization, and 2) Prototype-anchored Image Reconstruction (PIR), enforcing encoder stability through cluster-conditional image feature reconstruction. Comprehensive experiments across diverse baseline methods and benchmarks demonstrate that SSAM can surpass state-of-the-art TTA baselines by a clear margin while maintaining computational efficiency. The framework's architecture-agnostic design and minimal hyperparameter dependence further enhance its practical applicability.

Introduction: The Challenge of Distribution Shift

Vision-Language Models (VLMs) like CLIP have revolutionized zero-shot classification. However, their performance often degrades when encountering distribution shifts at test time—such as moving from clean training images to sketches, thermal scans, or low-resolution data. Test-Time Adaptation (TTA) aims to refine these models on-the-fly using unlabeled test data.

A critical limitation in current TTA paradigms is the reliance on frozen image encoders. While methods often tune text prompts or use feature caches, they neglect the visual domain where the distribution shift actually occurs. Updating a massive image encoder without explicit supervision is challenging; SSAM addresses this by introducing a self-supervised signal derived from category-aware feature reconstruction.

Methodology: Dual-Phase Association Learning

SSAM (Self-Supervised Association Modeling) enables dynamic encoder refinement through two synergistic components:

  1. Soft Prototype Estimation (SPE): Instead of rigid class assignments, SPE generates a probabilistic "Association Map" between image features and text-derived category embeddings. These are used to compute Visual Prototypes—weighted averages of features that represent each category within the current test batch.
  2. Prototype-anchored Image Reconstruction (PIR): This serves as the primary self-supervised signal. The model attempts to reconstruct original image features by recombining the visual prototypes according to the association map. A high reconstruction error indicates poor alignment between visual features and category concepts, providing a gradient to update the image encoder.
The SSAM framework architecture featuring Category-anchored Soft Clustering and Centroid-based Image Reconstruction.

To maintain stability and efficiency, SSAM utilizes lightweight adapters (e.g., learnable parameters added to ViT patch embeddings) rather than fine-tuning the entire backbone.

Experimental Setup

The framework was evaluated on two primary benchmarks:

  • Cross-Domain (CD) Benchmark: 10 diverse datasets (e.g., Flowers102, Stanford Cars, EuroSAT) testing generalizability across varied visual domains.
  • Out-of-Distribution (OOD) Benchmark: Robustness tests using ImageNet variants like ImageNet-A (adversarial), ImageNet-R (renditions), and ImageNet-Sketch.

Key Results and Performance

SSAM consistently outperforms state-of-the-art TTA baselines such as TPT, TDA, and DMN.

Performance comparison of SSAM components across various benchmarks and datasets.

Key quantitative highlights include:

  • Accuracy Improvements: On the ViT-B/16 backbone, SSAM improved average accuracy on the CD benchmark from 64.59% to 68.08%.
  • Robustness Gains: On the adversarial ImageNet-A dataset, SSAM achieved a boost of over 10% compared to vanilla CLIP.
  • Component Synergy: Ablation studies (shown in the figure above) demonstrate that the combination of PIR and category-anchored alignment yields the best results across all datasets.

Discussion and Insights

  • Reconstruction as Supervision: By turning classification into a generative consistency check, SSAM provides a robust label-free signal for visual adaptation.
  • Visual Domain Primacy: The results confirm that even minor tuning of the image encoder is often more effective for TTA than extensive prompt engineering.
  • Architecture Agnostic: Gains were observed across both ResNet and ViT architectures, proving the framework's versatility.
  • Layer Sensitivity: Adapting earlier layers was found to be more effective, likely because it allows the model to correct low-level feature distortions caused by distribution shifts.

Limitations and Future Work

While efficient, SSAM requires backpropagation during inference, which may impact latency in real-time edge applications. Future research could explore "training-free" variants or extend this self-supervised association logic to more complex tasks like object detection and segmentation.

Summary updated

BibTeX
@misc{wang2025ssam,
  author = {Yaxiong Wang and Zhenqiang Zhang and Lechao Cheng and Zhun Zhong and Dan Guo and Meng Wang},
  title = {{SSAM: Self-Supervised Association Modeling for Test-Time Adaption}},
  year = {2025},
  eprint = {2506.00513},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2506.00513},
}
Figure