Our new X account is live! Follow @wizwand_team for updates
WorkDL logo mark

Sharpness-Aware Gradient Matching for Domain Generalization

About

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.

Pengfei Wang, Zhaoxiang Zhang, Zhen Lei, Lei Zhang• 2023

Related benchmarks

TaskDatasetResultRank
Domain GeneralizationVLCS
Accuracy80
238
Domain GeneralizationPACS
Accuracy (Art)87.4
221
Domain GeneralizationOfficeHome
Accuracy70.1
182
Domain GeneralizationDomainNet
Accuracy45
113
Domain GeneralizationTerraIncognita
Accuracy48.8
81
Domain GeneralizationDomainBed v1.0 (test)
Average Accuracy75.49
71
Domain GeneralizationOffice-Home
Average Accuracy70.1
63
Domain GeneralizationTerraInc
Accuracy48.8
52
Domain GeneralizationDomainBed (OH, TI, VLCS, PACS, DN) (test)
Accuracy (OH)83.4
33
Domain GeneralizationTerraInc (out-of-domain)
Accuracy48.8
31
Showing 10 of 18 rows

Other info

Code

Follow for update