{'fraction_non_alphanumeric': 0.03850541048802294, 'fraction_numerical': 0.009711132348860868, 'mean_word_length': 4.772913329773981, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Cross-Domain Similarity Learning for Face Recognition in Unseen Domains

Face recognition models trained under the assumption of identical training and test distributions often suffer from poor generalization when faced with unknown variations, such as a novel ethnicity or unpredictable individual make-ups during test time. In this paper, we introduce a novel cross-domain metric learning loss, which we dub Cross-Domain Triplet (CDT) loss, to improve face recognition in unseen domains. The CDT loss encourages learning semantically meaningful features by enforcing compact feature clusters of identities from one domain, where the compactness is measured by underlying similarity metrics that belong to another training domain with different statistics. Intuitively, it discriminatively correlates explicit metrics derived from one domain, with triplet samples from another domain in a unified loss function to be minimized within a network, which leads to better alignment of the training domains. The network parameters are further enforced to learn generalized features under domain shift, in a model-agnostic learning pipeline. Unlike the recent work of Meta Face Recognition, our method does not require careful hard-pair sample mining and filtering strategy during training. Extensive experiments on various face recognition benchmarks show the superiority of our method in handling variations, compared to baseline and the state-of-the-art methods.


Introduction
Face recognition using deep neural networks has shown promising outcomes on popular evaluation benchmarks [21,25,26,23]. Many current methods base their approaches on the assumption that the training data -CASIA-Webface [46] or MS-Celeb-1M [19] being the widely used ones -and the testing data have similar distributions. However, when deployed to real-world scenarios, those models often do not generalize well to test data with unknown statistics. In face recognition applications, this may mean a shift in attributes such as ethnicity, gender or age between the training and evaluation data. On the other hand, collecting and labelling more data along the underrepresented attributes Figure 1. Comparison between the conventional triplet and our Cross-Domain Triplet losses. Top: The standard triplet loss is domain agnostic and utilizes a shared metric matrix, Σ, to measure distances of all (anchor,positive) and (anchor,negative) pairs. Bottom: Our proposed Cross-Domain Triplet loss, takes into account Σ + and Σ − , i.e., the similarity metrics obtained from positive and negative pairs in one domain, to make compact clusters of triplets that belong to another domain. This, results to better alignment of the two domains. Here, colors indicate domains. is costly. Therefore, given existing data, learning algorithms are needed to yield universal face representations and in turn, be applicable across such diverse scenarios.
Domain generalization has recently emerged to address the same challenge, but mainly for object classification with limited number of classes [3,9,32]. It aims to employ multiple labeled source domains with different distributions to learn a model that generalizes well to unseen target data at test time. However, many domain generalization methods are tailored to closed-set scenarios and hence, not directly applicable if the label spaces of the domains are disjoint. Generalized face recognition is indeed a prominent example of open-set applications with very large number of categories, encouraging the need for further research in this area.
In this paper, we introduce an approach to improve the problem of face recognition from unseen domains by learning semantically meaningful representations. To this end, we are motivated by recent works in few-shot learning [31], domain generalization [9] and face recognition [22], revealing a general fact that, in training a model, it is beneficial to exploit notions of semantic consistency between training data coming from various sources. Therefore, we introduce Cross-Domain Triplet (CDT) loss based on the triplet objective [36], that learns useful features by considering two domains, where the similarity metrics provided by one domain are utilized in another domain to learn compact feature clusters of identities (Fig 1).
Such similarity metrics are encoded by means of covariance matrices, borrowing the idea from [31]. Different from [31], however, instead of using class-specific covariance matrices, we cast the problem in domain alignment regime, where our model first estimates feature distributions between the anchor and positive/negative samples, namely the similarity metrics derived from positive/negative pairs in one domain (i.e., Σ + and Σ − in Fig 1). Then, we utilize these similarity metrics and apply them to triplets of another domain to learn compact clusters. As supported by theoretical insights and experimental evaluations, our CDT loss aligns distributions of two domains in a discriminative manner. Furthermore, by leveraging a meta-learning framework, our network parameters are further enforced to learn generalized features under domain shift, following recent studies [9,18].
Our experiments demonstrate the effectiveness of our approach equipped with the Cross-Domain Triplet loss, consistently outperforming the state-of-the-art on practical scenarios of face recognition for unknown ethnicity using the Cross-Ethnicity Faces (CEF) [39] and Racial Faces in-the-Wild (RFW) [44] benchmark datasets. Furthermore, it can satisfactorily handle face recognition across other variations as shown by empirical evaluations.
To summarize, we introduce an effective Cross-Domain Triplet loss function which utilizes explicit similarity metrics existing in one domain, to learn compact clusters of identities from another domain. This, results to learning semantically meaningful representations for face recognition from unseen domains. To further expose the network parameters to domain shift, under which more generalized features are obtained, we also incorporate the new loss in a model-agnostic learning pipeline. Our experiments show that our proposed method achieves state-of-the-art results on the standard face recognition from unseen domain datasets.

Related Work
Face Recognition. Following the success of deep neural networks, recent works on face recognition have tremendously improved the performances [46,36,35,43,7,37,6], thanks to large amount of labeled data being at the disposal. Many loss designs are shown to be effective in large scale network training, i.e., CosFace [43] proposes to squeeze the classification boundary with a loss margin in cosine man-ifold, ArcFace [7] combines the boundary margin with an angular margin to have better classification effect. Very recently, URFace [37] proposes sample-level confidence weighted cosine loss with an adversarial de-correlation loss to achieve better feature representations.
Generally, face recognition algorithms conjecture that the training data (e.g. CASIA-WebFace [46] or MS-Celeb-1M [19]) and testing data follow similar distributions. Recent works [18,39] however, demonstrate unsatisfactory performance of such systems due to their poor generalization ability to handle unseen data in practice. This, makes face recognition models that are aware of test-time distribution changes, be more favorable. Furthermore, in minimizing distribution discrepancy, it is crucial to consider class information to avoid mis-alignment of samples from different categories in different domains [24].
Meta-learning and Domain Generalization. It is now an accepted fact that meta-learning (a.k.a. learning to learn [41]) can boost generalization ability of a model. The episodic training scheme originated from Model-Agnostic Meta-Learning (MAML) [16] has been widely used to address few shot learning [40,38], domain generalization for object recognition from unseen distributions [29,3,32] and very recently face recognition from unseen domains [18]. The underlying idea is to simulate the train/test distribution gap in each round of training through creating episodic train/test splits out of the available training data. Some other examples include Model-Agnostic learning of Semantic Features (MASF) [9] which aligns a soft confusion matrix to retain knowledge about inter-class relationships, Feature Critic Networks [32] which proposes learning an auxiliary loss to help generalization and Meta-Learning Domain Generalization (MLDG) [28] which generates domain shift during training by synthesizing virtual domains within each batch.
Efforts in addressing unseen scenarios are either on transferring existing class variances to under-represented classes [47], or learning universal features through various augmentations [37]. A recent effort is Meta Face Recognition (MFR) [18], in which a loss is composed of distances of hard samples, identity classification and the distances between domain centers. However, simply enforcing alignment of the centers of training domains does not necessarily align their distributions and may lead to undesirable effects, e.g., aligning different class samples from different domains [24]. As a result, this loss component does not always improve recognition (see w/o da. rows in Asian and Caucasian sections of Table 10 in [18]).

Proposed Method
In this section, we present our approach to improve the problem of face recognition from unseen domains by learning semantically meaningful representations. To do so, we are inspired by recent works [31,9,22], showing that, in training a model, it is beneficial to exploit notions of semantic consistency between data coming from different distributions. We learn semantically meaningful features by enforcing compact clusters of identities from one domain, where the compactness is measured by underlying similarity metrics that belong to another domain with different statistics. In fact, we distill the knowledge encoded as similarity metrics across the domains with different label spaces.
We start with introducing the overall network architecture. Our architecture closely follows a typical image/face recognition design. It consists of a representation-learning network f r (· ; θ r ), parametrized by θ r , an embedding network f e (· ; θ e ), parametrized by θ e and a classifier network f c (· ; θ c ), parametrized by θ c . Following the standard setting [3,9,18], both f c (· ; θ c ) and f e (· ; θ e ) are light networks, a couple of Fully Connected (FC) layers, which take inputs from f r (· ; θ r ). More specifically, forwarding an image I through f r (·) outputs a tensor f r (I) ∈ R H×W ×D that, after being flattened, acts as input to both the classifier f c (·) and the embedding network f e (·).
Before delving into more details, we first review some basic concepts used in our formulation. Then, we provide our main contribution to learn generalized features from multiple source domains with disjoint label spaces. Finally, we incorporate the solution into a model-agnostic algorithm, originally based on Model-Agnostic Meta-Learning (MAML) [16].

Notation and Preliminaries
Throughout the paper, we use bold lower-case letters (e.g., x) to show column vectors and bold upper-case letters (e.g., X) for matrices. The d × d identity matrix is denoted by I d . By a tensor X , we mean a multi-dimensional array of order k , i.e., X ∈ R d1×···×d k . [X ] i,j,··· ,k denotes the element at position {i, j, · · · , k} in X .
In Riemannian geometry, the Euclidean space R d is a Riemannian manifold equipped with the inner product defined as x, y = x T Σ y, x, y ∈ R d [11,14]. The class of Mahalanobis distances in R d , d : where Σ ∈ R d×d is a Positive Semi-Definite (PSD) matrix [27], region covariance matrix of features being one instance [10,15]. This, boils down to the Euclidean (l 2 ) distance when the metric matrix, Σ, is chosen to be I d . The motivation behind Mahalanobis metric learning is to determine Σ such that d Σ (·, ·) endows certain useful properties by expanding or shrinking axes in R d . In a general deep neural network for metric learning, one relies on a FC layer with weight matrix W ∈ R D×d immediately before a loss layer (e.g. contrastive [20] or triplet [36]) to provide the embeddings of the data to a reduced dimension space [12,13,36]. Then, given the fact that Σ is a PSD matrix and can be decomposed as Σ = W T W , the squared l 2 distance between two samples x and y (of a batch) passing through a network is computed as where f (x) ∈ R d denotes functionality of the network on an image x.
In this work, we use positive (negative) image pairs to denote face images with equal (different) identities. Moreover, a triplet, (anchor, positive, negative), consists of one anchor face image, another sample from the same identity and one image from a different identity.

Cross-Domain Similarity Learning
Here, we tackle the face recognition scenario where during training we observe k source domains, each with different attributes like ethnicity. At test time, a new target domain is presented to the network which has samples of individuals with different identities and attributes. We formulate this problem as optimizing a network using a novel loss based on the triplet loss [36] objective function, which we dub Cross-Domain Triplet loss. Cross-Domain Triplet loss, accepts inputs from two domains i D and j D, estimates underlying distributions of positive and negative pairs from one domain (e.g., j D), to measures the distances between (anchor, positive) and (anchor, negative) samples of the other domain (e.g., i D), respectively. Then, using the computed distances and a pre-defined margin, the standard triplet loss function is applied.
represents a batch of B j triplets from the j-th domain, j ∈ 1 · · · k, from which we can consider positive samples . For simplicity we drop the superscript j here. We combine all local descriptors of each image to estimate the underlying distribution by a covariance matrix. Specifically, we forward each positive image pair (a, p), through f r (·) to obtain the feature tensor representation f r (a), f r (p) ∈ R H×W ×D . We cast the problem in the space of pairwise differences. Therefore, we define the tensor R + = f r (a) − f r (p). Next, we flatten the resulting tensor This allows us to calculate a covariance matrix of positive pairs in pairwise difference space as where N = BHW and µ + = 1 Similarly, using B negative pairs This enables us to define a covariance matrix of negative pairs as where Considering that a batch of images has adequate samples, this will make sure a valid PSD covariance matrix is obtained, since each face image has HW samples in covariance computations. Furthermore, samples from a large batch-size can satisfactorily approximate domain distributions according to [1,8].
Our Cross Domain Triplet loss, l cdt , works in a similar fashion by utilizing the distance function d 2 Σ (·, ·) defined in (2), to compute distance of samples using the similarity metrics from another domain. Given triplet images i T from domain i D and j Σ + , j Σ − from domain j D computed via (3) and (4), respectively, it is defined as where τ is a pre-defined margin and [·] + is the hinge function. We utilize class balanced sampling to provide inputs to both covariance and Cross-Domain Triplet loss calculations as this has been shown to be more effective in long-tailed recognition problems [18,33].
Insights Behind our Method. Central to our proposal, is distance of the form r T Σ r, defined on samples of two domains with different distributions. If r is drawn from a distribution then the multiplications with Σ results in a distance according to the empirical covariance matrix, which optimizing over the entire points translates to alignment of the domains. More specifically, assuming that Σ is PSD, then eigendecomposition exists, i.e., Σ = V ΛV T . Expanding the term leads to which correlates r with the eigenvectors of Σ weighted by the corresponding eigenvalues. This, attains its maximum when r is in the direction of leading eigenvectors of the empirical covariance matrix Σ. In other words, as the eigenvectors of Σ are directions where its input data has maximal variance, minimizing this term over r vectors results to alignment of the two data sources. Fig 2 depicts the underlying process in our loss.

A Solution in a Model Agnostic Framework
Following recent trends in domain generalization tasks, we employ gradient-based meta-train/meta-test episodes under a model-agnostic learning framework to further expose the optimization process to distribution shift [9,32,18]. Algorithm (1) summarizes our overall training process. More specifically, in each round of training, we split input source domains into one meta-test and the remaining meta-train domains. We randomly sample B triplets from each domain to calculate our losses. First, we calculate two covaraince matrices, Σ + and Σ − , as well as temporary set of parameters, Θ , based on the summation of a classification and triplet losses, L s . The network is trained to semantically perform well on the held-out meta-test domain, hence Σ + , Σ − and Θ are used to compute the loss on the meta-test domain, L t . This loss has additional CDT loss, l cdt , to also involve cross-domain similarity for domain alignment. In the end, the model parameters are updated by accumulated gradients of both L s and L t , as this has been shown to be more effective than the original MAML [2,18]. Here, the accumulated L t loss provides extra regularization to update the model with higher-order gradients. In the following, we provide details of the identity classification and the triplet losses.
Having a classification training signal is crucial to face recognition applications. Hence, we use the standard Large Margin Cosine Loss (LMCL) [43] as our identity classification loss which is as follows where y i is the ground-truth identity of the image I i , f c (·) is the classifier network, w yi is the weight vector of the identity y i in θ c , s is an scaling multiplier and m is the margin.
We further encourage f r network to learn locally compact semantic features according to identities from one domain. To this end, we use the triplet loss. Using the standard l 2 distance function · 2 , the triplet loss function provides training signal such that for each triplet, the distance between a and n becomes greater than the distance between a and p plus a predefined margin ρ. More formally, l trp T; θ r , θ e = 1 Note that w y , f c (I) and f e (I) are l 2 normalized prior to computing the loss. Furthermore, f c (·) and f e (·) operate on the extracted representation by f r (·). Compute Θ ← Θ − α∇ (Θ) Ls 10: Compute j Σ + and j Σ − using positive and negative pairs of j T

Experiments
In this part, we first provide our implementation details for the sake of reproducibility. Then, we provide experimental results for face recognition from unseen domains. We conclude this section by ablation analysis of important components of our algorithm. To the best of our knowledge, Meta Face Recognition (MFR) [18] is the very recent work that addresses the same problem. Therefore, we compare our method against MFR in all evaluations. We also consider the performances of CosFace [43], Arcface [7] and URFace [37] as our baseline. Implementation Details. Our implementation was done in PyTorch [34]. For our baseline model, we utilized a 28-layer ResNet with a final FC layer that generates an embedding space of R 256 , i.e., the final generalized feature space at test time. In our design, f r (·; θ r ) is the backbone immediately before this FC layer. f c (·) generates logits immediately after it, while f e (·) stacks an additional FC layer, to map inputs to a lower dimensional space of R 128 . As for the optimizer, we adopted stochastic gradient descent with the weight decay of 0.0005 and momentum of 0.9. In Algorithm (1), the batch-size B is set to 128, α and β to 1e −4 decaying to half every 1K steps and λ to 0.7. We set the classifier margin m to 0.5 and both margins τ and ρ to 1.

Cross Ethnicity Face Verification/Identification
As our first set of experiments, we tackled the problem of face recognition from unseen ethnicity. Here, the evaluation protocol is leave-one-ethnicity-out, i.e., excluding samples of one ethnicity (domain) from training and then evaluating the performances on the samples of the held-out domain.
Datasets. For evaluation, there exist two recent datasets recommended for studying facial cross ethnicity recognition performances, namely the Cross-Ethnicity Faces (CEF) [39] and Racial Faces in-the-Wild (RFW) [44] datasets. CEF dataset is selected from MS-Celeb-1M [19], consisting of four types of ethnicity images, Caucasian, African-American, East-Asian and South-Asian. We combined the last two sets into one ethnicity domain, Asian. There are 200 identities with 10 different images from each ethnicity. Note that, the identities in CEF are disjoint from the MS-Celeb-1M dataset, which we use to train our model. Similarly, RFW is another cross-ethnicity evaluation benchmark made from the MS-Celeb-1M dataset with four ethnicity subsets: Caucasian, African, Asian and Indian. CEF has only test samples, while  [39] testing set using our annotated MS-Celeb-1M dataset with ethnicity labels. We report the evaluation metrics when either a single domain or all domains (i.e., the last row) are used to train a CosFace model [43]. Testing data is either from CA: Caucasian, AA: African-American or AS: Asian domain, from disjoint identities to those of the training data. As shown in the results, regardless of the amount of data, a model trained on samples from a specific domain, performs much better on the testing data from the same domain. This, suggests the importance of having bias free training data when evaluating generalized face recognition algorithms. The top two results are highlighted in bold.
RFW provides both training and testing data across the domains.
Effect of Ethnicity Bias in Training Data. Note that, most public face datasets are collected from the web by querying celebrities. This, leads to significant performance bias towards the Caucasian ethnicity. For example, 82% of the data are Caucasian images in the MS-Celeb-1M dataset, while there are only 9.7% African-American, 6.4% East-Asian and less than 2% Latino and South-Asian combined altogether [39].
To further highlight the influence of having ethnicity bias in training data of face recognition models, we performed an experiment using our annotated MS-Celeb-1M dataset with ethnicity labels and the CEF test set. To train a model, we considered two cases either 1) only with training samples of a single test ethnicity or 2) all training samples from all of the ethnicities. We report two standard evaluation metrics, verification accuracy and identification accuracy. To calculate the verification accuracy, we follow the standard protocol suggested by [21], from which 10 splits are constructed and the overall average number is reported. Each split contains 900 positive and 900 negative pairs and the accuracy on each split is computed using the threshold found from the remaining 9 splits. As suggested by [39], in facial recognition systems, the drop in the identification accuracy is larger when dealing with face images from a novel ethnicity during test time. Therefore, we also report identification accuracy numbers suggested by [39]. More specifically, we consider a positive pair of reference and query to be correct, if there is no other image from a different identity that is closer in distance to the reference, than the query.
We show the results of this experiment in Table 1. Several conclusions can be drawn here. First, the results indicate that a network trained only on samples of a specific eth-  Table 2. Comparative results of our method against the state of the art on the four leave-one-ethnicity-out scenarios on the CEF test set [39]. Note that our method consistently outperforms the competitors.
nicity, tends to perform highly better on the same ethnicity, regardless of the amount of training samples. Second, the second best numbers in each column are very close to their corresponding upper bound shown in the last row ("All" here means when all training samples from all of the ethnicities are considered during training). Comparatively, the gaps between the seen domain and unseen test domains under the identification score are very larger, exceeding 20% between CA and AA when only Caucasian samples are used during training. This, clearly shows that such a bias may invalidate conclusions drawn from performance of facial recognition systems in unseen domains. A related study [42] shows the impact of noise in training data in face recognition. We note that, for pre-training, the method of MFR utilizes the MS-Celeb-1M dataset, but without removing target ethnicity samples from training data. As we have experimentally observed and discussed above, this, causes difficulties when addressing generalized face recognition problem. Therefore, in this section, we adapt MFR, when considering face recognition from unseen domains. Thus, we first aim to remove such a bias from our training data. To this end, we train an ethnicity classifier network on manually annotated face images with ground-truth ethnicity label. The number of images per ethnicity varies between 5K to 8K. We then, make use of the network to find correct ethnicity label of each individual in the dataset. This allow us to remove all known samples of an specific domain when addressing cross-ethnicity face recognition.  Table 3. Comparative results of our method against the state of the art on the four leave-one-ethnicity-out scenarios of the RFW dataset [44]. Note that our method consistently outperforms the competitors.
Training Data. To train our model, we used our MS-Celeb-1M dataset annotated with ethnicity labels. In the case of RFW experiments, we further trained the model using RFW train set, while following the leave-one-ethnicityout testing protocol. Where there is only one training sample per identity, we made use of random augmentation of the image, to generate a positive pair. The augmentation is a random combination of Gaussian blur and occlusion suggested by [37]. Since RFW has overlapping identities with MS-Celeb-1M, following MFR, we first removed samples of such identities and made MS-C-w/o-RFW, i.e., MS-Celebwithout-RFW.
Evaluation Metrics. At test time, the extracted feature vectors of each image and its flipped version are concatenated and considered as the final representation of the image. We used cosine distance to compute the distances. As for evaluating performances, we report the True Acceptance Rate (TAR) at different levels of False Acceptance Rate (FAR) such as 0.001, 0.01 and 0.1 using the Receiver Operating Characteristic (ROC) curve. Moreover, we report Rank-1 accuracy where a pair of probe and gallery image is considered correct if after matching the probe image to all gallery images, the top-1 result is within the same identity.
Results on the CEF Testing Set. In Table 2 Table 4. Comparative results of our method against the state of the art on cross-age face recognition using the CACD-VS dataset [4]. Our method works on par with MFR.
no annotated face image as Indian in the source domains here. Our method, equipped with the Cross-Domain Triplet loss, comfortably outperforms the recent method of MFR. This, we believe, clearly shows the benefits of our approach, which allows us to learn cross-domain similarities from labeled source face images, thus yielding a better representation for unseen domains.
Results on the RFW Dataset. In Table 3, using the RFW dataset, we compare our results with those of the state-of-theart methods described above in the leave-one-ethnicity-out protocol. As in the previous experiment, our method is the top performing one in all cases. Under FAR@0.1 measure, the gap between our algorithm and the closest competitor, MFR, exceeds 3% when African-American and Indian images are considered as the test domain. CosFace method is considered as the baseline and is the least performing method, indicating the importance of learning generalized features in face recognition.

