# Triplet Loss Network for Unsupervised Domain Adaptation
## 3 Architecture and Methodology
### Optimization
high-dimensional (512 in digit classification and SYS-SIGNS to GTSRB, and 9216 for OFFICE31), we used the cosine similarity as our measure of distance \(d(.,. )\) in the separability loss in Equation (8). For digit classification and synthetic-to-real task, the encoder part of our model has four convolutional layers using \(5\times 5\) filters with 64, 128, 256, and 512 filters per layer, respectively. The classifier and the discriminator are four-layer fully-connected networks with 256, 128, and 50 neurons per each of their first three layers, respectively, and with an output layer of 10 neurons for the classifier and one neuron for the discriminator. The model weights were initialized using Xavier weight initialization [45]. The rest of the hyper-parameters are reported below, in Table 5, as they were tuned empirically for each experiment in Table 1. For the object recognition task, we used a pre-trained AlexNet [43] as the base for our encoder and classifier. For detailed information about our code, see the supplementary data/materials. ## 5 Conclusions

Domain Adaptation proves its benefit in increasing the accuracy for unlabeled datasets into other domains, which is a significant breakthrough in the field of machine learning. The current models that approach the unsupervised domain adaptation problem using generative models (or very deep models, like ResNet) as their baseline are highly expensive to train, in terms of time and space. Therefore, in this work, we present our model, TripNet, which has a simple model that allows for fast convergence, yet which can achieve good performance on domain adaptation in different image classification problems. TripNet consists of an encoder, a classifier, and a discriminator. Both the classifier and the discriminator are stacked on the encoder. For each of the three components, we define a specific loss: Classification, discrimination, and separability losses. These losses are used to train the components in a weighted manner. When tested on three image classification problems, TripNet achieved the best results in some cases and a fair performance (given its simplicity, in terms of training) in other cases. As further work on TripNet, we will explore the problem of semi-supervised domain adaptation, as we believe that TripNet will perform better in this field compared to the existing models. **Supplementary Materials:** The code for Triplet Loss Network for Unsupervised Domain Adaptation can be found in: Tri-Loss-Unsupervised. **Author Contributions:** Conceptualization, I.E.I.B. and Y.Y. ; Data curation, I.E.I.B. and Y.Y. ; Formal analysis, I.E.I.B. and A.K. ; Investigation, I.E.I.B. and A.K. ; Methodology, I.E.I.B. ; Project administration, A.K. ; Resources, R.G. and A.K. ; Software, I.E.I.B. and Y.Y. ; Supervision, A.K. and A.M.K. ; Validation, I.E.I.B., Y.Y., A.K., and A.M.K. ; Visualization, I.E.I.B. and Y.Y. ; Writing--original draft, I.E.I.B. ; Writing--review & editing, I.E.I.B., Y.Y., R.G., A.K., and A.M.K. **Funding:** This research work was funded by Zayed University Cluster Research Award R18038. **Conflicts of Interest:** The authors declare no conflict of interest. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Experiments** & \(\beta_{Sep}\) & \(\beta_{C}\) & \(\beta_{P}\) & \(\lambda_{S}\) & \(\lambda_{T}\) & \(\text{PL}_{\text{Thresh}}\) \\ \hline SVHN\(\rightarrow\) MNIST & 1.5 & 1 & 4 & 0.5 & 0.8 & 0.999 \\ MNIST \(\rightarrow\) USPS & 1.5 & 2.5 & 1 & 0.2 & 1 & 0.995 \\ USPS \(\rightarrow\) MNIST & 2.5 & 3 & 1.5 & 0.6 & 1 & 0.995 \\ SVHN\({}_{extra}\rightarrow\) MNIST & 3 & 0.5 & 2 & 0.5 & 1 & 0.999 \\ W \(\rightarrow\) A & 2 & 1.5 & 3 & 0.5 & 1 & 0.999 \\ W \(\rightarrow\) D & 1.5 & 1 & 2.5 & 0.7 & 1 & 0.999 \\ D \(\rightarrow\) A & 2 & 1.5 & 2.5 & 0.5 & 1.5 & 0.999 \\ D \(\rightarrow\) W & 1.5 & 2 & 3 & 0.5 & 1 & 0.999 \\ SYS-SIGNS \(\rightarrow\) GTSRB & 2 & 2 & 1.5 & 0.5 & 1 & 0.999 \\ \hline \hline \end{tabular}
\end{table}