Phase Matching for Out-of-Distribution Generalization
Chengming Hu, Yeqian Du, Rui Wang, Hao Chen, Congcong Zhu
TL;DR
Phase Matching (PhaMa) addresses domain generalization by leveraging a frequency-domain decomposition of images, treating the amplitude spectrum as the domain-sensitive component and the phase spectrum as the structure-preserving, generalizable component. The method perturbes amplitudes during training and enforces phase-consistent representations via cross patch contrast using a momentum encoder and PatchNCE loss, integrated into a simple objective with classification and contrast terms. Empirical results on DG benchmarks (PACS, Digits-DG, Office-Home, VLCS) and robustness tests (CIFAR-10/100-C, GTA5→Cityscapes) show substantial improvements over baselines and competitive methods, supported by t-SNE and Grad-CAM analyses. A Fourier-based Structural Causal Model provides a conceptual framework linking Fourier components to DG, highlighting a semi-causal phase and non-causal amplitude in cross-domain generalization and suggesting directions for future work in latent-space frequency representations.
Abstract
The Fourier transform, an explicit decomposition method for visual signals, has been employed to explain the out-of-distribution generalization behaviors of Deep Neural Networks (DNNs). Previous studies indicate that the amplitude spectrum is susceptible to the disturbance caused by distribution shifts, whereas the phase spectrum preserves highly-structured spatial information that is crucial for robust visual representation learning. Inspired by this insight, this paper is dedicated to clarifying the relationships between Domain Generalization (DG) and the frequency components. Specifically, we provide distribution analysis and empirical experiments for the frequency components. Based on these observations, we propose a Phase Matching approach, termed PhaMa, to address DG problems. To this end, PhaMa introduces perturbations on the amplitude spectrum and establishes spatial relationships to match the phase components with patch contrastive learning. Experiments on multiple benchmarks demonstrate that our proposed method achieves state-of-the-art performance in domain generalization and out-of-distribution robustness tasks. Beyond vanilla analysis and experiments, we further clarify the relationships between the Fourier components and DG problems by introducing a Fourier-based Structural Causal Model (SCM).
