Introduction
Domain Generalization (DG) is a critical challenge in machine learning, where models trained on specific source domains must generalize to unseen target domains. For instance, a model trained on photographs should ideally recognize objects in sketches or paintings. However, two primary obstacles hinder current DG methods: the tendency of models to converge to "sharp" minima—which are sensitive to distribution shifts—and the "long-tail trap," where imbalanced data distributions cause models to over-focus on high-frequency "head" classes at the expense of rare "tail" classes.
Addressing the Long-Tail Trap and Sharp Minima
This research proposes a "plug-and-play" framework designed to overcome these hurdles by integrating Sharpness-Aware Minimization (SAM) with a novel Maximum Square Loss ($L_m$).
Standard entropy minimization, while useful for clustering, often creates a "gradient monopoly." High-confidence samples from easy-to-transfer classes generate massive gradients, drowning out the learning signal for difficult or rare classes. To counter this, the authors introduce Maximum Square Loss, which features a linearly increasing gradient ($|4p - 2|$). This "gentler" approach prevents the model from obsessing over high-probability points, ensuring a more balanced distribution of gradients across all classes, including the tail.
Simultaneously, the framework employs SAM to seek out "flat" minima in the loss landscape. By adding small adversarial perturbations to model weights during training, the model is forced to find solutions robust to minor variations, which inherently translates to better generalization across stylistically diverse domains.
Experimental Evaluation
The researchers evaluated their approach on four major DG benchmarks: PACS, OfficeHome, DigitsDG, and the highly imbalanced DomainNet. The proposed method was integrated into several state-of-the-art baselines, including DG_via_ER, EISNet, and FACT.
As shown in the training curves, the proposed method ("Ours") not only achieves higher final accuracy but also demonstrates significantly faster convergence, often reaching peak performance in nearly half the epochs required by standard baselines. On the PACS dataset using a ResNet50 backbone, the method improved the average accuracy of the FACT baseline from 87.94% to 90.08%.
Visualizing Feature Representations
To understand the underlying mechanics of the framework, the authors utilized t-SNE visualizations to map the feature space.
The visualizations reveal that the proposed framework produces features that are more domain-invariant (indicated by the mixing of domain-specific colors) while maintaining high class discriminability (indicated by distinct, tight clusters for different classes). This confirms that the combination of flatness-seeking optimization and balanced loss leads to a more robust and generalizable representation.
Conclusion
By addressing the dual challenges of sharp minima and gradient imbalance in long-tailed data, this framework provides a robust solution for Domain Generalization. The results across multiple benchmarks demonstrate that seeking "flatter" valleys and dampening the signal from easy samples are key to building models that truly understand underlying concepts across diverse and imbalanced domains.
Summary updated