C ONTROLLING DIRECTIONS ORTHOGONAL TO A CLASSIFIER
Anonymous authors
Paper under double-blind review
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 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.
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 of high dimensional data X and binary label Y , where the label distribution is Bernoulli, i.e . , P Y = B( 0 . 5 ) and class-conditional distributions are Gaussians, P X ∣ Y =
y = N( µ y ,σ 2 y I ) with label-dependent means µ 0 , µ 1 and variances σ 0 , σ 1 .
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 = 1 ∣ θ ⊺ 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 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 the independence constraint (ensuring complementarity).
Our search for the orthogonal classiﬁer can be asked now 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 the orthogonal random variable?
The solution to this problem, which we call classiﬁer orthogonalization , turns out to be surprisingly simple, making use of an overall classiﬁer w x in addition to the principal one.
We denote the outcome of this orthogonalization process as w 2 = w x ∖ w 1 .
The advantage of this construction is that it is based only on the classiﬁers, not needing to uncover the exact latent mechanism referred to in the deﬁnition.
[-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 
-]
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 discriminator 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) {+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]
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.
It’s 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 ,Z 2 and assume their supports are manifolds diffeomorphic with 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 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 the discrete variables and discrete-continuous 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 z 2 attains 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 .
Similarly, 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 [Equation] Y (
[Equation]
( x [Equation] 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 ∣ i ) =
p Z 1 ∣ Y ( z 1 ∣ i ) ∗ p Z 2 ∣ Y ( z 2 ∣ i ) ∗ vol J f
( z 1 ,z 2 ) , where vol J f is the volume of 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 label-conditioned 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 adjust the full classiﬁer w x to be orthogonal to the principal classiﬁer w 1 .
The validity of this procedure is subject to overlapping support of class-conditional distributions, ensures that the classiﬁer outputs w x ( x ) i ,w 1 ( x ) i 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.
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
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) .
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 1 − δ , we have:
[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 density ratio of class-conditioned distributions and the Rademacher term are small.
Typically, the Rademacher complexity term satisﬁes R ∣D∣ (W) =
O(∣D∣ − 12 ) (Bartlett & Mendelson, 2001; Gao & Zhou, 2016).
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 [Equation]
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 maximize the IS objective, i.e . , w 2 = arg max L IS .
However, importance sampling method has an Achilles’ heel, variance.
A few bad samples with large weights can drastically deviates the estimation, which is problematic for mini-batch learning in practice.
We provide an analysis to 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 =even when the learned classiﬁer w is approaching to the optimal, i.e . , w ≈ w 2 .
Let ̂L n IS ( w ) ∶=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 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 latent variables that mutually orthogonal 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 the style domain
A ’s data to domain B via only 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 Z 2 to 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 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]
[Figure]
[Table]
[Table] [Equation] [Table] 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 AB ( x ) r ( x ) ( 1 − D AB ( x ))
+ D AB ( x ) r ( x ) and r ( x ) =
w x ∖ w 1 ( x ) 0 1 − w x ∖ w 1 ( x ) 0 .
Consider an extreme case where we allow the model to change all latent, 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:
[Equation]
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 .
Symmetric statement holds for L BA OGAN ( G BA ) .
4. E XPERIMENTS 4.1. S ETUP
Datasets.
(a) MNIST-C : We construct MNIST-C(olors) dataset based on MNIST digits (LeCun & Cortes, 2005).
MNIST-C 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, 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 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 MNIST-C 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 two representative domain generalization algorithms, Fish (Shi et al., 2021) and MLDG (Li et al., 2018), to obtain w 1 .
We indicate different approaches by the parentheses after w x ∖ w 1 and 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 image’s latent z 1 from domain A to domain B; 2) Z 2 accuracy: percentage of transferred images whose latent z 2 unchanged; 3) FID scores: a standard metric evaluates image quality (Heusel et al., 2017).
We only report FID scores on 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 marginal and label-conditioned latent distributions are large.
In this paragraph, we provide 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) further 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 concentrate around the ground-truth probabilities (red lines).
Main result.
As shown in Table 1 and 2, adding orthogonal classiﬁer to the vanilla CycleGAN signiﬁcantly improve its z 2 accuracy (from 14 to 90 + in MNIST-C, from 16 to 40 + in CelebA-GH) while paying 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 orthog- onalization is compatible with domain generalization algorithms when the prediction mechanism Z 1 ∣ Y is invariant across collected environments.
Fig.
3 displays the transferred samples from domain A.
We see that vanilla CycleGAN models change the background colors/hair colors along with digit colors/facial characteristics in MNIST-C 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.
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 to bridge the domain gap via the following domain adversarial objective:
[Equation]
I npu t
V a n ill a
O r ac l e
[Figure] L [Figure] where discriminator D ∶ Z → [ 0 , 1 ] distinguishes features from two domains.
The equilibrium of the objective is achieved when the encoder perfectly align 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 thus w 1 could be directly computed via frequency count.
We propose to training the encoder f with the orthogonalized discriminator w x ∖ w 1 ,
[Equation]
Proposition 3.
Suppose there exists random variable Z 2 =
z 2 ( X ) that 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 ( [Equation]
= arg max y h ( x
[Equation] y is generated by our model h .
5. E XPERIMENTS
Models.
We take a renowned domain adaptation algorithm VADA (Shu et al., 2018) as our baseline.
VADA is based on domain adversarial training and combined with techniques of 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 incorporates two recent domain adaptation algorithms for images— CyCADA (Hoffman et al., 2018) and ADDA (Tzeng et al., 2017)—into comparison.
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.
In the target domain test set, the label distribution is the same as that of the target domain train 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 of seven tasks.
We ﬁnd VADA+IW performs worse than VADA in three 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 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 [Table] 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 [Table] 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 that evaluates the fairness.
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 orthogonalize a 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 expressiveness-fairness trade-off; ReBias (Bahng et al., 2020), which minimize the HilbertSchmidt Independence Criterion between the model representations and biased representations; as well as the Vanilla ( w x ) trained by ERM.
We employs 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 both baselines.
We borrow experiment conﬁgurations, like CNN architecture, from Song et al.
Please refer to Appendix E.3 for more details.
Results.
Table 4, 5 reports the test accuracy, ∆ DP and ∆ EO on Adults and German datasets.
We observe that the orthogonal classiﬁer decreases the degree of unfairness on 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 merit of training-free, which allow it to be applied to improve any off-the-shelf classiﬁer’s fairness without requiring additional training [Table] [Table] [Table]
R ELATED W ORKS
Disentangled representation learning Similar to orthogonal random variables, disentangled representation learning associates a deﬁnition of independence of dimensions in the representation.
Higgins et al.
(2018) deﬁnes the disentangled representations based on the equivalence and independence of group transformations, Kim & Mnih (2018) relates disentanglement to distribution factorization and Shu et al.
(2020) characterizes disentanglement via generator consistency and restrictiveness.
There are two key differences.
First, most disentanglement deﬁnitions do not take the diffeomorphism and the labels into account, but a bijection between latents and inputs (Shu et al., 2020).
In contrast, our deﬁnition requires diffeomorphism and label-conditioned independence.
Further, disentanglement learning does not learn discriminative models on different latents as ours.
Several works aim to learn disentangled representations (Chen et al., 2016; Higgins et al., 2017; Chen et al., 2018).
However, Locatello et al.
(2019) shows that unsupervised disentangled representation learning is impossible without inductive bias.
Model de-biasing A line of works focuses on prevent model replying on the dataset biases.
Bahng et al.
(2020) learns the de-biased representation by imposing HSIC penalty with designed 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ﬁer A line of work related to ours is learning a collection of diverse predictors through input gradient penalties. Diversity means that the classiﬁers rely on different patterns to each other.
To encourage diversity, Ross et al. (2018; 2020) propose a notion of local independence, which uses the cosine similarity between input gradients over pairs of classiﬁers as the regularizer, and Teney et al.
(2021) uses the dot product of input gradients instead. Ross et al. (2017) sequentially trains multiple classiﬁers by salient map based on input gradients. A detached work (Littwin & Wolf, 2016) proposes to add orthogonal weights constraints on the ﬁnal linear layer.
The set of diverse classiﬁers is used to model interpretability (Ross et al., 2017), overcoming simplicity bias (Teney et al., 2021), improve ensembles performance (Ross et al., 2020), and recover the confounding decision rules (Ross et al., 2018).
There is a trade-off between diversity and accuracy, determined by the coefﬁcient of the regularizers.
In contrast, given the principal variable, our method precisely obtains a classiﬁer that only uses the orthogonal variable for prediction, without any tradeoff.
We also focus on novel applications of the classiﬁers for controlling the orthogonal direction, such as style transfer, domain adaptation and fairness.
Further, the notion of orthogonality is developed on pair of latent orthogonal variables through diffeomorphism (Deﬁnition 1), as opposed to the input space.
Although learning diverse classiﬁer through input gradients penalty are efﬁcient, it cannot guarantee to learn the orthogonal classiﬁer in general.
We provide an illustrative counter-example in
Appendix F, where the input space is not disentangled and does not have orthogonal input gradient for the pair of orthogonal classiﬁers.
We also prove that, given the principal classiﬁer, minimizing the loss with input gradient penalty is not guaranteed to get the orthogonal classiﬁer.
However, classiﬁer orthogonalization can recover the orthogonal classiﬁer when the inputs are entangled.
C ONCLUSION
We consider ﬁnding a discriminative direction that is orthogonal to a principal classiﬁer.
The solution in the linear case is straightforward but cannot immediately generalize to the non-linear case.
To tackle the problem, we deﬁne and investigate orthogonal random variables, which characterize the orthogonality of the data.
We further propose a simple but effective algorithm (classiﬁer orthogonalization) to construct the orthogonal classiﬁer.
With both theoretical analysis and empirical evidence, we show that the orthogonal classiﬁer makes accurate predictions by leveraging the variable orthogonal to the one used by the principal classiﬁer.
Experimentally, we apply classiﬁer orthogonalization on partial style transfer, domain adaptation and fairness.
We demonstrate that the orthogonal classiﬁer enables controlled style transfer, improves existing alignment methods for label shifts domain adaptation, and has a lower degree of unfairness.
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 diffeomor- phism 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ﬁnition 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]
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 1 − δ , we have:
[Equation]
Proof.
Denote the empirical risk of w as
[Equation]
and the population risk as
[Equation]
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]
n
Since ˆ w x = inf w x ∈W ˆ R ( w x ) ,w ∗ x = inf w x
[Equation]
R ( w x ) , and ∣ ˆ R ( ˆ w x ) −
[Equation]
( ˆ
[Equation]
∣
[Equation]
R n (W) +
[Equation] [Equation]
[Equation]
√ 2log 1 δ n , we have [Equation]
Then we have:
[Equation]
[Table] [Equation] [Table] [Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation] [Table]
w
[Table]
[Equation]
[Table]
[Equation] [Table]
⎤⎥⎥⎥⎥⎥⎦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 ,
E
[Equation]
[Equation]
x,y )
[Equation]
y log
[Equation]
[Equation]
w
[Equation]
w
[Equation]
x
[Equation]
As a result [Equation] we have [Equation]
Thus
[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 diffeomor- phism 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 ( x ) j ∣ t ( X ) 1 = t ( x ) 1 , ⋯ ,t ( X ) j − 1 = t ( x ) j − 1 ,z
( X ) =
z 1 ( x ) ,Y = y .
[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 [Equation] f [Equation]
[Equation]
[Equation] [Equation] [Equation] =
[Equation] x ) / [Equation] [Equation]
[Equation] x [Equation] x
[Equation] x [Equation] / w 1 ( x )
[Equation] 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 ) that 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 =
[Equation]
, principle classiﬁer w [-1 ( x ) 
-][Equation]
= p s [Equation] y
[Equation] x )) p s ( y
[Equation]
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]
y ( x )) /
∑ y ′ p s ( f ( x )∣ y ′ ) p s ( y ′ ) p s ( y ( x )) + ∑ y ′ p t ( f ( x )∣ y ′ )
p t ( y ′ )
p t ( y ( x )) )
=
p s ( f ( x )∣ y ( x ))
p s ( y ( 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,
[Equation]
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
[Equation]
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
I npu t
V a n ill a O r ac l e M L DG
[Figure]
I
[Figure] t [Figure] a
[Figure]
D E XTRA E XPERIMENTS D. S TYLE TRANSFER
We show transferred samples for both domains in Fig.
4 on MNIST-C and CelebA-GH.
[Table]
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.
Table 6 reports 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 MNIST-C. 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, follow 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 MNIST-C 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 MNIST-C/CelebA.
E.1. D ETAILS OF M ODELS
We craft datasets for training the oracle w 1 ( x ) =
Pr ( Y ∣ z 1 ( x )) .
For MNIST-C, oracle dataset has bias degrees 0 ./ 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 MNIST-C, the two environments are datasets with bias degrees 0 .
5 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-blondhaired 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 MNIST-C, D 1 is the dataset with bias degrees 0 {+./ 
+}
and D 2 is the dataset with bias degrees 0 / 0 . 8 .
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 Z 2 accuracy measures the success rate of keeping Z 2 aspects unchanged.
E. D OMAIN ADAPTATION
The full names for the seven datasets are MNIST, MNIST-M, SVHN, GTSRB, SYN-DIGITS (DIGITS), SYN-SIGNS (SIGNS), CIFAR-10 (CIFAR) and STL-10 (STL).
We sub-sample each dataset by the designated imbalance ratio to construct the pairs.
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 1 which has gender as the sensitive attribute; the UCI German credit dataset 2 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 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 X
[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
[Equation]
Z
[Equation]
∣( z 1 )
[Equation]
=
[Equation]
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 w 2 does 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
[Equation]
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 0 ( 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 ) =
( 0 I m × m ) ( k + m )× m
[Equation]
2 µ 2 .
Together, the dot product between input gradients is
[Equation]
Since
[Equation]
x ) ) 2 > 0 , E [∇ x w 1 ( x ) T ∇ x w 2 ( 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 ∇ x
[Equation]
[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
[Equation]
The strict inequality holds by µ
[Equation]
To verify that µ T
[Equation]
[Equation]
exist, pick k = 3 ,m = 2 , g − 1 ( x ) =
[Equation]
⎞ ⎠ x , and µ 1 = ⎛ ⎝ 111 ⎞ ⎠ .
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.