arXiv:2604.21728cs.CVcs.LG2026-04中稿 · CVPR被引 1

让视觉语言模型在测试时自动筛选相关样本,提升跨领域适应能力。

Ramen: Robust Test-Time Adaptation of Vision-Language Models with Active Sample Selection

论文配图:Ramen: Robust Test-Time Adaptation of Vision-Language Models with Active Sample Selection
图 1 · 摘自论文原文
  • 根据领域一致性和预测均衡性主动挑选相似样本进行适应
  • 在多种图像退化与领域迁移数据集上表现稳定,显著优于现有方法
  • 适合处理测试数据混合多领域的真实场景,效率高且无需重新训练

预训练的视觉-语言模型(如CLIP)具备强大的零样本泛化能力,但对分布偏移敏感。测试时自适应(Test-time adaptation)在不访问源数据或目标标签的情况下,在推理阶段调整模型,是应对分布偏移的实用方案。然而,现有方法通常假设测试样本来自单一一致领域,而实际测试数据常包含多个具有不同特征的领域混合。这导致其在混合领域设置下性能下降。为此,我们提出Ramen框架,通过主动样本选择实现鲁棒的测试时自适应。对于每个输入测试样本,Ramen基于两个标准:领域一致性(确保适配聚焦于相似领域数据)和预测均衡性(缓解由偏差预测引发的适配偏差),从过往数据中检索定制化相关样本批次。为提高效率,Ramen采用嵌入-梯度缓存机制,存储历史测试图像的嵌入和样本级梯度;利用嵌入检索相关样本,聚合对应梯度进行模型更新,无需额外前向或反向传播。理论分析揭示了该机制在混合领域偏移下的有效性。在多个图像退化与领域迁移基准上的实验表明,Ramen实现了强且一致的性能,在复杂混合领域场景中提供高效可靠的自适应能力。代码已开源:https://github.com/baowenxuan/Ramen。

原文摘要 · Abstract (English)

Pretrained vision-language models such as CLIP exhibit strong zero-shot generalization but remain sensitive to distribution shifts. Test-time adaptation adapts models during inference without access to source data or target labels, offering a practical way to handle such shifts. However, existing methods typically assume that test samples come from a single, consistent domain, while in practice, test data often include samples from mixed domains with distinct characteristics. Consequently, their performance degrades under mixed-domain settings. To address this, we present Ramen, a framework for robust test-time adaptation through active sample selection. For each incoming test sample, Ramen retrieves a customized batch of relevant samples from previously seen data based on two criteria: domain consistency, which ensures that adaptation focuses on data from similar domains, and prediction balance, which mitigates adaptation bias caused by skewed predictions. To improve efficiency, Ramen employs an embedding-gradient cache that stores the embeddings and sample-level gradients of past test images. The stored embeddings are used to retrieve relevant samples, and the corresponding gradients are aggregated for model updates, eliminating the need for any additional forward or backward passes. Our theoretical analysis provides insight into why the proposed adaptation mechanism is effective under mixed-domain shifts. Experiments on multiple image corruption and domain-shift benchmarks demonstrate that Ramen achieves strong and consistent performance, offering robust and efficient adaptation in complex mixed-domain scenarios. Our code is available at https://github.com/baowenxuan/Ramen .

视觉语言模型测试时自适应领域迁移主动学习

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。