Meta Curvature-Aware Minimization for Domain Generalization
Ziyang Chen, Yiwen Ye, Feilong Tang, Yongsheng Pan, Yong Xia
TL;DR
This work tackles domain generalization by addressing limitations of sharpness-based methods like SAM, introducing a curvature-aware training paradigm. It defines a loss-agnostic curvature metric and derives Meta Curvature-Aware Minimization (MeCAM), which minimizes the vanilla loss and the surrogate gaps of SAM and meta-learning to locate flatter minima. Theoretical results include a PAC-Bayesian generalization bound and a convergence rate of $O\left(\frac{\log T}{\sqrt{T}}\right)$ for MeCAM in non-convex stochastic optimization. Empirically, MeCAM achieves superior generalization on five DG benchmarks and demonstrates good extensibility and flatter loss landscapes, with code to be released on GitHub.
Abstract
Domain generalization (DG) aims to enhance the ability of models trained on source domains to generalize effectively to unseen domains. Recently, Sharpness-Aware Minimization (SAM) has shown promise in this area by reducing the sharpness of the loss landscape to obtain more generalized models. However, SAM and its variants sometimes fail to guide the model toward a flat minimum, and their training processes exhibit limitations, hindering further improvements in model generalization. In this paper, we first propose an improved model training process aimed at encouraging the model to converge to a flat minima. To achieve this, we design a curvature metric that has a minimal effect when the model is far from convergence but becomes increasingly influential in indicating the curvature of the minima as the model approaches a local minimum. Then we derive a novel algorithm from this metric, called Meta Curvature-Aware Minimization (MeCAM), to minimize the curvature around the local minima. Specifically, the optimization objective of MeCAM simultaneously minimizes the regular training loss, the surrogate gap of SAM, and the surrogate gap of meta-learning. We provide theoretical analysis on MeCAM's generalization error and convergence rate, and demonstrate its superiority over existing DG methods through extensive experiments on five benchmark DG datasets, including PACS, VLCS, OfficeHome, TerraIncognita, and DomainNet. Code will be available on GitHub.
