Target contrastive pessimistic risk for robust domain adaptation

Wouter M. Kouw, Marco Loog · DOI

Abstract

In domain adaptation, classifiers with information from a source domain adapt to generalize to a target domain. However, an adaptive classifier can perform worse than a non-adaptive classifier due to invalid assumptions, increased sensitivity to estimation errors or model misspecification. Our goal is to develop a domain-adaptive classifier that is robust in the sense that it does not rely on restrictive assumptions on how the source and target domains relate to each other and that it does not perform worse than the non-adaptive classifier. We formulate a conservative parameter estimator that only deviates from the source classifier when a lower risk is guaranteed for all possible labellings of the given target samples. We derive the classical least-squares and discriminant analysis cases and show that these perform on par with state-of-the-art domain adaptive classifiers in sample selection bias settings, while outperforming them in more general domain adaptation settings.

Introduction

In the ideal machine learning scenario, training data (the source) and testing data (the target) are drawn from the same distribution. In practice, this is rarely the case. Domain adaptation (DA) seeks to bridge the gap between these distributions. However, many existing DA methods rely on "brittle" assumptions, such as covariate shift—the assumption that while the input distribution changes, the relationship between inputs and labels remains constant.

When these assumptions are violated, or when the domains are significantly dissimilar, adaptation can lead to "negative transfer." This occurs when an adapted model performs worse than a simple baseline model trained only on the source data. This paper introduces the Target Contrastive Pessimistic (TCP) risk framework, a minimax approach designed to ensure that an adaptive classifier performs at least as well as—and often strictly better than—a non-adaptive source classifier.

The TCP Framework: Contrast and Pessimism

The core of the proposed method is a new objective function that balances adaptation with a safety net. The TCP risk framework is built on two fundamental pillars:

  1. Contrast: Rather than simply minimizing risk on the target domain, the objective minimizes the difference between the risk of the new model and the risk of the existing source model. If this difference is zero or negative, the new model is theoretically guaranteed to be at least as effective as the source model.
  2. Pessimism: Because target data is unlabeled, the true risk cannot be calculated directly. The authors adopt a "pessimistic" stance: they assume an adversary selects the worst possible "soft labels" for the target data to maximize the risk.

This formulation results in a minimax optimization problem where the classifier attempts to minimize the risk contrast while an adversarial labeling agent attempts to maximize it. The authors provide closed-form solutions for two primary cases:

  • TCP-LS: A discriminative approach based on Least-Squares.
  • TCP-LDA/QDA: Generative approaches based on Linear and Quadratic Discriminant Analysis.

Key Insights and Theoretical Guarantees

The "Safety Net" Property

By framing the objective as a contrast, the model is implicitly constrained. It only deviates from the source classifier’s parameters if it can find a solution that lowers the risk even under the most adversarial labeling of the target data. This prevents the model from over-adjusting to noise or misleading patterns in the unlabeled target set.

Strict Improvement

A significant theoretical contribution of this work is the proof that for Discriminant Analysis, the TCP estimator is strictly better than the source classifier on target samples. This provides a rare mathematical guarantee of improvement in the domain adaptation literature, where most methods offer only empirical hopes of success.

Efficiency and Flexibility

Unlike many DA methods (such as Kernel Mean Matching) that require storing all source samples to calculate importance weights, TCP only requires the parameters of the trained source classifier. This makes it highly memory-efficient and suitable for deployment in resource-constrained environments. Furthermore, TCP does not require specific assumptions like covariate shift or a shared latent space, making it more flexible for diverse real-world applications.

Empirical Evaluation

The framework was rigorously tested across two distinct scenarios:

Sample Selection Bias

Using seven datasets from the UCI repository (including pima diabetes and ionosphere), the authors created artificial bias by sampling source data from specific feature regions while keeping the target data representative of the general population. In these controlled settings, TCP performed on par with specialized methods like KMM, demonstrating that robustness does not require a sacrifice in performance.

Real-World Domain Adaptation

The models were also tested on a heart disease dataset comprising patient records from four different hospitals (located in Hungary, Switzerland, California, and Ohio). This represents a "hard" DA problem due to variations in patient demographics, missing data, and varying disease prevalence (prior shift).

In these messy, real-world conditions, TCP-LS and TCP-LDA significantly outperformed state-of-the-art methods like Transfer Component Analysis (TCA) and Robust Bias-Aware (RBA) classifiers. While other methods occasionally performed worse than a random guess (AUC < 0.5) when their underlying assumptions failed, the TCP models remained stable and consistently improved upon the source baseline.

Conclusion and Future Work

The Target Contrastive Pessimistic risk framework provides a robust alternative to traditional domain adaptation. By prioritizing a "do no harm" approach through minimax optimization, it avoids the pitfalls of negative transfer.

While the current work focuses on single-source adaptation and surrogate risks (like mean squared error), future research could extend this to multi-source environments—using a union of source classifiers as a baseline—and explore direct optimization for 0/1 classification error. For now, TCP stands as a reliable method for practitioners who need the benefits of adaptation without the risk of catastrophic failure.

Summary updated

BibTeX
@article{kouw2021target,
  author = {Wouter M. Kouw and Marco Loog},
  title = {{Target contrastive pessimistic risk for robust domain adaptation}},
  journal = {Pattern Recognition Letters},
  year = {2021},
  doi = {10.1016/j.patrec.2021.05.005},
}
Figure