A DVERSARIAL S UPPORT A LIGNMENT
CSAIL
A BSTRACT
We study the problem of aligning the supports of distributions.
Compared to the existing work on distribution alignment, support alignment does not require the densities to be matched.
We propose symmetric support difference as a divergence measure to quantify the mismatch between supports.
We show that select discriminators (e.g. discriminator trained for Jensen–Shannon divergence) are able to map support differences as support differences in their one-dimensional output space.
Following this result, our method aligns supports by minimizing a symmetrized relaxed optimal transport cost in the discriminator 1D space via an adversarial process.
Furthermore, we show that our approach can be viewed as a limit of existing notions of alignment by increasing transportation assignment tolerance.
We quantitatively evaluate the method across domain adaptation tasks with shifts in label distributions.
Our experiments 1 show that the proposed method is more robust against these shifts than other alignment-based baselines.
I NTRODUCTION
Learning tasks often involve estimating properties of distributions from samples or aligning such characteristics across domains.
We can align full distributions (adversarial domain alignment), certain statistics (canonical correlation analysis) or the support of distributions (this paper).
Much of the recent work has focused on full distributional alignment, for good reasons.
In domain adaptation, motivated by theoretical results (Ben-David et al., 2007; 2010), a series of papers (Ajakan et al., 2014;
Ganin & Lempitsky, 2015; Ganin et al., 2016; Tzeng et al., 2017; Shen et al., 2018; Pei et al., 2018;
Zhao et al., 2018; Li et al., 2018a; Wang et al., 2021; Kumar et al., 2018) seek to align distributions of representations between domains, and utilize a shared classifier on the aligned representation space.
Alignment in distributions implies alignment in supports.
However, when there are additional objectives/constraints to satisfy, the minimizer for a distribution alignment objective does not necessarily minimize a support alignment objective.
Example in Figure 1 demonstrates the qualitative distinction between two minimizers when distribution alignment is not achievable.
The distribution alignment objective prefers to keep supports unaligned even if support alignment is achievable.
Recent works (Zhao et al., 2019; Li et al., 2020; Tan et al., 2020; Wu et al., 2019b; Tachet des Combes et al., 2020) have demonstrated that a shift in label distributions between source and target leads to a characterizable performance drop when the representations are forced into a distribution alignment.
The error bound in Johansson et al.
(2019) suggests aligning the supports of representations instead.
In this paper, we focus on distribution support as the key characteristic to align.
We introduce a support divergence to measure the support mismatch and algorithms to optimize such alignment.
We also position our approach in the spectrum of other alignment methods.
Our contributions are as follows (all proofs can be found in Appendix A):
In Section 2.1, we measure the differences between supports of distributions.
Building on the Hausdorff distance, we introduce a novel support divergence better suited for optimization, which we refer to as symmetric support difference (SSD) divergence.
In Section 2.2, we identify an important property of the discriminator trained for Jensen–Shannon divergence: support differences in the original space of interest are “preserved” as support differences in the one-dimensional discriminator output space.
In Section 3, we present our practical algorithm for support alignment, Adversarial Support Alignment (ASA).
Essentially, based on the analysis presented in Section 2.2, our solution is to align supports in the discriminator 1D space, which is computationally efficient.
In Section 4, we place different notions of alignment – distribution alignment, relaxed distribution alignment and support alignment – within a coherent spectrum from the point of view of optimal transport, characterizing their relationships, both theoretically in terms of their objectives and practically in terms of their algorithms.
In Section 5, we demonstrate the effectiveness of support alignment in practice for domain adaptation setting.
Compared to other alignment-based baselines, our proposed method is more robust against shifts in label distributions. [Figure] t
[Figure]
support alignment procedures p ( x ) is a fixed
Beta distribution p x )
=
Beta x | with support q θ ( x ) is a
“shifted”
Beta distribution q θ x )
=
Beta x
− θ | 2 , parameterized by θ with support [ θ θ
+ 1] .
Panel (a) shows the initial configuration with θ init =
− 3 . shows the result by distribution alignment. the result by support We report Wasserstein distance D W and SSD divergence D △
SSD DIVERGENCE AND SUPPORT ALIGNMENT
Notation.
We consider an Euclidean space X =
R n equipped with Borel sigma algebra B and a metric d : X × X
→ R (e.g. Euclidean distance).
Let P be the set of probability measures on ( X , B ) .
For p ∈ P , the support of p is denoted by supp( p ) and is defined as the smallest closed set X
⊆ X such that p ( X ) = 1 .
f
♯ p denotes the pushforward measure of p induced by a measurable mapping f .
With a slight abuse of notation, we use p ( x ) and [ f ♯ p ]( t ) to denote the densities of measures p and f ♯ p evaluated at x and t respectively, implicitly assuming that the measures are absolutely continuous.
The distance between a point x ∈ X and a subset Y ⊆
X is defined as d ( x, Y ) =
inf
y ∈ Y d ( x, y ) .
The symmetric difference of two sets A and B is defined as A △ B =
( A \ B ) ∪ ( B \ A ) .
2. D IFFERENCE BETWEEN SUPPORTS
To align the supports of distributions, we first need to evaluate how different they are.
Similar to distribution divergences like Jensen–Shannon divergence, we introduce a notion of support divergence.
A support divergence 2 between two distributions in P is a function D S ( · , · ) : P × P → R satisfying: 1)
D S ( p, q ) ≥ 0 for all p, q ∈ P ; 2) D S ( p, q ) =
iff supp( p ) =
supp( q ) .
While a distribution divergence is sensitive to both density and support differences, a support divergence only needs to detect mismatches in supports, which are subsets of the metric space X .
An example of a distance between subsets of a metric space is the Hausdorff distance: d H ( X, Y ) =
max { sup x ∈ X
d
( x, Y ) , sup
y ∈ Y d ( y, X ) } .
Since it depends only on the greatest distance between a point and a set, minimizing this objective for alignment only provides signal to a single point.
To make the optimization less sparse, we consider all points that violate the support alignment criterion and introduce symmetric support difference (SSD) divergence:
[Equation]
Proposition 2.1.
SSD divergence D △ ( p, q ) is a support divergence
[Equation]
We note that our proposed SSD divergence is closely related to Chamfer distance/divergence (CD) (Fan et al., 2017; Nguyen et al., 2021) and Relaxed Word Mover’s Distance (RWMD) (Kusner et al., 2015).
While both CD and RWMD are stated for discrete points (see Section 6 for further comments), SSD divergence is a general difference measure between arbitrary (discrete or continuous) distributions.
This distinction, albeit small, is important in our theoretical analysis (Sections 2.2, 4.1).
S UPPORT ALIGNMENT IN ONE - DIMENSIONAL SPACE
Goodfellow et al.
(2014) showed that the log-loss discriminator f : X → [0 , 1] , trained to distinguish samples from distributions p and q ( sup f E x ∼ p
[log f ( x )]
+ E x ∼ q [log(1 − f ( x ))] ) can be used to estimate the Jensen–Shannon divergence between p and q .
The closed form maximizer f ∗ is
[Equation]
Note that for a point x / ∈ supp( p ) ∪ supp( q ) the value of f ∗ ( x ) can be set to an arbitrary value in [0 , 1] , since the log-loss does not depend on f ( x ) for such x .
The form of the optimal discriminator (2) gives rise to our main theorem below, which characterizes the ability of the log-loss discriminator to identify support misalignment.
Theorem 2.1.
Let p and q be the distributions with densities satisfying
[Equation]
Let f ∗ be the optimal discriminator (2).
Then, D △ ( p, q ) =
if and only if D △ ( f ∗ ♯ p, f ∗ ♯ q ) = 0 .
The idea of the proof is to show that the extreme values ( 0 and 1 ) of f ∗ ( x ) [-= 
 and, by Proposition 2.2, τ p (1) > 0 and τ q (1) = 0 . Repeating the same argument in reverse direction we see that supp( p ) \ supp( q ) ̸ = ∅ if and-]can only be attained in x ∈ supp( p ) △ supp( q ) .
