Learning How to Learn Domain-Invariant Parameters for Domain Generalization

Feng Hou, Yao Zhang, Yang Liu, Jin Yuan, Cheng Zhong, Yang Zhang, Zhongchao Shi, Jianping Fan, Zhiqiang He

Abstract

Deep Neural Networks (DNNs) often struggle with domain shift, where a model trained on specific source domains fails to generalize to unseen target domains. This paper introduces a novel framework designed to identify and prioritize the update of domain-invariant parameters within a network. By combining Fourier-based data augmentation with a gradient-matching mechanism, the proposed method encourages the model to focus on structural content rather than stylistic variations, achieving state-of-the-art performance across multiple benchmarks.

Introduction

The brittleness of Deep Neural Networks is a significant hurdle for real-world deployment. A model trained to recognize objects in clear photographs often fails when encountering the same objects in sketches, paintings, or adverse weather conditions. This phenomenon, known as domain shift, highlights the tendency of models to overfit to "domain-specific" features (like texture or lighting) rather than "domain-invariant" features (like shape and structure).

Domain Generalization (DG) aims to address this by training models on multiple source domains to learn features that remain robust across unseen environments. While data augmentation is a common strategy, it often fails to bridge the gap if the augmented samples do not sufficiently challenge the model's internal representations. This research proposes a "learning to learn" approach that explicitly identifies which parameters contribute to generalization.

Methodology

The authors propose two primary components to force the model to prioritize universal features: Domain Decoupling and Combination (DDC) and Domain-invariance-guided Backpropagation (DIGB).

Domain Decoupling and Combination (DDC)

Traditional image augmentations often operate in the spatial domain. In contrast, DDC operates in the frequency domain using Fourier Transforms. The method separates an image into two components:

  • Amplitude: Represents the low-level style, texture, and appearance.
  • Phase: Represents the high-level content and structural information.

By swapping the amplitude of a source image with that of an image from a different domain while preserving the original phase, DDC creates "contrastive pairs." These pairs consist of two images that are stylistically distinct but structurally identical, providing a perfect testbed for domain invariance.

Domain-invariance-guided Backpropagation (DIGB)

To ensure the model actually learns from these pairs, the authors introduce DIGB. This mechanism utilizes a Siamese (twin) network architecture to process the contrastive pairs simultaneously. During the backward pass, the model analyzes the gradients for each layer:

  • If the gradients for the original image and the stylized image point in a similar direction, the parameters in that layer are deemed domain-invariant.
  • A similarity vector is then used to amplify the updates for these consistent layers.

This "learning to learn" strategy ensures that the optimization process emphatically updates the parameters that contribute to generalization while dampening those that focus on domain-specific noise.

Experimental Results

The framework was evaluated on three major Domain Generalization benchmarks, consistently outperforming existing methods.

Benchmark Performance

  • PACS (Photo, Art, Cartoon, Sketch): The model achieved an average accuracy of 87.2% using a ResNet-18 backbone, significantly higher than previous methods like MixStyle (83.7%) and FACT (84.6%).
  • Office-Home: On this more complex dataset containing 65 categories, the method reached a state-of-the-art (SOTA) average accuracy of 67.6%.

Robustness Analysis

Using the ROBIN benchmark, the researchers tested the model against real-world nuisances such as occlusions, weather changes, and pose shifts. The proposed method showed superior resilience compared to baselines, suggesting that the learned features are truly robust to environmental perturbations rather than just stylistic shifts.

Discussion and Insights

Gradient Consistency and Layer Depth

Analysis of the model's internal behavior revealed that deeper layers tend to exhibit higher gradient consistency than shallower layers. This aligns with the intuition that early layers in a CNN act as low-level texture filters (more domain-specific), while deeper layers capture high-level semantic concepts (more domain-invariant).

Optimization Landscape

The researchers observed that their method leads to "flatter minima" in the loss landscape. In deep learning theory, a flatter loss surface is strongly correlated with better generalization, as small shifts in the input distribution (domain shifts) are less likely to result in a dramatic increase in loss.

Conclusion and Future Work

This paper presents a robust strategy for Domain Generalization by explicitly guiding the optimization process toward domain-invariant parameters. By using Fourier-based augmentation to decouple style from content and gradient matching to identify generalization-friendly weights, the model achieves superior performance on standard benchmarks.

Future work may address the computational overhead associated with Siamese training and explore the applicability of Fourier-based decoupling in non-visual domains, such as medical signal processing or sensor data. Overall, the principle of "strengthening domain-invariant parameters" offers a promising path toward more reliable and generalizable artificial intelligence.

Summary updated

BibTeX
@inproceedings{hou2023learning,
  author = {Feng Hou and Yao Zhang and Yang Liu and Jin Yuan and Cheng Zhong and Yang Zhang and Zhongchao Shi and Jianping Fan and Zhiqiang He},
  title = {{Learning How to Learn Domain-Invariant Parameters for Domain Generalization}},
  booktitle = {IEEE International Conference on Acoustics, Speech and Signal Processing},
  year = {2023},
  url = {https://openreview.net/forum?id=JWObUMvnjk},
}
Figure