Domain-Conditioned Class Imbalance: Rethinking Class Balance in Multi-Domain Learning

Yongkun Deng, Nan Yang, Xiatong Guo, Zhiyong Wang, Dong YuanNeurIPS 2026

TL;DR

Imagine auditing a multi-domain dataset: every class has the exact same total number of images, and every domain is the exact same size. Looks balanced, right? Not necessarily—horses might dominate sketches while nearly vanishing in photos, causing standard models to quietly drop 15% in accuracy. This paper uncovers this hidden trap—Domain-Conditioned Class Imbalance (DCI)—and introduces HyperIDAC, a framework that dynamically generates custom classifiers on the fly depending on an image’s visual domain, all without requiring ground-truth labels.

What Problem Does This Paper Address?

Real-world visual data rarely comes from one neat source; it spans multiple domains (like daytime vs. nighttime dashcams, or product photos vs. user sketches) and is usually unlabeled.

In machine learning, we know how to fix standard class imbalance (e.g., having 1,000 dogs and 10 cats) using resampling or loss reweighting—provided we have labels and a single global distribution. When building multi-domain datasets, engineers usually check two marginal statistics: Are total class counts equal? Are domain sizes equal?

The authors point out a critical blind spot: equal totals do not guarantee equal joint allocation across domain–class pairs. In their PACS experiment, keeping 200 images per class and 350 per domain while skewing the internal allocation caused accuracy to plummet from 85.06% to 70.05%.

Figure 1: Marginal balance can hide Domain-Conditioned Class Imbalance.

Because class frequencies shift from domain to domain, no single global adjustment can fix every domain at once. Worse, in unlabeled datasets, the model doesn't even know which domain–class combinations are starving for data.

Methods

Instead of forcing features to be "domain-invariant" (the classic playbook), the authors embrace domain differences. Their framework, HyperIDAC, adapts the decision boundary to each sample using a frozen CLIP backbone and two novel engines:

Figure 2: Overview of the HyperIDAC framework. (Top) Multi-Level Pseudo Label Management in a teacher–student setup: high-confidence samples use teacher or historical pseudo-labels, uncertain samples fall back to multi-template CLIP zero-shot predictions, and very low-confidence samples are trained with KL consistency instead of being discarded. (Bottom) Dynamic Domain Learning builds a domain prior from image features and zero-shot domain predictions, and uses a hypernetwork to turn this prior into instance-specific classifier weights and domain-aware class embeddings for the student classifier. The teacher is updated via EMA.
  1. Dynamic Domain Learning (DDL):
  2. Domain-Aware Prior: For each image, the model estimates which domain it belongs to (using zero-shot CLIP text prompts like "a clipart image", or unsupervised K-means clustering if domain names are unknown). It blends these probabilities with learnable domain embeddings and visual features into a unified control vector $\beta$.
  3. Hypernetwork Classifier: Rather than using a static linear head, a lightweight hypernetwork (a network that generates weights for another network) takes $\beta$ and spits out instance-specific classifier weights. It also adapts CLIP’s text class embeddings to the domain, blending data-driven logits with stable semantic CLIP scores so rare classes aren't forgotten.
  4. Multi-Level Pseudo Label Management (PLM): Since training is completely unlabeled, HyperIDAC uses a standard Exponential Moving Average (EMA) teacher-student setup, upgraded with a three-tier safety net to prevent early mistakes from snowballing on rare domain–class pairs:

  5. High confidence: Uses teacher predictions, stabilized by a historical buffer that tracks each sample's best past confidence.

  6. Medium confidence: Falls back to zero-shot CLIP predictions, weighted by a time-decaying trust factor.
  7. Very low confidence: Instead of throwing these tricky samples away, the student learns soft consistency with the teacher via KL divergence.

Datasets

The authors evaluate on four standard multi-domain benchmarks—PACS, VLCS, Office-Home, and DomainNet—plus ImageNet-LT (1,000 classes) to test scalability.

