D ISTRIBUTIONALLY R OBUST L EARNING FOR U NSUPERVISED D OMAIN A DAPTATION
Anonymous authors
Paper under double-blind review
A BSTRACT
We propose a distributionally robust learning (DRL) method for unsupervised domain adaptation (UDA) that scales to modern computer-vision benchmarks.
DRL can be naturally formulated as a competitive two-player game between a predictor and an adversary that is allowed to corrupt the labels, subject to certain constraints, and reduces to incorporating a density ratio between the source and target domains (under the standard log loss).
This formulation motivates the use of two neural networks that are jointly trained — a discriminative network between the source and target domains for density-ratio estimation, in addition to the standard classiﬁcation network.
The use of a density ratio in DRL prevents the model from being overconﬁdent on target inputs far away from the source domain.
Thus,
DRL provides conservative conﬁdence estimation in the target domain, even when the target labels are not available.
This conservatism motivates the use of DRL in self-training for sample selection, and we term the approach distributionally robust self-training (DRST).
In our experiments, DRST generates more calibrated probabilities and achieves state-of-the-art self-training accuracy on benchmark datasets.
We demonstrate that DRST captures shape features more effectively, and reduces the extent of distributional shift during self-training.
I NTRODUCTION
In many real-world applications, the target domain for deployment of a machine-learning (ML) model can signiﬁcantly differ from the source training domain.
Furthermore, labels in the target domain are often more expensive to obtain compared to the source domain.
An example is synthetic training where the source domain has complete supervision while the target domain of real images may not be labeled.
Unsupervised domain adaptation (UDA) aims to maximize performance on the target domain, and it utilizes both the labeled source data and the unlabeled target data.
A popular framework for UDA involves obtaining proxy labels in the target domain through selftraining (Zou et al., 2019).
Self-training starts with a classiﬁer trained on the labeled source data.
It then iteratively obtains pseudo-labels in the target domain using predictions from the current ML model.
However, this process is brittle, since wrong pseudo-labels in the target domain can lead to catastrophic failure in early iterations (Kumar et al., 2020).
To avoid this, self training needs to be conservative and select only pseudo-labels with sufﬁciently high conﬁdence level.
This entails accurate knowledge of the conﬁdence levels.
Accurate conﬁdence estimation is a challenge for current deep learning models.
Deep learning models tend to produce over-conﬁdent and misleading probabilities, even when predicting on the same distribution (Guo et al., 2017a; Gal & Ghahramani, 2016).
Some attempts to remedy this issue include temperature scaling (Platt et al., 1999), Monte-Carlo sampling (Gal & Ghahramani, 2016) and Bayesian inference (Blundell et al., 2015; Riquelme et al., 2018).
However, Snoek et al.
(2019) has shown that the uncertainty estimation from these models cannot be trusted under domain shifts.
In this paper, we instead consider the distributionally robust learning (DRL) framework (Liu &
Ziebart, 2014; 2017) which provides a principled approach for uncertainty quantiﬁcation under domain shifts.
DRL can be formulated as a two-player adversarial risk minimization game, as depicted in Figure 1(a).
Recall that the standard framework of empirical risk minimization (ERM) directly learns a predictor ˆ P ( Y | X ) from training data.
In contrast, DRL also includes an adversary Q ( Y | X )
[Table]
/p7IsORUuMo0J0RhoGar03gf7VuCuGFlzGRpEAFmS0KU25BbE3SsXpMUgJ8rA0mkum/WmSAdUKgM6zoEJz5kxdN+7Tu2HXn5qzauCziKKMDdIhqyEHnqIGuURO1EEEP6Am9oFfj0Xg23oz3WWvJKGb20R8ZH99sCp4S</latexit> <latexit sha1_base64="VRWHybXlTEa0GEfAeMumoe7RYMM=">AAACEHicbZDNSsNAFIUn9a/Wv6hLN8Ei1k1JRNBl0Y3LCrYVmhAm00k7dDIJMzfSEvIIbnwVNy4UcevSnW/jtA2orQcGDt+9lzv3BAlnCmz7yygtLa+srpXXKxubW9s75u5eW8WpJLRFYh7LuwArypmgLWDA6V0iKY4CTjvB8GpS79xTqVgsbmGcUC/CfcFCRjBo5JvHbigxyZp+5gIdQabyvDY6yX8AzIBvVu26PZW1aJzCVFGhpm9+ur2YpBEVQDhWquvYCXgZlsAIp3nFTRVNMBniPu1qK3BElZdND8qtI016VhhL/QRYU/p7IsORUuMo0J0RhoGar03gf7VuCuGFlzGRpEAFmS0KU25BbE3SsXpMUgJ8rA0mkum/WmSAdUKgM6zoEJz5kxdN+7Tu2HXn5qzauCziKKMDdIhqyEHnqIGuURO1EEEP6Am9oFfj0Xg23oz3WWvJKGb20R8ZH99sCp4S [Figure]
[Figure]
TargetPredictor
[Figure]
data, and X t represents the target unlabeled data, y pred is the predictor’s probabilistic labels and the y fake is the adversary’s proposed probabilistic labels.
(b) Architecture for end-to-end training of the
DRL framework without class regularization.
It is an instantiation of (a) using neural networks.
The expected target loss cannot be evaluated due to lack of target labels in the UDA setting.
Instead, we need to compute the gradients directly for training the networks.
We present the details in Sec. 2.2.
that is allowed to perturb the labels, subject to certain feature-matching constraints to ensure datacompatibility.
Formally, the minimax game for DRL is:
[Equation]
where the adversary Q ( Y | X ) is constrained to match the evaluation of a set of features Φ( x, y ) to that of the source distribution (see Section 2 for details).
Note that the loss in (1) is evaluated under the target input distribution P t ( X ) , and the predictor does not have direct access to the source data { X s , Y s } .
Instead, the predictor optimizes the target loss by playing a game with an adversary constrained by source data.
A special case of UDA is the covariate shift setting, where the label-generating distribution P ( Y | X ) is assumed to be the same in both source and target domains.
Under this assumption, with log-loss and a linear predictor parameterized by θ and features Φ( x, y ) , (1) reduces to:
[Equation]
Intuitively, the density ratio P s ( x ) /P
t ( x ) prevents the model from being overconﬁdent on target inputs far away from the source domain.
Thus, the DRL framework is a principled approach for conservative conﬁdence estimation.
Previous works have shown that DRL is highly effective in safety-critical applications such as safe exploration in control systems (Liu et al., 2020) and safe trajectory planning (Nakka et al., 2020).
However, these works only consider estimating the density ratio in low dimensions (e.g. control inputs) using standard kernel density estimator (KDE) and extending it to high-dimensional inputs such as images remains an open challenge.
Moreover, it is not clear if the covariate-shift assumption holds for common high-dimensional settings such as images — which we investigate in this paper.
In this paper, we propose a novel deep-learning method based on the DRL framework for accurate uncertainties that scales to modern domain-adaptation tasks in computer vision.
Summary of Contributions:
We develop differentiable density-ratio estimation as part of the DRL framework to enable efﬁcient end-to-end training.
See Figure 1(b).
We employ DRL’s conﬁdence estimation in the self-training framework for domain adaptation and term it as distributionally robust self-training (DRST).
See Figure 2. 3.
We further combine it with automated synthetic to real generalization (ASG) framework of (Chen et al., 2020b) to improve generalization in the real target domain when the source domain consists of synthetic images.
We demonstrate that DRST generates more calibrated probabilities.
DRST-ASG achieves competitive accuracy on the VisDA2017 dataset (Peng et al., 2017) with 1% improvement over the baseline class-regularized self-training (CRST) using the standard soft-max conﬁdence measure.
We analyze the reason for the effectiveness of DRST through a careful ablation study.
One challenge for training DRL is that the training loss cannot be directly evaluated under the UDA framework.
However, we show that the gradients of the target loss can indeed be evaluated.
By deriving gradients for both neural networks and proposing a joint training algorithm (Alg. 1), we show the network can be trained efﬁciently.
We also directly incorporate class regularization in the minimax game under our DRL framework.
This is a principled approach in contrast to standard label smoothing incorporated on top of a given learning method.
In our ablation studies, we observe that the covariate-shift assumption progressively holds to a greater extent as the iterations in self-training proceed.
This is also correlated with the greater ability to capture shape features through self training, as seen in the Grad-CAM visualization (Selvaraju et al., 2017).
P ROPOSED F ORMULATION AND A LGORITHMS
In this section, we ﬁrst introduce the class regularized DRL framework (2.1) and then propose differentiable density ratio estimation to enable end-to-end learning of DRL using neural networks.
We provide training details, especially the gradient computation for training both networks (2.2).
This is unique for our setting since the actual training loss on target cannot be evaluated due to lack of target labels.
Finally, we propose our self-training algorithm DRST in 2.3.
2. D ISTRIBUTIONALLY ROBUST LEARNING WITH C LASS R EGULARIZATION
We are interested in robustly minimizing the classiﬁcation loss on the target domain with conﬁdence of adversary’s prediction regularized.
We use a weighted logloss term to penalize high conﬁdence in the adversary’s label prediction as the regularization.
We make the same covariate shift assumption as in (Liu & Ziebart, 2014) that only the marginal input distribution changes and P ( y | x ) is shared between source and target: P s ( x ) (cid:54) =
P t ( x ) and P s ( y | x ) =
P t ( y | x ) .
We aim to solve the following:
[Equation]
where Y is a one-hot encoding of the class and r ∈ [0 , 1] is a hyper-parameter that controls the level of regularization.
In this formulation, the estimator player ˆ P ( Y | X ) ﬁrst chooses a conditional label distribution to minimize the regularized logloss on the target domain and then an adversarial player Q ( Y | X ) chooses a conditional label distribution from the set ( Ξ ) to maximize the regularized logloss.
The constraint set Ξ deﬁnes how much ﬂexibility we want to give to the adversary.
Usually, we design feature functions on both X and Y and restrict the adversary to match statistics of the expectation of the features.
We have the following lemma:
Lemma 1.
If we choose feature map Φ( X, Y ) as the statistics to constrain Q ( Y | X ) , then equationcan be reduced to a reguralized maximum entropy problem with the estimator constrained:
[Equation]
such that: ˆ P ( Y | X ) ∈ ∆ and | E P s ( x ) ˆ P ( y | x ) [Φ( X, Y )] − E P s ( x,y )
[Φ( X, Y )] | ≤ λ, where ∆ deﬁnes the conditional probability simplex that ˆ P ( y | x ) must reside within, Φ is a vectorvalued feature function that is evaluated on input x , and E P s ( x,y )
[Φ( X, Y )] is a vector of the expected feature values that corresponds with the feature function.
λ is the slack term of constraints.
The proof of this lemma involves strong duality of the convex-concave function, such that the min and max player can switch the order.
We refer more details to the appendix.
The following theorem states the solution of the problem:
Theorem 1.
The parametric solution of (4) for ˆ P ( y | x ) takes the form:
[Equation]
where the parameter θ can be optimized by maximizing the log-likelihood on the target distribution.
The gradients take the form:
[Equation]
where ˜ c (cid:44) E ˜ P
s ( x ) ˜ P
( y | x ) [Φ( X, Y )] , as the empirical evaluation of the feature expectations.
Here ˜ P s ( x ) and ˜ P ( y | x ) are the empirical distribution.
In principle, P ( y | x ) is the ground truth conditional label distribution shared between source and target domains.
We call
E P t ( x ) P ( y | x ) [ − log ˆ P θ ( Y | X )] the expected target loss in the paper.
Even though it is not available in practice, we can approximate the gradients (6) using the source data in training.
The norm of the approximated gradient converges to the true gradient in the rate of O (1 /m ) , where m is the amount of source data.
The proof involves application of the Lagrangian multiplier, setting the derivative of each speciﬁc ˆ P ( y | x ) to 0 and utilizing the KKT condition.
We refer details to the appendix.
Algorithm
Input : Source data , Target data , DNN φ ) , DNN τ , SGD optimizer Opt 1 and Opt 2 , learn- ing rate γ 1 and γ 2 , epoch number T .
Initialization : φ, τ ← random initialization, epoch ←
While epoch < T
For each mini-batch Compute (10) back propagate
Back propagate L d Optimizer Opt 1 ( γ 1 ) updates β
Compute ˆp following (5).
Compute gradients using (9) Back-propagate through ∇ φ L c w = w − γ 2 · ∇ w L c b = b − γ 2 · ∇ b L c Optimizer Opt 2 ( γ 2 ) updates α epoch ← epoch +
Output : Trained α , β , w , b
We use this form to illustrate the property of representation-level conservativeness and the class-level regularization of our formulation.
Representation-level conservativeness:
The prediction has higher certainty for inputs closer to the source domain, when magnitude of P s ( x ) /P
t ( x ) is large.
On the contrary, if the inputs are farther away from the source, which means P s ( x ) /P
t ( x ) is small, the prediction is uncertain.
Class-level regularization: Hyper-parameter r adjusts the smoothness of the Q ( Y | X ) ’s label prediction in (3).
It translates to the ry terms in the parametric form.
In training, we compute the gradients using source labels where y is the one-hot encoding of the class.
In testing, we can set y to be all one vector to obtain smoothed conﬁdence.
In machine learning methods using density ratios, such as transfer learning (Pan & Yang, 2009), or off-policy evaluation (Dud ´ ık et al., 2011), a plugin estimator for the density ratio P s ( x ) /P
t ( x ) is used.
However, density ratio estimation (Sugiyama et al., 2012), especially in the high-dimensional data, is rather different.
It is also not the case that more accurate density ratio estimation would lead to the better downstream task performance.
We have a synthetic example shown in Appendix E.
To scale up the method for modern domain adaptation tasks, we ask the question: can we train the density ratio estimation and the learning tasks that use the ratios together such that they share the common goal–the target domain predictive performance?
2. D IFFERENTIABLE D ENSITY R ATIO E STIMATION AND E ND - TO - END T RAINING FOR DRL
We propose an end-to-end training procedure for DRL such that density ratio estimation is trained together with the target classiﬁcation.
We use two neural networks for classiﬁcation and the density ratio estimation, respectively.
See ﬁgure 1(b).
Differentiable density ratio estimation: We make the observation that the density ratio in the parametric form (5) can be a trainable weight for each example, which can receive gradients from the objective function.
On the other hand, the density ratio can be estimated using a binary classiﬁcation using unlabeled source and target data.
Therefore, we propose to train a discriminative neural network to differentiate the two domains for the density ratio estimation, which receive training signals from both the target classiﬁcation loss and the binary classiﬁcation loss.
Expected target loss as a training objective: According to Theorem 1, even though the expected target loss cannot be evaluated using data, we can approximate the gradient (6) using source samples.
We can directly apply the gradients on the last layer of the classiﬁcation network and back-propagate to the other layers.
We next present the overall training objective and derive the gradients.
The overall training objective: Assume φ ( x, α, w , b ) is the classiﬁcation neural net with parameters w and b in the linear last layer and parameters α in the other layers.
The input is the source data.
Assume τ ( x, β ) is the discriminative neural net with parameters β , with input as both unlabeled source and target data.
The last layer of the classiﬁcation network is: w · φ ( x, α ) + b .
We use the following training objective that accounts for the interactions between training density ratios and classiﬁcation performance for the target domain:
[Equation]
where L c is the expected target loss E P t ( x ) P ( y | x ) [ − log ˆ P ( Y | X )] , which cannot be evaluated but has gradients available for training from the DRL framework, ˆ P ( Y | X ) takes the following form with neural networks as feature functions: ˆ P ( y | x ) ∝ exp
[Equation]
We use L d to represent the cross-entropy loss on the domain discriminator that produces ˆ P ( C | X ) , with C ∈ { s , t } as the source domain class and target domain class.
Here we use ˜ P ( x ) and ˜ P ( c | x ) to represent the overall unlabeled data distribution and the empirical domain class in the data.
Then the predictions from the classiﬁer are ˆ P ( c | x ) ∝ exp { cτ ( x, β ) } .
Based on the Bayes’ rule, the density ratio P t ( x ) P s ( x ) can be computed as:
[Equation]
Therefore, we can use a discriminator for estimating P ( t | x ) P ( s | x ) from unlabeled source and target data (Bickel et al., 2007).
Gradients for the classiﬁcation network: With density ratios, given by the discriminative network, we compute the gradient of the classiﬁcation network following (6) on w , φ ( x, α ) , and b .
[Equation]
where ˆP and y are vectors of predicted conditional label probabilities using the current parameters as in Eq.
(2.2) and the one-hot encoding of the true labels in the source data, respectively.
Note that ∇ w E P t ( x ) P ( y | x ) [ − log ˆ P ( Y | X )] corresponds with the gradient for learning θ in Eq.
(6), with Φ( x, y ) =
w · yφ ( x, α ) + b .
Gradients of the discriminative network from expected target loss : We denote d s = P ( s | x ) and d t = P ( t | x ) as the two weight scalars for each input x , and therefore we have ˆ P ( y | x ) ∝ exp { d s d t ( w · yφ ( x, α ) + b ) } .
Since vec ( d s , d t ) is exactly the output of the density estimator, we treat ( d s , d t ) as trainable variables and derive gradients from the expected target loss L c .
In this way, the parameter β of the density ratio estimation network has additional learning signals from both losses.
We derive the gradients as:
[Equation]
which is dependent on unlabeled the target inputs ˜ P t ( x ) , but does not rely on the target labels.
We refer to the appendix for the detailed derivation.
Then we concatenate (10) into a gradient vector and back-propagate the discriminative network.
We summarize the procedure in Algorithm 1.
2. D ISTRIBUTIONALLY R OBUST S ELF -T RAINING
Algorithm: We propose Algorithm 2 to combine the DRL model with self-training.
The idea is to regard each training epoch as a new distribution shift problem in DRL.
After each training epoch, we make predictions on the target domain and select the top conﬁdent portion with the proxy labels to merge into the source training data.
Both the pseudo labels and the model conﬁdence are from the DRL model (5).
Then the labeled source data and newly pseudo-labeled target portion become the new source set for the next learning epoch for DRL, as shown in Figure 2.
As studied in the previous self-training work (Zou et al., 2018), the data proportion p does not have signiﬁcant impact on the results.
After validating this in practice, we set p = 0 .
5 for DRST for simplicity.
[Table] [Table]
/7qDWKWRlwhk9SYrucm6GdUo2CST0u91PCEsjEd8q6likbc+Nn83Ck5s8qAhLG2pZDM1d8TGY2MmUSB7YwojsyyNxP/87ophtd+JlSSIldssShMJcGYzH4nA6E5QzmxhDIt7K2EjaimDG1CJRuCt/zyKmnVqp5b9e4vK/WbPI4inMApXIAHV1CHO2hAExiM4Rle4c1JnBfn3flYtBacfOYY/sD5/AHaX489</latexit>
[Figure]
[Figure] [Table] [Figure] [Table]
Predict on target data using
[Table]
5) and
[Table]
dataConduct [Table] epoch ← epoch +
Initialization with ASG:
The quality of source model has an impact on the ﬁnal self-training performance.
Recently, (Chen et al., 2020b) proposed automated synthetic-to-real generalization (ASG) where ImageNet pre-trained knowledge is used to improve synthetic training through a distillation loss.
It was shown that initializing with ASG trained model leads to signiﬁcant improvement in self-training.
As a result, we also take the ASG model as our model initialization, and show solid improvements from DRST on top of competitive baselines.
E XPERIMENTS
In this section, we evaluate the performance of our method on benchmark domain adaptation benchmark datasets.
We evaluate DRST as an effective unsupervised domain adaptation method (Sec. 3.1) and DRL as a domain generalization method providing more calibrated uncertainties (Sec. 3.2).
We adopt three datasets in our experiments: Ofﬁce31 (Saenko et al., 2010), Ofﬁce-Home (Venkateswara et al., 2017) and VisDA2017 (Peng et al., 2017).
In particular, we use the largest data VisDA2017 for the evaluation of DRST, for which we compare with (1) traditional UDA baselines: MMD (Long et al., 2015), MCD (Saito et al., 2018b) and ADR (Saito et al., 2018a); (2) recent self-training UDA baselines: CBST (Zou et al., 2020) and CRST (Zou et al., 2020); (3) other uncertainty quantiﬁcation or UDA methods + self-training baselines: AVH (Chen et al., 2020a)
+ CBST and DeepCORAL(Sun & Saenko, 2016)+CBST.
In addition, we use Ofﬁce31 and Ofﬁce-Home for evaluating DRL’s performance.
We compare DRL with source training only and temperature scaling for demonstrating the calibration of the uncertainties used in DRST.
Apart from accuracy, we also use Brier score (Brier, 1950) and the realiability plot (Guo et al., 2017a) to evaluate the performance of our proposed method and the baselines.
Brier score measures the mean squared difference between the predicted probability p assigned to the possible outcome and actual outcome y : BS = 1 n n (cid:80) i
= m (cid:80) j
=1 ( p ij − y ij ) 2 .
The lower the Brier score is for a set of predictions, the better the predictions are calibrated.
3. U NSUPERVISED D OMAIN A DAPTATION USING DRST
Accuracy and calibration: Figure 3(a) and table 1 demonstrates that DRST outperforms all the baselines in accuracy.
Our vanilla version of DRST outperforms CRST by more than 5% and with
ASG initialization, we improve the SOTA self-training accuracy on VisDA by more than 1%.
Note that in the rest of the results, we directly use DRST to represent DRST-ASG.
Figure 3(b) demonstrates that DRST also achieves more calibrated conﬁdence.
Ablation study: Figure 3(a)(b) also include two ablation methods.
In the ﬁrst ablation, we set r to 0 so that there is no class regularization in DRL (“r = 0”).
The prediction then follows the form in
Eq.
In the second ablation, we set density ratio to 1 such that there is no representation level
[Table]
82.4 DRST (proposed) 93.47 86.30 65.74 68.03 93.99 95.08 87.34 83.30 92.
83.66 66.42 83.75 ASG(Chenetal.
,2020b)
86.00 12.04 61.17 CBST-ASG(Chenetal.
,2020b)
73.42 56.49 82.23 CRST-ASG(Chenetal.
,2020b)
74.88 61.10 84.21 DRST-ASG (proposed) 94.51 85.58 76.50 77.18 94.39 95.33 88.89 81.23 94.
[Figure]
We show that DRST is outperforming consertiveness (“R = 1”), which means we mute the differentiable density ratio estimation in our method.
We can see that DRST achieves the best performance when both components are present.
We also predicted labels by different methods method shape
Covariate shift: In ﬁgure 3(c), we demonstrate the ratio difference between P s ( x ) /P
t ( x ) −
P s ( x, y ) /P
t ( x, y ) , where x is the last layer representations from each of the method.
We estimate this ratio using discriminative density ratio estimators (per class).
When P s ( y | x ) =
P t ( y | x ) , the ratio difference is close to 0.
We can see that the P ( y | x ) gap between source and target is decreasing along self-training.
This is due to the shape features captured by the method.
We can also observe it from ﬁgure 4, where we visualize the last layer model attention of our model and the baselines.
Therefore, even though the covariate shift assumption from DRL may not be satisﬁed at the beginning of self-training, self-training helps align P ( y | x ) by promoting the learning of shape representations, such that P s ( y | x ) and P t ( y | x ) converges along the training.
Density ratio estimation: We show a pair of examples in the target domain with relatively high and low density ratios.
In ﬁgure 5(a), a more typical “train” image obtains higher density ratio than a train on a busy platform, whose shape of the train is not obvious.
DRL is able to give higher conﬁdence to images that are better-represented in the synthetic training domain.
More examples are given in the appendix.
[Figure]
[Figure]
[Figure]
3. P REDICTIVE PERFORMANCE AND UNCERTAINTY QUANTIFICATION OF DRL
We compare DRL with source models on VisDA2017 , Ofﬁce-31 , and Ofﬁce-Home datasets to show the DRL model’s accuracy and calibration.
Note that DRL can be regarded as a lightweight model generalization method since the target unlabeled data is only used for the density ratio estimation.
DRL’s improvement on source training: Figure 5 (b) and Figure 6 demonstrate the signiﬁcant improvement over the source synthetic training model in all the data sets.
Note that the only difference between the DRL and the source model is DRL’s predictive form and the differentiable density ratio estimation.
In these plots, all the models are trained with the same number of total training epochs.
The accuracy and brier score at epoch 5 means we incorporate DRL to improve source training mode from epoch 5.
Therefore, we can observe DRL’s consistent signiﬁcant improvement over the source training model even when starting late in the learning process.
The lower brier score provides evidence on more conservative model conﬁdence that beneﬁts self-training.
DRL’s conservativeness in conﬁdence: Figure 7 demonstrates DRL’s more calibrated uncertainty measure.
We adopt the same deﬁnition of conﬁdence and accuracy as (Guo et al., 2017a) and the same diagram plotting protocol as (Maddox et al., 2019).
The closer the curve is to the dash line, the more calibrated the uncertainty is.
DRL tends to be a little underconﬁdent but also stays closer to the calibration line (dash line).
[Figure]
R ELATED W ORK
Uncertainty Quantiﬁcation with Deep Models: Bayesian methods largely contribute to current effort for complementing deep learning with uncertainty quantiﬁcation.
MCMC (Gal, 2016; Welling & Teh, 2011; Chen et al., 2014), (stochastic) variational inference for deep learning (Kingma &
Welling, 2013; Louizos & Welling, 2017; Blundell et al., 2015; Riquelme et al., 2018), dropout variational inference (Gal & Ghahramani, 2015; Gal et al., 2017; Kendall & Gal, 2017), and SGDbased approximations (Mandt et al., 2017) aim to approximate the Bayesian inference from different perspectives in the deep learning setting.
However, with a large number of parameters in the neural network, Bayesian deep learning may suffer from computational inefﬁciency.
Other calibration methods such as temperature scaling (Platt et al., 1999; Guo et al., 2017b), deep ensemble (Lakshminarayanan et al., 2017), calibration regression (Kuleshov et al., 2018), quantile regression (Romano et al., 2019) and trainable calibration measure (Kumar et al., 2018).
However, these methods are not applicable to our domain shift setting.
Unsupervised Domain Adaptation: One line of work in unsupervised domain adaptation methods focus on (feature) representation alignment between the source and target domains (Fernando et al., 2014; Pan et al., 2010; Sun et al., 2016;
Wang et al., 2018; Baktashmotlagh et al., 2013; Gretton et al., 2012).
In deep learning, it is more prevalent to use a discriminator network to differentiate two learned representations (adversarially) to locate such a feature space (Tzeng et al., 2017; Ajakan et al., 2014;
Long et al., 2018; Sankaranarayanan et al., 2017).
However, recent study show that this approach lacks theoretical grounding (Wu et al., 2019) and suffers from unstable training.
Another line of work focus on more speciﬁc shift assumptions between two domains, like covariate shift (Shimodaira, 2000) and label shift (Lipton et al., 2018; Azizzadenesheli et al., 2019).
Importance weighting on source samples is the common strategy to correct the shift.
For the covariate shift case, even though various density ratio estimation has been investigated before (Sugiyama et al., 2012), only few works explore the possibility to apply them in high-dimensional data (Khan et al., 2019;
Moustakides & Basioti, 2019; Park et al., 2020).
Self-training for UDA: Multiple self-training methods have been proposed to do unsupervised domain adaptation.
Class-balance self-training (Zou et al., 2018) propose a class-balancing technique to avoid the gradual dominance of large classes on pseudo-label generation.
Smoothing the model conﬁdence further help improve the performance (Zou et al., 2019).
It is also helpful to use a query selection strategy based on angular visual hardness (Chen et al., 2019).
Recently, more theoretical understanding of self-training are developed (Kumar et al., 2020; Chen et al., 2020c).
In this paper, we incorporate ideas from the CRST to smooth the DRL’s model uncertainty and demonstrate that
DRL’s model conﬁdence helps choose better pseudo-labeled data from the target domain.
Distributionally robust learning: Distributionally robust learning (Liu & Ziebart, 2014; 2017;
Chen et al., 2016; Fathony et al., 2016; 2018) for domain shift is developed based on a pessimistic perspective of the ﬁnite samples existing in the source domain.
However, the limitation of this line of work is that it usually only works for low-dimensional data.
Another inconvenience lies in the requirement for the density ratio P s ( x ) /P
t ( x ) to be done beforehand.
Instead of having the adversary as the conditional labeling function, an alternative is to have it perturbing the covariate variable (Ben-Tal et al., 2013; Shaﬁeezadeh Abadeh et al., 2015; Sinha et al., 2017;
Hu et al., 2018; Najaﬁ et al., 2019).
This line of work has been mostly focusing on model robustness against adversarial perturbations.
Instead, in this paper, we focus on the beneﬁt of DRL’s uncertainty estimation for self-training in UDA.
We apply neural networks and propose end-to-end learning method to handle high-dimensional image data.
C ONCLUSION
In this paper, we develop a learning method under the distributionally robust learning framework for modern domain adaptation.
We propose differentiable density ratio estimation and class regularization in the framework.
We develop end-to-end training techniques for our proposed method.
Using
DRL’s model conﬁdence, our self-training algorithm achieves SOTA predictive performance while stay calibrated.
We also demonstrate that self-training helps reduce the distribution gap between source and target domains, facilitating DRL to be effective. A P ROOF OF L EMMA Proof.
The two-player game in (3) can be written as:
[Equation]
According to strong Lagrangian duality
[Equation]
we can switch the order of the two players and it is equivalent to:
[Equation]
Solving the minimizing problem ﬁrst assuming that we know Q ( Y | X )
[Equation]
we get the result that ˆ P ( Y | X ) =
Q ( Y | X ) .
Plugging it into the maximizing problem, the whole problem reduces to (4).
B P ROOF OF T HEOREM
Proof.
The generalized constrained optimization problem in (4) can be written as:
[Equation]
such that:
[Equation]
Note that the ﬁnal constraint is superﬂuous since the domain of the objective function is the positive real numbers.
The Lagrangian associated with this problem is:
[Equation]
 , where θ and λ ( x ) are the Lagrangian multipliers.
