Negatives-Dominant Contrastive Learning for Generalization in Imbalanced Domains
Abstract
Imbalanced Domain Generalization (IDG) focuses on mitigating both domain and label shifts, both of which fundamentally shape the model's decision boundaries, particularly under heterogeneous long-tailed distributions across domains. Despite its practical significance, it remains underexplored, primarily due to the technical complexity of handling their entanglement and the paucity of theoretical foundations. In this paper, we begin by theoretically establishing the generalization bound for IDG, highlighting the role of posterior discrepancy and decision margin. This bound motivates us to focus on directly steering decision boundaries, marking a clear departure from existing methods. Then, we technically propose a novel Negative-Dominant Contrastive Learning (NDCL) for IDG to enhance discriminability while enforce posterior consistency across domains. Specifically, inter-class decision-boundary separation is enhanced by placing greater emphasis on negatives as the primary signal in our contrastive learning, naturally amplifying gradient signals for minority classes to avoid the decision boundary being biased toward majority classes. Intra-class compactness is encouraged through a re-weighted cross-entropy strategy, and posterior consistency across domains is enforced through a prediction-central alignment strategy. Finally, rigorous yet challenging experiments on benchmarks validate the effectiveness of our NDCL. The code is available at https://github.com/Alrash/NDCL.
Lay Summary
We train models to recognize objects across different environments, but in real-world applications, some categories appear much more frequently than others, and the data distributions may vary significantly between domains. These combined domain and label shifts often distort the model's decision boundaries, causing existing methods to struggle, especially on minority classes. To better understand this problem, we first provide a theoretical analysis showing that reliable generalization depends on both consistent predictions across domains and clear decision boundaries between classes. Motivated by this insight, we develop a new method called Negative-Dominant Contrastive Learning (NDCL), which focuses more strongly on separating different classes while naturally giving minority classes larger learning signals. Our NDCL also encourages samples from the same class to stay compact and aligns prediction behaviors across domains to improve consistency. Extensive experiments on challenging imbalanced domain generalization benchmarks show that NDCL consistently improves performance, particularly under highly heterogeneous long-tailed settings.