Gradient Matching for Domain Generalization

Yuge Shi, Jeffrey Seely, Philip H. S. Torr, N. Siddharth, Awni Hannun +2 more
4/20/2021
405 citations
cs.LGstat.ML

Official code: YugeTen/fish (128 stars, Python, MIT, last commit 2021-12-14).

Abstract

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.

Show full abstract

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.

View on arXivView PDF

Code Implementations(1)

YugeTen/fishOfficial100%
MIT

Official implementation of paper Gradient Matching for Domain Generalization

1289PythonJul 11, 20214 years agoMIT

Similar Papers

Cite this paper

@article{shi2021gradient,
  title  = {Gradient Matching for Domain Generalization},
  author = {Yuge Shi and Jeffrey Seely and Philip H. S. Torr and N. Siddharth and Awni Hannun and Nicolas Usunier and Gabriel Synnaeve},
  year   = {2021},
  eprint = {2104.09937},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2104.09937}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2104.09937.svg)](https://codeofpaper.com/paper/2104.09937)

Discussion