Assumption (3) guarantees that f ∗ ( x ) cannot approach neither 0 nor 1 in the intersection of the supports supp( p ) ∩ supp( q ) , i.e. the values { f ∗ ( x ) | x ∈ supp( p ) ∩ supp( q ) } are separated from the extreme values 0 and 1 .
We conclude this section with two technical remarks on Theorem 2.1.
Remark 2.1.1.
The result of Theorem 2.1 does not necessarily hold for other types of discriminators.
For instance, the dual Wasserstein discriminator (Arjovsky et al., 2017; Gulrajani et al., 2017) does not always highlight the support difference in the original space as a support difference in the discriminator output space.
This observation is formaly stated in the following proposition.
Proposition 2.2.
Let f ⋆W be the maximizer of sup f :L( f ) ≤ 1 E x ∼ p
[ f ( x )] − E
x ∼ q [ f ( x )] , where L( · ) is the Lipschitz constant.
There exist p and q with supp( p ) ̸
= supp( q ) but supp( f ⋆W ♯ p ) =
supp( f ⋆W ♯ q ) .
Remark 2.1.2.
In practice the discriminator is typically parameterized as f ( x ) = σ ( g ( x )) , where g : X → R is realized by a deep neural network and σ ( x ) =
(1 + e − x ) − 1 is the sigmoid function.
The optimization problem for g is
[Equation]
and the optimal solution is g ∗ ( x )
= log p ( x ) − log q ( x ) .
Naturally the result of Theorem 2.1 holds for g ∗ , since g ∗ ( x ) =
σ − 1 ( f ∗ ( x )) and σ is a bijective mapping from R ∪ {−∞ , ∞} to [0 , 1] .
A DVERSARIAL SUPPORT ALIGNMENT
We consider distributions p and q parameterized by θ : p θ , q θ .
The log-loss discriminator g optimized for (4) is parameterized by ψ : g ψ .
Our analysis in Section 2.2 already suggests an algorithm.
Namely, we can optimize θ by minimizing D △ ( g ψ♯ p θ , g ψ♯ q θ ) while optimizing ψ by (4).
This adversarial game is analogous to the setup of the existing distribution alignment algorithms 3 .
In practice, rather than having direct access to p θ , q θ , which is unavailable, we are often given i.i.d.
samples { x pi } Ni =1 , { x qi } Mi =1 .
They form discrete distributions
ˆ p θ ( x ) = 1 N (cid:80) Ni =
δ ( x − x pi ) , ˆ q θ ( x ) = 1 M (cid:80) Mi =1 δ ( x − x qi ) , and [ g ψ♯
ˆ p θ ]( t ) = 1 N (cid:80) Ni =1 δ ( t − g ψ ( x pi )) , [ g ψ♯ ˆ q θ ]( t ) =
1 M (cid:80) Mi =1 δ ( t − g ψ ( x qi )) .
Since g ψ♯ ˆ p θ and g ψ♯ ˆ q θ are discrete distributions, they have supports { g ψ ( x pi ) }
Ni =1 and { g ψ ( x qi ) } Mi = respectively.
SSD divergence between discrete distributions g ψ♯ ˆ p θ and g ψ♯ ˆ q θ is
[Equation]
Effect of mini-batch training.
When training on large datasets, we need to rely on stochastic optimization with mini-batches.
We denote the mini-batches (of same size, as in common practice) from p θ and q θ as x p = { x pi } mi =1 and x q = { x qi } mi =1 respectively.
By minimizing D △ ( g ψ ( x p ) , g ψ ( x q )) , we only consider the mini-batch support distance rather than the population support distance (5).
We observe that in practice the described algorithm brings the distributions to a state closer to distribution alignment rather than support alignment (see Appendix D.5 for details).
The problem is in the typically small batch size.
The algorithm actually tries to enforce support alignment for all possible pairs of mini-batches, which is a much stricter constraint than population support alignment.
To address the issue mentioned above, without working with a much larger batch size, we create two “history buffers”: h p , storing the previous 1D discriminator outputs of (at most) n samples from p θ , and a similar buffer h q for q θ .
Specifically, h = { g ψ old ,i ( x old ,i ) } ni =1 stores the values of the previous n samples x old ,i mapped by their corresponding past “versions” of the discriminator g ψ old ,i .
We minimize D △ ( v p , v q ) , where v p = concat( h p , g ψ ( x p )) , v q = concat( h q , g ψ ( x q )) : D [Equation]
[Equation]
 [Equation] Note that D △ ( · , · ) between two sets of 1D samples can be efficiently calculated since d ( v pi , v q ) and d ( v qj , v p ) are simply 1-nearest neighbor distances in 1D.
