Abstract
Vision-language models like CLIP demonstrate remarkable zero-shot capabilities but often falter under distribution shifts. Existing Test-time Prompt Tuning (TPT) methods attempt to adapt models using simple image augmentations, which lack the semantic diversity needed for robust domain adaptation. We present $IT^3A$, a framework that leverages generative AI—Stable Diffusion and GPT-4—to produce diverse multi-modal augmentations. By incorporating a cosine similarity filtering mechanism to maintain semantic fidelity, $IT^3A$ achieves a 5.5% accuracy improvement over state-of-the-art methods on out-of-distribution (OOD) benchmarks.
Introduction
Foundation models are increasingly deployed in real-world scenarios where test data significantly deviates from training distributions (e.g., sketches, adversarial examples, or artistic renditions). To address this, Test-time Prompt Tuning (TPT) has emerged as a technique to optimize model prompts using a single test sample. However, traditional TPT relies on basic augmentations like cropping or flipping, which provide limited semantic variety. While diffusion models have been explored for image augmentation, they often ignore the textual component and risk introducing "noisy" hallucinations that degrade model performance.
Methodology
The $IT^3A$ framework (Diffusion-Enhanced Test-time Adaptation with Text and Image Augmentation) introduces three core components to enhance the adaptation process:
1. Multi-modal Generative Augmentation
Unlike unimodal approaches, $IT^3A$ generates both visual and textual variations. For visual augmentation, test image features are processed through Stable Diffusion to create new images that preserve core semantics while varying style and appearance. Simultaneously, GPT-4 generates diverse descriptive text templates (e.g., "A scenic view of a {}") to replace generic prompts.
2. Cosine Similarity Filtering
To mitigate the risk of generative "hallucinations," $IT^3A$ employs a filtering mechanism. It calculates the cosine similarity between the classification logits of the original image and the generated pairs. Augmentations that deviate significantly from the original sample's semantic profile are discarded, ensuring the model tunes on high-quality data.
3. Adapter-based Tuning
Instead of rigid prompt token tuning, $IT^3A$ utilizes a lightweight CLIP-Adapter. This allows the model to learn a residual feature transformation, enhancing efficiency and flexibility during the limited test-time window.
Experiments and Results
The framework was evaluated on natural distribution shifts (ImageNet-V2, -A, -R, -Sketch) and cross-dataset generalization across 10 diverse datasets.
- Performance Gains: On a ResNet-50 backbone, $IT^3A$ outperformed the original TPT by an average of 5.50% across OOD datasets. Notably, on the adversarial ImageNet-A dataset, accuracy rose to 33.9% from the CLIP baseline of 23.8%.
- Efficiency: Despite the use of generative models, $IT^3A$ is optimized for speed. It requires only 4 optimization steps and takes approximately 0.33s per image, significantly faster than previous diffusion-based TTA methods (1.08s).
Conclusion
$IT^3A$ demonstrates that multi-modal generative augmentation, when paired with robust filtering, significantly enhances test-time adaptation. By balancing diversity and fidelity, the framework provides a scalable path for making foundation models more resilient to real-world distribution shifts. Future work will focus on reducing the computational overhead of generative models and extending the approach to complex multi-modal tasks like composed image retrieval.
Summary updated