# Triplet Loss Network for Unsupervised Domain Adaptation
## 3 Architecture and Methodology
### Optimization
### Target Accuracy Comparison

#### 4.1.1 Digit Classification

Our model was evaluated for UDA for the digit classification task, where the labels are \(0\sim 9\), using different datasets: MNIST of handwritten digits [38], SVHN of street houses numbers [39]; and the USPS [40] of U.S. Postal Service Handwritten Digit Database. These datasets were chosen because they have different distributions and their labels are present for validation and evaluation. We used 60,000 images from MNIST from its training part and 10,000 images from its evaluation part. USPS is a relatively smaller dataset, from which we used 7291 images for training and 2007 images for testing. Finally, SVHN had 73,257 images for training, 26,032 images for testing, and SVHN\({}_{extn}\) had 531,131 additional images for training. Our experiments were SVHN \(\rightarrow\) MNIST, USPS \(\leftrightarrow\) MNIST, and SVHN\({}_{extn}\)\(\rightarrow\) MNIST. The target accuracy results are shown in Table 1, where we can see first the decrease in performance when changing the domain (first two rows): For SVHN \(\rightarrow\) MNIST, we see a decrease of 36.6%; on average, there was a 23% decrease across all experiments, proving the need for domain adaptation methods. Our novel model either exceeded the compared methods or approached the highest-achieved results. It is also noteworthy that our model was so close to the results of a model that was trained on the target only, and surpassed it in some cases. This is due to the use of the separation loss and the discriminator, which allowed our latent representations to be domain-invariant, as seen in Figure 3, where all classes were clustered together, regardless of domain. Figure 3 illustrates the projection of the latent representations of both domains in the first experiment, SVHN \(\rightarrow\) MNIST. The projection for the visualization was produced using T-SNE [41] by reducing the dimensions of the latent space from 512 into 2, for visualization purposes. In Figure 3, it can be noticed that, after domain adaptation, the clusters for both domains that carry the same labels settled close to each other in the latent space, which demonstrates the competence of the presented model. According to the results presented in Table 1, there was no one specific model which outperformed the others in all cases. Those that exceeded our model (though, not by a significant margin) had more complex architectures and were difficult to train. We highlight this point later, in Section 4.2. \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Method** & **SVHN \(\rightarrow\) MNIST** & **MNIST \(\rightarrow\) USPS** & **USPS \(\rightarrow\) MNIST** & **SVHN\({}_{extra}\)\(\rightarrow\) MNIST** \\ \hline \hline DCNN-TargetOnly & 98.97 & 95.02 & 98.96 & 98.97 \\ \hline DCNN-SourceOnly & 62.19 & 86.75 & 75.52 & 73.67 \\ \hline ADDA & 76.0 & 92.87 & 93.75 & 86.37 \\ RevGrad & - & 89.1 & 89.9 & - \\ PixelDA & - & 95.9 & - & - \\ DSN & - & 91.3 & 73.2 & - \\ DANN & 73.85 & 85.1 & 73.0 & - \\ DRCN & 81.97 & 91.8 & 73.0 & - \\ KNN-Ad & 78.8 & - & - & - \\ ATDA & 85.8 & 93.17 & 84.14 & 91.45 \\ UNIT & - & 95.97 & 93.58 & 90.53 \\ CoGAN & - & 95.65 & 93.15 & - \\ SimNet & - & 96.4 & 95.6 & - \\ Gen2 Adpt & 92.4 & 92.8 & 90.8 & - \\ MCD & 93.6 & - & - & - \\ Image2 Image & 90.1 & **98.8** & 97.6 & - \\ TarGAN & **98.1** & 93.8 & 94.1 & - \\ DupGAN & 92.46 & 96.01 & **98.75** & 96.42 \\ \hline
**TripNet (Ours)** & 94.70 & 97.63 & 97.94 & **98.57** \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Test accuracy comparison for Unsupervised Domain Adaptation on digit classification. The results for the previous works have been copied from the original papers, or the DupGAN [12], without repeating the experiments, as we used a similar architecture for the encoder and the classifier parts, as well as the same experimental setup as those works (except for TarGan, which uses a bigger classifier). The “-” notation is used for experiments where the results have not been reported in previous works.