MapFlow: latent transition via normalizing flow for unsupervised domain adaptation

Hossein Askari, Yasir Latif, Hongfu SunMachine Learning 2023

Introduction

Unsupervised Domain Adaptation (UDA) aims to leverage labeled data from a source domain to improve performance on an unlabeled target domain. Traditionally, the "gold standard" for UDA has been achieving domain invariance—forcing the model to extract features that are statistically identical across both domains. However, the MapFlow framework challenges this paradigm, arguing that strict invariance often comes at the cost of discriminability. By forcing disparate domains into a single distribution, models frequently discard the very nuances required for accurate classification in the target domain.

The Invariance Paradox

The core motivation behind MapFlow is the "invariance paradox." While making features transferable is necessary, excessive invariance can lead to "inadaptability." Mathematically, the authors demonstrate that forcing $P(z_s) = P(z_t)$ is not a prerequisite for low target error. If the source error is minimized, the model only requires a predictable, structured relationship between the distributions. MapFlow shifts the focus from distribution matching to geometric alignment, preserving the multimodal structure of the latent space.

The MapFlow Framework (MFF)

MapFlow introduces a bijective (invertible) transformation between source and target latent spaces using Normalizing Flows (NF).

Normalizing Flows for Latent Mapping

The framework utilizes architectures like Glow with affine coupling layers to map complex target latent distributions to a well-behaved source latent distribution. Because these flows are invertible and possess tractable Jacobians, the model can precisely account for the "volume change" between distributions, effectively "unwarping" the target domain to align with the source's logic without losing its unique structure.

Variational Inference and Stability

To provide a stable "anchor" for the mapping, MapFlow models the source latent space using Variational Inference, regularizing it toward a Gaussian prior. This ensures that the target domain is mapped to a structured, predictable space rather than an arbitrary one.

Multi-task Objective

The optimization process involves a comprehensive loss function combining reconstruction losses to preserve data structure, flow-based likelihood losses to optimize the mapping, and discriminative losses like Virtual Adversarial Training (VAT) and conditional entropy minimization to maintain sharp clusters in the target domain.

Experimental Results

MapFlow was evaluated across several standard UDA benchmarks, consistently achieving state-of-the-art (SOTA) or near-SOTA performance.

  • MNIST → SVHN: In this challenging task involving significant dimensionality and style shifts, MapFlow achieved 81.5% accuracy, a 4.8% improvement over the DIRT-T baseline.
  • Office-31: The model reached an average accuracy of 89.5%, outperforming established methods like CDAN and ALDA.
  • VisDA-2017: On large-scale synthetic-to-real challenges, MapFlow achieved 77.1% average accuracy, demonstrating its scalability to complex real-world scenarios.

Qualitative analysis via t-SNE visualizations confirmed that MapFlow produces tighter, more distinct clusters in the target domain compared to traditional adversarial models, which often collapse classes into a single invariant "blob."

Conclusion and Future Work

MapFlow represents a significant shift in UDA by replacing rigid invariance with flexible, invertible mappings. By preserving domain-specific information, it maintains high discriminability while ensuring transferability. While highly effective for covariate shift, future work will focus on extending the framework to handle label shift (differing class proportions) and conditional shift (fundamental changes in feature-label relationships).

Summary updated

BibTeX
@article{askari2023mapflow,
  author = {Hossein Askari and Yasir Latif and Hongfu Sun},
  title = {{MapFlow: latent transition via normalizing flow for unsupervised domain adaptation}},
  journal = {Machine Learning},
  year = {2023},
  doi = {10.1007/s10994-023-06357-2},
}
Figure