Share your thoughts, 1 month free Claude Pro on usSee more
WorkDL logo mark

Gradient Matching for Domain Generalization

About

Machine learning systems typically assume that the distributions of training and test sets match closely. However, a critical requirement of such systems in the real world is their ability to generalize to unseen domains. Here, we propose an inter-domain gradient matching objective that targets domain generalization by maximizing the inner product between gradients from different domains. Since direct optimization of the gradient inner product can be computationally prohibitive -- requires computation of second-order derivatives -- we derive a simpler first-order algorithm named Fish that approximates its optimization. We demonstrate the efficacy of Fish on 6 datasets from the Wilds benchmark, which captures distribution shift across a diverse range of modalities. Our method produces competitive results on these datasets and surpasses all baselines on 4 of them. We perform experiments on both the Wilds benchmark, which captures distribution shift in the real world, as well as datasets in DomainBed benchmark that focuses more on synthetic-to-real transfer. Our method produces competitive results on both benchmarks, demonstrating its effectiveness across a wide range of domain generalization tasks.

Yuge Shi, Jeffrey Seely, Philip H.S. Torr, N. Siddharth, Awni Hannun, Nicolas Usunier, Gabriel Synnaeve• 2021

Related benchmarks

TaskDatasetResultRank
Image ClassificationPACS
Overall Average Accuracy66.1
241
Domain GeneralizationVLCS
Accuracy77.8
238
Domain GeneralizationPACS
Accuracy85.5
231
Domain GeneralizationPACS (test)
Average Accuracy85.5
225
Domain GeneralizationOfficeHome
Accuracy68.6
202
Image ClassificationOfficeHome
Average Accuracy68.6
137
Domain GeneralizationDomainNet
Accuracy42.7
133
Domain GeneralizationDomainBed
Average Accuracy63.9
127
Domain GeneralizationDomainBed (test)
VLCS Accuracy77.8
110
Domain GeneralizationOffice-Home (test)
Average Accuracy68.6
106
Showing 10 of 69 rows

Other info

Code

Follow for update