Moreover the history buffers store only the scalar values from the previous batches.
These values are only considered in nearest neighbor assignment but do not directly provide gradient signal for optimization.
Thus, the computation overhead of including a long history buffer is very light.
We present our full algorithm, Adversarial
Support Alignment (ASA), in Algorithm 1.
S PECTRUM OF NOTIONS OF ALIGNMENT
In this section, we take a closer look into our work and different existing notions of alignment that have been proposed in the literature, especially their formulations from the optimal transport perspective.
We show that our proposed support alignment framework is a limit of existing notions of alignment, both in terms of theory and algorithm, by increasing transportation assignment tolerance.
4. T HEORETICAL CONNECTIONS
Distribution alignment.
Wasserstein distance is a commonly used objective for distribution alignment.
In our analysis, we focus on the Wasserstein-1 distance:
[Equation]
Algorithm {+
+}
Our proposed ASA algorithm.
n (maximum history buffer size), we use
= 1000 .
1: for number of training steps do 2:
Sample mini-batches { x pi } mi =1 ∼ p θ , { x qi } mi =1 ∼ q θ . 3:
Perform optimization step on ψ using stochastic gradient ∇ ψ (cid:18)m
[Equation] (cid:80) i = (cid:104)
[Equation] 4: v p ← concat( h p , { g
[Equation]
( x pi ) [Equation] mi =1 ) , v q ← concat( h q , { g ψ ( x qi ) } mi =1 ) .
5: π ip → q ← arg min j d ( v pi , v qj ) , π jq → p ← arg min i d ( v pi , v qj ) .
Perform optimization step on θ using stochastic gradient ∇ θ (cid:18)n + m n + m (cid:80) i
= (cid:104) d ( v pi , v qπ ip → q ) + d ( v qi , v pπ iq → p ) (cid:105)(cid:19) .
U PDATE H ISTORY ( h p , { g ψ ( x pi ) } mi =1 ) , U PDATE H ISTORY ( h q , { g ψ ( x qi ) } mi =1 ) .
8: end for where Γ( p, q ) is the set of all measures on X × X with marginals of p and q , respectively.
The value of D W ( p, q ) is the minimal transportation cost for transporting probability mass from p to q .
The transportation cost is zero if and only if p = q , meaning the distributions are aligned.
Relaxed distribution alignment.
Wu et al.
(2019b) proposed a modified Wasserstein distance to achieve asymmetrically-relaxed distribution alignment, namely β -admissible Wasserstein distance:
[Equation]
where Γ β ( p, q ) is the set of all measures γ on X × X such that (cid:82) γ ( x, y ) dy
= p ( x ) , ∀ x and (cid:82) γ ( x, y ) dx ≤ (1 + β ) q ( y ) , ∀ y .
With the relaxed marginal constraints, one could choose a transportation plan γ which transports probability mass from p to a modified distribution q ′ rather than the original distribution q as long as q ′ satisfies the constraint q ′ ( x ) ≤ (1 + β ) q ( x ) , ∀ x .
Therefore,
D βW ( p, q ) is zero if and only if p ( x ) ≤ (1 + β ) q ( x ) ,
∀ x .
In (Wu et al., 2019b), β is normally set to a positive finite number to achieve the asymmetric-relaxation of distribution alignment, and it is shown that D 0 W ( p, q ) =
D W ( p, q ) .
We can extend D βW ( p, q ) to a symmetric version, which we term β 1 , β 2 -admissible Wasserstein distance:
[Equation]
The aforementioned property of β -admissible Wasserstein distance implies that D β
[Equation]
and only if p ( x ) ≤ (1 + β 1 ) q ( x ) , ∀ x and q ( x ) ≤ (1 + β 2 ) p ( x ) , ∀ x , in which case we call p and q “ ( β 1 , β 2 ) -aligned”, with β 1 and β 2 controlling the transportation assignment tolerances.
Support alignment.
The term E p [ d ( x, supp( q ))] in (1) represents the average distance from samples in p to the support of q .
From the optimal transport perspective, this value is the minimal transportation cost of transporting the probability mass of p into the support of q .
We show that SSD divergence can be considered as a transportation cost in the limit of infinite assignment tolerance.
Proposition 4.1.
D
[Equation]
We now have completed the spectrum of alignment objectives defined within the optimal transport framework.
The following proposition establishes the relationship within the spectrum.
Proposition 4.2.
Let p and q be two distributions in P .
Then,
D W ( p, q ) = 0 implies D β 1 ,β 2 W ( p, q ) = 0 for all finite β 1 , β 2 > 0 .
D β 1 ,β 2 W ( p, q ) = 0 for some finite β 1 , β 2 > 0 implies D △ ( p, q ) = 0 .
The converse of statements 1 and 2 are false.
In addition to the result presented in Theorem 2.1, we can show that the log-loss discriminator can also “preserve” the existing notions of alignment.
Proposition 4.3.
Let f ∗ be the optimal discriminator (2) for given distributions p and q .
Then,
[Equation]
4. A LGORITHMIC CONNECTIONS
The result of Proposition 4.3 suggests methods similar to our ASA algorithm presented in Sectioncan achieve different notions of alignment by minimizing objectives discussed in Section 4.1 between the 1D pushforward distributions.
We consider the setup used in Section 3 but without history buffers to simplify the analysis, as their usage is orthogonal to our discussion in this section.
Recall that we work with a mini-batch setting, where { x pi } mi =1 and { x qi } mi =1 are sampled from p and q respectively, and g is the adversarial log-loss discriminator.
We denote the corresponding 1D outputs from the log-loss discriminator by o p = { o pi } mi =
= { g ( x pi ) } mi =1 and o q (defined similarly).
Distribution alignment.
We adapt (7) for { o pi } mi =1 and { o qi } mi =1 :
[Equation]
where Γ( o p , o q ) is the set of m × m doubly stochastic matrices.
Since o p and o q are sets of 1D samples with the same size, it can be shown (Rabin et al., 2011) that the optimal γ ∗ corresponds to an assignment π ∗ , which pairs points in the sorting order and can be computed efficiently by sorting both sets o p and o q .
The transportation cost is zero if and only if there exists an invertible 1 -toassignment
π ∗ such that o pi =
o qπ ∗ ( i ) .
GAN training algorithms proposed in (Deshpande et al., 2018; 2019) utilize the above sorting procedure to estimate the maximum sliced Wasserstein distance.
Relaxed distribution alignment.
Similarly, we can adapt (8):
[Equation]
where Γ β ( o p , o q ) is the set of m × m matrices with non-negative real entries, such that (cid:80) mj
=1 γ ij = 1 , ∀ i and (cid:80) mi =1 γ ij ≤ 1 + β, ∀ j .
The optimization goal in (11) is to find a “soft-assignment” γ which describes the transportation of probability mass from points o pi in o p to points o qi in o q .
The parameter β controls the set of admissible assignments Γ β , which is similar to its role discussed in Section 4.1: with transportation assignment tolerance β , the total mass of points in o p transported to each of the points o qi cannot exceed 1 + β .
We refer to such assignments as ( β + 1) -to- 1 assignment.
The transportation cost is zero if and only if there exists such an assignment between o p and o q .
It can be shown (see Appendix C) that for integer value of β , the set of minimizers of (11) must contain a “hard-assignment” transportation plan, which assigns each point o pi to exactly one point o qj .
Then (1 + β ) gives the upper bound on the number of points o pi that can be transported to given point
o qj .
This hard assignment problem can be solved quasi-linearly with worst case time complexity
O (cid:0) ( β + 1) m 2 (cid:1) (Bonneel & Coeurjolly, 2019), which, combined with Proposition 4.3, can lead to new algorithms for relaxed distribution alignment besides those proposed in Wu et al. (2019b).
Support alignment.
When β = ∞ , the sum (cid:80) mi =1 γ ij is unconstrained for all j , and each point o pi can be assigned to any of the points o qj .
The optimal solution is simply 1-nearest neighbor assignment, or to follow the above terminology, ∞ -to- 1 assignment.
E XPERIMENTS
Problem setting.
We evaluate our proposed ASA method in the setting of unsupervised domain adaptation (UDA).
The goal of UDA algorithms is to train and “adapt” a classification model
M : X → Y from source domain distribution p X,Y to target domain distribution q X,Y given the access to a labeled source dataset { x pi , y pi } N p
i
=1 ∼ p X,Y and an unlabeled target dataset { x qi } N q i =1 ∼ q X .
A common approach for UDA is to represent M as C ϕ ◦ F θ : a classifier C ϕ : Z → Y and a feature extractor F θ : X → Z , and train C ϕ and F θ by minimizing: 1) classification loss ℓ cls on source examples; 2) alignment loss D align measuring discrepancy between p θZ =
F θ♯ p X and q θZ =
F θ♯ q X : min ϕ,θ
[Equation] [Equation]
[Figure]
In practice D align is an estimate of a divergence measure via an adversarial discriminator g ψ .
Choices of D align include f-divergences (Ganin et al., 2016; Nowozin et al., 2016) and Wasserstein distance (Arjovsky et al., 2017) to enforce distribution alignment and versions of re-weighted/relaxed distribution divergences (Wu et al., 2019b; Tachet des Combes et al., 2020) to enforce relaxed distribution alignment.
For support alignment, we apply the proposed ASA method as the alignment subroutine in (12) with log-loss discriminator g ψ (4) and D align computed as (6).
Task specifications.
We consider 3 UDA tasks: USPS → MNIST, STL → CIFAR, and VisDA-2017, and 2 versions of ASA: ASA-sq , ASA-abs corresponding to squared and absolute distances respectively for d ( · , · ) in (6).
We compare ASA with: No DA (no domain adaptation), DANN (Ganin et al., 2016) (distribution alignment with JS divergence), VADA (Shu et al., 2018)
(distribution alignment with virtual adversarial training), IWDAN , IWCDAN (Tachet des Combes et al., 2020) (relaxed distribution alignment via importance weighting)
sDANN- β (Wu et al., 2019b) (relaxed/ β -admissible
JS divergence via re-weighting).
Please refer to Appendix D for full experimental details.
To evaluate the robustness of the methods, we simulate label distribution shift by subsampling source and target dataset, so that source has balanced label distribution and target label distribution follows the power law q Y ( y )
∝ σ ( y )
− α , where σ is a random permutation of class labels { 1 , . . .
, K }
and α controls the severity of the shift ( α = 0 means balanced label distribution).
For each task, we generate 5 random permutations σ for 4 different shift levels α ∈ { 0 , 1 , 1 . 5 , 2 } .
Essentially we transform each (source, target) dataset pair to 5 × 4 = 20 tasks of different difficulty levels, since classes are not equally difficult and different permutations can give them different weights.
Evaluation metrics.
We choose the average (per-)class accuracy and minimum (per-)class accuracy on the target test set as evaluation metrics.
Under the average class accuracy metric, all classes are treated as equally important (despite the unequal representation during training for α > 0 ), and the minimum class accuracy focuses on model’s worst within-class performance.
In order to account for the variability of task difficulties across random permutations of target labels, we report robust statistics, median and a 25-75 percentile interval, across 5 runs.
Illustrative example.
First we consider a simplified setting to intuitively understand and directly analyze the behavior of our proposed support alignment method in domain adaptation under label distribution shift.
We consider a 3-class USPS → MNIST problem by selecting a subset of examples corresponding to digits ‘3’, ‘5’, and ‘9’, and use a feature extractor network with 2D output space.
We introduce label distribution shift as described above with α = 1 . 5 , i.e. the probabilities of classes in the target domain are 12% , 23% , and 65% .
We compare No DA, DANN, ASA-abs by their average target classification accuracy, Wasserstein distance D W ( p θZ , q θZ ) and SSD divergence D △ ( p θZ , q θZ ) between the learned embeddings of source and target domain.
We apply a global affine transformation to each embedding space in order to have comparable distances between different spaces: we center the embeddings so that their average is 0 and re-scale them so that their average norm is 1. The [Table]
[Table] results are shown in Figure 2 and Table D.5.
Compared to No DA, both DANN and ASA achieve support alignment.
DANN enforces distribution alignment, and thus places some target embeddings into regions corresponding to the wrong class.
In comparison, ASA does not enforce distribution alignment and maintains good class correspondence across the source and target embeddings.
Main results.
The results of the main experimental evaluations are shown in Tables 1, 2, 3.
Without any alignment, source only training struggles relatively to adapt to the target domain.
Nonetheless, its performance across the imbalance levels remains robust, since the training procedure is the same.
Agreeing with the observation and theoretical results from previous work (Zhao et al., 2019; Li et al., 2020; Tan et al., 2020; Wu et al., 2019b; Tachet des Combes et al., 2020), distribution alignment methods (DANN and VADA) perform well when there is no shift but suffer otherwise, whereas relaxed distribution alignment methods (IWDAN, IWCDAN and sDANN- β ) show more resilience to shifts.
On all tasks with positive α , we observe that it is common for the existing methods to achieve good class average accuracies while suffering significantly on some individual classes.
These results suggest that the often-ignored but important min-accuracy metric can be very challenging.
Finally, our support alignment methods (ASA-sq and ASA-abs) are the most robust ones against the shifts, while still being competitive in the more balanced settings ( α = 0 or 1 ).
We achieve best results in the more imbalanced and difficult tasks ( α = 1 . 5 or 2 ) for almost all categories on all datasets.
Please refer to Appendix D for ablation studies and additional comparisons.
R ELATED WORK
Distribution alignment.
Apart from the works, e.g. (Ajakan et al., 2014; Ganin et al., 2016; Ganin & Lempitsky, 2015; Pei et al., 2018; Zhao et al., 2018;
Long et al., 2018; Tachet des Combes et al.,
[Table]
Li et al., 2018b; Tzeng et al., 2017; Shen et al., 2018; Kumar et al., 2018; Li et al., 2018a; Wang et al., 2021; Goodfellow et al., 2014; Arjovsky et al., 2017; Gulrajani et al., 2017; Mao et al., 2017; Radford et al., 2015; Salimans et al., 2018; Genevay et al., 2018; Wu et al., 2019a; Deshpande et al., 2018; 2019), that do distribution alignment, there are also papers (Long et al., 2015; 2017;
Peng et al., 2019; Sun et al., 2016; Sun & Saenko, 2016) focusing on aligning some characteristics of the distribution, such as first or second moments.
Our work is concerned with a different problem, support alignment, which is a novel objective in this line of work.
In terms of methodology, our use of the discriminator output space to work with easier optimization in 1D is inspired by a line of work (Salimans et al., 2018; Genevay et al., 2018; Wu et al., 2019a; Deshpande et al., 2018; 2019) on sliced
Wasserstein distance based models.
Our result in Proposition 4.3 also provides theoretical insight on the practical effectiveness of 1D OT in (Deshpande et al., 2019).
Relaxed distribution alignment.
In Section 4, we have already covered in detail the connections between our work and (Wu et al., 2019b).
Balaji et al.
(2020) introduced relaxed distribution alignment with a different focus, aiming to be insensitive to outliers.
Chamfer distance/divergence (CD) is used to compute similarity between images/3D point clouds (Fan et al., 2017; Nguyen et al., 2021).
For text data, Kusner et al.
(2015) presented Relaxed Word Mover’s Distance (RWMD) to prune candidates of similar documents.
CD and RWMD are essentially the same as (5) with d ( · , · ) being the Euclidean distance.
They are computed by finding the nearest neighbor assignments.
Our subroutine of calculating the support distance in the 1D discriminator output space is done similarly by finding nearest neighbors within the current batch and history buffers.
Support estimation.
There exists a series of work, e.g. (Schölkopf et al., 2001; Hoffmann, 2007;
Tax & Duin, 2004; Knorr et al., 2000; Chalapathy et al., 2017; Ruff et al., 2018; Perera et al., 2019;
Deecke et al., 2018; Zenati et al., 2018), on novelty/anomaly detection problem, which can be casted as support estimation.
We consider a fundamentally different problem setting.
Our goal is to align the supports and our approach does not directly estimate the supports.
Instead, we implicitly learn the relationships between supports (density ratio to be specific) via a discriminator.
C ONCLUSION AND FUTURE WORK
In this paper, we studied the problem of aligning the supports of distributions.
We formalized its theoretical connections with existing alignment notions and demonstrated the effectiveness of the approach in domain adaptation.
We believe that our methodology opens possibilities for the design of more nuanced and structured alignment constraints, suitable for various use cases.
One natural extension is support containment, achievable with only one term in (1).
This approach is fitting for partial domain adaptation, where some source domain classes do not appear in the target domain.
Another interesting direction is unsupervised domain transfer, where support alignment is more desired than existing distribution alignment methods due to mode imbalance (Binkowski et al., 2019). A CKNOWLEDGMENTS
The computational experiments presented in this paper were performed on “Satori” cluster developed as a collaboration between MIT and IBM.
We used Weights & Biases (Biewald, 2020) for experiment tracking and visualizations to develop insights for this paper.
TJ acknowledges support from MIT-IBM Watson AI Lab, from Singapore DSO, and MIT-DSTA Singapore collaboration. We thank Xiang Fu and all anonymous reviewers for their helpful comments regarding the paper’s writing and presentation. A P ROOFS OF THE THEORETICAL RESULTS A. P ROOF OF P ROPOSITION 2.
1) D
[Equation]
p
[Equation]
0 for all p, q ∈ P :
Since d ( · , · ) ≥ 0 , for all p, q ,
[Equation]
[Equation]
[Equation]
(13) which makes D △ ( p, q ) =
SD( p, q ) + SD( q, p ) ≥ 0 .
2) D △ ( p, q ) =
if and only if supp( p ) = supp( q ) :
With statement 1, D △ ( p, q ) =
if and only if SD( p, q ) = 0 and SD( q, p ) = 0 .
Then,
SD
[Equation]
q
[Equation]
This is equivalent to
[Equation]
Thus, supp( p ) ⊆ supp( q ) , and similarly, supp( q )
⊆
supp( p ) , which makes supp( p ) =
supp( q ) .
A. A SSUMPTION AND PROOF OF T HEOREM 2. A.2. C OMMENTS ON A SSUMPTION (3)
Assumption (3) is not restrictive.
Indeed, distributions satisfying Assumption (3) include:
• uniform p ( x ) =
U ( x ; [ a, b ]) ; • truncated normal; • p ( x ) of the form
[Equation]
with non-negative energy (unnormalized log-density) function E p : X → [0 , ∞ ) ; • mixture of any distributions satisfying Assumption (3), for instance the distributions shown in Figure A.1 top-left are mixtures of truncated normal distributions on [ − 2 , 2] .
Starting from arbitrary density p 0 ( x ) with bounded support we can derive a density p ( x ) satisfying
Assumption (3) via density clipping and re-normalization
[Equation]
for some C ′ > 1 .
A.2. P ROOF OF T HEOREM 2.
First, we show that D △ ( p, q ) = 0 implies D △ ( f ∗ ♯ p, f ∗ ♯ q ) = 0 .
D △ ( p, q ) = 0 implies supp( p ) =
supp( q ) .
Then for any mapping f : X → R , we have supp( f ♯ p )
=
supp( f ♯ q )[-= 
 then p = q-] , which implies supp( f ∗ ♯ p ) = supp( f ∗ ♯ q ) .
