C ONTROLLING DIRECTIONS ORTHOGONAL TO A CLASSIFIER
A BSTRACT
We propose to identify directions invariant to a given classiﬁer so that these directions can be controlled in tasks such as style transfer.
While orthogonal decomposition is directly identiﬁable when the given classiﬁer is linear, we formally deﬁne a notion of orthogonality in the non-linear case.
We also provide a surprisingly simple method for constructing the orthogonal classiﬁer (a classiﬁer utilizing directions other than those of the given classiﬁer).
Empirically, we present three use cases where controlling orthogonal variation is important: style transfer, domain adaptation, and fairness.
The orthogonal classiﬁer enables desired style transfer when domains vary in multiple aspects, improves domain adaptation with label shifts and mitigates the unfairness as a predictor.
The code is available at https://github.com/Newbeeer/orthogonal_classifier .
I NTRODUCTION
Many machine learning applications require explicit control of directions that are orthogonal to a predeﬁned one.
For example, to ensure fairness, we can learn a classiﬁer that is orthogonal to sensitive attributes such as gender or race (Zemel et al., 2013; Madras et al., 2018).
Similar, if we transfer images from one style to another, content other than style should remain untouched.
Therefore images before and after transfer should align in directions orthogonal to style.
Common to these problems is the task of ﬁnding an orthogonal classiﬁer.
Given any principal classiﬁer operating on the basis of principal variables , our goal is to ﬁnd a classiﬁer, termed orthogonal classiﬁer , that predicts the label on the basis of orthogonal variables , deﬁned formally later.
The notion of orthogonality is clear in the linear case.
Consider a joint distribution P XY over X ∈ R d and binary label Y .
Suppose the label distribution is Bernoulli, i.e . , P Y = B
( Y ;0 . 5 ) and class-conditional distributions are Gaussian, P X ∣ Y
=
y =
N( X ; µ y ,σ 2 y I ) , where the means and variances depend on the label.
If the principal classiﬁer is linear, w 1 =
Pr ( Y = 1 ∣ θ ⊺ 1 x ) , any classiﬁer w 2 , in the set W 2 = { Pr ( Y =∣ θ ⊺ 2 x ) ∣ θ ⊺ 1 θ 2 = 0 } , is considered orthogonal to w 1 .
Thus the two classiﬁers w 1 ,w 2 , with orthogonal decision boundaries (Fig. 1) focus on distinct but complementary attributes for predicting the same label.
Finding the orthogonal classiﬁer is no longer straightforward in the non-linear case.
To rigorously deﬁne what we mean by the orthogonal classiﬁer, we ﬁrst introduce the notion of mutually orthogonal random variables that correspond to (conditinally) independent latent variables mapped to observations through a diffeomorphism (or bijection if discrete).
Each r.v. is predictive of the label but represents complementary information.
Indeed, we show that the orthogonal random variable maximizes the conditional mutual information with the label given the principal counterpart, subject to an independence constraint that ensures complementarity.
Our search for the orthogonal classiﬁer can be framed as follows: given a principal classiﬁer w 1 using some unknown principal r.v. for prediction, how do we ﬁnd its orthogonal classiﬁer w 2 relying solely on orthogonal random variables?
The solution to this problem, which we call classiﬁer orthogonalization , turns out to be surprisingly simple.
In addition to the principal classiﬁer, we assume access to a full classiﬁer w x
that predicts the same label based on all the available information, implicitly relying on both principal and orthogonal latent variables.
The full classiﬁer can be trained normally, absent of constraints 1 .
We can then effectively “subtract” the contribution of w 1 from the full classiﬁer to obtain the orthogonal classiﬁer w 2 which we denote as w 2 = w x ∖ w 1 .
The advantage of this construction is that
2 1 0 1 2 3 4 5 x 1       xp ( x | Y =0) p ( x | Y =1) 2 1 0 1 2 3 4 5 x 1       x2 1 0 1 2 3 4 5 x 1       x2 1
1 2 3 4 5 x 1       x
[Figure]
we do not need to explicitly identify the underlying orthogonal variables.
It sufﬁces to operate only on the level of classiﬁer predictions.
We provide several use cases for the orthogonal classiﬁer, either as a predictor or as a discriminator.
As a predictor, the orthogonal classiﬁer predictions are invariant to the principal sensitive r.v., thus ensuring fairness.
As a discriminator, the orthogonal classiﬁer enforces a partial alignment of distributions, allowing changes in the principal direction.
We demonstrate the value of such discriminators in 1) controlled style transfer where the source and target domains differ in multiple aspects, but we only wish to align domain A’s style to domain B, leaving other aspects intact; 2) domain adaptation with label shift where we align feature distributions between the source and target domains, allowing shifts in label proportions.
Our results show that the simple method is on par with the state-of-the-art methods in each task.
N OTATIONS AND D EFINITION
Symbols.
We use the uppercase to denote random variable ( e.g . , data X , label Y ), the lowercase to denote the corresponding samples and the calligraphic letter to denote the sample spaces of r.v., e.g . , data sample space X .
We focus on the setting where label space Y is discrete, i.e . , Y = { 1 , ⋯ ,C } , and denote the C − 1 dimensional probability simplex as ∆ C .
A classiﬁer w ∶ X → ∆ C is a mapping from sample space to the simplex.
Its y -th dimension w ( x ) y denotes the predicted probability of label y for sample x .
Distributions.
For random variables A,B , we use the notation p A , p A ∣ B , p AB to denote the marginal/conditional/joint distribution, i.e . ,
p A ( a ) =
p ( A = a ) , p A ∣ B ( a ∣ b ) = p ( A = a ∣ B = b ) , p AB ( a,b ) = p ( A = a,B = b ) .
Sometimes, for simplicity, we may ignore the subscript if there is no ambiguity, e.g . , p ( a ∣ b ) is an abbreviation for p A ∣ B ( a ∣ b ) .
We begin by deﬁning the notion of an orthogonal random variable.
We consider continuous X,Z 1 ,Zand assume their supports are manifolds diffeomorphic to the Euclidean space.
The probability density functions (PDF) are in C 1 .
Given a joint distribution p XY , we deﬁne the orthogonal random variable as follows:
Deﬁnition 1 (Orthogonal random variables) .
We say Z 1 and Z 2 are orthogonal random variables w.r.t p XY if they satisfy the following properties:
(i)
There exists a diffeomorphism f
∶ Z 1 × Z 2 → X such that f ( Z 1 ,Z 2 ) =
X .
(ii) Z 1 and Z 2 are statistically independent given Y , i.e . , Z 1 ⊥⊥ Z 2 ∣ Y .
The orthogonality relation is symmetric by deﬁnition.
Note that the orthogonal pair perfectly reconstructs the observations via the diffeomorphism f ; as random variables they are also sampled independently from class conditional distributions p
( Z 1 ∣ Y ) and p ( Z 2 ∣ Y ) .
For example, we can regard foreground objects and background scenes in natural images as being mutually orthogonal random variables.
Remark.
The deﬁnition of orthogonality can be similarly developed for discrete variables and discretecontinuous mixtures.
For discrete variables, for example, we can replace the requirement of diffeomorphism with bijection.
Since the diffeomorphism f is invertible, we can use z 1 ∶ X → Z 1 and z 2 ∶ X → Z 2 to denote the two parts of the inverse mapping so that Z 1 =
z 1 ( X ) and Z
= z 2 ( X ) .
Note that, for a given joint distribution p XY , the decomposition into orthogonal random variables is not unique.
There are multiple pairs of random variables that represent valid mutually orthogonal latents of the data.
We can further justify our deﬁnition of orthogonality from an information theoretic perspective by showing that the choice of zattains the maximum of the following constrained optimization problem.
Proposition 1.
Suppose the orthogonal r.v. of z 1 ( X ) w.r.t p XY exists and is denoted as z 2 ( X ) .
Then z ( X ) =
z 2 ( X ) is a maximizer of I ( z ( X ) ; Y ∣ z 1 ( X )) subject to I ( z ( X ) ; z 1 ( X )∣ Y )
= 0 .
We defer the proof to Appendix B.1.
Proposition 1 shows that the orthogonal random variable maximizes the additional information about the label we can obtain from X while remaining conditionally independent of the principal random variable.
This ensures complementary in predicting the label.
C ONSTRUCTING THE O RTHOGONAL C LASSIFIER
Let Z 1 =
z 1 ( X ) and Z
= z 2 ( X ) be mutually orthogonal random variables w.r.t p XY .
We call Z 1 the principal variable and Z 2 the orthogonal variable.
In this section, we describe how we can construct the Bayes optimal classiﬁer operating on features Z 2 from the Bayes optimal classiﬁer relying on Z 1 .
We formally refer to the classiﬁers of interests as: (1) principal classiﬁer w 1 ( x ) y
= p ( Y =
y ∣ Z 1 =
z 1 ( x )) ; (2) orthogonal classiﬁer w 2 ( x ) y
= p ( Y =
y ∣ Z 2 =
z 2 ( x ))
; (3) full classiﬁer w x ( x ) y
= p ( Y =
y ∣ X = x ) .
3. C LASSIFIER ORTHOGONALIZATION
Our key idea relies on the bijection between the density ratio and the Bayes optimal classiﬁer (Sugiyama et al., 2012).
Speciﬁcally, the ratio of densities p X ∣ Y ( x ∣ i ) and p X ∣ Y ( x ∣ j ) , assigned to an arbitrary point x , can be represented by the Bayes optimal classiﬁer w ( x ) i =
Pr ( Y = i ∣ x ) as p X ∣ Y ( x ∣ i )
p X ∣ Y ( x ∣ j ) =
p Y ( j ) w ( x ) i p Y
( i ) w ( x ) j .
Similar, the principal classiﬁer w 1 gives us associated density ratios of class-conditional distributions over Z 1 .
For any i,j ∈ Y , we have p Z 1 ∣ Y ( z 1 ( x )∣ i )
p
Z 1 ∣ Y ( z 1 ( x )∣ j ) =
p Y ( j ) w 1 ( x ) i p Y
( i )
w 1 ( x ) j .
These can be combined to obtain density ratios of class-conditional distribution p Z 2 ∣ Y and subsequently calculate the orthogonal classiﬁer w 2 .
We additionally rely on the fact that the diffeomorphism f permits us to change variables between x and z 1 ,z 2 : p X ∣ Y ( x ∣ [Equation] ) = [Equation]
∣
[Equation]
z
[Equation]
∣
[Equation]
Y
[Equation]
z
[Equation]
∗ vol J f ( z 1 ,z 2 ) , where vol J f is volume of the Jacobian (Berger et al., 1987) of the diffeomorphism mapping.
Taken together,
[Equation]
Note that since the diffeomorphism f is shared with all classes, the Jacobian is the same for all labelconditioned distributions on Z 1 ,Z 2 .
Hence the Jacobian volume terms cancel each other in the above equation.
We can then ﬁnally work backwards from the density ratios of p Z 2 ∣ Y to the orthogonal classiﬁer:
[Equation]
We call this procedure classiﬁer orthogonalization since it adjusts the full classiﬁer w x to be orthogonal to the principal classiﬁer w 1 .
The validity of this procedure requires overlapping supports of the classconditional distributions, which ensures the classiﬁer outputs w x
( x ) i ,w 1 ( x ) i to remain non-zero for all x ∈ X ,i ∈ Y .
Empirically, we usually have access to a dataset D = {( x t ,y t )} nt
= 1 with n iid samples from the joint distribution p
XY .
To obtain the orthogonal classiﬁer, we need to ﬁrst train the full classiﬁer ˆ w x based on the dataset D .
We can then follow the classiﬁer orthogonalization to get an empirical orthogonal classiﬁer, denoted as w
=
ˆ w x ∖ w 1 .
We use symbol ∖ to emphasize that the orthogonal classiﬁer uses complementary information relative to z 1 .
Algorithm 1 summarizes the construction of the orthogonal classiﬁer.
Generalization bound.
Since w x is trained on a ﬁnite dataset, we consider the generalization bound of the constructed orthogonal classiﬁer.
We denote the population risk as R ( w ) =
− E p XY ( x,y ) [ log w ( x ) y ] and the empirical risk as ˆ R ( w ) = − 1 ∣D∣ ∑ ( x i ,y i )∈D log w ( x i )
y i .
For a function family W whose elements map X to the simplex ∆ C , we deﬁne ˆ w x = inf w x ∈W ˆ R ( w x ) ,w ∗ x = inf w x ∈W R ( w x ) .
We further denote the Rademacher complexity of function family W with sample size ∣D∣ as R ∣D∣ (W) .
Input: principal classiﬁer w 1 , dataset D .
Train an empirical full classiﬁer ˆ w x on D by empirical risk minimization.
Construct an orthogonal classiﬁer ˆ w x ∖ w 1 via classiﬁer orthogonalization (Eq.
return the empirical orthogonal classiﬁer ˆ w 2 =
ˆ w x ∖ w
Theorem 1.
Assume p y is uniform distribution, ∀ w x ∈ W takes values in ( m, 1 − m ) C with m ∈ ( 0 , 12 ) , and 1 / p X ∣ Y ( x ∣ y ) ∈ ( 0 ,γ ) ⊂ ( 0 , +∞) holds for ∀ x ∈ X ,y ∈ Y .
Then for any δ ∈ ( 0 , 1 ) with probability at least− δ , we have: [Equation] ¿`
[Equation]
Theorem 1 shows that the population risk of the empirical orthogonal classiﬁer in Algorithm 1 would be close to the optimal risk if the maximum value of the reciprocal of class-conditioned distributions 1 / p X ∣ Y ( x ∣ y ) and the Rademacher term are small.
Typically, the Rademacher complexity term satisﬁes R ∣D∣ (W) =
O(∣D∣ − 1 2 ) (Bartlett & Mendelson, 2001; Gao & Zhou, 2016).
We note that the empirical full classiﬁer may fail in speciﬁc ways that are harmful for our purposes.
For example, the classiﬁer may not rely on all the key features due to simplicity bias as demonstrated by (Shah et al., 2020).
There are several ways that this effect can be mitigated, including Ross et al.
; Teney et al.
3. A LTERNATIVE METHOD : IMPORTANCE SAMPLING
An alternative way to get the orthogonal classiﬁer is via importance sampling.
For each sample point ( x,y ) , we construct its importance φ ( x,y ) ∶=
[Equation]
( x )) p Z 1 ∣ Y ( z 1 ( x )∣ y ) .
Via Bayes’ rule, the importance φ ( x,y ) can be calculated from the principal classiﬁer by φ ( x,y ) =
p Y ( y ) w 1 ( x ) y .
We deﬁne the importance sampling (IS) objective as L IS ( w ) ∶=
E x,y ∼ p XY [ φ ( x,y ) log w ( x ) y ] .
It can be shown that the orthogonal classiﬁer w 2 maximizes the IS objective, i.e . , w 2 = arg max L IS .
However, the importance sampling method has an Achilles’ heel: variance.
A few bad samples with large weights can drastically deviate the estimation, which is problematic for mini-batch learning in practice.
We provide an analysis of the variance of the IS objective.
It shows the variance increases with the divergences between Z 1 ’s marginal and its label-conditioned marginals, { D f ( p Z 1 ∣∣ p Z 1 ∣ Y =
y )} Cy = 1 even when the learned classiﬁer w is approaching the optimal classiﬁer, i.e . , w ≈ w 2 .
Let ̂L n IS ( w ) ∶= 1 n ∑ nt = 1 φ ( x t ,y t ) log w ( x t )
y t be the empirical IS objective estimated with n iid samples.
Clearly, Var (̂L n IS ( w ))
= 1 n Var (̂L 1 IS ( w )) .
While Var (̂L 1 IS ( w )) at w = w 2 is the following,
[Equation]
where D f is the Pearson χ 2 -divergence.
The expression indicates that the variance grows linearly with the expected divergence.
In contrast, the divergences have little effect when training the empirical full classiﬁer in classiﬁer orthogonalization.
We provide further experimental results in section 4.1.2 to demonstrate that classiﬁer orthogonalization has better stability than the IS objective with increasing divergences and learning rates.
O RTHOGONAL C LASSIFIER FOR C ONTROLLED S TYLE T RANSFER
In style transfer, we have two domains A,B with distributions P XY ,Q XY .
We use binary label Y to indicate the domain of data X (0 for domain A , 1 for domain B ).
Assume Z 1 and Z 2 are mutually orthogonal variables w.r.t both P XY and Q XY .
The goal is to conduct controlled style transfer between the two domains.
By controlled style transfer, we mean transferring domain
A ’s data to domain B only via making changes on partial latent ( Z 1 ) while not touching the other latent ( Z 2 ).
Mathematically, we aim to transfer the latent distribution from P Z 1 P Z 2 to Q Z 1 P Z 2 .
This task cannot be achieved by traditional style transfer algorithms such as CycleGAN (Zhu et al., 2017), since they directly transfer data distributions from P X to Q X , or equivalently from the perspective of latent distributions, from P Z 1 P Zto Q Z 1 Q Z 2 .
Below we show that the orthogonal classiﬁer w x ∖ w 1 enables such controlled style transfer.
Our strategy is to plug the orthogonal classiﬁer into the objective of CycleGAN.
The original CycleGAN objective deﬁnes a min-max game between two generators/discriminator pairs G AB / D AB and
[Figure]
[Figure]
G BA / D BA .
G AB transforms the images from domain A to domain B .
We use ̃ P to denote the generative distribution, i.e . , G AB ( X ) ∼ ̃ P for X ∼ P .
Similarly, ̃ Q denotes the generative distribution of generator
G BA .
The minimax game of CycleGAN is given by
[Equation]
where GAN losses L AB GAN , L BA GAN minimize the divergence between the generative distributions and the targets, and the cycle consistency loss L cyc is used to regularize the generators (Zhu et al., 2017).
Concretely, the GAN loss L AB GAN is deﬁned as follows,
[Equation]
Now we tilt the GAN losses in CycleGAN objective to guide the generators to perform controlled transfer.
Specially, we replace L AB GAN in Eq.
(3) with the orthogonal GAN loss L AB OGAN when updating the generator
G AB :
[Equation]
where φ ( D AB ( x ) ,r ( x ))
=
D
[Equation] ( x [Equation] r ( x ) ( 1 − D AB ( x ))
+ D AB ( x ) r ( x ) and r ( x ) =
w x ∖ w 1 ( x )
w x ∖ w 1 ( x ) 1 .
Consider an extreme case where we allow the model to change all latents, i.e . , z 1 ( x ) = x .
As a result, L OGAN degenerates to the original L GAN since w x ∖ w 1 ≡ 12 and φ ( D AB ( x ) ,r ( x )) ≡ D AB ( x ) .
The other orthogonal GAN loss L BA OGAN can be similarly derived.
For a given generator G AB , the discriminator’s optimum is achieved at D ∗ AB ( x ) =
Q ( x )/
( ̃ P ( x ) + Q ( x )) .
Assuming the discriminator is always trained to be optimal, the generator G AB can be viewed as optimizing the following virtual objective: L AB OGAN ( G AB ) ∶=
L AB OGAN ( G AB ,D ∗ AB ) =
E x ∼̃ P log ̃ P ( x ) ̃ P ( x )+ Q ( x ) r ( x ) .
The optimal generator in the new objective satisﬁes the following property.
Proposition 2.
The global minimum of L AB OGAN ( G AB ) is achieved if and only if ̃
P Z 1 ,Z 2 ( z 1 ,z 2 ) =
Q Z 1 ( z 1 ) P Z 2 ( z 2 ) .
We defer the proof to Appendix B.4.
The proposition states that the new objective L AB OGAN converts the original global minimum Q Z 1 Q Z 2 in L AB GAN to the desired one Q Z 1 P Z 2 .
The symmetric statement holds for L BA OGAN ( G BA ) .
4. E XPERIMENTS 4.1. S ETUP
Datasets.
(a) CMNIST : We construct C(olors)MNIST dataset based on MNIST digits (LeCun & Cortes, 2005).
CMNIST has two domains and 60000 images with size ( 3 , 28 , 28 ) .
The majority of the images in each domain will have a digit color and a background color correspond to the domain: domain A ↔ “red digit/green background” and domain B ↔ “blue digit/brown background”.
We deﬁne two bias degree s λ d , λ b to control the probability of the images having domain-associated colors, e.g . , for an image in domain A, with λ d probability, its digit is set to be red; otherwise, its digit color is randomly red or blue.
The background colors are determined similarly with parameter λ b .
In our experiments, [Table] [Table] we set λ d = 0 .
9 and λ b = 0 . 8 .
Our goal is to transfer the digit color ( Z 1 ) while leaving the background color ( Z 2 ) invariant.
(b) CelebA-GH : We construct the CelebA-G(ender)H(air) dataset based on the gender and hair color attributes in CelebA (Liu et al., 2015).
CelebA-GH consists of 110919 images resized to ( 3 , 128 , 128 ) .
In CelebA-GH, domain A is non-blond-haired males, and the domain B is blond-haired females.
Our goal is to transfer the facial characteristic of gender ( Z 1 ) while keeping the hair color ( Z 2 ) intact.
Models.
We compare variants of orthogonal classiﬁers to the vanilla CycleGAN ( Vanilla ) and the importance sampling objective ( IS ).
We consider two ways of obtaining the w 1 classiﬁer: (a) Oracle:
The principal classiﬁer w 1 is trained on an oracle dataset where Z 1 is the only discriminative direction, e.g . , setting bias degrees λ d = 0 .
9 and λ b = 0 in CMNIST such that only digit colors vary across domains.
(b) Domain generalization: Domain generalization algorithms aim to learn the prediction mechanism that is invariant across environments and thus generalizable to unseen environments (Blanchard et al., 2011; Arjovsky et al., 2019).
The variability of environments is considered as nuisance variation.
We construct environments such that only Y ∣ Z 1 is invariant.
We defer details of the environments to Appendix E.1.
We use three domain generalization algorithms, Fish (Shi et al., 2021), TRM (Xu & Jaakkola, 2021) and MLDG (Li et al., 2018), to obtain w 1 .
We indicate different approaches by the parentheses after w x ∖ wand IS, e.g . , w x ∖ w 1 (Oracle) is the orthogonal classiﬁer with w 1 trained on Oracle datasets.
Metric.
We use three metrics for quantitative evaluation: 1) Z 1 accuracy: the success rate of transferring an image’s latent
z
1 from domain A to domain B; 2) Z 2 accuracy: percentage of transferred images whose latents z 2 are unchanged; 3) FID scores: a standard metric of image quality (Heusel et al., 2017).
We only report FID scores on the CelebA-GH dataset since it is not common to compute FID on MNIST images.
Z 1 ,Z 2 accuracies are measured by two oracle classiﬁers that output an image’s latents z 1 and z 2 (Appendix E.1.3).
For more details of datasets, models and training procedure, please refer to Appendix E.
4.1. R ESULTS
Comparison to IS.
In section 3.2, we demonstrate that IS suffers from high variance when the divergences of the marginal and the label-conditioned latent distributions are large.
We provide further empirical evidence that our classiﬁer orthogonalization method is more robust than IS.
Fig.
2(a) shows that the test loss of IS increases dramatically with the divergences.
Fig.
2(b) displays that IS’s test loss grows rapidly when enlarging learning rate, which corroborates the observation that gradient variances are more detrimental to the model’s generalization with larger learning rates (Wang et al., 2013).
In contrast, the test loss of w x ∖ w 1 remains stable with varying divergences and learning rates.
In Fig. 2(c), we visualize the histograms of predicted probabilities of w x ∖ w 1 (light color) and IS (dark color).
We observe that the predicted probabilities of w x ∖ w 1 better concentrates around the ground-truth probabilities (red lines).
Main result.
As shown in Table 1 and 2, adding an orthogonal classiﬁer to the vanilla CycleGAN signiﬁcantly improves its z 2 accuracy (from 14 to 90 + in CMNIST, from 16 to 40 + in CelebA-GH) while incurring a slight loss of the image quality.
We observe that the oracle version of orthogonal classiﬁer ( w x ∖ w 1 (Oracle)) achieves best z 2 accuracy on both datasets.
In addition, class orthogonalization is compatible with domain generalization algorithms when the prediction mechanism Z 1 ∣ Y is invariant across collected environments.
In Fig.
3, we visualize the transferred samples from domain A.
We observe that vanilla CycleGAN models change the background colors/hair colors along with digit colors/facial characteristics in CMNIST and CelebA.
In contrast, orthogonal classiﬁers better preserve the orthogonal aspects Z 2 in the input images.
We also provide visualizations for domain B in Appendix C. I npu t V a n [Figure]
O RTHOGONAL C LASSIFIER FOR D OMAIN ADAPTATION
In unsupervised domain adaptation, we have two domains, source and target with data distribution p s , p t .
Each sample comes with three variables, data X , task label
Y and domain label U .
We assume U is uniformly distributed in { 0 (source), 1 (target) } .
The task label is only accessible in the source domain.
Consider learning a model
h
= g
○ f that is the composite of the encoder f
∶ X → Z and the predictor g ∶ Z → Y .
A common practice of domain adaptation is to match the two domain’s feature distributions p s ( f ( X )) ,p t ( f ( X )) via domain adversarial training (Ganin & Lempitsky, 2015; Long et al., 2018; Shu et al., 2018).
The encoder f is optimized to extract useful feature for the predictor while simultaneously bridging the domain gap via the following domain adversarial objective:
[Equation]
(4) where discriminator D ∶ Z → [ 0 , 1 ] distinguishes features from two domains.
The equilibrium of the objective is achieved when the encoder perfectly aligns the two domain, i.e . , p s ( f ( x ))
=
p t ( f ( x )) .
We highlight that such equilibrium is not desirable when the target domain has shifted label distribution (Azizzadenesheli et al., 2019; des Combes et al., 2020).
Instead, when the label shift appears, it is more preferred to align the conditioned feature distribution, i.e . , p s ( f ( x )∣ y ) =
p t ( f ( x )∣ y ) , ∀ y ∈ Y .
Now we show that our classiﬁer orthogonalization technique can be applied to the discriminator for making it “orthogonal to” the task label.
Speciﬁcally, consider the original discriminator as full classiﬁer w x , i.e . , for a given f , w x ( x ) 0 = arg max D L( f,D )
= p s ( f ( x ))
p s ( f ( x ))
+ p t ( f ( x )) .
We then construct the principle classiﬁer w 1 that discriminates the domain purely via the task label Y , i.e . , w 1 ( x )
=
Pr ( U =
∣ Y =
y ( x )) .
Note that here we assume the task label Y can be determined by the data X , i.e . , Y = y
( X ) .
We focus on the case that Y is discrete so w 1 could be directly computed via frequency count.
We propose to train the encoder f with the orthogonalized discriminator w x ∖ w 1 ,
[Equation]
Proposition 3.
Suppose there exists random variable Z 2 =
z 2 ( X ) orthogonal to y ( X ) =
Y w.r.t p ( f ( X ) ,U ) .
Then f achieves global optimum if and only if it aligns all label-conditioned feature distributions, i.e . , p s ( f ( x )∣ y )
=
p t ( f ( x )∣ y ) , ∀ y ∈ Y .
Note that in practice, we have no access to the target domain label prior p t ( Y ) and the label y ( x ) for target domain data x ∼ p t .
Thus we use the pseudo label ˆ y as a surrogate to construct the principle classiﬁer, where ˆ y ( x ) =
arg max y h
( x ) y is generated by our model h .
5. E XPERIMENTS
Models.
We take a well-known domain adaptation algorithm VADA (Shu et al., 2018) as our baseline.
VADA is based on domain adversarial training and combined with virtual adversarial training and entropy regularization.
We show that utilizing orthogonal classiﬁer can improve its robustness to label shift.
We compare it with two improvements: (1) VADA+ w x ∖ w 1 which is our method that plugs in the orthogonal classiﬁer as a discriminator in VADA; (2) VADA+IW :
We tailor the SOTA method for label shifted domain adaptation, importance-weighted domain adaptation (des Combes et al., 2020), and apply it to VADA.
We also incorporate two recent domain adaptation algorithms for images— CyCADA (Hoffman et al., 2018) and ADDA (Tzeng et al., 2017)—into comparisons.
Setup.
We focus on visual domain adaptation and directly borrow the datasets, architectures and domain setups from Shu et al.
To add label shift between domains, we control the label distribution in the two domains.
For source domain, we sub-sample 70% data points from the ﬁrst half of the classes and 30% from the second half.
We reverse the sub-sampling ratios on the target domain.
The label distribution remains the same across the target domain train and test set.
Please see Appendix E.2 for more details.
Results.
Table 3 reports the test accuracy on seven domain adaptation tasks.
We observe that VADA+ w x ∖ w 1 improves over VADA across all tasks and outperforms VADA+IW on ﬁve out of seven tasks.
We ﬁnd VADA+IW performs worse than VADA in two tasks, MNIST → SVHN and MNIST → MNIST-M. Our hypothesis is that the domain gap is large between these datasets, hindering the estimation of importance weight.
Hence, VADA-IW is unable to adapt the label shift appropriately.
In addition, the results show that VADA+ w x ∖ w 1 outperforms ADDA on six out of seven tasks.
[Table]
O RTHOGONAL C LASSIFIER FOR F AIRNESS
We are given a dataset D = {( x t ,y t ,u t )} nt = 1 that is sampled iid from the distribution p XY U , which contains the observations x ∈ X , the sensitive attributes u ∈ U and the labels y ∈ Y .
Our goal is to learn a classiﬁer that is accurate w.r.t y and fair w.r.t u .
We frame the fairness problem as ﬁnding the orthogonal classiﬁer of an “totally unfair” classiﬁer w 1 that only uses the sensitive attributes u for prediction.
We can directly get the unfair classiﬁer w 1 from the dataset statistics, i.e . , w 1 ( x ) y
= p ( Y =
y ∣ U =
u ( x )) .
Below we show that the orthogonal classiﬁer of unfair classiﬁer meets equalized odds, one metric for fairness evaluation.
Proposition 4.
If the orthogonal random variable of U = u ( X ) w.r.t p XY exists, then the orthogonal classiﬁer w x ∖ w 1 satisﬁes the criterion of equalized odds.
We emphasize that, unlike existing algorithms for learning fairness classiﬁer, our method does not require additional training.
We obtain a fair classiﬁer via orthogonalizing an existing model w x which is simply the vanilla model trained by ERM on the dataset D .
6. E XPERIMENTS
Setup.
We experiment on the UCI Adult dataset, which has gender as the sensitive attribute and the UCI German credit dataset, which has age as the sensitive attribute (Zemel et al., 2013; Madras et al., 2018; Song et al., 2019).
We compare the orthogonal classiﬁer w x ∖ w 1 to three baselines: LAFTR (Madras et al., 2018), which proposes adversarial objective functions that upper bounds the unfairness metrics;
L-MIFR (Song et al., 2019), which uses mutual information objectives to control the expressivenessfairness trade-off; ReBias (Bahng et al., 2020), which minimizes the Hilbert-Schmidt Independence Criterion between the model representations and biased representations; as well as the Vanilla ( w x ) trained by ERM.
We employ two fairness metrics – demographic parity distance ( ∆ DP ) and equalized odds distance ( ∆ EO ) – deﬁned in Madras et al.
We denote the penalty coefﬁcient of the adversarial or de-biasing objective as γ , whose values govern a trade-off between prediction accuracy and fairness, in all baselines.
We borrow experiment conﬁgurations, such as CNN architecture, from Song et al.
Please refer to Appendix E.3 for more details.
Results.
Tables 4, 5 report the test accuracy, ∆ DP and ∆ EO on Adults and German datasets.
We observe that the orthogonal classiﬁer decreases the unfairness degree of the Vanilla model and has competitive performances to existing baselines.
Especially in the German dataset, compared to LAFTR, our method has the same ∆ EO but better ∆ DP and test accuracy.
It is surprising that our method outperforms LAFTR, even though it is not specially designed for fairness.
Further, our method has beneﬁt of being training-free, which allows it to be applied to improve any off-the-shelf classiﬁer’s fairness without additional training [Table] [Table] [Table]
[Table]
R ELATED W ORKS
Disentangled representation learning Similar to orthogonal random variables, disentangled representations are also based on speciﬁc notions of feature independence.
For example, Higgins et al.
(2018) deﬁnes disentangled representations via equivalence and independence of group transformations, Kim & Mnih (2018) relates disentanglement to distribution factorization, and Shu et al.
(2020) characterizes disentanglement through generator consistency and a notion of restrictiveness.
Our work differs in two key respects.
First, most deﬁnitions of disentanglement rely primarily on the bijection between latents and inputs (Shu et al., 2020) absent labels.
In contrast, our orthogonal features must be conditionally independent given labels.
Further, in our work orthogonal features remain implicit and they are used discriminatively in predictors.
Several approaches aim to learn disentangled representations in an unsupervised manner (Chen et al., 2016; Higgins et al., 2017; Chen et al., 2018).
However, Locatello et al.
(2019) argues that unsupervised disentangled representation learning is impossible without a proper inductive bias.
Model de-biasing A line of works focuses on preventing model replying on the dataset biases.
Bahng et al.
(2020) learns the de-biased representation by imposing HSIC penalty with biased representation, and Nam et al.
(2020) trains an unbiased model by up-weighting the high loss samples in the biased model.
Li et al.
(2021) de-bias training data through data augmentation.
However, these works lack theoretical deﬁnition for the de-biased model in general cases and often require explicit dataset biases.
Density ratio estimation using a classiﬁer Using a binary classiﬁer for estimating the density ratio (Sugiyama et al., 2012) enjoys widespread attention in machine learning.
The density ratio estimated by classiﬁer has been applied to Monte Carlo inference (Grover et al., 2019; Azadi et al., 2019), class imbalance (Byrd & Lipton, 2019) and domain adaptation (Azizzadenesheli et al., 2019).
Learning a set of diverse classiﬁers Another line of work related to ours is learning a collection of diverse classiﬁers through imposing penalties that relate to input gradients.
Diversity here means that the classiﬁers rely on different sets of features.
To encourage such diversity, Ross et al.
(2018; 2020) propose a notion of local independence, which uses cosine similarity between input gradients of classiﬁers as the regularizer, while in Teney et al.
the regularizer pertains to dot products.
Ross et al.
(2017) sequentially trains multiple classiﬁers to obtain qualitatively different decision boundaries.
We defer more discussions of the advantages of classiﬁer orthogonalization over existing methods to Appendix F.
C ONCLUSION
We consider ﬁnding a discriminative direction that is orthogonal to a given principal classiﬁer.
The solution in the linear case is straightforward but does not generalize to the non-linear case.
We deﬁne and investigate orthogonal random variables, and propose a simple but effective algorithm (classiﬁer orthogonalization) to construct the orthogonal classiﬁer with both theoretical and empirical support.
Empirically, we demonstrate that the orthogonal classiﬁer enables controlled style transfer, improves existing alignment methods for domain adaptation, and has a lower degree of unfairness. A CKNOWLEDGEMENTS
The work was partially supported by an MIT-DSTA Singapore project and by an MIT-IBM Grand
Challenge grant.
YX was partially supported by the HDTV Grand Alliance Fellowship.
We would like to thank the anonymous reviewers for their valuable feedback
A M ORE PROPERTIES OF ORTHOGONAL RANDOM VARIABLE
In this section we demonstrate the properties of orthogonal random variables.
We also discuss the existence and uniqueness of orthogonal classiﬁer when given the principal classiﬁer.
Below we list some useful properties of orthogonal random variables.
Proposition 5.
Let Z 1 and Z 2 be any mutually orthogonal w.r.t P XY , then we have
(i) Invariance : For any diffeomorphism g , g ( Z 1 ) and g ( Z 2 ) are also mutually orthogonal.
(ii) Distribution-free : Z 1 ,Z 2 are mutually orthogonal w.r.t P X ′ Y
if and only if there exists a diffeomorphism mapping between X and X ′ .
(iii) Existence : Suppose the label-conditioned distributions p y ∈ C 1 , supp ( p y ) =
X , ∀ y ∈ Y .
For z 1 ∈ C 1 and z 1 (X) is diffeomorphism to Euclidean space, then ∀ i ∈ Y , there exists a diffeomorphism mapping ( z 1 ( X ) ,z 2 ,i ( X ))
such that z 1 ( X ) ⊥⊥ z 2 ,i ( X )∣ Y = i .
Further if there exists diffeomorphism mappings between z 2 ,i s, then the orthogonal r.v. of z 1 ( X ) exists.
In the following theorem, we justify the validity of the classiﬁer orthogonalization when z 1 ( x ) satisﬁes some regularity conditions.
Theorem 2.
Suppose w 1 ( x ) i =
p
( Y = i ∣ z 1 ( x )) .
If the label-condition distributions p y s, and z 1 satisfy the conditions in Proposition 5.(iii), then w x ∖ w 1 is the unique orthogonal classiﬁer of w 1 .
Note that our construction of w x ∖ w 1 does not require the exact expression of z 1 ( X ) , its orthogonal r.v or data generation process.
The theorem states that the orthogonal classiﬁer constructed by classiﬁer orthogonalization is the Bayesian classiﬁer for any orthogonal random variables of z 1 ( X ) .
B P ROOFS B. P ROOF FOR P ROPOSITION
Proposition 1.
Suppose the orthogonal r.v. of z 1 ( X ) w.r.t p XY exists and is denoted as z 2 ( X ) .
Then z ( X ) =
z 2 ( X ) is a maximizer of I ( z ( X ) ; Y ∣ z 1 ( X )) subject to I ( z ( X ) ; z 1 ( X )∣ Y )
= 0 .
Proof.
For any function z , by chain rule we have I ( z 1 ( X ) ,z 2 ( X ) ; Y )
=
I ( z 1 ( X ) ; Y )
+ I ( z 2 ( X )
Y ∣ z 1 ( X )) and I ( z 1 ( X ) ,z ( X ) ; Y )
=
I ( z 1 ( X ) ; Y )
+ I
( z ( X ) ;
Y ∣ z 1 ( X ))
Further, the deﬁni- tion of the orthogonal r.v. ensures that there exists a differmorphism f between X and z 1 ( X ) ,z 2 ( X ) , which implies I ( z 1 ( X ) ,z
( f ( z 1 ( X ) ,z 2 ( X ))) ; Y )
=
I ( z 1 ( X ) ,z ( X ) ; Y ) .
Hence by data processing inequality we have:
[Equation]
⇔ I ( z 1 ( X
[Equation]
X
[Equation]
; Y
[Equation]
[Equation]
⇔ I ( z 2 ( X ) ; Y ∣ z 1 ( X )) ≥ I ( z ( X ) ; Y ∣ z 1 ( X ))
The above inequality shows that z
= z 2 maximize the mutual information
I ( z ( X ) ;
Y ∣ z 1 ( X ))
Further, by deﬁnition of the orthogonal r.v., z
= z 2 is independent of z 1 conditioned on Y , i.e. z ( X ) ⊥⊥ z 1 ( X )∣ Y which is equivalent to I ( z ( X ) ; z 1 ( X )∣ Y )
= 0 .
B. P ROOF FOR T HEOREM
Theorem 1.
Assume p y is uniform distribution, ∀ w x ∈ W takes values in ( m, 1 − m ) C with m ∈ ( 0 , 12 ) , and 1 / p X ∣ Y ( x ∣ y ) ∈ ( 0 ,γ ) ⊂ ( 0 , +∞) holds for ∀ x ∈ X ,y ∈ Y .
Then for any δ ∈ ( 0 , 1 ) with probability at least− δ , we have:
[Equation]
∣D∣ ⎞ ⎟⎠
Proof.
Denote the empirical risk of w as
[Equation]
and the population risk as
[Equation]
Step 1: bounding excess risk ∣ R ( ˆ w x ) − R ( w ∗ x )∣ .
By the classical result in theorem 8 in Bartlett & Mendelson (2001), we know that for any w ∈ W , δ ∈ ( 0 , 1 ) , since − log w ( x ) y ∈ ( 0 , log 1 m ) , with probability at least 1 − δ ,
[Equation]
Since ˆ w x = inf w x ∈W ˆ R ( w x ) ,w ∗ x = inf w x ∈W R ( w x ) , and ∣ ˆ R ( ˆ w x ) − R ( ˆ w x )∣ ≤ 2 R n (W) +
[Equation]
1 m
[Equation]
n , ∣ ˆ R ( w ∗ x
[Equation]
[Equation]
2log
[Equation]
√ 2log
[Equation]
n , we have
[Equation]
Step 2: bounding ∣ R ( ˆ w x ∖ w 1 ) − R ( w ∗ x ∖ w 1 )∣ by ∣ R ( ˆ w x ) − R ( w ∗ x )∣ .
[Equation]
⎤⎥⎥⎥⎥⎦
Then we have:
[Equation]
⎤⎥⎥⎥⎥⎥⎦RRRRRRRRRRRRRR⎞⎟⎠
We deﬁne the ratio r ( x,y )
=
ˆ w x ( x ) y w ∗ x
( x ) y .
We deﬁne y ( x ) ∶= arg min y r ( x,y ) , ¯ y ( x ) ∶= arg max y r
( x,y ) .
We have r ( x,y ( x )) ≤
∑ y ′
ˆ w x ( x ) y ′ / w 1 ( x ) y ′
∑ y ′ w ∗ x ( x ) y ′ /
w 1 ( x ) y ′ ≤ r ( x, ¯ y ( x )) .
Let assume 1 p ( y ∣ x ) ≤ γ for all x,y .
For any function y ′
∶ X → Y , we have the following bound, where we have importance weight φ ( x,y ) ∶= 1 p ( y ∣ x ) if y = y ′
( x ) otherwise 0 ,
[Equation]
As a result
[Equation]
we have
[Equation]
Thus
[Equation]
⎤⎥⎥⎥⎥⎥
[Equation]
⎞⎟⎠
[Equation]
Combining Eq.
(6) and Eq.
(7), we know that with probability 1 − δ , we have:
[Equation]
B. P ROOF FOR P ROPOSITION 5 AND T HEOREM
Proposition 5.
Let Z 1 and Z 2 be any mutually orthogonal w.r.t P XY , then we have
(i) Invariance : For any diffeomorphism g , g ( Z 1 ) and g ( Z 2 ) are also mutually orthogonal.
(ii) Distribution-free : Z 1 ,Z 2 are mutually orthogonal w.r.t P X ′ Y
if and only if there exists a diffeomorphism mapping between X and X ′ .
(iii) Existence : Suppose the label-conditioned distributions p y ∈ C 1 , supp ( p y ) =
X , ∀ y ∈ Y .
For z 1 ∈ C 1 and z 1 (X) is diffeomorphism to Euclidean space, then ∀ i ∈ Y , there exists a diffeomorphism mapping ( z 1 ( X ) ,z 2 ,i ( X ))
such that z 1 ( X ) ⊥⊥ z 2 ,i ( X )∣ Y = i .
Further if there exists diffeomorphism mappings between z 2 ,i s, then the orthogonal r v. of z 1 ( X ) exists.
Proof.
(i) Since Z 1 and Z 2 are independent, the independence also holds for g ( Z 1 ) and g ( Z 2 ) .
In addition, we construct the diffeomorphism between ( g ( Z 1 ) ,g ( Z 2 )) and X as ˆ f ( g ( Z 1 ) ,g ( Z 2 ))
=
f ( g − 1 ( g ( Z 1 )) ,g − 1 ( g ( Z 2 )))
=
X .
Apparently f ( g − 1 ( Z 1 ) ,g − 1 ( Z 2 )) is a diffeomorphism.
(ii) We denote the diffeomorphism between X ′ and X as ˆ f .
Then the diffeomorphism mapping between ( Z 1 ,Z 2 ) and X is ˆ f ○ f .
Thus Z 1 ,Z 2 are mutually orthogonal w.r.t X ′ .
(iii)
We will use a constructive proof.
Step 1 : Denote dim (X) =
d, dim ( z 1 (X))
=
k , then we can prove that the manifold [ z 1 (X) , R d − k ] is diffeomorphism of X .
We denote the diffeomorphism as f , and denote f ( x ) =
[ z 1 ( x ) ,t ( x )] where z 1 ∶ X → z 1 (X) ,t ∶ X → R d − k .
Step 2 :
For X ∣ Y =
y , let F j ( t ( x ) j ∣ t ( x ) 1 , ⋯ ,t ( x ) j − 1 ,z 1 ( x ) , 1 ) ∶ R → [ 0 , 1 ] ,j ∈ { 1 ,...,d − k } be the CDF corresponding to the distribution of t
[Equation]
The conditions p ∈ C 1 ,p ( x ) > 0 , ∀ x ∈ X ensure that the PDF of f ( X ) is also in C 1 and takes values in ( 0 , ∞) .
Thus the above CDFs are all diffeomorphism mapping.
By the inverse CDF theorem, for any z 1 ( x ) , h ( t ( X ) ; z 1 ( X ) =
z 1 ( x )) is a uniform distribution in ( 0 , 1 ) d − k .
Hence the random variable deﬁned by the mapping h , i.e . , z 2 ,y ( X ) =
h ( t ( X ) ; z 1 ( X )) , is independent of z 1 ( X ) given Y = 1 .
In addition, by the construction of z 2 ,y ( x ) we know that there exists a diffeomorphism ˆ f between ( z 1 (X) ,t (X)) and ( z 1 (X) ,z 2 ,y (X))
such that ˆ f ( z 1 ( X ) ,t ( X )) =
( z 1 ( X ) ,z 2 ,y ( X )) .
Then f − 1 ○ ˆ f − 1 ( z 1 ( X ) ,z 2 ,y ( X ))
=
X is also a diffeomorphsim mapping.
Step 3 :
From the condition we know that for every y ∈ Y , there exists a diffeomorphism function m y such that m
y ○
z 2 ,y ( x ) =
z 2 , 1 ( x ) .
Apparently ∀ y , m y ○
z 2 ,y ( X ) ⊥⊥ z 2 , 1 ( X )∣ Y = y by z 2 ,y ( X ) ⊥⊥ z 1 ( X )∣ Y =
y .
Further, ( z 1 ,z 2 , 1 ) is a diffeomorphism.
Hence z 2 , 1 ( X ) is the orthogonal r.v. of z 1 ( X ) w.r.t P XY .
Theorem 2.
Suppose w 1 ( x ) i =
p
( Y = i ∣ z 1 ( x )) .
If the label-condition distributions p y s, and z 1 satisfy the conditions in Proposition 5.(iii), then w x ∖ w 1 is the unique orthogonal classiﬁer of w 1 .
Proof.
By the existence property in Proposition 5, we know that for X , there exists a orthogonal r.v. of z 1 ( X ) and denote it as z 2 ( X 1 ) .
By the proposition we know that there exists a common diffeomorphism f mapping ( z 1 ( X ∣ y ) ,z 2 ( X ∣ y )) to X ∣ y , ∀ y ∈ Y .
Further, by change of variables and the deﬁnition of orthogonal r.v., we have p i, 2 ( z 2 ) p j, 2 ( z 2 ) =
p i, 1 ( z 1 ) p i, 2 ( z 2 ) vol J f ( z 1 ,z 2 ) p j, 1 ( z 1 ) p j, 2 ( z 2 ) vol J f ( z 1 ,z 2 ) / p i, 1 ( z 1 ) p
j, 1 ( z 1 ) =
p i ( x ) p j ( x ) / p i, 1 ( z 1 ) p
j, 1 ( z 1 ) =
w x ( x ) i w x ( x ) j / w 1 ( x ) i w 1 ( x ) j .
Thus via the bijection of classiﬁer and density ratios we know that w x ∖ w 1 ( x ) i =
p
( Y = i ∣ z 2 ( x )) .
B. P ROOF FOR P ROPOSITION
Proposition 2.
The global minimum of L AB OGAN ( G AB ) is achieved if and only if ̃
P Z 1 ,Z 2 ( z 1 ,z 2 ) =
Q Z 1 ( z 1 ) P Z 2 ( z 2 ) .
Proof.
By deﬁnition, r ( x ) = w 2 ( x ) 1 − w 2 ( x ) =
P ( z 2 ( x )) Q ( z 2 ( x )) .
Thus we can reformulate the criterion L AB OGAN as the following:
[Equation]
where we get the lower bound by Jensen’s inequality.
The equality holds when ̃ P ( z 1 ,z 2 ) =
Q ( z 1 ) P ( z 2 ) .
B. P ROOF FOR P ROPOSITION
Proposition 3.
Suppose there exists random variable Z 2 =
z 2 ( X ) orthogonal to y ( X ) =
Y w.r.t p ( f ( X ) ,U ) .
Then f achieves global optimum if and only if it aligns all label-conditioned feature distributions, i.e . , p s ( f ( x )∣ y )
=
p t ( f ( x )∣ y ) , ∀ y ∈ Y .
Proof.
By deﬁnition, optimal classiﬁer w x ( x ) 0 = p s ( f ( x ))
p s ( f ( x ))
+ p t ( f ( x )) , principle classiﬁer w {+1 ( x ) 
+}
= p s ( y ( x ))
p s ( y ( x ))
+ p t ( y ( x )) .
By the deﬁnition of orthogonal r.v., ( Y,U ) and f ( X ) have a bijection between them.
It suggests, conditioned on Y , the supports of f ( X )∣ Y =
y is non-overlapped for different y in both domains p s and p t .
It means if p s ( f ( x )∣ y ) > 0 then ∀
y ′
≠ y , p s ( f ( x )∣ y ′ )
= 0 .
Thus the orthogonal classiﬁer w x ∖ w 1 satisﬁes:
[Equation]
x ))
p s ( y ( x )) /
( p s ( f ( x )∣ y ( x ))
p s ( y ( x ))
p s ( y ( x ))
+ p t ( f ( x )∣ y ( x ))
p t ( y ( x ))
p t ( y ( x )) ) =
p s ( f ( x )∣ y ( x )) p s ( f ( x )∣ y ( x ))
+ p t ( f ( x )∣ y ( x ))
Thus the objective in Eq.
(5) can be reformulated as,
L( f, ( w x ∖ w 1 )(⋅) 0 ) = E x ∼ p s [ log p s ( f ( x )∣ y ( x )) p s ( f ( x )∣ y ( x )) + p t ( f ( x )∣ y ( x )) ]
+
E x ∼ p t [ log p t ( f ( x )∣ y ( x ))
p s ( f ( x )∣ y ( x ))
+ p t ( f ( x )∣ y ( x )) ]
=
E y ∼ p
s E x ∼ p s ( x ∣ y )
[− log p
s ( f ( x )∣ y )
+ p t ( f ( x )∣ y )
p s ( f ( x )∣ y ) ]
+ E y ∼ p t E x ∼ p t ( x ∣ y )
[− log p
s ( f ( x )∣ y )
+ p t ( f ( x )∣ y )
p t ( f ( x )∣ y ) ] ≥ − E y ∼ p
s [ log E x ∼ p s ( x ∣ y )
[ p s ( f ( x )∣ y )
+ p t ( f ( x )∣ y )
p s ( f ( x )∣ y ) ]] − E y ∼ p t
[ log E x ∼ p t ( x ∣ y )
[ p s ( f ( x )∣ y )
+ p t ( f ( x )∣ y )
p t ( f ( x )∣ y ) ]]
= − 2log 2 .
The lower-bound holds due to Jensen’s inequality.
The equality is achieved if and only if p s ( f ( x )∣ y )
p t ( f ( x )∣ y ) is invariant to x , for all y , i.e . , ∀ y ∈ Y ,p s ( f ( x )∣ y )
=
p t ( f ( x )∣ y ) .
B. P ROOF FOR P ROPOSITION
Proposition 4.
If the orthogonal random variable of U = u ( X ) w.r.t p XY exists, then the orthogonal classiﬁer w x ∖ w 1 satisﬁes the criterion of equalized odds.
Proof.
We denote the orthogonal random variables as z 2 ( X ) , and w x ∖ w 1 ( x ) =
Pr [ y ∣ z 2 ( x )] .
Since z 2 ( X ) ⊥⊥ U ∣ Y , we know that w x ∖ w 1 ( X ) ⊥⊥ U ∣ Y .
Hence the prediction of the classiﬁer w x ∖ w 1 is conditional independent of sensitive attribute U on the ground-truth label Y , which meets the equalized odds metric.
C E XTRA S AMPLES
[Figure]
t
V
[Figure]
n
[Figure]
D E XTRA E XPERIMENTS D. S TYLE TRANSFER
[Table]
Fish
[Table]
IS
[Table]
[Table] [Table] [Table] We show transferred samples for both domains in Fig.
4 on CMNIST and CelebA-GH.
D. S TYLE TRANSFER ON C ELEB A
Unlike the split in CelebA-GH dataset, domain A is males, and domain B is females.
The two domains together form the full CelebA (Liu et al., 2015) with 202599 images.
Note that there exists large imbalance of hair colors within the male group, with only around 2% males having blond hair.
Tablereports the Z 1 / Z 2 accuracies and FID scores on the full CelebA datasets.
We ﬁnd that our method improves the style transfer on the original CelebA dataset, especially the Z 2 accuracy.
It shows that our method can help style transfer in real-world datasets with multiple varying factors.
E E XTRA E XPERIMENT D ETAILS E. S TYLE TRANSFER E.1. D ATASET DETAILS
We randomly sampled two digits colors and two background colors for CMNIST. For CelebA-GH, we extract two subsets—male with non-blond hair and female with blond hair—by the attributes provided in CelebA dataset.
For all datasets, we use 0.8/0.2 proportions to split the train/test set.
For CelebA dataset, following the implementation of Zhu et al.
( https://github.com/ junyanz/CycleGAN ), we use 128-layer UNet as the generator and the discriminator in PatchGAN.
For CMNIST dataset, we use a 6-layer CNN as the generator and a 5-layer CNN as the discriminator.
We adopt Adam with learning rate 2e-4 as the optimizer and batch size 128/32 for CMNIST/CelebA.
E.1. D ETAILS OF M ODELS
We craft datasets for training the oracle w 1 ( x ) =
Pr ( Y ∣ z 1 ( x )) .
For CMNIST, oracle dataset has bias degrees 0 .
For CelebA-GH, oracle dataset has { male, female } as classes and the hair colors under each class are balanced.
For each dataset, we construct two environments to train the domain generalization models.
For CMNIST, the two environments are datasets with bias degrees 0 .
9 / 0 . 4 and 0 .
For CelebA-GH, the two environments consist of different groups of equal size: one is { non-blond-haired males, blond-haired females } and the other is { non-blond-haired males, blond-haired females, non-blond-haired females, blond-haired males } .
Note that the facial characteristic of gender ( Z 1 ) is the invariant prediction mechanism across environments, instead of the hair color.
E.1. E VALUATION FOR Z 1 / Z 2 ACCURACY
To evaluate the accuracies on Z 1 , Z 2 latents, we train two oracle classiﬁers w ∗ 1 ( x ) =
Pr ( Y ∣ z 1 ( x )) ,w ∗ 2 ( x ) =
Pr ( Y ∣ z 2 ( x )) on two designed datasets.
Speciﬁcally, w 1 / w 2 are trained on datasets D 1 / D 2 with Z 1 / Z 2 as the only discriminative direction.
For CMNIST, D 1 is the dataset with bias degrees 0 [-./ 
-].
and D 2 is the dataset with bias degrees 0 / 0 .
For CelebA-GH, D 1 is the dataset with { male, female } as classes and the hair colors under each class are balanced.
D 2 is the dataset with { blond hair, non-blond hair } as classes and the males/females under each class are balanced.
The Z 1 accuracy on dataset D for transfer model G is:
[Equation]
And Z 2 accuracy is:
[Equation]
where I is the indicator function.
Z 1 accuracy measures the success rate of transferring the Z 1 and Zaccuracy measures the success rate of keeping Z 2 aspects unchanged.
E. D OMAIN ADAPTATION
The full names for the seven datasets are MNIST, MNIST
We use the 18-layer neural network in Shu et al.
(2018) with pre-process via instance-normalization.
Following Shu et al.
, smaller CNN is used for digits (MNIST, MNIST-M, SVHN, DIGITS) and trafﬁc signs (SIGNS, GTSRB) and larger CNN is used for CIFAR-10 and STL-10.
We use the Adam optimizer and hyper-parameters in Appendix B in Shu et al.
(2018) except for MNIST → MNIST-M, where we ﬁnd that setting λ s = 1 ,λ d = 1 e − 1 largely improves the VADA performance over label shifts.
Furthermore, we set λ d = 1 e − 2 , i.e . , the default value suggested by Shu et al.
(2018), to enable adversarial feature alignment.
E. F AIRNESS
The two datasets are: the UCI Adult dataset 2 which has gender as the sensitive attribute; the UCI German credit dataset 3 which has age as the sensitive attribute.
We borrow the encoder, decoder and the ﬁnal fc layer from Song et al.
For fair comparison, we use the same encoder+fc layer as the function family W of our classiﬁer since our method do not need decoder for reconstruction.
We use Adam with learning rate 1e-3 as the optimizer, and a batch size of 64.
The original ReBias method trains a set of biased models to learn the de-biased representations (Bahng et al., 2020), such as designing CNNs with small receptive ﬁelds to capture the texture bias.
However, in the fairness experiments, the bias is explicitly given, i.e . , the sensitive attribute.
For fair comparison, we set the HSIC between the sensitive attribute and the representations as the de-bias regularizer.
F L EARNING A DIVERSE SET OF CLASSIFIERS
In this section we discuss the difference and advantages of the classiﬁer orthogonalization, compared to methods that learn a diverse set of classiﬁers.
We also provide a counter-example to show that the orthogonal input gradient does not lead to a pair of orthogonal classiﬁers.
We show that orthogonal classiﬁers might not in optimal solution set of minimizing input gradient penalty.
The goals of learning diverse classiﬁers include interpretability (Ross et al., 2017), overcoming simplicity bias (Teney et al., 2021), improving ensemble performance (Ross et al., 2020), and recovering confounding decision rules (Ross et al., 2018).
There is a direct trade-off between diversity and accuracy and this is controlled by the regularization parameter.
In contrast, in our work, given the principal classiﬁer, our method directly constructs a classiﬁer that uses only the orthogonal variables for prediction.
There is no trade-off to set in this sense.
We also focus on novel applications of controlling the orthogonal directions, such as style transfer, domain adaptation and fairness.
Further, our notion of orthogonality is deﬁned via latent orthogonal variables that relate to inputs via a diffeomorphism (Deﬁnition 1) as opposed to directly in the input space.
Although learning diverse classiﬁers through input gradient penalties is efﬁcient, it does not guarantee orthogonality in the sense we deﬁne it.
We provide an illustrative counter-example in Appendix F, where the input space is not disentangled nor has orthogonal input gradients but corresponds to a pair of orthogonal classiﬁers in our sense.
We also prove that, given the principal classiﬁer, minimizing the loss by introducing an input gradient penalty would not necessarily lead to an orthogonal classiﬁer.
We note that one clear limitation of our classiﬁer orthogonalization procedure is that we need access to the full classiﬁer.
Learning this full classiﬁer can be impacted by simplicity bias (Shah et al., 2020) that could prevent it from relying on all the relevant features.
We can address this limitation by leveraging previous efforts (Ross et al., 2020; Teney et al., 2021) to mitigate simplicity bias when training the full classiﬁer.
F. R ELATIONSHIP TO ORTHOGONAL INPUT GRADIENTS
The orthogonality constraints on input gradients demonstrate good performance in learning a set of diverse classiﬁers (Ross et al., 2017; 2018; 2020; Teney et al., 2021).
They typically use the dot product of input gradients between pairs of classiﬁers as the regularizer.
We highlight that when facing the latent orthogonal random variables, the orthogonal gradient constraints on input space no longer guarantees to learn the orthogonal classiﬁer.
We demonstrate it on a simple non-linear example below.
Consider a binary classiﬁcation problem with the following data generating process.
Label Y is uniformly distributions in {− 1 , 1 } .
Conditioned on the label, we have two independent k -dimensional latents Z 1 ,Z 2 such that Z 1 ∣ Y =
y ∼ N( yµ 1 ,I k ) , Z 2 ∣ Y =
y ∼ N( yµ 2 ,I k ) .
µ 1 ∈ R k ,µ 2 ∈ R m are the means of the latent variables, and k > m .
The data X is generated from latents via the following diffeomorphism
[Equation]
⎠ where g is an arbitrary non-linear diffeomorphism on R k .
We can see that Z 1 ,Z 2 are mutually orthogonal w.r.t the distribution p XY .
Now consider the Bayes optimal classiﬁers w 1 ,w 2 using variable Z 1 ,Z 2 .
We have w 1 ( x ) =
p Y ∣ Z 1 ( 1 ∣ z 1 ) =
σ ( 2 µ T 1 z 1 ) and w 2 ( x ) =
p Y ∣ Z 2 ( 1 ∣ z 2 )
=
σ ( 2 µ T 2 z 2 ) , where σ is the sigmoid function.
Apparently, they are a pair of orthogonal classiﬁers.
Besides, we denote the classiﬁer based on the ﬁrst m dimensions in z 1 for prediction as w 3 , i.e . , w 3 ( x ) =
p Y ∣( Z 1 )
∶ m ( 1 ∣( z 1 ) ∶ m ) =
σ ( 2 ( µ [Equation] T ∶ m ( z 1 ) ∶ m ) .
Given the principal classiﬁer w 1 , we consider using the loss function in Ross et al.
(2018; 2020) to learn the orthogonal classiﬁer of w 1 , by adding a input gradient penalty term to the standard classiﬁcation loss:
[Equation]
L c is the expected cross-entropy loss, cos is the cosine-similarity and λ is the hyper-parameter for the gradient penalty term (Ross et al., 2018; 2020).
Below we show that (1) the orthogonal classiﬁer wdoes not necessarily satisfy E [ cos 2 (∇ x w 1 ( x ) , ∇ x w 2 ( x ))] = 0 .
(2) the orthogonal classiﬁer w 2 is not necessarily the minimizer of L w 1 ( w ) .
Proposition 6.
For the above ( Z 1 ,Z 2 ) , their corresponding Bayes classiﬁers w 1 ,w 2 satisfy E [∇ x w 1 ( x ) T ∇ x w 2 ( x )]
=
if and only if ( µ 1 ) T ∶ m µ 2 = 0 .
Proof.
Let X 1 =
g ( Z 1 − ( Z 2 0 ( k − m ) )) , X
=
Z 2 are the two components of X .
Note that z 1 = g − 1 ( x 1 ) + ( x 2( k − m ) ) .
By chain rule, the input gradient of w 1 is
[Equation]
where I m × k is the submatrix of I k × k .
Similarly we get ∇ x w 2 ( x ) =
[Equation] × [Equation] ( k
[Equation]
m [Equation]
Together, the dot product between input gradients is
[Equation]
Since
[Equation]
x )] if and only if ( µ 1 ) T ∶ m µ 2 = 0 .
Proposition 6 ﬁrst shows that the expected input gradient product of the two Bayes classiﬁers of underlying latents is non-zero, unless the linear decision boundaries on z 1 ,z 2 are orthogonal.
Hence, given the principal classiﬁer w 1 , the expected dot product of input gradients between w 1 and its orthogonal classiﬁer w 2 does not have to be zero.
Proposition 7.
The orthogonal classifer w 2 does not minimize L w 1 ( w ) if ( µ 1 ) ∶ m = µ 2 and µ T 1 ∇ x 1 g − 1 ( x 1 ) T ∇ x 1 g − 1 ( x 1 )
k
× m ( µ 1 ) ∶ m < 0 .
Particularly, we show that L w 1 ( w 3 ) <
L w 1 ( w 2 ) in this case.
Proof.
Let w 3 ( x ) =
p Y ∣( Z 1 )
∶ m ( 1 ∣( z 1 ) ∶ m ) .
The input gradient of w 3 ( x ) is
[Equation]
When ( µ 1 ) ∶ m = µ 2 , the dot-product between ∇ x w 3 ( x ) , ∇ x w 1 ( x ) is
[Equation]
When ( µ 1 ) ∶ m = µ 2 , we know that
z 1 ( x ) ,z 2 ( x ) are equally predictive of the label and thus L c ( w 3 )
=
L c ( w 2 ) .
Note that if µ T 1 ∇ x 1 g − 1 ( x 1 ) T ∇ x 1 g − 1 ( x 1 ) k
× m ( µ 1 ) ∶ m < 0 , we have E [ cos 2 (∇ x w 1 ( x ) , ∇ x w 2 ( x ))] > E [ cos 2 (∇ x w 1 ( x ) , ∇ x w 3 ( x ))] : [Equation] cos
[Equation]
∇ x w 1 ( x ) , ∇ x w 2 ( x )
[Equation]
[Equation]
⎤⎥⎥⎥⎥⎥⎥⎥⎥⎦
[Equation]
The strict inequality holds by µ T 1 ∇ [Equation] g
[Equation]
To verify that µ T 1 ∇ x 1 g − 1 ( x 1 ) T ∇ x 1 g − 1 ( x 1 )
k
× m ( µ 1 ) ∶ m < 0 does exist, pick k = 3 ,m = 2 , g − 1 ( x ) =
⎛ ⎝ 2 − [-
 [Equation] [Equation] ⎞-]31 − 11 − 1⎞ ⎠ x , and µ 1 = ⎛ ⎝ 11 1 ⎞ ⎠ .
We have µ T 1 ∇ x 1 g − 1 ( x 1 ) T ∇ x 1 g − 1 ( x 1 ) k
× m ( µ 1 ) ∶ m = − 2 in this case.
Together, we have L w 1 ( w 3 ) <
L w 1 ( w 2 ) .
Proposition 7 shows that the orthogonal classiﬁer w 2 is not the minimizer of the loss with input gradient penalty.
The results above also hold for un-normalized version of input gradient penalty in Teney et al.
(2021) by similar analysis.