Introduction: The Invariance-Accuracy Trade-off
Domain Generalization (DG) is a fundamental challenge in machine learning, where models trained on multiple source domains must perform reliably on unseen target domains. The prevailing paradigm, Invariant Feature Learning (IFL), seeks to extract features that are invariant across domains. By training a model to ignore domain-specific "nuisance" factors (e.g., background, lighting), researchers aim to isolate the core features necessary for classification.
However, a critical limitation exists in standard IFL methods: they typically assume that the domain ($d$) and the class label ($y$) are independent. In many real-world scenarios—ranging from medical diagnostics to wearable sensor data—this assumption is violated. When domains and labels are dependent, forcing "perfect" domain invariance can inadvertently discard information essential for accurate classification, leading to a significant drop in performance.
The Core Problem: Domain-Class Dependency
The tension between domain invariance and classification accuracy becomes apparent when we examine the feature space. In standard adversarial training, a discriminator is used to ensure that domain information cannot be recovered from the learned features.
As shown in the figure above, when $d$ and $y$ are dependent (right side), the distribution of classes varies across domains. If a model is forced to make the feature distributions identical across domains (Figure 1d), it effectively "smears" the class boundaries. This results in a feature representation that is domain-blind but also class-confused.
The AFLAC Framework: Accuracy-Constrained Invariance
To address this, the authors introduce Adversarial Feature Learning with Accuracy Constraint (AFLAC). This framework moves away from the goal of "perfect" invariance and instead targets an optimal level of invariance that does not compromise accuracy.
Theoretical Foundation
The authors provide a theoretical proof (Theorem 3) that the maximum amount of domain information that can be removed without hurting classification accuracy is bounded by the conditional entropy $H(d|y)$. This insight suggests that the model should retain exactly as much domain information as is naturally present in the class labels of the training data.
The Algorithm
AFLAC implements this by modifying the standard Domain Adversarial Network (DAN) objective. Instead of forcing the domain discriminator toward a uniform distribution (total unpredictability), AFLAC regularizes the feature encoder to minimize the Kullback-Leibler (KL) divergence between the discriminator's predicted domain distribution and the true class-conditional domain distribution $p(d|y)$ observed in the source data.
By steering the model toward $p(d|y)$ rather than a uniform distribution, AFLAC ensures that the learned features are as domain-invariant as possible while remaining perfectly sufficient for the classification task. This approach also makes the model significantly less sensitive to regularization hyperparameters compared to standard methods.
Experimental Evaluation
The authors validated AFLAC across several benchmarks characterized by varying levels of domain-class dependency:
- BMNISTR (Biased and Rotated MNIST): In this synthetic setup, the authors manually controlled the dependency between image rotation (domain) and digit identity (class). AFLAC significantly outperformed standard methods as the dependency increased, showing gains of up to 4.5% in F-measure over the next best method.
- WISDM (Human Activity Recognition): This dataset features high dependency because individual users (domains) have unique physical patterns for different activities. AFLAC achieved 84.4% accuracy, surpassing both vanilla CNNs and standard adversarial approaches.
- PACS and IEMOCAP: On these standard DG benchmarks, AFLAC maintained competitive or superior performance, demonstrating its robustness across image and speech modalities.
Conclusion
AFLAC challenges the long-standing assumption that "more invariance is always better" in domain generalization. By introducing an accuracy constraint grounded in information theory, AFLAC provides a principled way to handle biased datasets where domains and classes are linked. The result is a more stable, accurate, and theoretically sound approach to learning robust features for real-world applications.
Summary updated