Thus, D △ ( f ∗ ♯ p, f ∗ ♯ q ) = 0 .
Now, we prove that D △ ( f ∗ ♯ p, f ∗ ♯ q ) = 0 implies D △ ( p, q )
= 0 by contradiction.
D △ ( f
[Equation]
p, f [Equation] ) = 0 implies the following:
[Equation]
1) Suppose E x ∼ p
[ d ( x, supp( q ))] > 0 .
This is only possible if p ( { x | x ∈ supp( p ) \ supp( q ) } ) > 0 .
Since x ∈ supp( p ) \ supp( q ) implies p ( x ) > 0 , q ( x ) = 0 , and for any x ∈ supp( p ) ∪ supp( q ) , p ( x ) > 0 , q ( x )
= {+
+}
if and only if f ∗ ( x ) =
[Equation]
= 1 , we have:
[Equation]
and therefore 1 ∈ supp( f ∗ ♯ p ) .
[-Note that f ∗ ( x ) = 
 if and only if p ( x ) >-]For a real number α : 0 < α < 1 C 2 +1 , consider the probability of the event (1 − α, 1] ⊂ [0 , 1] under distribution f ∗ [-( x ) = 
 if and only if-]♯ q :
[Equation]
By assumption (3), p ( x ) < C and q [-(1) = 
 if 1 ∈ supp( τ-]( x ) > 0 implies q ( x ) > 1 C , therefore for x : q ( x ) >
we have
[-Similarly, f ∗ ( x ) = 
-][Equation]
This means that P f ∗ ♯ q ((1 − α, 1]) = 0 , i.e. supp( f ∗ ♯ q ) ∩ (1 − α, 1] = ∅ . {+To summarize, starting from the assumption that E x ∼ p [ d ( x, supp( q ))] > 
+}
we showed that • 1 ∈ supp( f ∗ ♯ p ) , P f ∗ ♯ p ( { 1 } ) > 0 ; • supp( f ∗ ♯ q ) ∩ (1 − α, 1] = ∅ . Because D △ ( f ∗ ♯ p, f ∗ ♯ q ) ≥ E t ∼ f ∗ ♯ p (cid:2) d ( t, supp( f ∗ ♯ q )) (cid:3) ≥ P f ∗ ♯ p ( { 1 } ) · d (1 , supp( f ∗ ♯ q )) ≥ P f ∗ ♯ p ( { 1 } ) · α > 0 , which contradicts with the given D △ ( f ∗ ♯ p, f ∗ ♯ q ) = 0 , we have E x ∼ p
[ d ( x, supp( q ))] = 0 .
2) Similarly, it can be shown E x ∼ q [-) = 
-][ d ( x, supp( p ))]
= 0 . Thus, D △ ( f ∗ ♯ p, f ∗ ♯ q ) = 0 implies D △ ( p, q ) = 0 .
A. P ROOF OF P ROPOSITION 2.
Consider a 1-dimensional Euclidean space R .
Let supp( p ) =
[ − 12 , 12 ] ∪ [1 , 2] with p ([ − 12 , 12 ]) =and p ([1 , 2]) = 14 .
Let supp( q ) =
[ − 2 , − 1] ∪ [ − 12 , 12 ] ∪ [1 , 2] with q ([ − 2 , − 1]) = 14 , q ([ − 12 , 12 ]) =
and q ([1 , 2]) = 12 .
The supports of p and q consist of disjoint closed intervals, and we assume uniform distribution within each of these intervals, i.e. p has density p ( x ) = 34 , ∀ x ∈ [ − 12 , 12 ]; p ( x ) = 14 , ∀ x ∈ [1 , 2] and q has densitiy q ( x ) = 14 , ∀ x ∈ [ − 2 , − 1]; q ( x ) = 14 , ∀ x ∈ [ − 12 , 12 ]; q ( x ) = 12 , ∀ x ∈ [1 , 2] .
Clearly, supp( p ) ̸
= supp( q ) .
The optimal dual Wasserstein discriminator f ∗ W is the maximizer of
[Equation]
Thus, f ∗ W is the maximizer of
[Equation]
which simplifies to
[Equation]
Since the optimization objective and the constraint are invariant to replacing the function f ( x ) with its symmetric reflection g ( x ) = f ( − x ) , if f ′ is a optimal solution, then there exists a symmetric maximizer f ∗ W ( x ) = 12 f ′ ( x ) + 12 f ′ ( − x ) , since f ∗ W ( x ) =
f ∗ W ( − x ) and Lip( f ∗ W ) ≤ Lip( f ′ ) ≤ 1 .
Thus, supp( f ⋆W ♯ p ) = supp( f ⋆W ♯ q ) as f ∗ W ( x ) =
f ∗ W ( − x ) for x ∈ [1 , 2] .
Note that one can easily “extend” the above proof to discrete distributions, by replacing the disjoint segments [ − 2 , − 1] , [ − 12 , 12 ] , [1 , 2] with points {− 1 } , { 0 } , { 1 } .
A. P ROOF OF P ROPOSITION 4.
From (8), we have
[Equation]
where lim β →∞ Γ β ( p, q ) is the set of all measures γ on X × X such that (cid:82) γ ( x, y ) dy = p ( x ) , ∀ x and (cid:82) γ
[Equation]
The set of inequalities
[Equation]
can be simplified to
[Equation]
y such that q ( y ) = 0 .
To put it together, we have
[Equation]
where Γ ∞ ( p, q ) is the set of all measures γ on X × X such that (cid:82) γ ( x, y ) dy
= p ( x ) , ∀ x and (cid:82) γ ( x, y ) dx
= 0 , ∀ y such that q ( y )
= 0 .
In other words, we seek the coupling γ ( x, y ) which defines a transportation plan such that the total mass transported from given point x is equal to p ( x ) , and the only constraint on the destination points y is that no probability mass can be transported to points y where q ( y )
= 0 , i.e. y / ∈ supp( q ) .
Let y ∗ ( x ) denote a function such that
[Equation]
[-= 
-]
We can see that γ ∗ given by
[Equation]
is the optimal coupling.
Indeed, γ ∗ satisfies the constraints γ ∗ ∈ Γ ∞ , and the cost of any other transportation cost γ ∈ Γ ∞ is at least that of γ ∗ (since y ∗ ( x ) is defined as a closest point y in supp( q ) to a given point x ).
Thus,
[Equation]
The last equation implies D ∞ W ( p, q ) =
SD( p, q ) ( SD( · , · ) is defined in (13)).
Then, D [Equation]
[Equation]
A. P ROOF OF P ROPOSITION 4.
D W ( p, q ) = 0 implies p = q , which is equivalent to
[Equation]
Then clearly, for all finite β 1 , β 2 > 0 it satisfies
[Equation]
Thus, D β 1 ,β 2 W ( p, q ) = 0 for all finite β 1 , β 2 > 0 . D [Equation]
[Equation]
( p, q ) = 0 for some finite β 1 , β 2 > 0 means that (14) is satisfied.
This implies that ∀ x ∈ supp( p ) , x ∈ supp( q ) and ∀ x ∈ supp( q ) , x ∈ supp( p ) , which makes supp( p ) =
supp( q ) .
Thus,
[Equation]
p [Equation] The converse of statements 1 and 2 are false: (a) For all finite β 1 , β 2 > 0 , let supp( p ) =
supp( q ) = { x 1 , x 2 } .
Let p ( x 1 ) =
p ( x 2 ) = 1 / 2 and q ( x 1 ) =
(1 + β ′ ) / 2 and q ( x 2 )
= (1 − β ′ ) / 2 where
[Equation]
Then, it can be easily checked that (14) is satisfied, which makes D β 1 ,β 2 W
[Equation]
However, since β ′ ̸ = 0 , p ̸ = q and thus D W ( p, q ) ̸ = 0 .
(b) Similar to (a), let supp( p ) =
supp( q ) = { x 1 , x 2 } .
Let p ( x 1 ) =
q ( x 2 )
= ε and p ( x 2 ) =
q ( x 1 ) = 1 − ε for some ε > 0 .
Since supp( p ) =
supp( q ) , D △ ( p, q ) = 0 .
However,
[Equation]
, and, thus, for any finite β 2 > 0 we can choose ε > 0 such that [Equation] Therefore, (14) is not satisfied and D β 1 , [Equation]
A. P ROOF OF P ROPOSITION
Using (2)
[Equation]
we first establish a connection between the pushforward distributions f ∗ ♯ p and f ∗ ♯ q .
Proposition A.1.
Let f ∗ be the optimal log-loss discriminator (2) between p and q .
Then,
[Equation]
Proof.
For any point t ∈ supp( f ∗ ♯ p ) ∪ supp( f ∗ ♯ q ) , the values of the densities
[Equation]
Note that for all x : t − ε < f ∗ ( x ) < t + ε we have [Equation] which implies
[Equation]
Since these inequalities hold for all x : t − ε < f ∗ ( x ) < t + ε
[Equation]
the similar relationship holds for the integrals:
[Equation]
The ratio [ f ∗ ♯ p ]( t ) /
([ f ∗ ♯ p ]( t ) + [ f ∗ ♯ q ]( t )) can be expressed as
[Equation]
Using the inequality above we observe that
[Equation]
for all ε > 0 , and taking the limit ε ↓ 0 we obtain
[Equation]
Consider point x 1 ∈ [ − 2 , 2] .
The value f ∗ ( x 1 ) characterizes the ratio of densities p ( x 1 ) /
( p ( x 1 ) + q ( x 1 )) at x 1 .
For another point x 2 mapped to the same value f ∗ ( x 2 ) =
f ∗ ( x 1 ) =
t 1 , 2 , the ratio of densities p ( x 2 ) /
( p ( x 2 ) + q ( x 2 )) is the same as p ( x 1 ) /
( p ( x 1 ) + q ( x 1 )) .
All points x mapped to t 1 , 2 share the same ratio of the densities p ( x ) /
( p ( x ) + q ( x )) .
This fact implies that the ratio of the pushforward densities [ f ∗ ♯ p ]( t 1 , 2 ) /
([ f ∗ ♯ p ]( t 1 , 2 ) + [ f ∗ ♯ q ]( t 1 , 2 )) at t 1 , 2 must be the same as the ratio of densities p ( x 1 ) /
( p ( x 1 ) + q ( x 1 )) = t 1 , 2 at x 1 (or x 2 ).
The pushforward PDFs [ f ∗ ♯ q ]( t ) , [ f ∗ ♯ q ]( t ) satisfy property
[ f ∗ ♯ p ]( t ) /
([ f ∗ ♯ p ]( t ) + [ f ∗ ♯ q ]( t ))
=
t for all t ∈ supp( f ∗ ♯ p ) ∪ supp( f ∗ ♯ q ) .
Comment.
Intuitively this proposition states the following.
If for some x ∈ X we have f ∗ ( x ) =
t ∈ [0 , 1] , t directly corresponds to the ratio of densities not only in the original space t = p ( x ) /
( p ( x ) + q ( x )) , but also in the 1D discriminator output space t =
[ f ∗ ♯ p ]( t ) /
([ f ∗ ♯ p ]( t ) + [ f ∗ ♯ q ]( t )) .
We also provide an intuitive example in Figure A.1.
Proof of Proposition 4.3, statement #1.
= ⇒ :
If D W ( p, q ) = 0 then p = q , then f ∗ ♯ p = f ∗ ♯ q .
Thus, D W ( f ∗ ♯ p, f ∗ ♯ q ) = 0 .
⇐ = : If D W ( f ∗ ♯ p, f ∗ ♯ q ) = 0 , then f ∗ ♯ p = f ∗ ♯ q .
Consider probability of event (cid:8) t (cid:12)(cid:12) t > 12 (cid:9) under distribution f ∗ ♯ p .
[Equation]
dx, where I [ · ] is the indicator function ( I [ c ] equal to 1 when the condition c is satisfied, and equal tootherwise).
For all x : p ( x ) > 0 , we have that f ∗ ( x ) =
p ( x ) p ( x )+ q ( x ) and p ( x ) + q ( x ) > 0 .
Therefore, the expression above can be re-written as
[Equation]
Similarly, the probability of event (cid:8) t (cid:12)(cid:12) t > 12 (cid:9) under distribution f ∗ ♯ q is
[Equation]
f ∗ ♯ p = f ∗ ♯ q implies that
[Equation]
or equivalently
[Equation]
Note, that the function I [ p ( x ) − q ( x ) > 0]( p ( x ) − q ( x )) is non-negative for any x .
This means that the integral can be zero only if the function is zero everywhere implying that for any x either I [ p ( x ) − q ( x ) > 0]
= 0 or p ( x ) − q ( x ) = 0 .
In other words, p
[Equation]
Using the fact the both densities p ( x ) and q ( x ) must sum up to 1 , we conclude that p = q and
D W ( p, q ) = 0 .
Proof of Proposition 4.3, statement #2.
Note that by (2) and (15), we have
[Equation]
= ⇒ :
Suppose D β 1 ,β 2 W ( p, q ) = 0 .
Then supp( p ) = supp( q ) =
S (by Proposition 4.2) and supp( f ∗ ♯ p ) =
supp( f ∗ ♯ q )
=
T by (Theorem 2.1).
Moreover, D β 1 ,β 2 W ( p, q ) = 0 implies 1 + β 2 ≤ p ( x ) q ( x ) ≤ 1 + β 1 , ∀ x ∈ S.
Since
[Equation]
the inequalities above are equivalent to
[Equation]
Combined with Proposition A.1, the above implies that
[Equation]
or equivalently
[Equation]
Therefore, D β 1 ,β 2 W ( f ∗ ♯ p, f ∗ ♯ q ) = 0 .
⇐ = : similarly, when D β 1 ,β 2 W [Equation] f [Equation]
supp
[Equation] Moreover, [Equation] Therefore, D β 1 ,β 2 W ( p, q ) = 0 .
B A COMMENT ON “ SLICED ” SSD DIVERGENCE
Recent works (Deshpande et al., 2018; 2019) have proposed to perform optimal transport (OT)-based distribution alignment by reducing the OT problem (7) in the original, potentially high-dimensional space, to that between 1D distributions.
Specifically, Deshpande et al.
(2018) consider the sliced
Wasserstein distance (Rabin et al., 2011):
[Equation]
(16) where S n − 1 = { θ ∈ R n | ∥ θ ∥ = 1 } is a unit sphere in R n , and f θ is a 1D linear projection f θ ( x ) = ⟨ θ, x ⟩ .
It is known that D SW is a valid distribution divergence: for any p ̸
= q there exists a linear slicing function f θ , θ ∈ S n − 1 which identifies difference in the distributions, i.e. f θ♯ p ̸ = f θ♯ q (Cramér–Wold theorem).
By reducing the original OT problem to that in a 1D space, Wu et al.
(2019a) and Deshpande et al.
(2019) develop efficient practical methods for distribution alignment based on fast algorithms for the 1D OT problem.
Unfortunately, the straight-forward extension of SSD divergence (1) to a 1D linearly sliced version does not provide a valid support divergence.
Proposition B.1.
There exist two distributions p and q in P , such that supp( p ) ̸
= supp( q ) but supp( f θ♯ p ) =
supp( f θ♯ q ) , ∀ f θ ( x ) = ⟨ θ, x ⟩ with θ ∈ S n − 1 .
Proof.
Consider a 2-dimensional Euclidean space R 2 and let supp( p ) =
{ ( x, y ) | x 2 + y 2 ≤ 2 } and supp( q ) = { ( x, y ) | 1 ≤ x 2 + y 2 ≤ 2 } .
Then, ∀ f θ ( x ) = ⟨ θ, x ⟩ with θ ∈ S 1 , supp( f θ♯ p )
= supp( f θ♯ q ) =
[ − 2 , 2] .
This counterexample is shown in Figure B.1. [Figure] − [Figure]
p ( x ) [Figure] [Figure] −   q ( x )
C D ISCUSSION OF “ SOFT ” AND “ HARD ” ASSIGNMENTS WITH 1D DISCRETE DISTRIBUTIONS
In Section 4.2 we considered the “soft-assignment” relaxed OT problem (11) and claimed that for integer β , the set of minimizers of (11) must contain a “hard-assignment” transportation plan, meaning γ ij ∈ { 0 , 1 } , ∀ i, j .
Below we justify this claim.
Note that for β =
the OT problem (11) is the standard OT problem for Wasserstein-1 distance (10), since the inequality constraints (cid:80) mi =1 γ ij ≤ 1 , ∀ j can only be satisfied as equalities.
For this problem, it is known (e.g. see Peyré et al.
Proposition 2.1) that the set of optimal “soft-assignment” contains a “hard-assignment” represented by a normalized permutation matrix.
This fact can be proven using the Birkhoff–von Neumann theorem.
The Birkhoff–von Neumann theorem states that the set of doubly stochastic matrices
[Equation]
is exactly the set of all finite convex combinations of permutation matrices.
In the context of the linear program (11) with β = 0 , the Birkhoff–von Neumann theorem means that all extreme points of the polyhedron Γ β ( o p , o q ) are hard-assignment matrices.
Therefore, by the fundamental theorem of linear programming (Bertsimas & Tsitsiklis, 1997), the minimum of the objective is reached at a “hard-assignment” matrix.
We argue that a similar result holds for the case of integer β > 0 .
In this case, the matrices in Γ β ( o p , o q ) can not be associated with the doubly stochastic matrices, since constraints on of the marginals of γ are relaxed to inequality constraints.
Because of that, the Birkhoff–von Neumann theorem can not be applied.
However, Budish et al.
(2009) provide a generalization of the Birkhoff–von
Neumann theorem (Theorem 1 in (Budish et al., 2009)) which applies to the cases where the equality constraints are replaced with integer-valued inequality constraints (recall that we consider integer β ).
Using this generalized result, our claim can be proven by performing the following steps.
Clearly, the polyhedron Γ β ( o p , o q ) contains all “hard-assignment” matrices and all their finite convex combinations.
The result proven in (Budish et al., 2009)
implies that each element of Γ β ( o p , o q ) can be represented as a finite convex combination of “hard-assignment” matrices.
Thus, the polyhedron Γ β ( o p , o q ) is exactly the set of all finite convex combinations of “hard-assignment” matrices and all extreme points of the polyhedron are “hard-assignment” matrices.
Finally, by analogy with the case of β = 0 , we invoke the fundamental theorem of the linear programming and conclude that the minimum of the objective (11) is reached at γ corresponding to a “hard-assignment” matrix.
D E XPERIMENT DETAILS D. USPS TO MNIST EXPERIMENT SPECIFICATIONS
We use USPS (Hull, 1994) and MNIST (LeCun et al., 1998) datasets for this adaptation problem.
Following Tachet des Combes et al.
we use LeNet-like (LeCun et al., 1998) architecture for the feature extractor with the 500-dimensional feature representation.
The classifier consists of a single linear layer.
The discriminator is implemented by a 3-layer MLP with 512 hidden units and leaky-ReLU activation.
We train all methods for 65 000 steps with batch size 64 .
We train the feature extractor, the classifier, and the discriminator with SGD (learning rate 0 .
02 , momentum 0 .
9 , weight decay 5 · 10 − 4 ) .
We perform a single discriminator update per 1 update of the feature extractor and the classifier.
After the first 30 000 steps we linearly anneal the feature extractor’s and classifier’s learning rates for 30steps to the final value 2 · 10 − 5 .
The feature extractor’s loss is given by a weighted combination of the cross-entropy classification loss on the labeled source example and a domain alignment loss computed from the discriminator’s signal (recall that different method use different forms of the alignment loss).
The weight for the classification term is constant and set to λ cls = 1 .
We introduce schedule for the alignment weight λ align .
For all alignment methods we linearly increase λ align from 0 to 1 .
during the first 10000 steps.
For ASA we use history buffers of size 1000.
D. STL TO CIFAR EXPERIMENT SPECIFICATIONS
We use STL (Coates et al., 2011) and CIFAR-10 (Krizhevsky, 2009) for this adaptation task.
STL and CIFAR-10 are both 10-class classification problems.
There are 9 common classes between the two datasets.
Following Shu et al.
we create a 9-class classification problem by selecting the subsets of examples of the 9 common classes.
For the feature extractor, we adapt the deep CNN architecture of Shu et al.
The feature representation is a 192 -dimensional vector.
The classifier consists of a single linear layer.
The discriminator is implemented by a 3-layer MLP with 512 hidden units and leaky-ReLU activation.
We train all methods for 40 000 steps with batch size 64 .
We train the feature extractor, the classifier, and the discriminator with ADAM (Kingma & Ba, 2014) (learning rate 0 .
001 , β 1 = 0 .
5 , β 2 = 0 .
999 , no weight decay).
We perform a single discriminator update per 1 update of the feature extractor and the classifier.
The weight for the classification loss term is constant and set to λ cls = 1 .
For all alignment methods we use constant alignment weight λ align = 0 .
For ASA we use history buffers of size 1000.
Conditional entropy loss.
Following (Shu et al., 2018)
we use auxiliary conditional entropy loss on target examples for domain adaptation methods.
For a classifier C ϕ : Z → Y and a feature extractor F θ :
X → Z where classifier outputs the distribution over class labels { 1 , . .
, K }
[Equation]
the conditional entropy loss on target examples { x qi } N q i =1 is given by
[Equation]
λ ent is the weight of the conditional entropy loss in the total training objective.
This loss acts as an additional regularization of the embeddings of the unlabeled target examples: minimization of the conditional entropy pushes target embeddings away from the classifier’s decision boundary.
For all domain adapation methods we use the conditional entropy loss
D. E XTENDED EXPERIMENTAL RESULTS ON STL TO CIFAR
Effect of conditional entropy loss.
In order to quantify the improvements of the support alignment objective and the conditional entropy objective in separation, we conduct an ablation study.
In addition to the results reported in Section 5, we evaluate all domain adaptation methods (except
VADA which uses the conditional entropy in the original implementation) on STL → CIFAR task without the conditional entropy loss ( λ ent = 0 ).
The results of the ablation study are presented in
Table D.1.
We observe that the effect of the auxiliary conditional entropy is essentially the same for all methods across all imbalance levels: with λ ent = 0 .
1 the accuracy either improves (especially the average class accuracy) or roughly stays on the same level.
The relative ranking of distribution alignment, relaxed distribution alignment
[Table]
and support alignment methods is the same with both λ ent = 0 and λ ent = 0 .
The results demonstrate that the benefits of support alignment approach and conditional entropy are orthogonal.
[Table]
Comparison with optimal transport based baselines.
We provide additional experimental results comparing our method with OT-based methods for domain adaptation.
We implement two OT-based methods which we describe below.
• The first method is a variant of the max-sliced Wasserstein distance (which was proposed for GAN training by Deshpande et al.
for domain adaptation.
In the table below we refer to this method as DANN-OT.
In our implementation DANN-OT minimizes the Wasserstein distance between the pushforward distributions g ∗ ♯ p , g ∗ ♯ q induced by the optimal log-loss discriminator g ∗ (4).
As discussed in Section 4.2 (paragraph “Distribution alignment”)
the computation of the Wasserstein distance between 1D distributions can be implemented efficiently via sorting.
• The second method is an OT-based variant of DANN which uses a dual Wasserstein discriminator instead of the log-loss discriminator.
In the table below we refer to this method as DANN-WGP.
This method minimizes the Wasserstein distance in its dual Kantorovich form.
We train the discriminator with the Wasserstein dual objective and a gradient penalty proposed to enforce Lipshitz-norm constraint (Gulrajani et al., 2017).
We present the evaluation results of the OT-based methods on STL → CIFAR domain adaptation task in the Table D.2.
Note that the OT-based methods aim to enforce distribution alignment constraints.
We observe that the OT-based methods follow the same trend as DANN: they deliver improved accuracy compared to No DA in the balanced setting, but suffer in the imbalanced settings ( α > 0 ) due to their distribution alignment nature.
We would also like to make a comment on OT-based relaxed distribution alignment.
Wu et al.
(2019b)
propose method
WDANN- β which minimizes the dual form of the asymmetrically-relaxed
[Table]
ASA
[Table]
Wasserstein distance.
However, they observe that sDANN- β outperforms WDANN-
β in experiments.
Hence, we use sDANN- β as a relaxed distribution alignment baseline in our experiments.
Effect of alignment weight.
We provide additional experimental results comparing ASA with
DANN and VADA across different values of the alignment loss weight λ align on STL → CIFAR task.
The results are shown in Table D.3.
DANN with a higher alignment weight λ align = 1 . 0 performs better in the balanced ( α = 0 ) setting and worse in the imbalanced ( α > 0 ) setting compared to a lower weight λ align = 0 .
1 , as the distribution alignment constraint is enforced stricter.
VADA optimizes a combination of distribution alignment + VAT (virtual adversarial training) objectives (Shu et al., 2018), and we observe the same trend: with lower alignment weight λ align = 0 .
01 , VADA performs worse in the balanced setting and better in the imbalanced setting compared to a higher weight λ align = 0 .
Weight λ align
= 0 .
1 is a middle ground between having poor performance in the imbalanced setting ( λ align = 1 . 0 ) and not sufficiently enforcing distribution alignment ( λ align = 0 . 01 ).
The role of VAT (similarly to that of conditional entropy loss) is orthogonal to alignment objectives.
Thus, we provide additional evaluations of combining support alignment and VAT (the “ASA-sq + VAT” entry in Table D.3) with alignment weight λ align = 1 . 0 .
The good performance of such combination shows that:
• One could improve our current support alignment performance by using auxiliary objectives.
• Support alignment based method performs qualitatively different from distribution alignment based method, since the performance holds with stricter support alignment while distribution alignment needs to loosen the constraints considerably to reduce the performance degradation in the imbalanced setting.
[Table]
D. V IS DA-17 EXPERIMENT SPECIFICATIONS
We use train and validation sets of the VisDA-17 challenge (Peng et al., 2017).
For the feature extractor we use ResNet-50 He et al.
(2016) architecture with modified output size of the final linear layer.
The feature representation is 256-dimensional vector.
We use the weights from pre-trained ResNet-50 model ( torchvision model hub) for all layers except the final linear layer.
The classifier consists of a single linear layer.
The discriminator is implemented by a 3-layer MLP with 1024 hidden units and leaky-ReLU activation.
We train all methods for 50 000 steps with batch size 36 .
We train the feature extractor, the classifier, and the discriminator with SGD.
For the feature extractor we use learning rate 0 .
001 , momentum 0 .
9 , weight decay 0 .
For the classifier we use learning rate 0 .
01 , momentum 0 .
9 , weight decay 0 .
For the discriminator we use learning rate 0 . 005 , momentum 0 .
9 , weight decay 0 .
We perform a single discriminator update per 1 update of the feature extractor and the classifier.
We linearly anneal the feature extractor’s and classifier’s learning rate throughout the training ( 50 000 ) steps.
By the end of the training the learning rates of the feature extractor and the classifier are decreased by a factor of 0 . 05 .
The weight for the classification term is constant and set to λ cls = 1 .
We introduce schedule for the alignment weight λ align .
For all alignment methods we linearly increase λ align from 0 to 0 .
1 during the first 10000 steps.
For all methods we use auxiliary conditional entropy loss on target examples with the weight λ ent = 0 . 1 .
For ASA we use history buffers of size 1000.
D. H ISTORY SIZE EFFECT AND EVALUATION OF SUPPORT DISTANCE
History size effect .
To quantify the effects of mini-batch training mentioned in Section 3, we explore different sizes of history buffers on USPS → MNIST task with the label distribution shift α = 1 . 5 .
The results are presented in Figure D.1 and Table D.4.
Figure D.2 shows the distributions of outputs of the learned discriminator at the end of the training.
While without any alignment objectives neither the densities nor the supports of g ψ♯ p θZ and g ψ♯ q θZ are aligned, both alignment methods approximately satisfy their respective alignment constraints.
Compared with DANN results, ASA with small history size performs similarly to distribution alignment, while all history sizes are enough for support alignment.
We also observe the correlation between distribution distance and target accuracy: under label distribution shifts, the better distribution alignment is achieved, the more target accuracy suffers.
Note that with too big history buffers (e.g. n = 5000 ), we observe a sudden drop in performance and increases in distances.
We hypothesize that this could be caused by the fact that the history buffer stores discriminator output values from the past steps while the discriminator parameters constantly evolve during training.
As a result, for a large history buffer, the older items might no longer accurately represent the current pushforward distribution as they become outdated.
[Figure]
DANN methods.
Direct evaluation of support distance.
In order to directly evaluate the ability of ASA (with history buffers) to enforce support alignment, we consider the setting of the illustrative experiment described in Section 5 (3-class USPS → MNIST adaptation with 2D feature extractor, α = 1 . 5 ).
We compare methods No DA, DANN, and ASA-abs (with different history buffer sizes).
For each method we consider the embedding space of the learned feature extractor at the end of training and compute
Wasserstein distance D W ( p θZ , q θZ ) and SSD divergence D △ ( p θZ , q θZ ) between the embeddings of source and target domain (note that we compute the distances in the original embedding space directly without projecting data to 1D with the discriminator).
To ensure meaningful comparison of the distances between different embedding spaces, we apply a global affine transformation for each embedding space: we center the embeddings so that their average is 0 and re-scale them so that their average norm is 1.
The results of this evaluation are shown in Table D.5.
We observe that, compared to no alignment and distribution alignment (DANN) methods, ASA aligns the supports without necessarily aligning the distributions (in this imbalanced setting, distribution alignment implies low adaptation accuracy).
[Table]
[Figure] [Table] [Figure] [Table]
[Figure] [Table] [Figure] [Table]
[Figure] [Table] [Figure] [Table]
[Figure] [Table] [Figure] [Table]