# Triplet Loss Network for Unsupervised Domain Adaptation
## 3 Architecture and Methodology
### Optimization
\begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Methods** & **W ->** A & **W ->**D & **D ->**A** & **D ->W** \\ \hline AlexNet before DA & 32.6 & 70.8 & 35.0 & 77.3 \\ \hline DANN & 52.7 & - & 54.5 & - \\ DRCN & 54.9 & - & 56.0 & - \\ DCNN & 49.8 & - & 51.1 & - \\ DupGan & **59.1** & - & **61.5** & - \\ \hline
**TripNet** & 55.6 & 99.3 & 57.3 & **98.5** \\ \hline TCA - ResNet & 60.9 & 99.6 & 61.7 & 96.9 \\ RevGrad - ResNet & 67.4 & 99.1 & 68.2 & 96.9 \\ Gen2 Apdt - ResNet & **71.4** & **99.8** & **72.8** & 97.9 \\ \hline ResNet before DA & 60.7 & 99.3 & 62.5 & 96.7 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Performance comparison on the OFFICE31 dataset, based on accuracy for unsupervised domain adaptation. Results were generated by averaging the results of five runs of our model, as well as using the reported results of the other papers. AlexNet-based experiments are separated with a bold line from ResNet based experiments; the best results are in bold for each; and the missing values are denoted by “-”. \begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline
**Methods** & **Before DA** & **DANN** & **DDC** & **DSN** & **TarGAN** & **Tri-Training** & **TripNet (ours)** \\ \hline SYN-SIGNS to GTSRB & 56.4 & 78.9 & 80.3 & 93.1 & 95.9 & **96.2** & 88.7 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Unsupervised domain adaptation results for the SYN-SIGNS to GTSRB experiment. The results have been directly used, as well as the results reported in the original works. ### Ablation Study

For the purpose of seeing the usefulness of each component of TripNet, we performed an ablation study on the MNIST \(\rightarrow\) USPS and SVHN\({}_{attn}\)\(\rightarrow\) MNIST cases by running the experiments each time without a specific component and comparing it with our final (full-model) results. We also compared the performance against two extreme cases: (i) tfTraining and testing on target domain, and (ii) training on the source domain and testing on the target domain. Our experiments also covered training without the balancing factor for separation loss (referred to as TripNet-WBF), training without the separation loss (referred to as TripNet-WSL), training without pseudo-labeling (referred to as TripNet-WPL), and training without the discriminator (referred to as TripNet-WD). As shown in Table 4, the accuracy degrades if we exclude any component, which shows the necessity of each in the presented model to build an efficient architecture for domain adaptation. It is also worth noticing that our model (TripNet) obtained better results than EC-TargetOnly on MNIST \(\rightarrow\) USPS, even though EC-TargetOnly was trained directly on the USPS data; this is mainly due to the fact that USPS and MNIST are very similar, and as USPS has a small training set. ### Implementation Details

In the digit recognition and synthetic-to-real experiments, our input images from all domains were reshaped into \(32\times 32\times 3\) images, or into \(227\times 227\times 3\) for the OFFICE31 object recognition task, and each pixel was re-scaled to \([0.0,1.0]\). Given that the latent representation vectors \(z_{i}\) are \begin{table}
\begin{tabular}{c c c} \hline \hline
**Experiments** & **MNIST \(\rightarrow\) USPS** & **SVHN\({}_{extra}\)\(\rightarrow\) MNIST** \\ \hline Training and testing on target labels & 95.02 & **98.97** \\ Training on source and testing on target & 86.75 & 73.67 \\ TripNet-WD & 96.07 & 81.4 \\ TripNet-WPL & 90.42 & 71.06 \\ TripNet-WSL & 90.86 & 71.33 \\ TripNet-WBF & 96.71 & 92.83 \\
**TripNet (Full)** & **97.63** & 98.57 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Test accuracy for the ablation study for TripNet. Figure 4: Comparison between TripNet and DupGAN, in terms of the number of iterations needed for convergence in the SVHN \(\rightarrow\) MNIST case. This shows that the generative model comes with a high cost, in terms of training time.