Taking the derivative with respect to ˆ P ( y | x ) , ∂
[Equation]
setting equal to zero, ∂
∂ ˆ P ( y | x ) L ( θ, λ ) = 0 , and solving, we get:
[Equation]
Therefore, if we instead set y as a one-hot encoding of the prediction, we conclude:
[Equation]
The derivation of gradient then resembles the derivation in Theorem 1 in (Liu & Ziebart, 2014).
[Figure]
[Equation]
C D ETAILED DERIVATION OF GRADIENTS
Gradient of the expected target loss over source densities d s , where we use R for the density ratio P s ( x ) P t ( x ) or d s d t :
[Equation]
and gradient of loss over target densities d t :
[Equation]
13) where:
[Equation]
D A DDITIONAL DRST E XPERIMENTAL R ESULTS
We demonstrate the TSNE plot of the learned decision boundaries for CBST, CRST and DRST in ﬁgure 8.
Figure 9 shows the misclassiﬁcation entropy comparison between source model and DRL model.
Misclassiﬁcation entropy is calculated as S i = 1 n
[Equation]
mj
=1 p ij log p ij , where n is the number of samples and m is the number of categories in the dataset, and p ij indicates the prediction probability of the i th sample on the j th category.
The larger misclassiﬁcation entropy is, the more uncertain the model prediction result is on the wrong predictions.
This means the model would fail more gently.
Figure 10 demonstrates additional model attention visualization.
Figure 11 shows additional target examples with high and low density ratios.
Our model is able to ﬁnd noisy and less-represented image from the target data by estimating the density ratios.
DRL would be more uncertain on those data.
[Figure]
E S IMULATION ON P LUG - IN E STIMATOR
DRL for domain shift requires P s ( x ) /P
t ( x ) to adjust the representation-level conservativeness.
Like many other machine learning methods using importance weights, like in transfer learning (Pan &
Yang, 2009), or off-policy evaluation (Dud´ık et al., 2011), we can use a plug-in estimator for the density ratio P s ( x ) /P
t ( x ) .
However, density ratio estimation (Sugiyama et al., 2012), especially in the high-dimensional data, is rather different.
Here, we ask the question: whether a more accurate density ratio estimation leads to greater predictive performance in the downstream tasks?
We show a two-dimensional binary classiﬁcation example in ﬁgure 12 to demonstrate relation between the performance of the density (ratio) estimation and the performance of the ultimate target learning tasks.
We use the RBA method (Liu & Ziebart, 2014) as an example.
We conduct kernel density estimation (KDE) and evaluate the average log-likelihood of the source and target domain.
We take the ratio of the density from KDE and plug in the RBA method.
We can see that the case with higher log-likelihood actually fail to give informative predictions.
One of the reason is the density (ratio) estimation task, as an independent learning task, does not share information with the downstream prediction tasks that use the ratios.
[Figure]
F A DDITIONAL R ESULTS FOR DRL ON O FFICE -
We include additional result for distributionally robust learning on ofﬁce-31 in Figure 13 and Figure 14.
G C ODE R EPOSITORY
Code can be found at: https://anonymous.4open.science/r/ 2ed8a9ce-f404-4489-9ef7-a3a83e02a44c/