## Prototypical Partial Optimal Transport for Universal Domain Adaptation

Yucheng Yang , Xiang Gu , Jian Sun * * †

School of Mathematics and Statistics, Xi'an Jiaotong University, Xi'an, China ycyang@stu.xjtu.edu.cn, { xianggu, jiansun } @xjtu.edu.cn

## Abstract

Universal domain adaptation (UniDA) aims to transfer knowledge from a labeled source domain to an unlabeled target domain without requiring the same label sets of both domains. The existence of domain and category shift makes the task challenging and requires us to distinguish 'known' samples ( . i e ., samples whose labels exist in both domains) and 'unknown' samples ( . ., i e samples whose labels exist in only one domain) in both domains before reducing the domain gap. In this paper, we consider the problem from the point of view of distribution matching which we only need to align two distributions partially. A novel approach, dubbed mini-batch Prototypical Partial Optimal Transport (m-PPOT), is proposed to conduct partial distribution alignment for UniDA. In training phase, besides minimizing mPPOT, we also leverage the transport plan of m-PPOT to reweight source prototypes and target samples, and design reweighted entropy loss and reweighted cross-entropy loss to distinguish 'known' and 'unknown' samples. Experiments on four benchmarks show that our method outperforms the previous state-of-the-art UniDA methods.

tation (PDA) (Cao et al. 2018a) assumes that target class set is a subset of source class set, i e . ., C t ⊆ C s . Open-set domain adaptation (OSDA) (Saito et al. 2018) exploits the situation where source class set is a subset of target class set C s ⊆ C t . Universal domain adaptation (UniDA) (You et al. 2019) is a more general setting that both source and target domains possibly have common and private classes. The setting of UniDA includes PDA, OSDA, and a mixture of PDA and OSDA, i e . ., open-partial DA (OPDA) (Panareda Busto and Gall 2017), in which both source and target domains have private classes. This paper focuses on the general UniDA setting. The goal of UniDA is to classify target domain common class samples and detect target-private class samples, meanwhile reducing the negative transfer possibly caused by source private classes. To reduce the domain gap in UniDA, we may use distribution alignment techniques as in UDA methods (Courty et al. 2017; Ganin and Lempitsky 2015), to align the distributions of two domains. However, matching all data of two domains may lead to the mismatch of the common class data of one domain to the private class data in the other domain, and cause negative transfer.

## 1 Introduction

Deep Learning has achieved significant progress in image recognition (Krizhevsky, Sutskever, and Hinton 2012; Simonyan and Zisserman 2014). However, deep learning based methods heavily rely on in-domain labeled data for training, to be generalized to target domain data. Considering that collecting annotated data for every possible domain is labour-intensive and time-consuming, a feasible solution is unsupervised domain adaptation (UDA) (Ben-David et al. 2010; Ganin and Lempitsky 2015; Long et al. 2018), which transfers the knowledge from labeled source domain to unlabeled target domain by alleviating distribution discrepancy between them. The most common setting in UDA is closedset DA which assumes the source class set C s is identical to the target class set C t . This may be impractical in real-world applications, because it is difficult to ensure that the target dataset always has the same classes as the source dataset.

To tackle this problem, some works consider more general domain adaptation tasks. For example, partial domain adap-

* These authors contributed equally.

† Corresponding Author.

Copyright © 2023, Association for the Advancement of Artificial Intelligence (www.aaai.org). All rights reserved.

In this work, we propose a novel Prototypical Partial Optimal Transport (PPOT) approach to tackle UniDA. Specifically, we model distribution alignment in UniDA as a partial optimal transport (POT) problem, to align a fraction of data (mainly from common classes), between two domains using POT. We design a prototype-based POT, in which the source data are represented as prototypes in POT formulation, which is further formulated as a mini-batch-based version, dubbed m-PPOT. We prove that POT can be bounded by m-PPOT and the distances between source samples and their corresponding prototypes, inspiring us to design a deep learning model for UniDA by using m-PPOT as one training loss. Meanwhile, the transport plan of m-PPOT can be regarded as a matching matrix, enabling us to utilize the row sum and column sum of the transport plan to reweight the source prototypes and target samples for distinguishing 'known' and 'unknown' samples. Based on the transport plan of m-PPOT, we further design reweighted cross-entropy loss on source labeled data and reweighted entropy loss on target data to learn a transferable recognition model.

In experiments, we evaluate our method on four UniDA benchmarks. Experimental results show that our method performs favorably compared with the state-of-the-art methods for UniDA. The ablation study validates the effectiveness of individual components proposed in our method.

## 2 Related Work

## 2.1 Domain Adaptation

Unsupervised domain adaptation aims to reduce the gap between source and target domains. Previous works (Ganin and Lempitsky 2015; Long et al. 2015, 2018) mainly focus on distribution alignment to mitigate domain gaps. The theoretical analysis in (Ben-David et al. 2010) shows that minimizing the discrepancy between source and target distributions may reduce the target prediction error. Previous works often minimize distribution discrepancy between two domains by adversarial learning (Ganin and Lempitsky 2015; Long et al. 2018; Zhang et al. 2019) and moment matching (Long et al. 2015; Sun and Saenko 2016; Pan et al. 2019). Partial DA (Cao et al. 2018b) tackles the scenario that only the source domain contains private classes. The methods in (Cao et al. 2018a; Zhang et al. 2018; Gu et al. 2021) are mainly based on reweighting source data for reducing negative transfer caused by source private class samples. Openset DA (Saito et al. 2018) assumes that the label set of the source domain is a subset of that of the target domain. (Saito et al. 2018; Liu et al. 2019; Bucci, Loghmani, and Tommasi 2020) propose diverse methods to classify 'known' samples meanwhile rejecting 'unknown' samples.

## 2.2 Universal Domain Adaptation

Universal DA does not have any prior knowledge on the label space of two domains, which means that both source and target domains may or may not have private classes. UAN (You et al. 2019) computes the transferability of samples by entropy and domain similarity to separate 'known' and 'unknown' samples. CMU (Fu et al. 2020) improves UAN to measure transferability by a mixture of entropy, confidence, and consistency from ensemble model. DANCE (Saito et al. 2020) designs an entropy-based method by increasing the confidence of common class samples while decreasing it for private class samples to better distinguish known and unknown samples. DCC (Li et al. 2021) tries to exploit the domain consensus knowledge to discover matched clusters for separating common classes in cluster-level. OVANet (Saito and Saenko 2021) trains a 'one-vs-all' discriminator for each class to recognize private class samples. GATE (Chen et al. 2022) explores the intrinsic geometrical relationship between the two domains and designs a universal incremental classifier to separate 'unknown' samples. Different from the above methods, we model the UniDA as a partial distribution alignment problem and propose a novel m-PPOT model to solve it.

## 2.3 Optimal Transport

Optimal transport (OT) (Villani 2009; Peyr´ e, Cuturi et al. 2019) is a mathematical tool for transporting/matching distributions. OT has been applied to diverse tasks such as generative adversarial training (Arjovsky, Chintala, and Bottou 2017), clustering (Ho et al. 2017), domain adaptation (Courty et al. 2017), object detection (Ge et al. 2021), etc.

The partial OT (Caffarelli and McCann 2010; Figalli 2010) is a special OT problem that only transports a portion of the mass. To reduce computational cost of OT, the Sinkhorn OT (Cuturi 2013) can be efficiently solved by the Sinkhorn algorithm, and is further extended to partial OT in (Benamou et al. 2015). In (Flamary et al. 2016; Courty et al. 2017; Damodaran et al. 2018), OT was applied to domain adaptation to align distributions of source and target domains in input space or feature space. They use OT in mini-batch to reduce computational overhead, however, suffering from sampling bias that the mini-batch data partially reflect the original data distribution. (Fatras et al. 2021; Nguyen et al. 2022) replace mini-batch OT with more robust OT models, such as unbalanced mini-batch OT and partial mini-batch OT, and achieve better performance. (Xu et al. 2021) designs joint partial optimal transport which only transports a fraction of the mass for avoiding negative transfer, and extends the task into open-set DA.

In this work, we consider the UniDA task. We propose a novel mini-batch based prototypical POT model, which partially aligns the source prototypes and target features to solve the problem of UniDA. Experiments show that our method achieves state-of-the-art results for UniDA.

## 3 Preliminaries on Optimal Transport

We consider two sets of data points, { x s i } m i =1 and { x t j } n j =1 , of which the empirical distributions are denoted as µ = ∑ m i =1 µ δ i x s i and ν = ∑ n j =1 ν δ j x t j respectively, where ∑ m i =1 µ i = 1 , ∑ n j =1 ν j = 1 and δ x is the Dirac function at position x . With a slight abuse of notations, we denote µ = ( µ , µ 1 2 , · · · , µ m ) ⊤ , ν = ( ν , ν 1 2 , · · · , ν n ) ⊤ and define a cost matrix as C ∈ R m n × , C ij = ( c x , x s i t j ) .

Kantorovich problem. The Kantorovich problem (Kantorovitch 1958) aims to derive a transport plan from µ to ν , modeled as the following linear programming problem:

$$\mathfrak { l } _ { \mathfrak { e } } \quad & \text$$

where ⟨· , ·⟩ F denotes the Frobenius inner product.

Mini-batch OT is designed to reduce computational cost and make OT more suitable for deep learning. We denote the collection of empirical distributions of b random samples in { x s i } m i =1 (resp. { x t j } n j =1 ) as P b ( µ ) (resp. P b ( ν ) ), where b is the batch size, and k is the number of mini-batches. The mini-batch OT is defined as

$$\mathbf m \text{-OT} _ { k } ( \mu, \nu ) =$$

where A i ∈ P b ( µ ) , B i ∈ P b ( ν ) for any i = 1 2 , , ..., k .

Partial OT aims to transport only α mass (0 ⩽ α ⩽ min( ∥ µ ∥ 1 , ∥ ν ∥ 1 )) between µ and ν with the lowest cost. The partial OT is defined as

