Skip to main content
QUICK REVIEW

[论文解读] Sharpness-Aware Gradient Matching for Domain Generalization

Pengfei Wang, Zhaoxiang Zhang|arXiv (Cornell University)|Mar 18, 2023
Domain Adaptation and Few-Shot Learning被引用 7
一句话总结

本文提出了一种新型的域泛化方法——锐度感知梯度匹配(SAGM),通过同时最小化经验风险、扰动损失及其差距,实现向低损失的平坦极小值收敛。通过隐式对齐经验损失与扰动损失之间的梯度方向,SAGM 在不增加额外计算成本的前提下,优于 SAM 和 GSAM,且在五个 DG 基准上实现了最先进性能,DomainBed 上的平均准确率达到 66.1%。

ABSTRACT

The goal of domain generalization (DG) is to enhance the generalization capability of the model learned from a source domain to other unseen domains. The recently developed Sharpness-Aware Minimization (SAM) method aims to achieve this goal by minimizing the sharpness measure of the loss landscape. Though SAM and its variants have demonstrated impressive DG performance, they may not always converge to the desired flat region with a small loss value. In this paper, we present two conditions to ensure that the model could converge to a flat minimum with a small loss, and present an algorithm, named Sharpness-Aware Gradient Matching (SAGM), to meet the two conditions for improving model generalization capability. Specifically, the optimization objective of SAGM will simultaneously minimize the empirical risk, the perturbed loss (i.e., the maximum loss within a neighborhood in the parameter space), and the gap between them. By implicitly aligning the gradient directions between the empirical risk and the perturbed loss, SAGM improves the generalization capability over SAM and its variants without increasing the computational cost. Extensive experimental results show that our proposed SAGM method consistently outperforms the state-of-the-art methods on five DG benchmarks, including PACS, VLCS, OfficeHome, TerraIncognita, and DomainNet. Codes are available at https://github.com/Wang-pengfei/SAGM.

研究动机与目标

  • 解决 SAM 类方法在域泛化中难以收敛至低损失平坦极小值的局限性。
  • 识别有效泛化的两个关键条件:邻域内损失较低,以及损失曲面的平坦性。
  • 提出一种联合优化经验风险、扰动损失及其差距的方法,以同时满足上述两个条件。
  • 通过梯度对齐实现泛化性能提升,且不增加计算成本。
  • 在标准域泛化基准上,持续展现对最先进方法的性能优势。

提出的方法

  • 提出三目标优化:最小化经验风险 $\mathcal{L}(\theta)$、扰动损失 $\mathcal{L}_p(\theta)$ 和代理差距 $h(\theta) = \mathcal{L}_p(\theta) - \mathcal{L}(\theta)$。
  • 将目标表述为最小化 $\mathcal{L}(\theta)$、$\mathcal{L}_p(\theta)$,以及二者梯度之间夹角,以实现梯度对齐。
  • 使用扰动方向 $\epsilon = \alpha \nabla\mathcal{L}(\theta)$ 计算 $\theta + \epsilon$ 处的扰动损失,近似锐度感知更新。
  • 通过确保 $\mathcal{L}(\theta)$ 与 $\mathcal{L}_p(\theta)$ 之间梯度方向一致,引入隐式梯度匹配,避免梯度冲突。
  • 通过避免额外前向传播或复杂 Hessian 近似,保持计算效率。
  • 在标准训练流程中端到端应用该方法,兼容标准深度学习框架。

实验结果

研究问题

  • RQ1能否通过联合最小化经验风险、扰动损失及其差距,实现在域泛化中更平坦且损失更低的极小值?
  • RQ2经验损失与扰动损失之间的梯度对齐是否能改善向可泛化极小值的收敛?
  • RQ3在多样化的域偏移场景下,SAGM 与 SAM 和 GSAM 相比,泛化性能如何?
  • RQ4SAGM 是否能在不依赖预训练模型或额外数据增强的前提下,实现最先进性能?
  • RQ5所提方法在提升域泛化任务泛化能力的同时,是否保持了计算效率?

主要发现

  • SAGM 在 DomainBed 基准上实现了 66.1% 的平均准确率,优于 ERM、SAM、GSAM 和 ERM+SAM,在五个域泛化数据集上表现更优。
  • 在 PACS 数据集上,SAGM 在 Sketch 域达到 86.6% 的准确率,显著优于 SAM(85.8%)和 GSAM(85.9%)。
  • SAGM 在所有五个基准(PACS、VLCS、OfficeHome、TerraIncognita 和 DomainNet)上均一致提升了泛化性能。
  • 局部锐度分析表明,SAGM 收敛至的极小值平坦度高于 SAM 和 GSAM,且在不同扰动半径下,损失差距 $h_\rho(\theta)$ 最小。
  • 消融实验表明,SAGM 中的梯度匹配使平均性能相比 ERM+SAM 提升 1.3%,验证了其有效性。
  • SAGM 超越了使用 CLIP 预训练模型的 Miro 方法,证明其在无需外部预训练的情况下具备强大的泛化能力。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。