SlowGuess/NeurIPS_2023_OCR huggingface dataset:
Proposition 10.1. Let  $\mu_1, \mu_2 \in \mathcal{P}_2^n(\mathbb{R}^d)$ . Let  $\theta \in \mathbb{S}^{d-1}$ . Let  $\nu_1, \nu_2 \in \mathcal{P}_2^n(\mathbb{R}^d)$  be two pivot measures supported on a line with direction  $\theta$ , with distinctics atoms for each measure. We then have:
$$
W _ {\nu_ {1}} ^ {2} (\mu_ {1}, \mu_ {2}) = W _ {\nu_ {2}} ^ {2} (\mu_ {1}, \mu_ {2}) \tag {75}
$$
We give a proof of this proposition.
Thanks to lemma 4.6, we know that the transport map  $T_{\nu}^{1 \to 2}$  is fully induced by the transport plan  $T_{\nu}^{Q_{\#}^{\theta} \mu_1 \to Q_{\#}^{\theta} \mu_2}$ . Let remind that  $T_{\nu}^{Q_{\#}^{\theta} \mu_1 \to Q_{\#}^{\theta} \mu_2}$  is given by  $T^{\nu \to Q_{\#}^{\theta} \mu_2} \circ T^{Q_{\#}^{\theta} \mu_1 \to \nu}$  (see equation (12)). Moreover the two optimal transport plans are obtained via the ordering permutations, i.e. let  $\sigma, \tau, \pi \in S(n)$  s.t:
$$
\begin{array}{l} \overline {{\boldsymbol {x}}} _ {\sigma (1)} \leq \ldots \leq \overline {{\boldsymbol {x}}} _ {\sigma (n)} \\ \overline {{\boldsymbol {y}}} _ {\tau (1)} \leq \dots \leq \overline {{\boldsymbol {y}}} _ {\tau (n)} \\ \overline {{z}} _ {\pi (1)} \leq \dots \leq \overline {{z}} _ {\pi (n)} \\ \end{array}
$$
With  $\overline{\boldsymbol{x}}_i$  being the atoms of  $Q_{\#}^{\theta}\mu_{1},\overline{\boldsymbol{y}}_{i}$  the atoms of  $Q_{\#}^{\theta}\mu_{2}$  and  $\overline{z}_i$  being the atoms of  $Q_{\#}^{\theta}\nu$
One have  $T^{\mu_1 \to \nu}(\pmb{x}_{\sigma(i)}) = \pmb{z}_{\pi(i)}$  (resp.  $T^{\nu \to \mu_2}(\pmb{z}_{\pi(i)}) = \pmb{x}_{\tau(i)}$ )  $\forall 1 \leq i \leq n$ . Composing these two identities gives:
$$
T _ {\nu} ^ {1 \rightarrow 2} \left(\boldsymbol {x} _ {\sigma (i)}\right) = \boldsymbol {y} _ {\tau (i)} \quad \forall 1 \leq i \leq n \tag {76}
$$
The last equation shows that  $T_{\nu}^{1 \to 2}$  is in fact independent of  $\pi$  and thus of  $\nu$ .
10.8 Proof that min-SWGG is a distance (generalized geodesic formulation)
This proof has already been established in 7.3. However we rephrase the proof in the context of generalized geodesics.
We aim to prove that  $\mathrm{SWGG}_2 = \sqrt{2W_2^2(\mu_1,\mu_\theta^{1\rightarrow 2}) + 2W_2^2(\mu_\theta^{1\rightarrow 2},\mu_2) - 4W_2^2(\mu_{g,\theta}^{1\rightarrow 2},\mu_\theta^{1\rightarrow 2})}$  defines a metric.
Finite and non-negativity. Each term of  $\mathrm{SWGG}_2^2$  is finite thus the sum of the three terms is finite. Moreover, being an upper bound of WD makes it non-negative.
Symmetry. We have
$$
\begin{array}{l} \operatorname {S W G G} _ {2} ^ {2} \left(\mu_ {1}, \mu_ {2}, \theta\right) = 2 W _ {2} ^ {2} \left(\mu_ {1}, \mu_ {\theta} ^ {1 \rightarrow 2}\right) + 2 W _ {2} ^ {2} \left(\mu_ {2}, \mu_ {\theta} ^ {1 \rightarrow 2}\right) - 4 W _ {2} ^ {2} \left(\mu_ {g, \theta} ^ {1 \rightarrow 2}, \mu_ {\theta} ^ {1 \rightarrow 2}\right) \\ = 2 W _ {2} ^ {2} \left(\mu_ {2}, \mu_ {\theta} ^ {1 \rightarrow 2}\right) + 2 W _ {2} ^ {2} \left(\mu_ {1}, \mu_ {\theta} ^ {1 \rightarrow 2}\right) - 4 W _ {2} ^ {2} \left(\mu_ {g, \theta} ^ {1 \rightarrow 2}, \mu_ {\theta} ^ {1 \rightarrow 2}\right) \\ = \quad \mathbf {S W G G} _ {2} ^ {2} \left(\mu_ {2}, \mu_ {1}, \theta\right). \\ \end{array}
$$
Identity property.
From one side, when  $\mu_1 = \mu_2 \Rightarrow T^{\mu_1 \to \mu_\theta^{1 \to 2}} = T^{\mu_2 \to \mu_\theta^{1 \to 2}} = Id$ , giving  $\mu_{g,\theta}^{1 \to 2} = \mu_1 = \mu_2$ . Thus:
$$
\mathrm {S W G G} _ {2} ^ {2} \left(\mu_ {1}, \mu_ {2}, \theta\right) = 2 W _ {2} ^ {2} \left(\mu_ {1}, \mu_ {\theta} ^ {1 \rightarrow 2}\right) + 2 W _ {2} ^ {2} \left(\mu_ {1}, \mu_ {\theta} ^ {1 \rightarrow 2}\right) - 4 W _ {2} ^ {2} \left(\mu_ {1}, \mu_ {\theta} ^ {1 \rightarrow 2}\right) = 0 \tag {77}
$$
From another side,  $\mathrm{SWGG}_2^2 (\mu_1,\mu_2,\theta) = 0\Rightarrow W_2^2 (\mu_1,\mu_2) = 0\Rightarrow \mu_1 = \mu_2$  (by being an upper bound of WD).
Triangle Inequality. We have:
$$
\begin{array}{l} \operatorname {S W G G} _ {2} ^ {2} \left(\mu_ {1}, \mu_ {2}, \theta\right) = 2 W _ {2} ^ {2} \left(\mu_ {1}, \mu_ {\theta} ^ {1 \rightarrow 2}\right) + 2 W _ {2} ^ {2} \left(\mu_ {\theta} ^ {1 \rightarrow 2}, \mu_ {2}\right) - 4 W _ {2} ^ {2} \left(\mu_ {g, \theta} ^ {1 \rightarrow 2}, \mu_ {\theta} ^ {1 \rightarrow 2}\right) (78) \\ = 2 \int_ {\mathbb {R} ^ {d}} \| T _ {\theta} ^ {1} (\boldsymbol {x}) - \boldsymbol {x} \| _ {2} ^ {2} d \mu_ {\theta} ^ {1 \rightarrow 2} (\boldsymbol {x}) + 2 \int_ {\mathbb {R} ^ {d}} \| T _ {\theta} ^ {2} (\boldsymbol {x}) - \boldsymbol {x} \| _ {2} ^ {2} d \mu_ {\theta} ^ {1 \rightarrow 2} (\boldsymbol {x}) (79) \\ - 4 \int_ {\mathbb {R} ^ {d}} \| T _ {\theta} ^ {g} (\boldsymbol {x}) - \boldsymbol {x} \| _ {2} ^ {2} d \mu_ {\theta} ^ {1 \rightarrow 2} (\boldsymbol {x}) \\ = \int_ {\mathbb {R} ^ {d}} \left(2 \| T _ {\theta} ^ {1} (\boldsymbol {x}) - \boldsymbol {x} \| _ {2} ^ {2} + 2 \| T _ {\theta} ^ {2} (\boldsymbol {x}) - \boldsymbol {x} \| _ {2} ^ {2} - 4 \| T _ {\theta} ^ {g} (\boldsymbol {x}) - \boldsymbol {x} \| _ {2} ^ {2}\right) d \mu_ {\theta} ^ {1 \rightarrow 2} (\boldsymbol {x}) (80) \\ = \int_ {\mathbb {R} ^ {d}} \| T _ {\theta} ^ {1} (\boldsymbol {x}) - T _ {\theta} ^ {2} (\boldsymbol {x}) \| _ {2} ^ {2} d \mu_ {\theta} ^ {1 \rightarrow 2} (\boldsymbol {x}) (81) \\ \end{array}
$$
where, with an abuse of notation for clarity sake,  $T_{\theta}^{i}$  is the optimal map between  $\mu_{\theta}^{1\rightarrow 2}$  and  $\mu_{i}$  and  $T_{\theta}^{g}$  is the optimal map between  $\mu_{\theta}^{1\rightarrow 2}$  and  $\mu_{g,\theta}^{1\rightarrow 2}$ . The last line comes from the parallelogram rule of  $\mathbb{R}^d$ . Thanks to Proposition 10.1 we see that SWGG is simply the  $L^2 (\mathbb{R}^d,\nu)$  square norm, i.e.:
$$
\operatorname {S W G G} _ {2} ^ {2} \left(\mu_ {1}, \mu_ {2}, \theta\right) = \| T _ {\theta} ^ {1} - T _ {\theta} ^ {2} \| _ {\nu} ^ {2} \stackrel {\text {d e f}} {=} \int_ {\mathbb {R} ^ {d}} \| T _ {\theta} ^ {1} - T _ {\theta} ^ {2} \| _ {2} ^ {2} d \nu \tag {82}
$$
with  $\nu$  being any arbitrary pivot measure of  $\mathcal{P}_2^n (\mathbb{R}^d)$ . And thus  $\mathrm{SWGG}_2$  is the  $L^2 (\mathbb{R}^d,\nu)$  norm. This observation is enough to conclude that  $\mathrm{SWGG}_2$  is a proper distance for  $\theta$  fixed.
11 Experiment details and additional results
WD, SW, Sinkhorn, Factored coupling are computed using the Python 0T Toolbox [28] and our code is available at https://github.com/MaheyG/SWGG. The Sinkhorn divergence for the point cloud matching experiment was computed thanks to the Geomloss package [27].
11.1 Behavior of min-SWGG with the dimension and the number of points
In this section, we draw two experiments to study the behavior of min-SWGG w.r.t. the dimension and to the number of points.
Evolution with  $d$  In [20][Theorem of Section 2], authors aim at enumerate the number of permutations obtained via the projection of point clouds on a line. It appears that the number of permutations increases with the dimension. They even show that whenever  $d \geq 2n$  ( $2n$  being the total number of points of the problem), all the possible permutations ( $n!$ ) are in the scope of a line. Fig. 11 depicts the number of obtainable permutations as a function of the dimension  $d$ , for  $n$  fixed. This theorem can be applied to min-SWGG to conclude that whenever  $d \geq 2n$ , we have  $\min - \mathrm{SWGG}_2^2 = W_2^2$ .
It turns out empirically that the greater the dimension, the better the approximation of  $W_2^2$  with min-SWGG (see Fig. 11) for a fixed  $n$ . More formally, the set of all possible transport maps is called the Birkhoff polytope and it is known that the minimum of the Monge problem is attained at the extremal points (which are exactly the set of permutations matrices, a set of  $n!$  matrices in our context) [8]. The set of the transport maps in the scope of SWGG is a subset of the extremal points of the Birkhoff polytope (there are permutations matrices but not all possibilities are represented). Theoretically, the set of transport maps in the scope of SWGG is larger as  $d$  grows, giving a subset that is more and more tight with the extremal points of the Birkhoff polytope. This explains that min-SWGG can benefit from higher dimension.
We plot in Fig. 11 the evolution, over 50 repetitions, of the ratio  $\frac{\min\text{-SWGG}(\mu_1,\mu_2)}{W_2^2(\mu_1,\mu_2)}$  with  $d,n = 50$  and  $\mu_{1}\sim \mathcal{N}(1_{\mathbb{R}^{d}},Id),\mu_{2}\sim \mathcal{N}(-1_{\mathbb{R}^{d}},Id)$
Evolution with  $n$  Fig. 12 represents the evolution of  $W_2^2(\mu_1, \mu_2)$  and min-SWGG $_2^2(\mu_1, \mu_2)$  for two distributions  $\mu_1 \sim \mathcal{N}(1_{\mathbb{R}^d}, Id)$  and  $\mu_2 \sim \mathcal{N}(-1_{\mathbb{R}^d}, Id)$ , with  $d = 4$  and a varying number of points. The results are averages over 10 repetitions.
Figure 11: Evolution of  $W_2^2$  and min-SWGG $_2$  with the dimension  $d$  for isotropic Gaussian distributions (left) Number of permutations induced by a direction  $\theta \in \mathbb{S}^{d-1}$  with  $n = 310$  and a varying dimension (right)
Figure 12: Evolution of  $W_{2}^{2}$  and min-SWGG w.r.t. the number of points
We observe that, when  $n$  is large enough, min-SWGG tends to stabilize around some constant value. We conjecture that there may exist an upper bound for min-SWGG:
$$
\min  - \operatorname {S W G G} _ {2} ^ {2} \left(\mu_ {1}, \mu_ {2}\right) \leq \psi (d, n, d ^ {\prime}) W _ {2} ^ {2} \left(\mu_ {1}, \mu_ {2}\right) \tag {83}
$$
Where  $d'$  is the max of the dimensions of the distributions  $\mu_1, \mu_2$  [66], and  $\psi$  an unknown function.
11.2 Computing min-SWGG
We now provide here more details about the experimental setup of the experiments of Section 5.1.
Choosing the optimal  $\theta$  We compare three variants for choosing the optimal direction  $\theta$ : random search, simulated annealing and optimization (defined in Section 4.3). We choose to compare with simulated annealing since it is widely used in discrete problem (such as the travelling salesman) and known to perform well in high dimension [62] [16] [36]. We notice in Fig. 3 of the paper that the smooth version of min-SWGG is always (comparable or) better than the simulated annealing. In this experiment, we randomly sample 2 Gaussian distributions with different means and covariances matrices, whose parameters are chosen randomly. For optimizing min-SWGG, we use the Adam optimizer of Pytorch, with a fixed learning rate of  $5e^{-2}$  during 100 iterations, considering  $s = 10$  and  $\epsilon = 1$ .
Fig. 13 provides the timings for computing the random search approximation, simulated annealing and the optimization scheme. In all cases, we recover the linear complexity of min-SWGG (blue curves) in a log space. For the computation timings we compute min-SWGG with random search
with  $L = 500$ , simulated annealing (green curves) with 500 iterations with a temperature scheme  $(1 - \frac{k + 1}{500})_{k = 1}^{500}$  and the optimization scheme (considering  $s = 10$  with a fixed number of iterations for the optimization scheme equals to 100).
Figure 13: Considering two Gaussian distributions in dimensions  $d$  equals to: 2 (left), 20 (middle), 200 (right), we compute min-SWGG with random search, simulated annealing schemes and optimization procedure and report the timings for varying number of points and fixed number of projections.
number of points  $n$
Additionally, we reproduce the same setup as in 5.1 for the SW, max-SW and PWD distance. For sake of readability we compared with min-SWGG optim and report the results in Fig. 14.
Figure 14: Comparison of min-SWGG optim with PWD (left) and with max-SW and SW (right). PWD and SW are computed with a growing number of projection
Runtime Evaluation In the paper, on Fig. 3 (Right), we compare the empirical runtime evaluation on GPU for different methods. We consider Gaussian distributions in dimension  $d = 3$  and we sample  $n$  points per distribution with  $n \in \{10^2, 10^3, 10^4, 5 \cdot 10^4, 10^5\}$ . For SW Monte-Carlo and min-SWGG random search, we use  $L = 200$  projections. For both max-SW and min-SWGG with optimization, we use 100 iterations with a learning rate of 1, and we fix  $s = 50$  for min-SWGG. We use the official implementation of the Subspace Robust Wasserstein (SRW) with the Frank-Wolfe algorithm [52].
11.3 Gradient Flows
We rely on the code provided with [37] for running the experiment of Section 5.2.
We fix  $n = 100$ , the source distribution is taken to be Gaussian and we consider four different target measures that represent several cases: i) a 2 dimensional Gaussian, ii) a 500 dimensional Gaussian (high dimensional case), iii) 8 Gaussians (multi-modal distribution) and iv) a two-moons distribution (non-linear case).
We fix a global learning rate of  $5e^{-3}$  with an Adam optimizer. For SW, PWD and SWGG (random search), we sample  $L = 100$  directions. For the optimization methods max-SW, we set a learning rate of  $1e^{-3}$  with a number of 100 iterations for i), iii), and iv) and 200 iterations for ii). For min-SWGG (optimization), we took a learning rate of i)  $1e^{-1}$ , ii)  $1e^{-3}$ , iii)  $5e^{-2}$ , and iv)  $1e^{-3}$ . The hyper parameters for the optimization of min-SWGG are  $s = 10$  and  $\epsilon = 0.5$ , except for the 500-dimensional Gaussian for which we pick  $\epsilon = 10$ .
Each experiment is run 10 times and shaded areas in Fig. 4 (see the main paper) represent the mean  $\pm$  the standard deviation.
11.4 Gray scale image colorization
We now provide additional results on a pan-sharpening application to complete results provided in Section 5.3.
In pan-sharpening [64], one aims at constructing a super-resolution multi-chromatic satellite image with the help of a super-resolution mono-chromatic image (source) and low-resolution multichromatic image (target).
To realize this task, we choose to use a color transfer procedure, where the idea is to transfer the color palette from the target to the source image. This transfer is carried out by the optimal transport plan of the Wasserstein distance. More details on color transfer can be found in Supp. 11.6.
Additionally, we improve the relevance of the colorization by adding a proximity prior. For that, we used super pixels computed via the Watershed algorithm [48] thanks to the scikit-image package [61]. Obtained high resolution colorized images of size  $512 \times 512$  ( $n = 262$ ) are reported on Fig. 15.
Figure 15: Source high resolution black and white image (left) Target low resolution colorful image (right) Obtained high resolution colorful image (mid).
All pan-sharpening experiments were run on the PairMax data set [64]. The hyperparameters (markers and compactness) for the watershed super-pixels are: 500, 200, 200, 200 markers (an upper bound for the number of super pixel) for each image (by order of apparition) and compactness  $1e - 8$  (high values result in more regularly-shaped watershed basins) for all the images.
11.5 Point clouds registration
We here provide additional details and results about the experiments in Section 5.4.
Authors of [9] highlighted the relevance of OT in the point clouds registration context, plugged into an Iterative Closest Point (ICP) algorithm. They leveraged the 1D partial OT without consideration for the direction of the line. Our experiment shows the importance of  $\theta$ : the smaller SWGG is, the better the registration.
In this experiment, having a one to one correspondence is mandatory: as such, we compare min-SWGG with a nearest neighbor assignment and the one provided by OT. Note that we do not compare min-SWGG with subspace detour [44], since: i) with empirical distributions, the reconstruction of the plan is degenerated (as it doesn't involve any computation), ii) the research of subspace can be intensive as no prior is provided.
To create the source distributions, we used random transformation  $(\Omega ,t)\in O(d)\times \mathbb{R}^{d}$  of the target domain.  $\Omega$  was picked randomly from  $O(d)$ , the set of rotations and reflections, and  $t$  has random direction with  $\| t\| _2 = 5$ . We also add a Gaussian noise  $\mathcal{N}(0,\epsilon Id)$ , with  $\epsilon = 0.1$ .
The ICP algorithm was run with 3 datasets with the following features: i) 500 points in 2D, ii) 3000 points in 3D, and iii) 150 000 points in 3D. min-SWGG was computed through the random search estimation with  $L = 100$ . A stopping criterion was the maximum number of iterations of the algorithm, which varies with the dataset i.e.: i) 50, ii) 100, and iii) 200 respectively. The other stopping criterion is  $\| \Omega - Id \| + \| t \|_2 \leq \varepsilon$  with  $\varepsilon$  chosen respectively for the datasets as follows: i)  $1e^{-4}$ , ii)  $1e^{-2}$ , and iii)  $1e^{-2}$ , where  $(\Omega, t) \in O(d) \times \mathbb{R}^d$  is the current transformation and  $\| \cdot \|$  is the Frobenius norm. All these settings were run with 50 different seeds. Results are reported in Fig. 16.
Figure 16: The three datasets (left) and the distributions of the Sinkhorn divergences, the Chamfer distance, the Frobenius distance, the timing and the number of iterations over 50 seeds (right).
From Fig. 16, one can see that for:
-  $n = 500$ : The registration obtained via OT is very powerful (it is fast to compute and converges toward a good solution). min-SWGG is slightly faster with better convergence result and an equivalent number of iterations. Finally the nearest neighbor does not converge to a solution closed to the target.
-  $n = 3000$ : registration by OT can converge poorly, moreover the timings are much higher than the competitors. min-SWGG shows efficient convergence results with an attractive computation time (order of few seconds). We observe that the number of iterations can be very large and we conjecture that it is due to the fact that min-SWGG-based ICP can exit local minima. The nearest neighbor is fast but, most of the time, does not converge to global minima (i.e. the exact matching of the shapes).
-  $n = 150000$ : In this setting, OT is totally untractable (the cost matrix needs 180 GB in memory). min-SWGG shows good convergence and is most of the time very fast whenever
the number of iterations does not attain the stopping criterion. The nearest neighbor assignment is faster but only converges to local minima.
Note that, despite the fact that min-SWGG is slightly slower than the nearest neighbor, the overall algorithm can be faster due to the better quality of each iteration (min-SWGG can attain a minimum with less iterations).
In Table 3 we give additional results on the final distribution. We control the final convergence via the square Chamfer distance and the square Frobenius distance. The Square Chamfer distance is a square distance between point cloud defined as:
$$
d ^ {2} (X, Y) = \sum_ {x \in X} \min  _ {y \in Y} | | x - y | | _ {2} ^ {2} + \sum_ {y \in Y} \min  _ {x \in X} | | x - y | | _ {2} ^ {2} \tag {84}
$$
and the Square Frobenius norm is a square distance between the transformation, defined as:
$$
\operatorname {F r} \left(\left(\Omega_ {\text {r e a l}}, t _ {\text {r e a l}}\right), \left(\Omega_ {\text {e s t i m a t e d}}, t _ {\text {e s t i m a t e d}}\right)\right) = \left\| \Omega_ {\text {r e a l}} - \Omega_ {\text {e s t i m a t e d}} \right\| _ {2} ^ {2} + \left\| t _ {\text {r e a l}} - t _ {\text {e s t i m a t e d}} \right\| _ {2} ^ {2} \tag {85}
$$
In both cases we can see that the final results for min-SWGG are much better than the results for NN and relatively closed to the results from OT.
n	500	3000	1500 00
NN	11.65	0.20	6.90
OT	0.03	0.16	.
min-SWGG	0.08	0.13	8 × 10-4
n	500	3000	150 000
NN	526	30.04	21.7
OT	3.8	6.5	.
min-SWGG	2	4.5	6.01
Table 3: Square Chamfer distance (top) and Square Frobenius distance (bottom) between final transformation on the source and the target. Best values are boldfaced.
An other important aspect of ICP is that the algorithm tends to fall into local minima: the current solution is not good and further iterations do not allow a better convergence of the algorithm. We observed empirically that min-SWGG can avoid getting stuck on local minima when a reasonable number of directions  $\theta$  is sampled ( $L \sim 100$ ). We conjecture that the random search approximation is not always the ideal solution and hence may escape local minima. This may lead to a better convergence solution for min-SWGG-based ICP.
11.6 Color Transfer
In this section, we provide an additional experiment in a color transfer context.
We aim at adapting the color of an input image to match the color of a target one [25, 44]. This problem can be recast as an optimal transport problem where we aim at transporting the color of the source image  $\mathbf{X}$  into the target  $\mathbf{Y}$ . For that, usual methods lie down on the existence of a map  $T: \mathbf{X} \to \mathbf{Y}$ . We challenge min-SWGG to this problem to highlight relevance of the obtained transport map.
Images are encoded as vector in  $\mathbb{R}^{nm\times 3}$ , where  $n$  and  $m$  are the size of the image and 3 corresponds to the number of channels (here RBG channels). We first compute a map  $T_0: X_0 \to Y_0$  between a subsample of  $X$  and  $Y$  of size 20000 and secondly extend this mapping to the complete distributions  $T: X \to Y$  using a nearest neighbor interpolation. The subsampling step is mandatory due to the size of the images but can deteriorate the quality of the transfer.
We compare the results obtained with maps obtained from Wasserstein distance, min-SWGG with random search (100 projections), subspace detour [44] and min-SWGG (optimized). Obtained images and the associated timings are provided in fig. 17.
Figure 17 shows that min-SWGG and  $W_{2}^{2}$  provide visually equivalent solutions. Since, the quality of the color transfer is dependent on the size of the subsampling: using min-SWGG permits larger
Figure 17: Color transfer of images with  $W_2^2$ , min-SWGG and subspace detours, with runtimes.
subsamples than  $W_2^2$  and thus improves the quality of the map  $T$ . Moreover one can note that min-SWGG (optimized) is the fastest to compute.
We now give more details about how to perform color transfer between two distributions. The first step is to encode  $n \times m$  images as  $\mathbb{R}^{nm \times 3}$  vectors, with 3 channels in a RGB image. Note that  $m$  and  $n$  can differ for the source and target image. The second step consists of defining subsamples  $X_0, Y_0$  of  $X, Y$ , in our case we took  $\pmb{X}_0, \pmb{Y}_0 \in \mathbb{R}^{20000 \times d}$ . We subsample the same number of points for the source and target image. In order to have a better subsampling of  $\pmb{X}$  and  $\pmb{Y}$ , it is common to perform a  $k$ -means [34] to derive  $\pmb{X}_0$  and  $\pmb{Y}_0$  ( $\pmb{X}_0, \pmb{Y}_0$  are then taken as centroids of the  $k$ -means algorithm). The third step is to compute  $T_0: \pmb{X}_0 \to \pmb{Y}_0$ . We set  $T$  as the optimal Monge map given by the Wasserstein distance and  $T$  as the optimal map given by min-SWGG. Finally, the fourth step deals with extending  $T_0: \pmb{X}_0 \to \pmb{Y}_0$  to  $T: \pmb{X} \to \pmb{Y}$ .  $\forall \pmb{x} \in \pmb{X}$ . We compute the closest element  $x_0 \in X_0$  and we pose:
$$
T (\boldsymbol {x}) = T \left(\boldsymbol {x} _ {0}\right). \tag {86}
$$
More details on the overall procedure can be found in [25].
To perform the experiment, we took  $L = 100$  projections for min-SWGG (random search). For min-SWGG (optimized), we fixed the following set of parameters for the gradient descent: learning rate  $5e^{-2}$ , number of iterations 20, number of copies  $s = 10$  and  $\epsilon = 1$ . Regarding the subspace detour results, we used the code of [44] provided at https://github.com/BorisMuzellec/Subspace0T.
Additionally, we perform color transfer without sub-sampling with the help of min-SWGG (we the same hyperparameters). This procedure is totally untractable for either  $W_2^2$  and subspace detours (due to memory issues). As we mentioned before, the subsampling phase can decrease the quality of the transfer and thus min-SWGG can deliver better result than before. Result are give in Fig. 18
Figure 18: Color transfer of images with min-SWGG without sub-sampling.
11.7 Data set distance