# Triplet Loss Network for Unsupervised Domain Adaptation  
[PERSON]  
1  
[PERSON]  
to a target domain sharing the same tasks but potentially following a different distribution. This can help in reducing the cost of data re-collection and its labelling. More formally, let \(D^{s}\) and \(D^{t}\) be the source and target domains, respectively. Domain adaptation (DA), which is a sub-field of transductive transfer learning (TTL), aims to solve a problem in \(D^{t}\), where data are hard to collect, using data from \(D^{s}\). Both domains, usually, share the same tasks (i.e., \(T^{t}=T^{s}\)) but the marginal distributions of the inputs differ (i.e., \(P(X^{s})\
eq P(X^{t})\)), as shown in Figure 1. DA is usually achieved by learning a shared feature space (i.e., \(Z^{s}=Z^{t}\)) [1]. There is a sizeable literature on DA. It can be categorized as either closed-set [2] or open-set [3; 4]. Closed-set DA is the case where the classes of \(D^{t}\) are the same as that of \(D^{s}\). Our work belongs to closed-set DA. On the other hand, open-set DA handles the case where only a few classes are shared between the two domains, and the source or the target domain might contain more classes. Similar to other machine learning tasks, DA can be split into supervised, unsupervised, and semi-supervised, depending on how much labeled data are available from \(D^{t}\). For supervised domain adaptation (SDA) [5] and semi-supervised domain adaptation (SSDA) [6], the data are completely or partially labeled, but are not sufficient enough to train an accurate model for the target domain from scratch. In unsupervised domain adaptation (UDA) [7; 8] the target domain samples are completely unlabeled, which is useful in situations where the data collection process is easy but the data labeling process is time consuming. The extreme case of DA is when we don't have any access to the target data, which is called domain generalization (DG). In DG, researchers have mainly used easy-to-collect datasets from different domains to make a model that can generalize well to unseen domains [9]. The focus of this work is on UDA, which typically needs large amounts of target data, especially in the case of deep unsupervised domain adaptation (DUDA). Although the focus is on DUDA because of the wide variety of real-world applications that it can solve, we use SDA as an upper bound to aim for, because SDA typically outperforms UDA, and we will exploit this fact to make our model perform even better by using a concept called pseudo-labelling [10]. Most of the previous DUDA approaches aimed at achieving two targets: (i) Produce (or learn) feature vectors from the data from \(D^{s}\) that can be used by a classifier to get highly accurate class labels, and (ii) make the features of both \(D^{s}\) and  
Figure 1: Both SVHN and MNIST datasets contain images of digits; however, there are many differences between them. SVHN images are real-world RGB images of digits (in different orientations) taken from street house numbers, whereas MNIST is a handwritten-digit dataset, where all images are in greyscale and have digits in a fixed orientation. The domain gap results from such differences in style, brightness, and contrast, among others. Domain adaptation aims at closing the above-mentioned gap between different datasets, such that an image classification model trained on SVHN would perform well on MNIST images, too. indistinguishable. Both [PERSON] et al., in [PERSON] et al. (2011), and [PERSON] et al., in [PERSON] et al. (2012), used generative models in different manners to achieve those targets. The former used Generative Adversarial Networks (GAN) to reconstruct various property maps of the source images while keeping the features extracted of both domains similar by training a base encoder on the opposite loss of the discriminator. The latter work used a duplex GAN architecture that could reconstruct the input images in both flavours, source and target, using the features extracted from the encoder.