Handling Other Variations
To demonstrate that our approach is generic and can handle other common variations during test time, we considered additional experiments. Following the standard protocol suggested by MFR [18], the full train data annotated with ethnicity is used as our source domains in all experiments.
Cross age face verification and identification. First, we considered an experiment using the Cross-Age Celebrity Dataset (CACD-VS) [4]. The dataset provides 4k cross-age image pairs with equal number of positive and negative pairs to form a testing subset for face verification task. The results of this experiment are shown in Table 4 Near infrared vs. visible light face recognition. Next, we considered an experiment using the CASIA NIR-VIS 2.0 face database [30]. Here, the gallery face images are captured under visible light while the probe ones are under near infrared light. Table 5 shows that our method consistently outperforms the competitors.
Cross pose face recognition. Finally, we considered an experiment using the Multi-PIE cross pose dataset [17,35]. Similar to the previous experiment, our method outperforms the competitors as shown in Table 6.

Ablation Analysis
In this section, we conduct further experiments to show the impact of important components of Algorithm 1 on verification accuracy. For this analysis, we made use of the Caucasian subset of the RFW dataset as the unseen domain and the rest of the data from all other domains as the source domains.
We first investigate how final recognition accuracy numbers vary, when different loss components are excluded from our algorithm. Different components here are identity classification, triplet and cross-domain triplet losses, denoted by l cls , l trp and l cdt , respectively. The results of this experiment are shown in Table 7. As the table indicates, every component of our overall loss, contributes importantly to Figure 3. Ablation study over the hyper-parameter λ. This indicates the effect of meta-test loss which has our Cross-Domain Triplet loss. We empirically observed that a value close to 0.7 gives the best results. the final performance, as excluding either of them leads to a consistent performance drop. Further comparing across the different loss terms, we observe that our proposed CDT loss plays a more important role here, since the performances significantly drop without this loss component. For instance, FAR@0.1 drops by more than 2% without l cdt .
Furthermore, one hyper-parameter in our approach is the contribution ratio of meta-train and meta-test losses, i.e., L s and L t . This is determined by hyper-parameter λ in Algorithm 1. In Fig 3, we show the effect of varying λ on the FAR@0.001 measure, when the Caucasian subset of the RFW dataset is considered the target domain. We observe that a value close to 0.7 gives the best results.

Conclusions
We have introduced a cross-domain metric learning loss, which is dubbed Cross-Domain Triplet (CDT) loss, that leverages the information jointly contained in two observed domains to provide better alignment of the domains. In essence, it first, takes into account similarity metrics of one data distribution, and then in a similar fashion to the triplet loss, uses the metrics to enforce compact feature clusters of identities that belong to another domain. Intuitively, CDT loss discriminatively correlates explicit metrics obtained from one domain with triplet samples from another domain in a unified loss function to be minimized within a network, which leads to better alignment of the training domains. We have also incorporated the loss in a meta-learning pipeline, to further enforce the network parameters to learn generalized features under domain shift. Extensive experiments on various face recognition benchmarks have shown the superiority of our method in handling variations, ethnicity being the most important one. In the future, we will investigate how a universal form of covariance matrix (such as the one used in [5]) could be utilized in our framework.