$$\text{POT} ^ { \alpha } ( \mu, \nu ) \stackrel {$$

$$\begin{array} {$$

Figure 1: Illustration of our model. Source and target data share the same feature extractor that embeds data in feature space. PPOT is to match target features and source prototypes which are updated by the source features, and the row/column sum of transport plan is applied for reweighting. We design reweighted entropy loss to align common class features of two domains, while pushing away the unknown features.

![image](https://ac.marcodsn.me/arxiv-markdown-images/2408.01089v1-figure-d5828c21-7368-4a0c-a195-96bbe736c8a2.jpg)

## 4 Method

In this section, we model UniDA as a partial distribution alignment problem. To partially align source and target distributions, the mini-batch prototypical partial optimal transport (m-PPOT) is proposed. The m-PPOT focuses on the discrete partial OT problem between source prototypes and target samples for mini-batch. Based on m-PPOT, we design a novel model for UniDA. We also use contrastive pre-training to have a better initialization of network parameters.

In UniDA, we are given labeled source data D s = { x , y s i i } m i =1 and unlabeled target data D t = { x t j } n j =1 . UniDA aims to label the target sample with a label from source class set C s or discriminate it as an 'unknown' sample. We denote the number of source domain classes as L = | C s | . Our deep recognition model consists of two modules, including a feature extractor f mapping input x into feature z , and an L -way classification head h . The source and target empirical distributions in feature space are denoted as ¯ p = ∑ m i =1 p δ i f ( x s i ) and ¯ q = ∑ n j =1 q δ j f ( x t j ) respectively, where ∑ m i =1 p i = 1 , ∑ n j =1 q j = 1 . With a slight abuse of notations, we denote the vector of data mass as ¯ p = ( p , p 1 2 , ..., p m ) ⊤ and ¯ q = ( q 1 , q 2 , ..., q n ) ⊤ and we set p i = 1 m , q j = 1 n for any i, j in this paper. Furthermore, the element of cost matrix C is defined as C ij = d f ( ( x s i ) , f ( x t j )) , where d is the L 2 -distance.

## 4.1 Modeling UniDA as Partial OT

(Ben-David et al. 2006, 2010) presented theoretical analysis on domain adaptation, emphasizing the importance of minimizing distribution discrepancy. However, it can not be simply extended to UniDA because the source/target data may belong to source/target private classes in UniDA setting. Directly aligning source distribution ¯ p and target distribution ¯ q will lead to data mismatch due to the existence of 'unknown' samples in both domains. For UniDA task, we first decompose ¯ ¯ p q , as

$$\bar { p } = ( 1 - \beta ) p _ { p } + \beta p _$$

where p p (resp. q p ) denotes distribution of source (resp. target) private class data in feature space, p c and q c are denoted as source and target common class data distributions, α and β are the ratio of common class samples in the source and target domain respectively. Our goal is to minimize the discrepancy between p c and q c , formulated as an OT problem:

$$\min _ { f, \pi } \langle \pi, \bar { C } \rangle _ { F } = \min _ { f } \text{OT} ( p _ { c }, q _ { c } ), \quad \ \ ( 4 )$$

where ¯ C ∈ R | p c |×| q c | is a submatrix of C , corresponding to the common class samples.

Obviously, we can not directly get these two distributions. Therefore, we consider to find an approximation of Eqn. (4). Following the assumption in (You et al. 2019) that q c is closer to p c than q p , meaning that the cost of transport between two domains' common class samples is generally less than the cost between two private class samples of these two domains or the private and common class samples of them. Note that partial OT only transports a fraction of the mass having lowest cost to transport. With the above assumption, the partial transport between two domains will prefer to transfer the common class samples of them. Therefore, we approximately solve Eqn. (4) by optimizing

$$\min _ { f } \Pi ^ { \alpha } ( \frac { \alpha } { \beta } \bar { p }, \bar { q } )$$

where coefficient ( α/β ) is to ensure that the mass of common class samples in ¯ p and ¯ q equals. The superscript α denotes the total mass to transport. For convenience of presentation, ( α/β ) · ¯ p and ¯ q are denoted as p and q respectively.

## 4.2 Prototypical Partial Optimal Transport

We have turned the distribution alignment between p c and q c into a partial OT problem in Eqn. (5). The remaining challenge is to embed partial OT into a deep learning framework. In this paper, we design a mini-batch based prototypical partial optimal transport problem for UniDA. We first define the Prototypical Partial Optimal Transport (PPOT).

Definition 1. (Prototypical Partial Optimal Transport) Let { c i } L i =1 be the set of source domain prototypes, defined as

$$c _ { i } = \sum _ { j \colon y _ { j } = i } \frac { \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot } { f ( x _ { j } ^ { s } ) } \frac { \cdot \cdot \cdot \cdot \cdot \cdot } { \sum _ { l = 1 } ^ { m } \mathbf 1 ( y _ { l } = i ) }.$$

The element of cost matrix C ij is defined as d c , f ( i ( x t j )) and the PPOT transportation cost between p and q is defined as

$$\text{PPOT} ^ { \alpha } ( p, q ) \stackrel { \triangle } { = } \text{POT} ^ { \alpha } ( c, q ) = \min _ { \pi \in \Pi ^ { \alpha } ( c, q ) } \langle \pi, C \rangle _ { F }, \ \ ( 6 ) \quad \text{but} \\ \text{sep}$$

where c = ∑ L i =1 r δ i c i is the empirical distribution of source domain prototypes, and r i = ∑ j y : j = i p j .

PPOT is suitable for the DA task because, first, it fits the mini-batch based deep learning implementation in which all of the prototypes, instead of batch of source samples, are regarded as source measures in POT. This change could reduce the mismatch caused by the lack of full coverage of source samples in a batch, and second, it requires less computational resources than original POT.

Mini-batch based PPOT. We further extend the PPOT to the mini-batch version m-PPOT, here we assume batch size b satisfy b | n and set k = n/b . Let B i be the i -th index set of b random target samples and their corresponding empirical distribution in feature space is denoted as q B i . We define B ≜ {B } i k i =1 as a partition if they satisfy:

- · B i ⋂ B j = ∅ : ∀ 0 ⩽ i &lt; j ⩽ k

$$\bullet \bigcup _ { i = 1 } ^ { k } \mathcal { B } _ { i } = \{ 1, 2, \dots, n \} \\ \dots \quad \dots \quad \dots \quad \dots \quad.$$

and the m-PPOT is defined as

$$\mathfrak { m } { - } \text{PPOT} _ { \mathcal { B } } ^ { \alpha } ( p, q ) \stackrel { \triangle } { = } \frac { 1 } { k } \sum _ { i = 1 } ^ { k } \text{POT} ^ { \alpha } ( c, q _ { \mathcal { B } _ { i } } ), \ \mathcal { B } \in \Gamma \quad ( 7 ) \quad \stackrel { \text{be} \, } { \text{as} \, i } \\ \text{firs}$$

where Γ is the set of all partitions of { 1 2 , , ..., n } , i e . ., the index set of target data. Note that these assumptions are easily satisfied by the dataloader module in pytorch. Furthermore, we denote the optimal transportation in i -th batch as π α i . To show that m-PPOT is closely related to PPOT, we give the following proposition 1.

Proposition 1. We extend π α i to a L × n matrix Π α i that pad zero entries to the column whose index does not belong to B i , then we have

$$\frac { 1 } { k } \sum _ { i = 1 } ^ { k } \Pi _ { i } ^ { \alpha } \in \Pi ^ { \alpha } ( c, q )$$

and

$$\text{PPOT} ^ { \alpha } ( p, q ) \leqslant \mathfrak { m } { \text{-PPOT} } _ { \mathcal { B } } ^ { \alpha } ( p. q ). \quad \text{ \quad \ \ } ( 8 )$$

Proposition 1 implies that m-PPOT α B ( p q , ) is an upper bound for PPOT α ( p q , ) . The following theorem shows that POT is bounded by the sum of m-PPOT and the distances of source samples to their corresponding prototypes.

Theorem 1. Considering two distributions p and q , the distance between f ( x s i ) and corresponding prototype c y i is denoted as d i ≜ d f ( ( x s i ) , c y i ) . The row sum of the optimal transport plan of PPOT α ( p q , ) is denoted as w = ( w , w , ..., w 1 2 L ) ⊤ , r i = ∑ j y : j = i p j . Then we have

$$\prod _ { \substack { \text{ POT} ^ { \alpha } ( p, q ) \leqslant \sum _ { i = 1 } ^ { m } \frac { m } { r _ { y _ { i } } } p _ { i } d _ { i } + \text{m-PPOT} ^ { \alpha } _ { \mathcal { B } } ( p, q ). \quad ( 9 ) \quad \text{$\omega$} } } \text{(the}$$

The proofs of theorem 1 and proposition 1 are included in Appendix.

## 4.3 UniDA based on m-PPOT

Our motivation is to minimize discrepancy between distributions of source and target common class data, meanwhile separating 'known' and 'unknown' data in both domains in training. We design the following losses for training.

m-PPOT loss. Based on theorem 1, to minimize the discrepancy between p c and q c , we first design the m-PPOT loss to minimize the second term in the bound of theorem 1. We introduce the m-PPOT α B ( p q , ) as a loss:

$$\mathcal { L } _ { o t } = \mathbb { E } _ { \mathcal { B } \in \Gamma } \tilde { ( m \text{-PPOT} ^ { \alpha } _ { \mathcal { B } } ( p, q ) ) } \,, \quad \quad ( 1 0 )$$

where E denotes the expectation over all target domain data index partitions in Γ . Using the mini-batch based optimization method, this term can be approximated by the partial OT problem POT α ( c q , B i ) over each mini-batch, according to Eqn. (7). The set of prototypes c is updated by exponential moving average as in (Xie et al. 2018). We use the entropy regularized POT algorithm proposed by (Benamou et al. 2015) to solve POT on mini-batch.

Reweighted entropy loss. We further design entropybased loss on target domain data to increase the prediction certainty. The solution π ∗ to the m-PPOT α B ( p q , ) is a matrix measuring the matching between source prototypes and target features. Since the more easily a prototype (feature) can be transported, the more likely it belongs to a common class ('known' sample), we leverage the row/column sum of π ∗ as indicator to identify unknown samples. Specifically, we first get the column sum of π ∗ and multiply a constant n/α to make w t ∈ R n satisfy ∥ w t ∥ 1 = n . A reweighted entropy loss is formulated as

$$\mathcal { I }, \quad \mathcal { L } _ { p e } = - \sum _ { i = 1 } ^ { n } \sum _ { j = 1 } ^ { L } w _ { i } ^ { t } p _ { i j } \log ( p _ { i j } ), w _ { i } ^ { t } = \frac { n } { \alpha } \sum _ { j = 1 } ^ { L } \pi _ { i j } ^ { * }, \quad ( 1 1 )$$

where p ij ≜ σ h ( ◦ f ( x t i )) j . We take this loss to increase the confidence of prediction for those target samples seen as 'known' samples.

Furthermore, we follow (Saito et al. 2020; Saito and Saenko 2021) to suppress the model to generate overconfident predictions for target 'unknown' samples by loss

$$\mathcal { L } _ { n e } = - \sum _ { i = 1 } ^ { n } \sum _ { j = 1 } ^ { L } w _ { i } ^ { u } p _ { i j } \log ( p _ { i j } ), w _ { i } ^ { u } = [ 1 - w _ { i } ^ { t } ] _ { + }, \ \ ( 1 2 )$$

where w u i depends on w t i , and higher w u i for a sample means higher confidence to be an 'unknown' sample. Therefore, we use L ne to reduce the confidence of those samples which are likely to be 'unknown' samples.

Reweighted cross-entropy loss. This loss is the classification loss defined in the source domain, based on the crossentropy using labels of source domain data. Different to standard classification loss, we use the column sum of π ∗ to compute weights w s ∈ R L for measuring the confidence of the 'known' source domain prototypes. Then we design the reweighted cross-entropy loss

$$\mathcal { L } _ { r c e } = - \sum _ { i = 1 } ^ { m } \sum _ { j = 1 } ^ { L } w _ { j } ^ { s } \mathbf 1 ( y _ { i } = j ) \log ( \sigma ( h \circ f ( x _ { i } ^ { s } ) ) _ { j } ) \quad ( 1 3 )$$

where w s j = L α ∑ n i =1 π ∗ ij is the weight of j -th source prototype representing j -th class center. The weights satisfy ∑ L j =1 w s j = L and each of them represents the possibility that each category belongs to a common class. (Papyan, Han, and Donoho 2020) shows that the cross-entropy based loss could minimize the distance of features to class prototype. This implies that the reweighted cross-entropy loss approximately minimizes the first term in bound of theorem 1, in which we use the row sum w s of m-PPOT to approximate the row sum w of PPOT, and use the class-balanced sampling in implementation to enforce that r , j ∀ j, are equal.

Training loss and details. Our model is jointly optimized with the above loss terms, and the total training loss is

$$\mathcal { L } = \mathcal { L } _ { r c e } + \mathcal { L } _ { e n t } + \eta _ { 1 } \mathcal { L } _ { o t }, \text{ \quad \ \ } ( 1 4 )$$

where L ent = η 2 L pe -η 3 L ne . In implementation, we set η 1 = 5 , η 2 = 0 01 . , and η 3 = 2 for all datasets. The training process of our method is shown in Fig. 1. In the beginning, we map data in both domains into feature space by the feature extractor. Source prototypes are updated by source features in every batch and then we compute the mPPOT between the empirical distributions of source prototypes and target samples, which we also leverage the row sum and column sum of corresponding transport plan to reweight in the losses. L ot aims to reduce the gap between the distribution of 'known' samples in both domains, meanwhile L ent enforces the 'known' samples to have higher prediction confidence by decreasing their entropy, and the 'unknown' samples to have lower prediction confidence by increasing the entropy, in the target domain. Since the classifiers are learned over the source domain data, this may align the 'known' target domain data to the source domain data distribution, while pushing the 'unknown' target domain data away from the source domain data distribution.

## Parameter initialization by contrastive pre-training.

Motivated by (Shen et al. 2022), we use contrastive learning to pre-train our feature extractor. Specifically, we send both source and target unlabeled data into our feature extractor and use the contrastive learning method (MocoV2 (Chen et al. 2020)) to pre-train our feature extractor, then fine-tune the entire model on labeled source data, and take these parameters as our model's initial parameters. We empirically find that contrastive pre-training also works in UniDA setting in our experiments.

## 4.4 Hyper-parameters

We notice that α and β are nearly impossible to calculate precisely in practice, so we propose a method to compute them approximately. We denote two scalars as τ 1 and τ 2 , where τ 1 ∈ (0 1] , , τ 2 &gt; 0 . To simplify the notation, we use s x ( ) = max σ h ( ◦ f ( x )) to denote the prediction confidence of x . We define α and β as

$$\alpha = \sum _ { j = 1 } ^ { n } \frac { 1 ( s ( x _ { j } ^ { t } ) \geqslant \tau _ { 1 } ) } { n }, \beta = \sum _ { i = 1 } ^ { L } \frac { 1 ( w _ { i } ^ { s } \geqslant \tau _ { 2 } ) } { L }. \quad ( 1 5 ) \quad \text{$last$} \quad \text{$\dim$}$$

The motivation is that we use the proportion of highconfidence samples to estimate the ratio of 'known' samples in the target domain, and similarly use the proportion of categories with high weights to approximate the ratio of common classes in the source domain.

In experiments, we set τ 1 = 0 9 . and τ 2 = 1 . In the i -th iteration of training phase, we first calculate α i by Eqn. (15), and update α by exponential moving average:

$$\alpha ^ { i } \leftarrow \lambda _ { 1 } \alpha ^ { i } + ( 1 - \lambda _ { 1 } ) \alpha ^ { i - 1 }.$$

Then we use α i as transport ratio and α /β i i -1 as coefficient of Eqn. (5) to compute L ot and its by-product w s . After that we compute β i by Eqn. (15) and update it as same as α i :

$$\beta ^ { i } \leftarrow \lambda _ { 2 } \beta ^ { i } + ( 1 - \lambda _ { 2 } ) \beta ^ { i - 1 },$$

where λ , λ 1 2 ∈ [0 , 1) are set to 0.001 in our experiments.

Furthermore, to reduce the possible mistakes that identify a 'known' sample as 'unknown' sample, we retain only a fraction of { w u i } n i =1 that have larger values, and set the others as 0. The fraction is set to 25% in all tasks.

## 5 Experiment

We evaluate our method on UniDA benchmarks. We solve three settings of UniDA, including OPDA, OSDA, and PDA but without using prior knowledge about the mismatch of source and target domain class label sets.

Datasets. Office-31 (Saenko et al. 2010) includes 4652 images in 31 categories from 3 domains: Amazon ( A ), DSLR ( D ), and Webcam ( W Office-Home ). (Venkateswara et al. 2017) consists of 15500 images in 65 categories, and it contains 4 domains: Artistic images ( A ), Clip-Art images ( C ), Product images ( P ), and Real-World images ( R ). VisDA (Peng et al. 2017) is a larger dataset which consists of 12 classes, including 150,000 synthetic images ( S ) and 50,000 images from real world ( R ). DomainNet (Peng et al. 2019) is one of the most challenging datasets in DA task with about 0.6 million images, which consists of 6 domains sharing 345 categories. We follow (Fu et al. 2020) to use 3 domains: Painting ( P ), Real ( R ), and Sketch ( S ). Following (Saito and Saenko 2021), we show the number of common classes, source private classes, and target private classes in brackets in the header of each result of tables.

Evaluation. In PDA tasks, we compute the accuracy for all target samples. In OSDA and OPDA settings, the target private class samples should be classified as a single category named 'unknown'. The samples with confidence less than threshold ξ are identified as 'unknown', where ξ is set to 0.75 in all experiments. Following (Fu et al. 2020), we report the H-score metric for OSDA and OPDA which is the harmonic mean of the average accuracy on common and private class samples.

Implementation. We implement our method using Pytorch (Paszke et al. 2019) on a single Nvidia RTX A6000 GPU. Following previous works (Saito and Saenko 2021; Chen et al. 2022), we use ResNet50 (He et al. 2016) without last fully-connected layer as our feature extractor. A 256dimensional bottleneck layer and prediction head h is successively added after the feature extractor. We use MocoV2

Table 1: H-score (%) comparison on Office-31, Office-Home, VisDA and DomainNet for OPDA. Note that we only report the average H-score over all tasks on Office-31 on Office-Home, and the results for different tasks are in Appendix.

| Method   | Office-31   | Office-Home   | VisDA   | DomainNet (150/50/145)   | DomainNet (150/50/145)   | DomainNet (150/50/145)   | DomainNet (150/50/145)   | DomainNet (150/50/145)   | DomainNet (150/50/145)   | DomainNet (150/50/145)   |
|----------|-------------|---------------|---------|--------------------------|--------------------------|--------------------------|--------------------------|--------------------------|--------------------------|--------------------------|
| Method   | (10/10/11)  | (10/5/50)     | (6/3/3) | P → R                    | P → S                    | R → P                    | R → S                    | S → P                    | S → R                    | Avg                      |
| UAN      | 63.5        | 56.6          | 30.5    | 41.9                     | 39.1                     | 43.6                     | 38.7                     | 39.0                     | 43.7                     | 41.0                     |
| CMU      | 73.1        | 61.6          | 34.6    | 50.8                     | 45.1                     | 52.2                     | 45.6                     | 44.8                     | 51.0                     | 48.3                     |
| DANCE    | 82.3        | 63.9          | 42.8    | 55.7                     | 47.0                     | 51.1                     | 46.4                     | 47.9                     | 55.7                     | 50.6                     |
| DCC      | 80.2        | 70.2          | 43.0    | 56.9                     | 43.7                     | 50.3                     | 43.3                     | 44.9                     | 56.2                     | 49.2                     |
| OVANet   | 86.5        | 71.8          | 53.1    | 56.0                     | 47.1                     | 51.7                     | 44.9                     | 47.4                     | 57.2                     | 50.7                     |
| GATE     | 87.6        | 75.6          | 56.4    | 57.4                     | 48.7                     | 52.8                     | 47.6                     | 49.5                     | 56.3                     | 52.1                     |
| PPOT     | 90.4        | 77.1          | 73.8    | 67.8                     | 50.2                     | 60.1                     | 48.9                     | 52.8                     | 65.4                     | 57.5                     |

Table 2: Comparison of H-score (%) on Office-Home and VisDA for PDA setting. 'P' and 'U' denote PDA and UniDA methods, respectively with and without assuming the target label set is a subset of the source label set.

| Method   | Type   |   Office-Home (25/40/0) |   VisDA (6/6/0) |
|----------|--------|-------------------------|-----------------|
| PADA     | P      |                    62.1 |            53.5 |
| IWAN     | P      |                    63.6 |            48.6 |
| ETN      | P      |                    70.5 |            59.8 |
| AR       | P      |                    79.4 |            88.8 |
| DCC      | U      |                    70.9 |            72.4 |
| GATE     | U      |                    73.9 |            75.6 |
| PPOT     | U      |                    74.3 |            83   |

| Method   | Type   |   Office-Home (25/0/40) |   VisDA (6/0/6) |
|----------|--------|-------------------------|-----------------|
| STA      | O      |                    61.1 |            64.1 |
| OSBP     | O      |                    64.7 |            52.3 |
| ROS      | O      |                    66.2 |            66.5 |
| DCC      | U      |                    61.7 |            59.6 |
| OVANet   | U      |                    64   |            66.1 |
| GATE     | U      |                    69.1 |            70.8 |
| PPOT     | U      |                    70   |            72.3 |

(Chen et al. 2020) to contrastive pre-train our feature extractor, the number of epochs in pre-training is 100, batch size is 256, and learning rate is 0.03.

In training phase, we optimize the model using Nesterov momentum SGD with momentum of 0.9 and weight decay of 5 × 10 -4 . Following (Ganin and Lempitsky 2015), the learning rate decays with the factor of (1 + αt ) -β , where t linearly changes from 0 to 1 in training, and we set α = 10 , β = 0 75 . . The batch size is set to 72 in all experiments except in DomainNet tasks where it is changed to 256. We train our model for 5 epochs (1000 iterations per epoch), and update source prototypes and α totally before every epoch. The initial learning rate is set to 1 × 10 -4 on Office-31, 5 × 10 -4 on Office-Home and VisDA, and 0.01 on DomainNet.

## 5.1 Results and Comparisons

We compare our method with four PDA methods (PADA (Cao et al. 2018b), IWAN (Zhang et al. 2018), ETN (Cao et al. 2019), AR (Gu et al. 2021)), three OSDA methods (OSBP (Saito et al. 2018), STA (Liu et al. 2019), ROS (Bucci, Loghmani, and Tommasi 2020)) and six UniDA methods (UAN (You et al. 2019), CMU (Fu et al. 2020), DANCE (Saito et al. 2020), DCC (Li et al. 2021), OVANet (Saito and Saenko 2021), GATE (Chen et al. 2022)). All the compared methods use the same backbone as ours.

OPDA setting. Table 1 shows the results of our method. Our method outperforms baselines and achieves state-of-

Table 3: Comparison of H-score (%) on Office-Home and VisDA for OSDA setting. 'O' and 'U' denote OSDA and UniDA methods, respectively with and without assuming the source label set is a subset of the target label set.

the-art results on all four datasets. On Office-31 and OfficeHome datasets, our method surpasses all baselines on average. In larger datasets, VisDA and DomainNet, our method brings more than 17% improvement over previous methods on VisDA, and 5% on DomainNet. In general, these results show that our method is suitable in UniDA tasks, especially on larger and challenging datasets.

PDA and OSDA settings. Following (Li et al. 2021), we train our model without any prior knowledge of label space mismatch in PDA and OSDA settings. We report the results for PDA setting in Table 2. We can see that our method achieves better results than other UniDA-based methods (denoted as 'U') on both datasets. The 'P' denotes the PDA methods using prior knowledge that only the source domain has private classes. The results of OSDA setting are shown in Table 3, our method still surpasses all UniDA methods and OSDA methods (denoted as 'O') using prior knowledge on label space mismatch on Office-Home and VisDA datasets.

## 5.2 Model Analysis

Comparison of m-PPOT with m-POT. To compare mPPOT with m-POT (mini-batch based partial OT without using prototypes) in UniDA, we replace m-PPOT with m-POT in our method and use the average weight of samples in each class to replace the prototype weights w s in Eqn. (13), and the corresponding method is denoted as 'POT'. As shown in Table 4, PPOT surpasses POT in all three datasets, confirming that m-PPOT performs better than m-POT in UniDA.

Table 4: Ablation study for OPDA on Office-31, OfficeHome and VisDA. 'CL' means contrastive pre-training.

| Method              |   Office-31 |   VisDA |   Office-Home |
|---------------------|-------------|---------|---------------|
| POT                 |        88.4 |    66.4 |          74.2 |
| PPOT (w/o CL)       |        89.4 |    58.1 |          74.3 |
| PPOT (w/o L pe )    |        88.4 |    71.1 |          76.5 |
| PPOT (w/o L ne )    |        89.6 |    67.8 |          74.4 |
| PPOT (w/o reweight) |        86.5 |    69.9 |          74.7 |
| PPOT                |        90.4 |    73.8 |          77.1 |

Figure 2: (a) Class weight w s in Eqn. (13) on the source domain. (b) Average weight w t in Eqn. (11) for each class on the target domain. Task: W → D on Office-31 for OPDA.

![image](https://ac.marcodsn.me/arxiv-markdown-images/2408.01089v1-figure-1cf9afb6-9b01-4f2f-bd7a-d051301f7e07.jpg)

![image](https://ac.marcodsn.me/arxiv-markdown-images/2408.01089v1-figure-d160f79e-d42d-47d5-9b65-ab56d650c22c.jpg)

Effect of contrastive pre-training. To evaluate the effect of contrastive pre-training, the contrastive pre-training is removed and the feature extractor is replaced by a ResNet50 pre-trained on ImageNet. The results shown in Table 4 illustrate that performance degenerates in all experiments, especially in more challenging tasks such as VisDA. Note that without contrastive pre-training, our model still surpasses state-of-the-art methods on Office-31 and VisDA and reaches a comparable result on Office-Home.

Effectiveness of reweighted entropy loss. To evaluate this loss, we remove L pe and L ne in our model respectively. Table 4 shows that PPOT outperforms PPOT(w/o L pe ) by 2% and PPOT(w/o L ne ) by 6% on VisDA dataset.

Effectiveness of reweighting strategy. To evaluate the effectiveness of our reweighting strategy in Eqns. (13) and (11), we set w s i = 1 in Eqn. (13) and w t j = 1 in Eqn. (11) for any 0 ⩽ i ⩽ m and 0 ⩽ j ⩽ n . The results of Table 4 show that PPOT(w/o reweight) decreases at least 3% more than PPOT in all datasets, which means that our reweighting strategy is important in our method. We further visualize the learned weights of source/target classes in UniDA task W → D on Office-31 datasets, as shown in Fig. 2. In both domains, most common classes have higher weights than private classes, which implies that our model can separate common and private classes effectively.

Sensitivity to hyper-parameters. Figure 3 evaluates the sensitivity of our model to hyper-parameters τ 1 , τ 2 , η 1 , η 2 , η 3 , and ξ . Results show that our model is relatively stable to τ 1 and τ 2 at the range of [0 6 . , 0 95] . and [0 7 . , 1 1] . respectively, as shown in Fig. 3(b). In Fig. 3(b), we can also see that the setting of threshold ξ does not impact the perfor-

Figure 3: Sensitivity to hyper-parameters (a) η 1 , η 2 and η 3 in Eqn. (14), (b) τ 1 , τ 2 in Eqn. (15) and threshold ξ . All results are for the OPDA setting in task C → A.

![image](https://ac.marcodsn.me/arxiv-markdown-images/2408.01089v1-figure-5327cc9a-d79b-41e0-b0a7-715b3b44ad2b.jpg)

![image](https://ac.marcodsn.me/arxiv-markdown-images/2408.01089v1-figure-f5339277-2838-4e2b-8dc6-6b30e8667425.jpg)

Figure 4: H-score curves of different methods with varying number of target private classes for OPDA tasks A → P and P → R.

![image](https://ac.marcodsn.me/arxiv-markdown-images/2408.01089v1-figure-4f1f1322-2164-4399-80bb-3061c0e2be03.jpg)

![image](https://ac.marcodsn.me/arxiv-markdown-images/2408.01089v1-figure-6e529a25-53c1-4843-a701-f5612cbe595c.jpg)

mance much on our model in range [0 5 . , 0 9] . . Furthermore, Fig. 3(a) shows that our model is relatively stable to varying values of η 1 , η 2 , and η 3 .

## H-score with varying number of target private classes.

Weevaluate our method with different numbers of target private classes. Results in A → P and P → R tasks are shown in Fig. 4, our method outperforms other baselines in all cases. It shows that our method is effective for OPDA with respect to different numbers of target domain private classes, and the performance marginally decreases with the increase of the number of target domain private classes.

## 6 Conclusion

In this paper, we propose to formulate the universal domain adaption (UniDA) as a partial optimal transport problem in deep learning framework. We propose a novel mini-batch based prototypical partial OT (m-PPOT) model for UniDA task, which is based on minimizing mini-batch prototypical partial optimal transport between two domain samples. We also introduce reweighting strategy based on the transport plan in UniDA. Experiments on four benchmarks show the effectiveness of our method for UniDA tasks including OPDA, PDA, OSDA settings. In the future, we plan to further theoretically analyze the mini-batch based m-PPOT, and apply it to more applications requiring partial alignments in deep learning framework.

## References

Arjovsky, M.; Chintala, S.; and Bottou, L. 2017. Wasserstein generative adversarial networks. In ICML .

Ben-David, S.; Blitzer, J.; Crammer, K.; Kulesza, A.; Pereira, F.; and Vaughan, J. W. 2010. A theory of learning from different domains. ML , 79(1): 151-175.

Ben-David, S.; Blitzer, J.; Crammer, K.; and Pereira, F. 2006. Analysis of representations for domain adaptation. In NeurIPS .

Benamou, J.-D.; Carlier, G.; Cuturi, M.; Nenna, L.; and Peyr´ e, G. 2015. Iterative Bregman projections for regularized transportation problems. SISC , 37(2): A1111-A1138.

Bucci, S.; Loghmani, M. R.; and Tommasi, T. 2020. On the effectiveness of image rotation for open set domain adaptation. In ECCV .

Caffarelli, L. A.; and McCann, R. J. 2010. Free boundaries in optimal transport and Monge-Ampere obstacle problems. Annals of Mathematics , 673-730.

Cao, Z.; Long, M.; Wang, J.; and Jordan, M. I. 2018a. Partial transfer learning with selective adversarial networks. In CVPR .

Cao, Z.; Ma, L.; Long, M.; and Wang, J. 2018b. Partial adversarial domain adaptation. In ECCV .

Cao, Z.; You, K.; Long, M.; Wang, J.; and Yang, Q. 2019. Learning to transfer examples for partial domain adaptation. In CVPR .

Chen, L.; Lou, Y.; He, J.; Bai, T.; and Deng, M. 2022. Geometric Anchor Correspondence Mining With Uncertainty Modeling for Universal Domain Adaptation. In CVPR .

Chen, X.; Fan, H.; Girshick, R.; and He, K. 2020. Improved baselines with momentum contrastive learning. arXiv preprint arXiv:2003.04297 .

Courty, N.; Flamary, R.; Habrard, A.; and Rakotomamonjy, A. 2017. Joint distribution optimal transportation for domain adaptation. In NeurIPS .

Cuturi, M. 2013. Sinkhorn distances: Lightspeed computation of optimal transport. In NeurIPS .

Damodaran, B. B.; Kellenberger, B.; Flamary, R.; Tuia, D.; and Courty, N. 2018. Deepjdot: Deep joint distribution optimal transport for unsupervised domain adaptation. In ECCV .

Fatras, K.; S´ ejourn´, T.; Flamary, R.; and Courty, N. 2021. e Unbalanced minibatch optimal transport; applications to domain adaptation. In ICML .

Figalli, A. 2010. The optimal partial transport problem. Archive for Rational Mechanics and Analysis , 195(2): 533560.

Flamary, R.; Courty, N.; Tuia, D.; and Rakotomamonjy, A. 2016. Optimal transport for domain adaptation. TPAMI , 1.

Fu, B.; Cao, Z.; Long, M.; and Wang, J. 2020. Learning to detect open classes for universal domain adaptation. In ECCV .

Ganin, Y.; and Lempitsky, V. 2015. Unsupervised domain adaptation by backpropagation. In ICML .

Ge, Z.; Liu, S.; Li, Z.; Yoshie, O.; and Sun, J. 2021. Ota: Optimal transport assignment for object detection. In CVPR .

Gu, X.; Yu, X.; Sun, J.; Xu, Z.; et al. 2021. Adversarial Reweighting for Partial Domain Adaptation. In NeurIPS .

He, K.; Zhang, X.; Ren, S.; and Sun, J. 2016. Deep residual learning for image recognition. In CVPR .

Ho, N.; Nguyen, X.; Yurochkin, M.; Bui, H. H.; Huynh, V.; and Phung, D. 2017. Multilevel clustering via Wasserstein means. In ICML .

Kantorovitch, L. 1958. On the translocation of masses. Management Science , 5(1): 1-4.

Krizhevsky, A.; Sutskever, I.; and Hinton, G. E. 2012. Imagenet classification with deep convolutional neural networks. In NeurIPS .

Li, G.; Kang, G.; Zhu, Y.; Wei, Y.; and Yang, Y. 2021. Domain consensus clustering for universal domain adaptation. In CVPR .

Liu, H.; Cao, Z.; Long, M.; Wang, J.; and Yang, Q. 2019. Separate to adapt: Open set domain adaptation via progressive separation. In CVPR .

Long, M.; Cao, Y.; Wang, J.; and Jordan, M. 2015. Learning transferable features with deep adaptation networks. In ICML .

Long, M.; Cao, Z.; Wang, J.; and Jordan, M. I. 2018. Conditional adversarial domain adaptation. In NeurIPS .

Nguyen, K.; Nguyen, D.; Pham, T.; Ho, N.; et al. 2022. Improving mini-batch optimal transport via partial transportation. In ICML .

Pan, Y.; Yao, T.; Li, Y.; Wang, Y.; Ngo, C.-W.; and Mei, T. 2019. Transferrable prototypical networks for unsupervised domain adaptation. In CVPR .

Panareda Busto, P.; and Gall, J. 2017. Open set domain adaptation. In ICCV .

Papyan, V.; Han, X.; and Donoho, D. L. 2020. Prevalence of neural collapse during the terminal phase of deep learning training. PNAS , 117(40): 24652-24663.

Paszke, A.; Gross, S.; Massa, F.; Lerer, A.; Bradbury, J.; Chanan, G.; Killeen, T.; Lin, Z.; Gimelshein, N.; Antiga, L.; et al. 2019. Pytorch: An imperative style, high-performance deep learning library. In NeurIPS .

Peng, X.; Bai, Q.; Xia, X.; Huang, Z.; Saenko, K.; and Wang, B. 2019. Moment matching for multi-source domain adaptation. In ICCV .

Peng, X.; Usman, B.; Kaushik, N.; Hoffman, J.; Wang, D.; and Saenko, K. 2017. Visda: The visual domain adaptation challenge. arXiv preprint arXiv:1710.06924 .

Peyr´ e, G.; Cuturi, M.; et al. 2019. Computational optimal transport: With applications to data science. Foundations and Trends® in Machine Learning , 11(5-6): 355-607.

Saenko, K.; Kulis, B.; Fritz, M.; and Darrell, T. 2010. Adapting visual category models to new domains. In ECCV .

Saito, K.; Kim, D.; Sclaroff, S.; and Saenko, K. 2020. Universal domain adaptation through self supervision. In NeurIPS .

Saito, K.; and Saenko, K. 2021. Ovanet: One-vs-all network for universal domain adaptation. In ICCV .

Saito, K.; Yamamoto, S.; Ushiku, Y.; and Harada, T. 2018. Open set domain adaptation by backpropagation. In ECCV .

Shen, K.; Jones, R. M.; Kumar, A.; Xie, S. M.; HaoChen, J. Z.; Ma, T.; and Liang, P. 2022. Connect, not collapse: Explaining contrastive learning for unsupervised domain adaptation. In ICML .

Simonyan, K.; and Zisserman, A. 2014. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556 .

Sun, B.; and Saenko, K. 2016. Deep coral: Correlation alignment for deep domain adaptation. In ECCV .

Venkateswara, H.; Eusebio, J.; Chakraborty, S.; and Panchanathan, S. 2017. Deep hashing network for unsupervised domain adaptation. In CVPR .

Villani, C. 2009. Optimal transport: old and new , volume 338. Springer.

Xie, S.; Zheng, Z.; Chen, L.; and Chen, C. 2018. Learning semantic representations for unsupervised domain adaptation. In ICML .

Xu, R.; Liu, P.; Zhang, Y.; Cai, F.; Wang, J.; Liang, S.; Ying, H.; and Yin, J. 2021. Joint partial optimal transport for open set domain adaptation. In IJCAI .

You, K.; Long, M.; Cao, Z.; Wang, J.; and Jordan, M. I. 2019. Universal domain adaptation. In CVPR .

Zhang, J.; Ding, Z.; Li, W.; and Ogunbona, P. 2018. Importance weighted adversarial nets for partial domain adaptation. In CVPR .

Zhang, Y.; Liu, T.; Long, M.; and Jordan, M. 2019. Bridging theory and algorithm for domain adaptation. In ICML .

## A Mathematical Deductions

## A.1 Notation

We first recall some definitions in our paper. The source and target empirical distributions in feature space are denoted as p = ∑ m i =1 p δ i f ( x s i ) and q = ∑ n j =1 q δ j f ( x t j ) respectively, ∑ m i =1 p i = 1 , ∑ n j =1 q j = 1 . c = ∑ L i =1 r δ i c i is the empirical distribution of source domain prototypes, and r i = ∑ j y : j = i p j . With a slight abuse of notations, we denote the vector of data mass as p = ( p , p 1 2 , ..., p m ) ⊤ , q = ( q 1 , q 2 , ..., q n ) ⊤ and c = ( r , r 1 2 , ..., r L ) ⊤ . In this paper, we set q j = 1 n for any 0 ⩽ j ⩽ n .

Furthermore, the definitions of PPOT α ( p q , ) and m-PPOT α B ( p q . ) are shown as follows:

The elements of cost matrix C p q , , C p c , , C c q , are defined as C p q , ij = d f ( ( x s i ) , f ( x t j )) , C p c , ik = d f ( ( x s i ) , c k )) , C c q , kj = d c ( k , f ( x t j )) , respectively. Here d is the L 2 distance.

$$\text{PPOT} ^ { \alpha } ( p, q ) & \stackrel { \triangle } { = } \text{POT} ^ { \alpha } ( c, q ) = \min _ { \pi \in \Pi ^ { \alpha } ( c, q ) } \langle \pi, C ^ { c, q } \rangle _ { F }, \\ _ { 1 }, & ( A \text{-} 1 )$$

$$\mathfrak { m } { - } P P O T ^ { \alpha } _ { \mathcal { B } } ( p, q ) \stackrel { \triangle } { = } \frac { 1 } { k } \sum _ { i = 1 } ^ { k } \text{POT} ^ { \alpha } ( c, q _ { \mathcal { B } _ { i } } ), \ \mathcal { B } \in \Gamma, \ \ ( A { - } 2 ) \\. \ \cdots \cdots \cdots \cdots \cdots \cdots \cdots \cdots \cdots \cdots \cdots \cdots \cdots \cdots \cdots \cdots \cdots \cdots \cdots \cdots \cdots \cdots \cdots \cdots \cdots \cdots \cdots \cdots \cdots \cdots \cdots \cdots \cdots \cdots \cdots \cdots \cdots \cdots \cdots \cdots \cdots \cdots \cdots \cdots \cdots \cdots \cdots \cdots \cdots \cdots \cdots \cdots \cdots \cdots \cdots \cdots \cdots \cdots \cdots \cdots \cdots \cdots \cdots \cdots \cdots \cdots \cdots \collections$$

where B i is the i -th index set of b random target samples and their corresponding empirical distribution in feature space is denoted as q B i . B ≜ {B } i k , satisfying B i ⋂ B j = ∅ and

$$\text{denoted as $q_{\mathcal{B}_{i}$.} \, \mathcal{B}=\{\mathcal{B}_{i}\}_{i=1}^{k}$, satisfying} \\ \bigcup _ { i = 1 } ^ { k } \mathcal { B } _ { i } = \{ 1, 2, \dots, n \}. \, b \, | \, n, k = \frac { n } { b }.$$

## A.2 Proof of proposition 1

Proposition 1. Let π α i be the optimal transportation of i -th batch of m-PPOT α B ( p q , ) . We extend π α i to a L × n matrix Π α i that pads zero entries to the column whose index does not belong to B i , then we have

$$\frac { 1 } { k } \sum _ { i = 1 } ^ { k } \Pi _ { i } ^ { \alpha } \in \Pi ^ { \alpha } ( c, q ) \text{ \quad \ \ } ( A \text{-} 3 )$$

and

$$\text{PPOT} ^ { \alpha } ( p, q ) \leqslant \text{m-PPOT} ^ { \alpha } _ { \mathcal { B } } ( p, q ). \quad \text{(A-4)}$$

Proof. The proof of

$$\frac { 1 } { k } \sum _ { i = 1 } ^ { k } \Pi _ { i } ^ { \alpha } \in \Pi ^ { \alpha } ( c, q ) \text{ \quad \ \ } ( A \text{-} 5 )$$

is equivalent to proving

$$\text{nt to proving} \\ ( \frac { 1 } { k } \sum _ { i = 1 } ^ { k } \Pi _ { i } ^ { \alpha } ) \mathbb { 1 } _ { n } \leqslant c, \\ ( \frac { 1 } { k } \sum _ { i = 1 } ^ { k } \Pi _ { i } ^ { \alpha } ) ^ { \top } \mathbb { 1 } _ { L } \leqslant q, \quad \quad ( A - 6 ) \\ \mathbb { 1 } _ { L } ^ { \top } ( \frac { 1 } { k } \sum _ { i = 1 } ^ { k } \Pi _ { i } ^ { \alpha } ) \mathbb { 1 } _ { n } = \alpha, \\ \text{to the definition of } \Pi ^ { \alpha } ( c, q ). \text{ Note that } \pi _ { i } ^ { \alpha } \in \text{ }$$

according to the definition of Π ( α c q , ) . Note that π α i ∈ Π ( α c q , B i ) satisfies

$$\pi _ { i } ^ { \alpha } \mathbb { 1 } _ { b } \leqslant c, \ \left ( \pi _ { i } ^ { \alpha } \right ) ^ { \top } \mathbb { 1 } _ { L } \leqslant q _ { \mathcal { B } _ { i } }, \ \mathbb { 1 } _ { L } ^ { \top } \pi _ { i } ^ { \alpha } \mathbb { 1 } _ { b } = \alpha. \quad ( \text{A-7} )$$

Combining with the definition of Π α i , we have

$$\dots \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Psi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi\Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phis \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Phi \Clone$$

where ¯ q B i ∈ R n is the extension of q B i by padding zero entries to the dimension whose index does not belong to B i , ⊙ corresponds to entry-wise product and m i is a n dimensional vector with element satisfying that

$$m _ { j } ^ { i } = \begin{cases} \frac { n } { b } = k, & \text{if $j\in \mathcal{B}_{i}$}, \\ 0, & \text{otherwise}. \end{cases} \quad ( A - 9 )$$

We have

$$\text{We have} \\ ( \frac { 1 } { k } \sum _ { i = 1 } ^ { k } \Pi _ { i } ^ { \alpha } ) \mathbb { 1 } _ { n } = \frac { 1 } { k } \sum _ { i = 1 } ^ { k } ( \Pi _ { i } ^ { \alpha } \mathbb { 1 } _ { n } ) \leqslant c, \\ ( \frac { 1 } { k } \sum _ { i = 1 } ^ { k } \Pi _ { i } ^ { \alpha } ) ^ { \top } \mathbb { 1 } _ { L } \leqslant ( \frac { 1 } { k } \sum _ { i = 1 } ^ { k } m ^ { i } ) \odot q, \quad \text{(A-10)} \\ \mathbb { 1 } _ { L } ^ { \top } ( \frac { 1 } { k } \sum _ { i = 1 } ^ { k } \Pi _ { i } ^ { \alpha } ) \mathbb { 1 } _ { n } = \frac { 1 } { k } \sum _ { i = 1 } ^ { k } ( \mathbb { 1 } _ { L } ^ { \top } \Pi _ { i } ^ { \alpha } \mathbb { 1 } _ { n } ) = \alpha,$$

Combining (A-9) with the conditions B i ⋂ B j = ∅ and

$$\bigcup _ { i = 1 } ^ { k } \mathcal { B } _ { i } = \{ 1, 2, \dots, n \}, \, \text{we find that}$$

$$( \sum _ { i = 1 } ^ { k } m ^ { i } ) _ { j } = k \sum _ { i = 1 } ^ { k } 1 ( j \in \mathcal { B } _ { i } ) = k, \quad \quad ( A \text{-} 1 )$$

it means that

$$\frac { 1 } { k } \sum _ { i = 1 } ^ { k } m ^ { i } = 1 _ { n }. \quad \quad ( A \text{-} 1 2 ) \quad \.$$

Therefore Eqn. (A-6) has been proved. So far, we have proved Eqn.(A-3), which means that the following inequality holds:

$$\text{PPOT} ^ { \alpha } ( p, q ) \leqslant \langle \frac { 1 } { k } \sum _ { i = 1 } ^ { k } \Pi _ { i } ^ { \alpha }, C ^ { c, q } \rangle _ { F }$$

$$= \frac { 1 } { k } \sum _ { i = 1 } ^ { k } \langle \Pi _ { i } ^ { \alpha }, C ^ { c, q } \rangle _ { F } \quad \quad \ \ ( A \text{-13} ) \quad \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \$$

$$& \text{POT} ^ { \alpha } ( p, q ) \leqslant \langle \frac { 1 } { k } \sum _ { i = 1 } \Pi _ { i } ^ { \alpha }. \\ & = \frac { 1 } { k } \sum _ { i = 1 } ^ { k } \langle \Pi _ { i } ^ { \alpha }, C ^ { \text{c}, q } \rangle _ { F } \\ & = \frac { 1 } { k } \sum _ { i = 1 } ^ { k } \text{POT} ^ { \alpha } ( c, q _ { \mathcal { B } _ { i } } ) \\ & = m \text{-PPOT} _ { \mathcal { B } } ^ { \alpha } ( p, q ).$$

## A.3 Proof of theorem 1

Theorem 1. Considering two distributions p and q , the distance between f ( x s i ) and corresponding prototype c y i is denoted as d i ≜ d f ( ( x s i ) , c y i ) . The row sum of the optimal transportation of PPOT α ( p q , ) is denoted as w = ( w , w , ..., w 1 2 L ) ⊤ , r i = ∑ j y : j = i p j . Then we have

$$\text{POT} ^ { \alpha } ( p, q ) \leqslant \sum _ { i = 1 } ^ { m } \frac { w _ { y _ { i } } } { r _ { y _ { i } } } p _ { i } d _ { i } + \text{m-PPOT} ^ { \alpha } _ { \mathcal { B } } ( p, q ). \ \ ( A { - } 1 4 ) \quad =$$

The proof of theorem 1 can be decomposed by two Lemmas.

Lemma 2. Consider three distributions p q , and c , we denote the optimal transportation of PPOT α ( p q , ) as π c q , ∈ R L × n , and denote the row sum of π c q , as w ≜ π c q , 1 n ⩽ c , w = ( w , w , . . . , w 1 2 L ) . We define an empirical distribution ¯ = c L ∑ w δ i c i . Then, we have

$$i = 1$$

$$\text{POT} ^ { \alpha } ( p, q ) \leqslant \text{POT} ^ { \alpha } ( p, \bar { c } ) + \text{POT} ^ { \alpha } ( p, q ). \quad ( \text{A-15} ) \quad \text{$bet}$$

Proof. Let π p c , ∈ R m L × be the optimal transportation matrix of POT α ( p c , ¯) . Obviously, due to ∥ w ∥ 1 = α , POT α ( p c , ¯) satisfies

$$\text{POT} ^ { \alpha } ( p, \bar { c } ) = \min _ { \pi \in \bar { \Pi } ^ { \alpha } ( p, \bar { c } ) } \langle \pi, C ^ { p, c } \rangle _ { F }, \quad \text{ (A-16)} \quad \text{$n$...}$$

¯ Π ( α p c , ¯) = { π | π 1 L ⩽ p , π ⊤ 1 m = w , 1 ⊤ m π 1 L = α } . Therefore, π p c , and π c q , satisfy these equations:

$$\pi ^ { p, c } \mathbb { 1 } _ { L } \leqslant p, \ \mathbb { 1 } _ { m } ^ { \top } \pi ^ { p, c } = w ^ { \top }, \quad ( \text{A-17} )$$

$$\pi ^ { c, q } \mathbb { 1 } _ { n } = w, \ \mathbb { 1 } _ { L } ^ { \top } \pi ^ { c, q } \leqslant q ^ { \top }, \quad \ \ ( \text{A-18} )$$

and then we define a m × n dimensional matrix S as:

$$S \stackrel { \triangle } { = } \pi ^ { p, c } D \, \pi ^ { c, q },$$

where

$$D & = \left ( \begin{array} { c c c c } \frac { 1 } { w _ { 1 } } & & & \\ & \frac { 1 } { w _ { 2 } } & & \\ & & \ddots & \\ & & & \frac { 1 } { w _ { L } } \end{array} \right ). \\. &. &. &. &. &. &.$$

Notice that S ∈ Π ( α p q , ) because according to Eqns.(A-17) and (A-18), we have

$$S _ { 1 } _ { n } & = \pi ^ { p, c } D \, \pi ^ { c, q } _ { 1 _ { n } } = \pi ^ { p, c } D \, w = \pi ^ { p, c } _ { 1 _ { L } } \leqslant p, \\ \mathbb { 1 } _ { m } ^ { \top } S & = \mathbb { 1 } _ { m } ^ { \top } \pi ^ { p, c } D \, \pi ^ { c, q } = w ^ { \top } D \, \pi ^ { c, q } = \mathbb { 1 } _ { L } ^ { \top } \pi ^ { c, q } \leqslant q ^ { \top }.$$

It means that S is a transport plan of POT α ( p q , ) , so

$$\text{POT} ^ { \alpha } ( p, q ) \leqslant \langle S, C ^ { p, q } \rangle _ { F } = \sum _ { i = 1 } ^ { m } \sum _ { j = 1 } ^ { n } C _ { i j } ^ { p, q } S _ { i j }$$

$$= \sum _ { i = 1 } ^ { m } \sum _ { j = 1 } ^ { n } \sum _ { k = 1 } ^ { L } \frac { 1 } { w _ { k } } C _ { i j } ^ { p, q } \pi _ { i k } ^ { p, c } \pi _ { k j } ^ { c, q }$$

$$& = \sum _ { i = 1 } \sum _ { j = 1 } \sum _ { k = 1 } \frac { 1 } { w _ { k } } C _ { i j } ^ { p, q _ { \pi } p, c _ { \pi } c, q } _ { k j } \\ & \square = \sum _ { i, j, k } \frac { 1 } { w _ { k } } d ( f ( x _ { i } ^ { s } ), f ( x _ { j } ^ { t } ) ) \pi _ { i k } ^ { p, c } \pi _ { k j } ^ { c, q } _ { k j } \\ & \text{the} _ { c _ { y _ { i } } } \leqslant \sum _ { i, j, k } \frac { 1 } { w _ { k } } d ( f ( x _ { i } ^ { s } ), c _ { k } ) \pi _ { i k } ^ { p, c } \pi _ { k j } ^ { c, q } _ { k j } + \sum _ { i, j, k } \frac { 1 } { w _ { k } } d ( c _ { k }, f ( x _ { j } ^ { t } ) ) \pi _ { i k } ^ { p, c } \pi _ { c _ { k } } _ { q } \\ \text{$\frac{the} _ { \alpha } } \leqslant \sum _ { i, j, k } \frac { 1 } { w _ { k } } C _ { i k } ^ { p, c _ { \pi } } \pi _ { i k } ^ { p, c _ { \pi } } \pi _ { k j } ^ { c, q } _ { k j } \\ & = \sum _ { i, j, k } \frac { 1 } { w _ { k } } C _ { i k } ^ { p, c _ { \pi } } \pi _ { i k } ^ { p, c } \sum _ { j } \pi _ { k j } ^ { c, q } + \sum _ { k, j } \frac { 1 } { w _ { k } } C _ { k j } ^ { c, q } \pi _ { k j } ^ { c, q } \sum _ { i } \pi _ { i k } ^ { p, c } \\ \text{em-} \\ & = \sum _ { i, k } C _ { i k } ^ { p, c _ { \pi } } \pi _ { i k } ^ { p, c } + \sum _ { k, j } C _ { k j } ^ { c, q } \pi _ { k j } ^ { c, q } _ { k j } \\ & \cdot d e _ { \alpha } = \text{$\frac{p,c_{\alpha} } { q } ( p, \bar { c } ) + P P O T ^ { \alpha } ( p, q ). } \\ & \leqslant c, \quad \square \right.$$

Lemma 3. Consider two distributions p and c , the definitions of POT α ( p c , ¯) and w follow Lemma 2. The distance between f ( x s i ) and c y i (i.e. C p c , i,y i ) is denoted as d i , then we have

$$\text{POT} ^ { \alpha } ( p, \bar { c } ) \leqslant \sum _ { i = 1 } ^ { m } \frac { w _ { y _ { i } } } { r _ { y _ { i } } } p _ { i } d _ { i }. \quad \quad ( \text{A-19} )$$

Proof. Let π be a m × L dimensional matrix, which satisfies

$$\pi _ { i j } = \begin{cases} \frac { w _ { j } } { r _ { j } } p _ { i }, & \text{if } y _ { i } = j, \\ & & ( A \text{-} 2 0 ) \\ 0, & \text{otherwise}. \end{cases}$$

Figure A-1: Source class weight computed by the row sum of solutions of PPOT α ( p q , ) and m-PPOT α ( p q , ) for OPDA task D → W.

![image](https://ac.marcodsn.me/arxiv-markdown-images/2408.01089v1-figure-424b65e2-06f0-4646-99dd-df29bf4a709b.jpg)

Computing the row and column sums of π , we can find that

$$\sum _ { j = 1 } ^ { L } \pi _ { i j } = \frac { w _ { y _ { i } } } { r _ { y _ { i } } } p _ { i } \leqslant p _ { i }, \text{ \quad \quad } ( \text{A-21} )$$

$$\sum _ { i = 1 } ^ { m } \pi _ { i j } = \frac { w _ { j } } { r _ { j } } \sum _ { i \colon y _ { i } = j } p _ { i } = w _ { j }, \text{ \quad \ \ } ( \text{A-2} )$$

$$\sum _ { i = 1 } ^ { m } \sum _ { j = 1 } ^ { L } \pi _ { i j } = \sum _ { j = 1 } ^ { L } w _ { j } = \alpha. \quad \quad ( A \text{-} 2 3 ) \quad \ \ F i _ { \text{ba} }$$

Eqns.(A-21), (A-22) and (A-23) are equal to equations as follows:

$$\pi ^ { \mathbf 1 } _ { L } \leqslant p, \ \pi ^ { \top } ^ { \top } ^ { \ } { 1 } _ { m } = w, \ 1 ^ { \top } _ { m } \pi ^ { \mathbf 1 } _ { L } = \alpha, \quad ( \text{A-2} 4 )$$

which means π ∈ ¯ Π ( α p c , ¯) . Therefore,

$$\text{POT} ^ { \alpha } ( p, \bar { c } ) \leqslant \langle \pi, C ^ { p, c } \rangle _ { F } = \sum _ { i = 1 } ^ { m } \frac { w _ { y _ { i } } } { r _ { y _ { i } } } p _ { i } d _ { i }. \quad ( \text{A-25} )$$

At last, we provide the proof of theorem 1.

Proof. Combining Lemmas 2, 3 and Proposition 1

$$\text{POT} ^ { \alpha } ( p, q ) \leqslant \text{POT} ^ { \alpha } ( p, \bar { c } ) + \text{PPOT} ^ { \alpha } ( p, q ),$$

$$\Phi ^ { \alpha } ( p, \bar { c } ) & \leqslant \sum _ { i = 1 } ^ { m } \frac { w _ { y _ { i } } } { r _ { y _ { i } } } p _ { i } d _ { i }, \\ \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha \Phi } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \beta } \Phi ^ { \beta } \Phi ^ { \beta } \Phi ^ { \beta } \Phi ^ { \beta } \Phi ^ { \beta } \Phi ^ { \beta } \Phi ^ { \beta } \Phi ^ { \beta } \Phi ^ { \beta } \Phi ^ { \beta } \Phi ^ { \beta } \Phi ^ { \beta } \Phi ^ { \beta } \Phi ^ { \beta } \Phi ^ { \beta } \Phi ^ { \beta } \Phi ^ { \beta } \Phi ^ { \beta } \Phi ^ { \beta } \Phi ^ { \beta } \Phi ^ { \beta } \Phi ^ { \beta } \Phi ^ { \beta } \Phi ^ { \beta } \Phi ^ { \alpha } \Phi ^ { \beta } \Phi ^ { \beta } \Phi ^ { \beta } \Phi ^ { \beta } \Phi ^ { \beta } \Phi ^ { \beta } \Phi ^ { \beta } \Phi ^ { \beta } \Phi ^ { \beta } \Phi ^ { \beta } \Phi ^ { \beta } \Phi ^ { \beta } \Phi ^ { \beta } \Phi ^ { \beta } \Phi ^ { \beta } \Phi ^ { \beta } \Phi ^ { \beta } \Phi ^ { \beta } \Phi ^ { \beta } \Phi ^ { \beta } \Phi ^ { \beta } \Phi ^ { \beta } \Phi ^ { \beta } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \lambda } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \eta } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \gamma } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \mu } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \nu } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \nolay \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha } \Phi ^ { \alpha. }$$

PPOT α ( p q , ) ⩽ m-PPOT α B ( p q , ) , we have

$$\text{POT} ^ { \alpha } ( p, q ) \leqslant \sum _ { i = 1 } ^ { m } \frac { w _ { y _ { i } } } { r _ { y _ { i } } } p _ { i } d _ { i } + \text{m-PPOT} ^ { \alpha } _ { \mathcal { B } } ( p, q ).$$

![image](https://ac.marcodsn.me/arxiv-markdown-images/2408.01089v1-figure-2d264626-48af-4f07-9eeb-e6a8a044c9d9.jpg)

Figure A-2: The values of POT α ( p q , ) and OT α ( p c , q c ) before and after training for OPDA task W → D.

![image](https://ac.marcodsn.me/arxiv-markdown-images/2408.01089v1-figure-b43fe657-1dd9-4931-a9e2-6d1c07e484ed.jpg)

Figure A-3: H-score curves of PPOT and POT with varying batch size for OPDA task C → A.

Figure A-4: Sensitivity to hyper-parameter λ in Eqn. (A-26). Results are for the OPDA setting in task P → C.

![image](https://ac.marcodsn.me/arxiv-markdown-images/2408.01089v1-figure-f794b405-e047-4ae5-9a1f-1055fb5d6d9e.jpg)

Figure A-5: Matching produced by PPOT in toy data. Different shapes mean different class, and the gray line is the matching computed by PPOT.

![image](https://ac.marcodsn.me/arxiv-markdown-images/2408.01089v1-figure-c6685be1-7557-4d8d-9713-b09418a4a919.jpg)

Table A-1: H-score(%) comparisons on Office-31 in OPDA setting.

|         | Office-31(10/10/11)   | Office-31(10/10/11)   | Office-31(10/10/11)   | Office-31(10/10/11)   | Office-31(10/10/11)   | Office-31(10/10/11)   | Office-31(10/10/11)   |
|---------|-----------------------|-----------------------|-----------------------|-----------------------|-----------------------|-----------------------|-----------------------|
| Methods | A2D                   | A2W                   | D2A                   | D2W                   | W2A                   | W2D                   | Avg                   |
| UAN     | 59.7                  | 58.6                  | 60.1                  | 70.6                  | 60.3                  | 71.4                  | 63.5                  |
| CMU     | 68.1                  | 67.3                  | 71.4                  | 79.3                  | 72.2                  | 80.4                  | 73.1                  |
| DANCE   | 79.6                  | 75.8                  | 82.9                  | 90.9                  | 77.6                  | 87.1                  | 82.3                  |
| DCC     | 88.5                  | 78.5                  | 70.2                  | 79.3                  | 75.9                  | 88.6                  | 80.2                  |
| OVANet  | 83.8                  | 78.4                  | 80.7                  | 95.9                  | 82.7                  | 95.5                  | 86.2                  |
| GATE    | 87.7                  | 81.6                  | 84.2                  | 94.8                  | 83.4                  | 94.1                  | 87.6                  |
| PPOT    | 86.2                  | 87.0                  | 90.2                  | 93.1                  | 90.2                  | 95.8                  | 90.4                  |

Table A-2: Ablation study. H-score(%) comparison for UniDA on Office-31, OfficeHome and VisDA.

| Methods   |   Office |   VisDA |   OfficeHome |
|-----------|----------|---------|--------------|
| PPOT      |     82.3 |    69.3 |         49.6 |
| POT       |     81   |    67.1 |         46.6 |

size than POT, especially when the batch size is less than 36. Moreover, for providing a more fair comparison with POT and PPOT, we train the network only with PPOT loss (10) (or POT loss) and a cross-entropy loss defined in source domain. Table A-2 shows their results for OPDA task in Office31 and Office-Home datasets, we can see that PPOT performs well than POT in both datasets.

## B Additional Empirical Analysis

## B.1 Comparison of the weight of the source prototypes derived from PPOT and m-PPOT

In the main paper, we use w s , i e . ., the row sum of the optimal transport plan of m-PPOT α ( p q , ) , to approximate w ( . i e ., the row sum of the solution of PPOT α ( p q , ) ) in L rce for approximately minimizing the first term in the bound of Theorem 1. Figure A-1 shows that the weight computed by the row sum of the optimal transport plan of m-PPOT α ( p q , ) can approximate that of PPOT α ( p q , ) .

## B.2 Can our model align the distributions of source and target common class data?

We present the value of OT ( p c , q c ) before and after the training of our model, as shown in Fig. A-2. Note that OT ( p c , q c ) decreases apparently after training, which empirically shows that our method is effective to align the distributions of source and target common class data.

## B.3 Effectiveness of our model to minimize POT

We also provide the value of POT α ( p q , ) before and after training in Fig. A-2 to testify whether POT α ( p q , ) can be minimized by our model. We find that the value of POT α ( p q , ) is apparently reduced after training, which empirically verifies the rationality of Theorem 1, because the L rce and L ot in our model are designed for minimizing the two terms in the upper bound of POT α ( p q , ) in Theorem 1.

## B.4 More results for POT and PPOT

We have discussed the advantages of PPOT over POT in the ablation study ('Comparison of m-PPOT with m-POT') of experiment section. Figure A-3 presents the results of PPOT and POT with varying batch sizes for OPDA task C → A. The figure shows that PPOT generally achieves higher performance in H-score than POT, and is more stable to the bath

Figure A-6: Transport plan of PPOT in task W → D on Office-31 datasets. Transport appears in the upper left of transport matrix is the correct transport.

![image](https://ac.marcodsn.me/arxiv-markdown-images/2408.01089v1-figure-84acc51f-5e37-4cdf-9fd7-82d8ed5db74a.jpg)

Figure A-7: Computational cost of UniDA methods in OPDA task A → C.

![image](https://ac.marcodsn.me/arxiv-markdown-images/2408.01089v1-figure-1db98425-a8d0-41bc-9943-6872a3c1619a.jpg)

## B.5 More detail about prototype update strategy

We have illustrated that the set of prototypes c is updated by exponential moving average in the paper, and here we show detail about this strategy. We update c by the moving average:

$$c \leftarrow \lambda \hat { c } + ( 1 - \lambda ) c \text{ \quad \ \ } ( A { - 2 6 } )$$

in each iteration, where ˆ c is computed by a batch of source features (note that if there is no sample with label k in a batch, we denote ˆ c k = c k directly). We also report the sensitivity of hyper-parameter λ , the result is shown in Fig. A-4. Note that our model is relatively stable to varying values of λ , and the result decreases when we do not use moving average strategy ( . i e ., λ = 1 ).

## B.6 Visualization of PPOT

We visualize the transport procedure of PPOT in toy data and the transport plan of PPOT in real data, as shown in Figs. A-5, A-6. In the toy data experiment, each of the source data(blue) and target data (red) are sampled by Gaussian mixture distributions composed of three distinct Gaussian components indicated by different shapes where the same shapes indicate the same class (both source and target data have two common classes and one private class) and green points are the prototypes of source data. We can see that most of transport occur between target common class points and their corresponding source prototype. In real data experiment, we first compute the features of source prototypes and target samples and choose 50 target features randomly as target samples. The transport plan between source prototypes and target features is shown in Fig. A-6, the task is W → D on Office-31 datasets. Note that we rearrange target samples to ensure the indexes of common class samples are less than private class samples, which means correct transport will present in the upper left of transport plan.

## B.7 Computational cost

We compare the computational cost of different methods with the total training time in the same training steps (5000 steps), as in Fig. A-7. Figure A-7 shows that PPOT is comparable to other methods in terms of computational cost.

## C Detailed Results on Office-31 and Office-Home

We have reported the average accuracies over all tasks on Office-31 and Office-Home in the paper (see Tables 1, 2 and 3 of the paper). We report the detailed results for each task in this section.

## C.1 Results for OPDA setting on Office-Home

We show the results of each task in Tables A-1 and A-3 on Office31 and Office-Home in OPDA setting. Our method achieves the best results in 13 out of 18 adaptation tasks.

## C.2 Results for PDA and OSDA setting on Office-Home

Table A-4 shows that our method achieves the best results on average and surpasses state-of-the-art results on half of them on Office-Home in PDA setting. The results in Table A-5 show that PPOT reaches the best results in 9 out of 12 tasks on Office-Home in OSDA setting.

|         | Office-Home(10/5/50)   | Office-Home(10/5/50)   | Office-Home(10/5/50)   | Office-Home(10/5/50)   | Office-Home(10/5/50)   | Office-Home(10/5/50)   | Office-Home(10/5/50)   | Office-Home(10/5/50)   | Office-Home(10/5/50)   | Office-Home(10/5/50)   | Office-Home(10/5/50)   | Office-Home(10/5/50)   | Office-Home(10/5/50)   |
|---------|------------------------|------------------------|------------------------|------------------------|------------------------|------------------------|------------------------|------------------------|------------------------|------------------------|------------------------|------------------------|------------------------|
| Methods | A2C                    | A2P                    | A2R                    | C2A                    | C2P                    | C2R                    | P2A                    | P2C                    | P2R                    | R2A                    | R2C                    | R2P                    | Avg                    |
| UAN     | 51.6                   | 51.7                   | 54.3                   | 61.7                   | 57.6                   | 61.9                   | 50.4                   | 47.6                   | 61.5                   | 62.9                   | 52.6                   | 65.2                   | 56.65                  |
| CMU     | 56.0                   | 56.9                   | 59.2                   | 67.0                   | 64.3                   | 67.8                   | 54.7                   | 51.1                   | 66.4                   | 68.2                   | 57.9                   | 69.7                   | 61.6                   |
| DANCE   | 61.0                   | 60.4                   | 64.9                   | 65.7                   | 58.8                   | 61.8                   | 73.1                   | 61.2                   | 66.6                   | 67.7                   | 62.4                   | 63.7                   | 63.9                   |
| DCC     | 58.0                   | 54.1                   | 58.0                   | 74.6                   | 70.6                   | 77.5                   | 64.3                   | 73.6                   | 74.9                   | 81.0                   | 75.1                   | 80.4                   | 70.2                   |
| OVANet  | 63.4                   | 77.8                   | 79.7                   | 69.5                   | 70.6                   | 76.4                   | 73.5                   | 61.4                   | 80.6                   | 76.5                   | 64.3                   | 78.9                   | 72.7                   |
| GATE    | 63.8                   | 75.9                   | 81.4                   | 74.0                   | 72.1                   | 79.8                   | 74.7                   | 70.3                   | 82.7                   | 79.1                   | 71.5                   | 81.7                   | 75.6                   |
| PPOT    | 66.0                   | 79.3                   | 84.8                   | 78.8                   | 78.0                   | 80.4                   | 82.0                   | 62.0                   | 86.0                   | 82.3                   | 65.0                   | 80.8                   | 77.1                   |

Table A-3: H-score(%) comparison on Office-Home in OPDA setting.

| Method   | Type   | Office-Home(25/40/0)   | Office-Home(25/40/0)   | Office-Home(25/40/0)   | Office-Home(25/40/0)   | Office-Home(25/40/0)   | Office-Home(25/40/0)   | Office-Home(25/40/0)   | Office-Home(25/40/0)   | Office-Home(25/40/0)   | Office-Home(25/40/0)   | Office-Home(25/40/0)   | Office-Home(25/40/0)   | Office-Home(25/40/0)   |
|----------|--------|------------------------|------------------------|------------------------|------------------------|------------------------|------------------------|------------------------|------------------------|------------------------|------------------------|------------------------|------------------------|------------------------|
| Method   | Type   | A2C                    | A2P                    | A2R                    | C2A                    | C2P                    | C2R                    | P2A                    | P2C                    | P2R                    | R2A                    | R2C                    | R2P                    | Avg                    |
| PADA     | P      | 52.0                   | 67.0                   | 78.7                   | 52.2                   | 53.8                   | 59.1                   | 52.6                   | 43.2                   | 78.8                   | 73.7                   | 56.6                   | 77.1                   | 62.1                   |
| IWAN     | P      | 53.9                   | 54.5                   | 78.1                   | 61.3                   | 48.0                   | 63.3                   | 54.2                   | 52.0                   | 81.3                   | 76.5                   | 56.8                   | 82.9                   | 63.6                   |
| ETN      | P      | 59.2                   | 77.0                   | 79.5                   | 62.9                   | 65.7                   | 75.0                   | 68.3                   | 55.4                   | 84.4                   | 75.7                   | 57.7                   | 84.5                   | 70.5                   |
| AR       | P      | 65.7                   | 87.4                   | 89.6                   | 79.3                   | 75.0                   | 87.0                   | 80.8                   | 65.8                   | 90.6                   | 80.8                   | 65.2                   | 86.1                   | 79.4                   |
| DCC      | U      | 54.2                   | 47.5                   | 57.5                   | 83.8                   | 71.6                   | 86.2                   | 63.7                   | 65.0                   | 75.2                   | 85.5                   | 78.2                   | 82.6                   | 70.9                   |
| GATE     | U      | 55.8                   | 75.9                   | 85.3                   | 73.6                   | 70.2                   | 83.0                   | 72.1                   | 59.5                   | 84.7                   | 79.6                   | 63.9                   | 83.8                   | 73.9                   |
| PPOT     | U      | 53.1                   | 81.2                   | 86.1                   | 78.9                   | 71.9                   | 83.7                   | 74.6                   | 55.5                   | 84.4                   | 77.4                   | 57.9                   | 86.3                   | 74.3                   |

Table A-4: H-score(%) comparison on Office-Home in PDA setting. 'P' and 'U' denote PDA and UniDA methods.

| Method   | Type   | Office-Home(25/0/40)   | Office-Home(25/0/40)   | Office-Home(25/0/40)   | Office-Home(25/0/40)   | Office-Home(25/0/40)   | Office-Home(25/0/40)   | Office-Home(25/0/40)   | Office-Home(25/0/40)   | Office-Home(25/0/40)   | Office-Home(25/0/40)   | Office-Home(25/0/40)   | Office-Home(25/0/40)   | Office-Home(25/0/40)   |
|----------|--------|------------------------|------------------------|------------------------|------------------------|------------------------|------------------------|------------------------|------------------------|------------------------|------------------------|------------------------|------------------------|------------------------|
| Method   | Type   | A2C                    | A2P                    | A2R                    | C2A                    | C2P                    | C2R                    | P2A                    | P2C                    | P2R                    | R2A                    | R2C                    | R2P                    | Avg                    |
| STA      | O      | 55.8                   | 54.0                   | 68.3                   | 57.4                   | 60.4                   | 66.8                   | 61.9                   | 53.2                   | 69.5                   | 67.1                   | 54.5                   | 64.5                   | 61.1                   |
| OSBP     | O      | 55.1                   | 65.2                   | 72.9                   | 64.3                   | 64.7                   | 70.6                   | 63.2                   | 53.2                   | 73.9                   | 66.7                   | 54.5                   | 72.3                   | 64.7                   |
| ROS      | O      | 60.1                   | 69.3                   | 76.5                   | 58.9                   | 65.2                   | 68.6                   | 60.6                   | 56.3                   | 74.4                   | 68.8                   | 60.4                   | 75.7                   | 66.2                   |
| DCC      | U      | 56.1                   | 67.5                   | 66.7                   | 49.6                   | 66.5                   | 64.0                   | 55.8                   | 53.0                   | 70.5                   | 61.6                   | 57.2                   | 71.9                   | 61.7                   |
| OVANet   | U      | 58.9                   | 66.0                   | 70.4                   | 62.2                   | 65.7                   | 67.8                   | 60.0                   | 52.6                   | 69.7                   | 68.2                   | 59.1                   | 67.6                   | 64.0                   |
| GATE     | U      | 63.8                   | 70.5                   | 75.8                   | 66.4                   | 67.9                   | 71.7                   | 67.3                   | 61.5                   | 76.0                   | 70.4                   | 61.8                   | 75.1                   | 69.1                   |
| PPOT     | U      | 60.7                   | 75.2                   | 79.5                   | 67.3                   | 70.1                   | 73.8                   | 70.6                   | 57.2                   | 76.1                   | 71.8                   | 61.4                   | 75.8                   | 70.0                   |

Table A-5: H-score(%) comparison on Office-Home in OSDA setting. 'O' and 'U' denote OSDA and UniDA methods.
Yucheng Yang Xiang Gu Jian Sun
Prototypical Partial Optimal Transport for Universal Domain Adaptation
Universal domain adaptation (UniDA) aims to transfer knowledge from a labeled
source domain to an unlabeled target domain without requiring the same label
sets of both domains. The existence of domain and category shift makes the task
challenging and requires us to distinguish "known" samples (i.e., samples whose
labels exist in both domains) and "unknown" samples (i.e., samples whose labels
exist in only one domain) in both domains before reducing the domain gap. In
this paper, we consider the problem from the point of view of distribution
matching which we only need to align two distributions partially. A novel
approach, dubbed mini-batch Prototypical Partial Optimal Transport (m-PPOT), is
proposed to conduct partial distribution alignment for UniDA. In training
phase, besides minimizing m-PPOT, we also leverage the transport plan of m-PPOT
to reweight source prototypes and target samples, and design reweighted entropy
loss and reweighted cross-entropy loss to distinguish "known" and "unknown"
samples. Experiments on four benchmarks show that our method outperforms the
previous state-of-the-art UniDA methods.