注意力头净化:利用 CLIP 实现域泛化的新视角
Attention Head Purification: A New Perspective to Harness CLIP for Domain Generalization
AI总结:
本文提出 CLIP 注意力头净化框架,通过头感知 LoRA 与门控头选择联合进行任务级和域级净化,在多个 DG 基准上优于现有方法。
摘要:
域泛化(DG)旨在从多个源域学习模型,以在未见过的目标域上取得令人满意的性能。近期工作由于 CLIP 出色的图文对齐和零样本性能,将其引入 DG 任务。以往方法要么采用全量微调,要么采用提示学习范式来利用 CLIP 完成 DG 任务。这些工作关注避免灾难性遗忘 CLIP 中编码的原始知识,却忽视了 CLIP 中编码的知识本质上可能包含特定于域的线索,而这些线索会限制其域泛化性能。本文提出了一种利用 CLIP 进行 DG 的新视角,即注意力头净化。我们观察到,不同注意力头可能编码图像的不同属性,恰当地选择注意力头可在跨域场景下带来显著性能提升。基于这些观察,我们从两个层级净化 CLIP 的注意力头,包括任务级净化和域级净化。对于任务级净化,我们设计了头感知 LoRA,使每个注意力头更适应所考虑的任务。对于域级净化,我们通过简单的门控策略执行头选择。我们利用 MMD 损失促使被掩码头特征更具域不变性,以强调更具泛化性的属性/头。训练期间,我们联合执行任务级净化和域级净化。我们在多个具有代表性的 DG 基准上进行实验。尽管方法简单,大量实验表明,我们的方法相对于以往最先进方法表现更优。
英文摘要:
Domain Generalization (DG) aims to learn a model from multiple source domains to achieve satisfactory performance on unseen target domains. Recent works introduce CLIP to DG tasks due to its superior image-text alignment and zeros-shot performance. Previous methods either utilize full fine-tuning or prompt-learning paradigms to harness CLIP for DG tasks. Those works focus on avoiding catastrophic forgetting of the original knowledge encoded in CLIP but ignore that the knowledge encoded in CLIP in nature may contain domain-specific cues that constrain its domain generalization performance. In this paper, we propose a new perspective to harness CLIP for DG, i.e., attention head purification. We observe that different attention heads may encode different properties of an image and selecting heads appropriately may yield remarkable performance improvement across domains. Based on such observations, we purify the attention heads of CLIP from two levels, including task-level purification and domain-level purification. For task-level purification, we design head-aware LoRA to make each head more adapted to the task we considered. For domain-level purification, we perform head selection via a simple gating strategy. We utilize MMD loss to encourage masked head features to be more domain-invariant to emphasize more generalizable properties/heads. During training, we jointly perform task-level purification and domain-level purification. We conduct experiments on various representative DG benchmarks. Though simple, extensive experiments demonstrate that our method performs favorably against previous state-of-the-arts.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。