To isolate their newly formalized problem, they test three distinct regimes on the multi-domain datasets:

  • Original: Datasets used as-is.
  • Long-Tailed Distribution (LTD): Standard global imbalance (downsampled with imbalance ratios from 5 to 50).
  • DCI (New Diagnostic Setup): Marginals are strictly locked—every domain has equal total samples and every class is globally balanced—while per-domain class allocations are deliberately skewed.

Key Insights and Ideas

  • Global balance is an illusion in multi-domain data: Fixing class marginals and domain marginals leaves massive room for internal skew. Furthermore, the authors note that no single domain-independent additive logit adjustment can mathematically match differing class priors across multiple domains simultaneously.
  • Condition, don't erase: Trying to strip away domain context hurts when class priors depend on the domain. Generating sample-specific classifiers via a hypernetwork lets decision boundaries flex naturally per domain.
  • You don't actually need domain names: Even when you take away CLIP's text-based domain descriptors ("sketch", "photo") and force HyperIDAC to guess latent domains via simple K-means clustering (even auto-selecting $K$), it barely loses a step and still beats supervised-style baselines.

Key Results

HyperIDAC ranks first across all 12 dataset–regime combinations (4 benchmarks $\times$ 3 regimes), beating recent long-tailed and domain-generalization baselines by an average of ~4 percentage points (pp):

  • Heavy Long-Tailed Gains: Outperforms the strongest baseline by +16.33 pp on DomainNet-LTD (64.96% vs. 48.63%) and +9.14 pp on Office-Home-LTD.
  • Crushing DCI Skew: Under DCI, HyperIDAC leads by +4.93 pp on Office-Home and +3.32 pp on DomainNet. As DCI skew is dialed up to extreme levels ($\alpha = 0.3$ on PACS), baselines crumble (dropping 13–28 pp), while HyperIDAC drops only 4.65 pp.
  • 1,000-Class Scalability: On ImageNet-LT, generating over 513,000 classifier parameters per sample still fits on a single 24-GB GPU, hitting 55.06% Top-1 accuracy (+9.35 pp over the runner-up, and a massive +25.12 pp on few-shot classes).

Limitations and Future Work

While the main text does not feature a dedicated limitations section, a clear boundary condition of the framework is its reliance on a strong, frozen vision-language foundation model (CLIP) to bootstrap both semantic fallback labels and visual representations. For future work, the authors hope the formalized DCI benchmark regime and HyperIDAC's domain-conditioned paradigm will serve as a foundation for building more realistic, uncurated multi-domain learning systems.

Summary updated

Abstract

Unlabeled image collections often span several visual domains, and the same class can be common in one domain and rare in another. Balanced class totals and balanced domain sizes, the common checks in dataset construction, do not rule this out: the allocation across domain–class pairs can remain highly skewed. We call this regime Domain-Conditioned Class Imbalance (DCI). Standard corrections are derived from global class counts and apply the same per-class adjustment in every domain. Under DCI the class priors differ across domains, and we show that no single domain-independent additive adjustment can match all of them at once. We introduce HyperIDAC, which estimates a soft domain prior for each image and uses a hypernetwork to generate an instance-specific, domain-conditioned classifier. A complementary multi-level pseudo-labeling module combines teacher predictions, label history, semantic fallback, and consistency learning to limit error reinforcement in sparse domain–class pairs. For controlled evaluation, we fix the class and domain marginals and vary only the joint domain–class allocation, which isolates the effect of DCI. Across four multi-domain benchmarks under original, long-tailed, and DCI regimes, HyperIDAC consistently outperforms the compared methods. These gains indicate that correcting class imbalance in multi-domain data requires conditioning on domain context rather than a single global adjustment.
BibTeX
@inproceedings{deng2026domain,
  author = {Yongkun Deng and NAN YANG and Xiatong Guo and Zhiyong Wang and Dong Yuan},
  title = {{Domain-Conditioned Class Imbalance: Rethinking Class Balance in Multi-Domain Learning}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=DSwaLAA6lD},
}
Figure