Bootstrap Generalization Ability from Loss Landscape Perspective

Huanran Chen, Shitong Shao, Ziyi Wang, Zirui Shang, Jin Chen, Xiaofeng Ji, Xinxiao Wu · DOI

Abstract

Domain Generalization (DG) remains a significant challenge in deep learning, as models often fail when encountering data distributions different from their training sets. While traditional approaches focus on learning domain-invariant features, this paper explores an alternative perspective: the geometry of the loss landscape. We present a framework that leverages a four-stage distillation-based fine-tuning paradigm (DFP), an adaptive learning rate scheduler (ALRS), and architectural modifications to encourage convergence toward "flat minima." Our results demonstrate that prioritizing loss landscape flatness significantly enhances a model's ability to generalize to unseen domains, achieving state-of-the-art performance on major benchmarks including PACS and VLCS.

Introduction

In standard supervised learning, we assume that training and testing data are independent and identically distributed (i.i.d.). However, real-world applications frequently violate this assumption due to shifts in lighting, background, or artistic style. This challenge, known as Domain Generalization (DG), requires models trained on specific "Source Domains" to perform robustly on entirely unseen "Target Domains."

Historically, researchers have addressed DG through domain-invariant representation learning—attempting to force the model to ignore domain-specific features. However, these methods can be counterproductive when domain gaps are subtle, often leading to overfitting on the source data. This paper shifts the focus from feature alignment to the optimization surface itself. Drawing on loss landscape theory, we argue that "sharp" minima lead to poor generalization, whereas "flat" minima—regions where the loss remains low despite small parameter perturbations—are inherently more robust to distribution shifts.

Methodology

To guide the model toward these desirable flat regions, we propose a "bootstrap" approach consisting of four integrated components:

1. Distillation-based Fine-tuning Paradigm (DFP)

The DFP is a four-stage training process designed to transition the model from coarse to fine resolutions while maintaining stability. The process begins with standard training at a resolution of 224x224, followed by a "Supervised Self-Distillation" stage. In this stage, an Exponential Moving Average (EMA) of the model acts as a teacher to regularize the current student model. This two-step process is then repeated at a higher resolution (384x384). This progressive adaptation ensures the model remains within a flat region of the loss landscape even as the input complexity increases.

2. Adaptive Learning Rate Scheduler (ALRS)

Traditional learning rate schedulers typically decay the learning rate based on epoch counts. In contrast, the ALRS monitors the "slope" and "difference" of the loss function in real-time. By keeping the learning rate as high as possible for as long as possible, the ALRS prevents the model from settling into narrow, sharp pits. High learning rates act as a natural regularizer, effectively "overshooting" local minima that lack the breadth required for strong generalization.

3. Wide PyramidNet272

Architectural width is theoretically linked to smoother loss surfaces. We utilize a modified PyramidNet architecture, specifically increasing the width of the Toeplitz matrix (input channels) at each layer. This "Super Wide" configuration is designed to be more amenable to optimization, facilitating the discovery of broader valleys in the loss landscape.

4. ShakeDrop Regularization

To further discourage the model from settling into sharp minima, we employ ShakeDrop regularization. By randomly perturbing the backward gradient during training, we introduce noise that makes it difficult for the optimization process to stabilize in unstable, narrow regions, pushing the model toward more robust, flatter ground.

Experimental Results

We evaluated our framework on three primary DG benchmarks: NICO++, PACS, and VLCS.

Benchmark Performance

  • PACS: On this classic benchmark (comprising Photo, Art, Cartoon, and Sketch domains), our Wide PyramidNet272 achieved an average accuracy of 89.18%. This significantly outperforms the standard ResNet18 baseline (83.70%) and various specialized DG algorithms.
  • VLCS: Our method set a new high bar with a mean accuracy of 78.01%, surpassing previous state-of-the-art methods such as RSC (76.16%) and StableNet (77.65%).
  • NICO Challenge: The proposed method secured 3rd place in the ECCV 2022 NICO Challenge. Notably, this was achieved without any explicit domain-invariant representation learning, validating the power of the loss landscape perspective.

Ablation Studies

Ablation experiments on the NICO++ dataset confirmed the necessity of the multi-stage DFP. Accuracy improved incrementally at each stage, rising from 83.1% after Stage 1 to 87.1% by the completion of Stage 4.

Discussion and Insights

Our findings suggest that "Flatness is King" in the context of Domain Generalization. Visualizations of the loss surface confirm that models trained with our paradigm reside in much broader, shallower valleys compared to baseline models.

Furthermore, we identify a "Learning Rate Paradox": while small learning rates are often viewed as a safe way to ensure convergence, they are detrimental to DG because they allow the model to overfit the sharp, idiosyncratic details of the source domains. Finally, we observed that brute-force domain alignment (e.g., DANN) can actually degrade performance on truly unseen data by forcing the model to over-specialize on the provided source domains.

Conclusion and Future Work

By focusing on the geometry of the loss landscape rather than explicit feature alignment, we have demonstrated a robust framework for Domain Generalization. While the computational cost of training a 272-layer wide network through a four-stage process is high, the gains in robustness are substantial. Future research will focus on reducing the computational overhead and exploring the application of these loss landscape insights to zero-shot domain generalization and low-data regimes.

Summary updated

BibTeX
@inproceedings{chen2022bootstrap,
  author = {Huanran Chen and Shitong Shao and Ziyi Wang and Zirui Shang and Jin Chen and Xiaofeng Ji and Xinxiao Wu},
  title = {{Bootstrap Generalization Ability from Loss Landscape Perspective}},
  booktitle = {Workshops @ ECCV},
  year = {2022},
  url = {https://openreview.net/forum?id=rno5DHL5B0C},
}
Figure