Login| Sign Up| Help| Contact|

Patent Searching and Data


Title:
DOMAIN GENERALIZATION VIA BATCH NORMALIZATION STATISTICS
Document Type and Number:
WIPO Patent Application WO/2021/178747
Kind Code:
A1
Abstract:
Generally, the present disclosure is directed to systems and methods that leverage batch normalization statistics as a way to generalize across domains. In particular, example implementations of the present disclosure can generate different representations for different domains by collecting independent batch normalization statistics, which can then be used to map between domains in a shared latent space. At test or inference time, samples from an unknown test or target domain can be projected into the same shared latent space. The domain of the target sample can therefore be expressed as a linear combination of the known ones, with the combination between weighted based on respective distances between batch normalization statistics in the latent space. This same mapping strategy can be applied at both training and test time to learn both a latent representation and a powerful but lightweight ensemble model that operates within such latent space.

Inventors:
SEGÚ MATTIA (CH)
TONIONI ALESSIO (CH)
TOMBARI FEDERICO (CH)
Application Number:
PCT/US2021/021002
Publication Date:
September 10, 2021
Filing Date:
March 05, 2021
Export Citation:
Click for automatic bibliography generation   Help
Assignee:
GOOGLE LLC (US)
International Classes:
G06N3/04; G06N3/08
Other References:
SEONGUK SEO ET AL: "Learning to Optimize Domain Specific Normalization with Domain Augmentation for Domain Generalization", ARXIV.ORG, CORNELL UNIVERSITY LIBRARY, 201 OLIN LIBRARY CORNELL UNIVERSITY ITHACA, NY 14853, 9 July 2019 (2019-07-09), XP081494637
ZHANG MING ET AL: "A Deep Transfer Model With Wasserstein Distance Guided Multi-Adversarial Networks for Bearing Fault Diagnosis Under Different Working Conditions", IEEE ACCESS, vol. 7, 31 May 2019 (2019-05-31), pages 65303 - 65318, XP011727590, DOI: 10.1109/ACCESS.2019.2916935
CARLUCCI FABIO MARIA ET AL: "AutoDIAL: Automatic Domain Alignment Layers", 2017 IEEE INTERNATIONAL CONFERENCE ON COMPUTER VISION (ICCV), 27 November 2017 (2017-11-27), pages 5077 - 5085, XP055789917, Retrieved from the Internet DOI: 10.1109/ICCV.2017.542
MATTIA SEG\`U ET AL: "Batch Normalization Embeddings for Deep Domain Generalization", ARXIV.ORG, CORNELL UNIVERSITY LIBRARY, 201 OLIN LIBRARY CORNELL UNIVERSITY ITHACA, NY 14853, 25 November 2020 (2020-11-25), XP081822235
Attorney, Agent or Firm:
PROBST, Joseph, J. (US)
Download PDF:
Claims:
WHAT IS CLAIMED IS:

1. A computer-implemented method to perform domain generalization via batch normalization statistics, the method comprising: obtaining, by a computing system comprising one or more computing devices, a machine-learned ensemble model that comprises a shared parameter portion and a plurality of different batch normalization layers respectively associated with a plurality of different source domains, wherein a plurality of different sets of batch normalization statistics are respectively associated with the plurality of different source domains; accessing, a target sample associated with a target domain; determining, by the computing system, a target set of batch normalization statistics for the target sample; determining, by the computing system, a plurality of similarity scores respectively between the target set of batch normalization statistics and the plurality of different sets of batch normalization statistics respectively associated with the plurality of different source domains; respectively processing, by the computing system, the target sample with the machine-learned ensemble model to respectively generate a plurality of domain-specific predictions respectively associated with the plurality of different source domains; interpolating, by the computing system, the plurality of domain-specific predictions based at least in part on the respective similarity scores between the target set of batch normalization statistics and the plurality of different sets of batch normalization statistics to obtain a target prediction for the target sample in the target domain; and outputting, by the computing system, the target prediction for the target sample.

2. The computer-implemented method of any preceding claim, wherein the machine-learned ensemble model comprises one or more multi-source domain alignment layers, and wherein each multi-source domain alignment layer comprises a shared weight portion and two or more of the different batch normalization layers in parallel that are respectively associated with the plurality of source domains.

3. The computer-implemented method of any preceding claim, wherein the target sample was unavailable during training of the machine-learned ensemble model.

4. The computer-implemented method of any preceding claim, wherein the plurality of different sets of batch normalization statistics and the target set of batch normalization statistics each comprise respective values for a mean statistic and a variance statistic.

5. The computer-implemented method of any preceding claim, wherein interpolating, by the computing system, the plurality of domain-specific predictions based at least in part on the respective similarity scores between the target set of batch normalization statistics and the plurality of different sets of batch normalization statistics to obtain the target prediction for the target sample in the target domain comprises: determining, by the computing system, a plurality of membership values respectively for the plurality of source domains, wherein the membership value for each source domain is inversely proportional to a respective distance between the target set of batch normalization statistics and the set of batch normalization statistics associated with such source domain; and determining, by the computing system, a weighted average of the plurality of domain- specific predictions weighted according to the plurality of membership values.

6. The computer-implemented method of any preceding claim, wherein the plurality of similarity scores respectively between the target set of batch normalization statistics and the plurality of different sets of batch normalization statistics respectively associated with the plurality of different source domains comprise a plurality of Wasserstein distances between respective multivariate gaussian distributions.

7. The computer-implemented method of any preceding claim, wherein the plurality of source domains comprise a plurality of image domains.

8. The computer-implemented method of any preceding claim, wherein the machine-learned ensemble model comprises a convolutional neural network.

9. The computer-implemented method of any preceding claim, wherein the machine-learned ensemble model comprises the shared parameter portion that is configured to perform feature extraction for all of the plurality of source domains and a plurality of different prediction heads that are respectively configured to separately perform prediction for the plurality of source domains.

10. The computer-implemented method of any preceding claim, wherein: respectively processing, by the computing system, the target sample with the machine-learned ensemble model to respectively generate the plurality of domain-specific predictions respectively associated with the plurality of different source domains comprises generating a plurality of softmax layer outputs respectively associated with the plurality of different source domains; and interpolating, by the computing system, the plurality of domain-specific predictions comprises: interpolating, by the computing system, the plurality of softmax layer outputs to generate an aggregate softmax output; and generating, by the computing system, the target prediction for the target sample based on the aggregate softmax output.

11. A computer readable storage medium comprising computer executable code that when executed by one or more computer processors will cause the one or more processors to carry out a method according to any one of the preceding claims.

12. A computer system comprising: one or more processors; and a computer readable storage medium according to claim 11.

13. A computing system for training an ensemble model to perform domain generalization, the computing system comprising: one or more processors; and one or more non-transitory computer-readable media that collectively store: an ensemble model that comprises one or more multi-source domain alignment layers, wherein each multi-source domain alignment layer comprises a shared weight portion and a plurality of different batch normalization layers respectively associated with a plurality of source domains; and instructions that, when executed by the one or more processors, cause the computing system to perform operations, the operations comprising, for each of one or more training iterations: obtaining a training batch that comprises a plurality of domain-specific sets of training examples respectively associated with the plurality of source domains; updating a plurality of different sets of batch normalization statistics for the plurality of different batch normalization layers respectively associated with the plurality of source domains; for each training example in the plurality of domain-specific sets of training examples: determining a training set of batch normalization statistics for the training example; determining a plurality of similarity scores respectively between the training set of batch normalization statistics and the plurality of different sets of batch normalization statistics respectively associated with the plurality of different source domains; and interpolating a plurality of domain-specific predictions based at least in part on the respective similarity scores between the training set of batch normalization statistics and the plurality of different sets of batch normalization statistics to obtain a training prediction for the training example; determining an aggregate loss based on the respective training prediction generated for each training example in the plurality of domain-specific sets of training examples; and updating one or more parameter values for at least the shared weight portion of at least one of the one or more multi-source domain alignment layers.

14. The computing system of claim 13, wherein the operations further comprise, prior to the one or more training iterations: performing a warm-up epoch in which the ensemble model is trained on an entire training dataset with gradients from domain-specific batches being propagated through a corresponding one of the different batch normalization layers that is associated with the corresponding source domain.

15. The computing system of claim 13 or 14, wherein the plurality of different sets of batch normalization statistics and the training set of batch normalization statistics each comprise respective values for a mean statistic and a variance statistic.

16. The computing system of any one of claims 13 to 15, wherein interpolating the plurality of domain-specific predictions based at least in part on the respective similarity scores between the training set of batch normalization statistics and the plurality of different sets of batch normalization statistics to obtain the training prediction for the training example comprises: determining a plurality of membership values respectively for the plurality of source domains, wherein the membership value for each source domain is inversely proportional to a respective distance between the training set of batch normalization statistics and the set of batch normalization statistics associated with such source domain; and determining a weighted average of the plurality of domain-specific predictions weighted according to the plurality of membership values.

17. The computing system of any one of claims 13 to 16, wherein the plurality of similarity scores respectively between the training set of batch normalization statistics and the plurality of different sets of batch normalization statistics respectively associated with the plurality of different source domains comprise a plurality of Wasserstein distances between respective multivariate gaussian distributions.

18. The computing system of any one of claims 13 to 17, wherein the operations further comprise, after the one or more training iterations: deploying the ensemble model for performing domain generalization to generate a target prediction for a target sample associated with an unseen target domain.

19. A computing system comprising: one or more processors; and one or more non-transitory computer-readable media that store: an ensemble model that comprises one or more multi-source domain alignment layers, wherein each multi-source domain alignment layer comprises a shared weight portion and a plurality of different batch normalization layers respectively associated with a plurality of source domains; and instructions that, when executed by the one or more processors, cause the computing system to employ the ensemble model to generate a target prediction for a target sample associated with a target domain that is different from the plurality of source domains.

Description:
DOMAIN GENERALIZATION VIA BATCH NORMALIZATION STATISTICS

RELATED APPLICATIONS

[0001] This application claims priority to and the benefit of U.S. Provisional Patent Application No. 62/985,434, filed March 5, 2020. U.S. Provisional Patent Application No. 62/985,434 is hereby incorporated by reference herein in its entirety.

FIELD

[0002] The present disclosure relates generally to domain generalization in machine- learned models. More particularly, the present disclosure relates to domain generalization by exploring the latent space of batch normalization (“batchnorm”) statistics.

BACKGROUND

[0003] Machine learning models trained on a distribution of data often fail to generalize to samples from different distributions. This phenomenon is commonly referred to in literature as domain shift between training and testing data and is one of the biggest limitations of data driven algorithms. Assuming the availability of few annotated samples from the test domain, the problem can be mitigated by fine-tuning the model with explicit supervision or with domain adaptation techniques. Unfortunately, this assumption does not always hold in practice as it is often unfeasible to collect samples for any possible environment for real applications (e.g., all possible test domains). For example, solutions for autonomous driving will require samples from any possible road in any possible season and weather condition.

[0004] In contrast to domain adaptation, domain generalization refers to algorithms to solve the domain shift problem by training or configuring models so that they are robust to unseen domains. Thus, in domain generalization techniques, explicit samples of the test or target domains are not required (or may not be available) at training time.

[0005] Most domain generalization works leverage many training sets to leam a domain- invariant feature extractor. Others focus on explicitly optimizing the model parameters to have consistent performance across domains with ad-hoc training policies, while a different line of work requires modifications to the model architecture to achieve domain invariance. However, none of these solutions makes the best use of the domain-specific training data since they explicitly attempt to discard any domain-specific information. SUMMARY

[0006] Aspects and advantages of embodiments of the present disclosure will be set forth in part in the following description, or can be learned from the description, or can be learned through practice of the embodiments.

[0007] One example aspect of the present disclosure is directed to a computer- implemented method to perform domain generalization via batch normalization statistics. The method includes obtaining, by a computing system comprising one or more computing devices, a machine-learned ensemble model that comprises a shared parameter portion and a plurality of different batch normalization layers respectively associated with a plurality of different source domains, wherein a plurality of different sets of batch normalization statistics are respectively associated with the plurality of different source domains. The method includes accessing, a target sample associated with a target domain. The method includes determining, by the computing system, a target set of batch normalization statistics for the target sample. The method includes determining, by the computing system, a plurality of similarity scores respectively between the target set of batch normalization statistics and the plurality of different sets of batch normalization statistics respectively associated with the plurality of different source domains. The similarity scores can be measures of distance or other statistical measures of similarity. The method includes respectively processing, by the computing system, the target sample with the machine-learned ensemble model to respectively generate a plurality of domain-specific predictions respectively associated with the plurality of different source domains. The method includes interpolating, by the computing system, the plurality of domain-specific predictions based at least in part on the respective similarity scores between the target set of batch normalization statistics and the plurality of different sets of batch normalization statistics to obtain a target prediction for the target sample in the target domain. The method includes outputting, by the computing system, the target prediction for the target sample.

[0008] Another example aspect of the present disclosure is directed to a computing system for training an ensemble model to perform domain generalization. The computing system includes one or more processors and one or more non-transitory computer-readable media that collectively store: an ensemble model that comprises one or more multi-source domain alignment layers, wherein each multi-source domain alignment layer comprises a shared weight portion and a plurality of different batch normalization layers respectively associated with a plurality of source domains; and instructions that, when executed by the one or more processors, cause the computing system to perform operations for each of one or more training iterations. The operations include obtaining a training batch that comprises a plurality of domain-specific sets of training examples respectively associated with the plurality of source domains. The operations include updating a plurality of different sets of batch normalization statistics for the plurality of different batch normalization layers respectively associated with the plurality of source domains. The operations include, for each training example in the plurality of domain-specific sets of training examples: determining a training set of batch normalization statistics for the training example; determining a plurality of similarity scores respectively between the training set of batch normalization statistics and the plurality of different sets of batch normalization statistics respectively associated with the plurality of different source domains; and interpolating a plurality of domain-specific predictions based at least in part on the respective similarity scores between the training set of batch normalization statistics and the plurality of different sets of batch normalization statistics to obtain a training prediction for the training example. The operations include determining an aggregate loss based on the respective training prediction generated for each training example in the plurality of domain-specific sets of training examples. The operations include updating one or more parameter values for at least the shared weight portion of at least one of the one or more multi-source domain alignment layers.

[0009] Another example aspect of the present disclosure is directed to one or more non- transitory computer-readable media that store instructions that when executed by one or more processors cause a computing system to perform operations. The operations include obtaining a machine-learned ensemble model that comprises a shared parameter portion and a plurality of parallel batch normalization layers that are respectively associated with a plurality of different source domains. The operations include accessing a target sample associated with a target domain. The operations include respectively processing the target sample with the machine-learned ensemble model to respectively generate a plurality of domain-specific predictions respectively associated with the plurality of different source domains. The operations include determining a plurality of distances respectively between a target set of batch normalization statistics generated for the target sample and a plurality of different sets of batch normalization statistics respectively associated with the plurality of different batch normalization layers respectively associated with the plurality of different source domains. The operations include interpolating the plurality of domain-specific predictions based at least in part on the respective distances between the target set of batch normalization statistics and the plurality of different sets of batch normalization statistics to obtain a target prediction for the target sample in the target domain. The operations include outputting the target prediction for the target sample.

[0010] Other aspects of the present disclosure are directed to various systems, apparatuses, non-transitory computer-readable media, user interfaces, and electronic devices. [0011] These and other features, aspects, and advantages of various embodiments of the present disclosure will become better understood with reference to the following description and appended claims. The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate example embodiments of the present disclosure and, together with the description, serve to explain the related principles.

BRIEF DESCRIPTION OF THE DRAWINGS [0012] Detailed discussion of embodiments directed to one of ordinary skill in the art is set forth in the specification, which makes reference to the appended figures, in which:

[0013] Figures 1A-C depict graphical diagrams of a process of creating domain-specific representations, projecting a sample from an unknown domain, and localizing the sample with respect to the known domains according to example embodiments of the present disclosure.

[0014] Figures 2A and 2B depict example multi-source domain alignment layers according to example embodiments of the present disclosure.

[0015] Figures 3 A and 3B depict application of the proposed approach to an example dataset for experimentation according to example embodiments of the present disclosure. [0016] Figure 4 provides pseudocode for an example training algorithm according to example embodiments of the present disclosure.

[0017] Figure 5 A depicts a block diagram of an example computing system according to example embodiments of the present disclosure.

[0018] Figure 5B depicts a block diagram of an example computing device according to example embodiments of the present disclosure.

[0019] Figure 5C depicts a block diagram of an example computing device according to example embodiments of the present disclosure.

[0020] Reference numerals that are repeated across plural figures are intended to identify the same features in various implementations. DETAILED DESCRIPTION Overview

[0021] Generally, the present disclosure is directed to systems and methods that leverage batch normalization statistics as a way to generalize across domains. In particular, example implementations of the present disclosure can generate different representations for different domains by collecting independent batch normalization statistics, which can then be used to map between domains in a shared latent space. At test or inference time, samples from an unknown test or target domain can be projected into the same shared latent space. The domain of the target sample can therefore be expressed as a linear combination of the known ones, with the combination weighted based on respective similarity scores between batch normalization statistics in the latent space. This same mapping strategy can be applied at both training and test time to leam both a latent representation and a powerful but lightweight ensemble model that operates within such latent space. Example experiments on example implementations of the proposed systems and methods are contained in the Appendix and demonstrate a significant increase (up to +12%) in classification accuracy over current state- of-the-art techniques on the following popular domain generalization benchmarks: PACS, Office31 and Office-Caltech.

[0022] Thus, in one example, a machine-learned ensemble model can include a shared parameter portion and a plurality of different batch normalization layers respectively associated with a plurality of different source domains. During training, a plurality of different sets of batch normalization statistics can be generated for the plurality of different source domains. During inference, a computing system can determine a target set of batch normalization statistics for a target sample associated with a target domain. Thereafter, the computing system can determine a plurality of similarity scores respectively between the target set of batch normalization statistics and the plurality of different sets of batch normalization statistics respectively associated with the plurality of different source domains. The computing system can process the target sample with the machine-learned ensemble model to respectively generate a plurality of domain-specific predictions respectively associated with the plurality of different source domains. The computing system can interpolate the plurality of domain-specific predictions based at least in part on the respective similarity scores between the target set of batch normalization statistics and the plurality of different sets of batch normalization statistics to obtain a target prediction for the target sample in the target domain. [0023] More particularly, example aspects of the present disclosure explicitly foster domain-specific representations by collecting independent batch normalization statistics for each of the available domains at training time. In some implementations, this results in training a lightweight ensemble of domain specific models with most or all of the parameters shared except for normalization statistics. Upon the reaching of convergence, the accumulated statistics can be used to map each domain as a point in a latent space.

[0024] To provide an example, Figure 1 A shows a visualization of such a space for a simplified case of a single batch normalization layer operating on the output of a convolutional layer with two filters (e.g., just two means and variances are accumulated, and each domain can be represented as a 2D gaussian; other embodiments accumulate larger numbers of statistics e.g., across multiple sequential layers). In this space the membership of a sample to a domain can be effectively measured by simply looking at the distance between the instance normalization statistics of the sample and each of the domain-specific statistics (e.g., with specific distance to their centroids which correspond to the accumulated population statistics). Thus, normalization statistics can be used to effectively learn a latent space of domains.

[0025] In particular, the same latent space representation can be used on samples from unknown domains, relying on their instance statistics to project them into the same latent space. Figure IB illustrates a visualization of this projection for a sample from an unknown domain via its instance statistics. After the projection, a distance of the sample from the domain centroids can be determined, effectively trying to localize the unknown domain with respect to the known ones. This process is sketched in Figure 1C, where the arrows denote the measured distance between known domain centroids and the unknown domain.

[0026] After the projection, the prediction of the proposed lightweight ensemble for the test sample can be generated as the combination of the domain-specific predictions. For example, the domain-specific predictions can be weighted according to the reciprocal of the distances in the latent space from the known domains. The same combination of domain- specific models can be used at training time on samples from the known domains. By doing so, the proposed training approaches force the models to leam a meaningful latent space and logits that can be safely linearly combined according to the proposed weighting strategy. [0027] Thus, example aspects of the present disclosure recognize that batch normalization statistics (e.g., accumulated on convolutional layers) can be used to map input samples (e.g., inputs images) to a latent space where membership to a domain can be measured according to the distance of the sample from domain centroids. One effective use of this concept is to learn a lightweight ensemble model that shares some or all parameters except for the normalization statistics. Such an ensemble model can generalize better to unseen domains via interpolation of the various domain-specific predictions based on distance between instance norm statistics for the target sample to the domain centroids.

[0028] The present disclosure provides a number of technical effects and benefits. As one example, compared to previous work, the proposed systems and methods do not discard domain specific attributes but use them to learn a domain latent space and map unknown domains with respect to known ones. This results in a drastic improvement over state-of-the- art with different network architectures on standard domain generalization benchmarks. Thus, the ability of a computing system to generalize to unseen domains can be improved.

[0029] The proposed techniques can be applied to many different machine learning model architectures which feature batch normalization statistics, including, as examples, any modem Convolutional Neural Network (CNN) that relies on batch normalization layers. The proposed approach also scales gracefully to the number of domains available at training time. [0030] As another example technical effect and benefit, the domain generalization techniques described herein can eliminate the need to train or re-train a new model for each possible domain or to collect training samples from all possible domains. In particular, the proposed systems and methods can generate a single ensemble model that is robust to new or unseen domains. Therefore, it is not necessary to generate additional models or collect additional training data for such additional domains. In such fashion, computing resources which would be spent on model training or training data collection can be conserved, thereby reducing the consumption of computing resources such as processor usage, memory usage, and/or network bandwidth.

Example Domain Generalization Techniques [0031] One example aspect of the proposed techniques is to use batch normalization statistics to map known and unknown domains in a shared latent space where domain membership of samples can be measured according to distance between gaussian distributions. The following sections introduce some common notations, describe an example multi-source domain alignment layers that can be used to map domains in a latent space, and describe examples of how to project samples from unknown domains in the same latent space to obtain robust performances. Finally, the same prediction by mapping strategy can be incorporated at training time to improve the model performance. [0032] Example Notation

[0033] Let X and Y denote the input (e.g., images) and the output (e.g., object categories) space of a model. Let denote the set of the K source domains available at training time. Each domain d t can be described by an unknown probability distribution over the space X x Y. The aim of a machine learning model is to learn the probability distribution p xy of the whole training set. Let t be a generic target domain available only at testing time and following the unknown probability distribution p xy over the same space.

[0034] Commonly, deep learning models learn a mapping X ® Y. Example implementations of the present disclosure include a lightweight ensemble of models that learns a mapping (X,D) ® Y that leverages the domain label to learn an ensemble of posterior distributions conditioned on the domain membership. Since it is not possible to leam the target distribution during training, one goal of the proposed methods is to approximate it as a mixture (e.g., linear combination) of the learned source distributions

[0035] A training set containing n d labelled samples is given for each source domain d E D. The test set is composed of m t unlabelled samples collected from the unknown marginal distribution of the target domain t. As opposed to the domain adaptation setting, the domain generalization approach used herein assumes that samples from the target domain are not available at training time. Moreover, at inference time it is assumed that each unseen sample is treated independently, that is, information from previously seen target samples is not accumulated to influence new predictions.

[0036] Example Multi-Source Domain Alignment Laver

[0037] Neural networks are particularly prone at capturing dataset bias in their internal representations. Internal features distributions are indeed highly domain-dependent. To capture and alleviate the distribution shift that is inherent in the multi-source setting, example implementations of the present disclosure adapt batch normalization layers to normalize the domain-dependent activations to a same reference distribution via domain-specific normalization statistics.

[0038] The activations of a certain domain d can thus be normalized by matching their first and second order moments, nominally . to those of a reference gaussian with zero mean and unitary variance:

[0039] where x d is an input activation extracted from the marginal distribution q d of the activations from the domain d are the population statistics for the domain d, and e > 0 is a small constant to avoid numerical issues.

[0040] At training time, the multi-source batch normalization layer can collect and apply domain-specific batch statistics , while accordingly updating the domain population statistics as moving average of the statistics for every batch b.

[0041] At inference time, each test sample can be analyzed individually and the domain label d may not be available. This boils down to the case where the batch size is equal to 1. It is possible to compare the instance statistics of a single sample x with the statistics of a batch b from the domain d. Since the population statistics are nothing but a less noisy estimate of the statistics of the same gaussian distribution, the validity of this statement extends to the comparison with them.

[0042] For example, an analysis of the computation of the batch statistics in the case of a 2D feature map of size H x W and batch size B is as follows:

[0043] are respectively the batch mean and variance and x is th e value of a single element of the feature map. If one considers the normally distributed aleatoric variable , it is evident that the instance statistics (case B = 1) are an estimate of the parameters of the same gaussian, but computed over a lower number of samples H W instead of B - H - W

[0044] Since internal features distributions are highly domain-dependent, the population statistics accumulated for each domain provide a compact representation of the corresponding domain. The next section explains how this layer can be exploited to map source domains and unseen samples in the same latent space.

[0045] Figures 2A and 2B illustrate example multi-source domain alignment layers. In particular, as shown at Figure 2A, the layer can include a shared weight portion to generate a feature map and multiple batch normalization layers in parallel which respectively correspond to different source domains. At training time, the batch normalization layers can collect and update domain-specific batch and population statistics. At inference time, as illustrated in Figure 2B, to compute the final prediction the same layer can collect the instance statistics of a target sample, which can then be used to estimate its domain membership. In some implementations, while separate batch normalization statistics are kept for each domain, the same batch normalization layer parameters gamma and beta can be jointly learned and shared by all batch normalization layers for all domains.

[0046] Example Domain Localization in the Batchnorm Latent Space [0047] Leveraging the Domain Alignment Layer proposed in the previous section to collect specific statistics allows the network to leam the multiple source distributions distinctly.

[0048] The result of this expedient is that a lightweight ensemble of models is learned, where every model shares some or all of the weights but differs for the normalization parameters. In one example all of the weights are shared but differs for the normalization parameters at one or more layers. In another example, all of the weights of a shared feature extraction portion are shared but differs for the normalization parameters at one or more layers and differs in that each source domain has a domain-specific prediction head.

[0049] Since such lightweight ensemble embodies the multiple source distributions the present disclosure proposes to reduce the domain shift on the target domain by optimally interpolating across these distributions to approximate the target distribution The resulting target distribution is a weighted mixture of the distributions in the ensemble. The choice of the weights depends in some implementations on the distance of a test sample from each source domain within the latent space.

[0050] Thus, example implementations map individual domains in a latent space based on their population statistics are the vectors of the accumulated population means and variances for the domain d for all layers l E B = {1,2, ..., L}. B is the set of batch normalization layers in the selected model architectures. The set of batch normalization layers included in the set B can include all or less than all of the batch normalization layers included in the model(s). The set B can include any number of layers (e.g., 1, 2, 20, etc.).

[0051] Specifically, a latent space L l is spanned by the activation statistics at the layer l of the model. In this space, single samples x are mapped via their instance statics at layer l, whereas the population statistics accumulated for each domain at the same layer l are used to represent domain centroids in such space. Intuitively, since activations in a neural network are highly domain-dependent, a cluster of points in this latent space coincides with a specific domain of which the accumulated population statistics provide a compact representation. [0052] Thus, in some implementations, the latent embedding for a certain domain d can be defined as:

[0053] which is the vector of the accumulated population statics for the domain d for all layers

[0054] Analogously, for an unseen target sample x t its projection can be derived by forward propagating it through the network and normalizing it by the instance statistics of its activations. The latent embedding for the target sample x t can thus be defined as the stacked vector of its instance statistics at different batch normalization layers in the network:

[0055] Each of the tuples of the latent embedding represents the instance statistics collected at a certain layer l during forward propagation and can be used to map the sample x t in the latent space L 1 of layer l.

[0056] Once the embedding for the test sample is available, we can exploit such information to map the sample in the batch normalization latent spaces where it is possible to determine the membership of a target sample x t to a domain d as, for example, the reciprocal of a distance measure between the target embedding and the domain embedding. This allows a soft domain classification of any test sample to each of the source domains.

[0057] To compute the distance measure between two points in the latent domain space L 1 of a layer l, consider the moving means and moving variances of the corresponding batch normalization layer as the parameters of a multivariate gaussian distribution. A distance on the space of probability measures can be adopted, i.e., a symmetric and positive definite function that satisfies the triangle inequality. One example distance function is the Wasserstein distance for the special case of two multivariate gaussian distributions.

[0058] be two normal distributions on R n . with expected value m respectively and covariance matrices. The 2- Wasserstein distance is then:

[0059] where 11 · 11 2 is the Euclidean norm on R n .

[0060] Example implementations leverage the Wasserstein metrics to measure the distance between a test sample x t and the embedding z d of the domain d by summing over the batch normalization layers / e B the distance between the activation embeddings and

[0061] where B is the set of the batch normalization layers in the selected network architecture.

[0062] The membership of a test sample x t to the domain d can in some implementations be defined as the reciprocal of the distance from that domain:

[0063] By looking at Equation 2 and 3, it can be seen that the only difference between the instance and the batch statistics is the number of samples over which they are estimated, and it is hence fair to compare them by computing the Wasserstein distance between the two multivariate gaussian distributions represented by them.

[0064] Once the memberships to all source domains are computed, they can be used to finally recover the target distribution as a mixture (e.g., a linear combination) of the learned source distributions p d y weighted by the corresponding domain membership:

[0065] where w d t is the membership value of the test sample x t to the domain d.

[0066] The final prediction f(x t ) can analogously be computed as, for example, a linear combination of the multiple predictions obtained under different domain assumptions:

[0067] where is the prediction obtained for the sample x t using the model learned from the domain d. In some implementations, the computation of the final prediction can occur at the softmax layer of the ensemble model. In other implementations, the computation of the final prediction can occur at the output layer of the ensemble model. In other implementations, the computation of the final prediction can individually occur at each layer of the ensemble model and the final prediction can be passed at each layer to the next sequential layer.

[0068] As one example for illustration, Figures 3A and 3B illustrates the application of this procedure to the PACS dataset as an example. This dataset is composed of 4 domains, 3 of which are assumed available at training time in the illustrated example. Consequently, every training batch is composed of 3 domain batches, one for each of the source domains. Figure 3A depicts the multi-source domain alignment layer introduced above. During training, different statistics are updated and applied for each of the source domains. At inference time, the target sample is propagated with instance normalization to derive its latent embedding. As shown in Figure 3B, the so-collected population and instance statistics are used to map the domains and the target sample to the same latent space. Finally, the domain membership of a sample can be estimated computing the Wasserstein distance between the domain and target centroids.

[0069] This elegant formulation allows optimal navigation in the latent space of the batchnorm statistics. Specifically, if a test sample belongs to one of the source domains, the proposed methods assigns a high membership value to the corresponding domain. On the other hand, if the test sample does not belong to any of the source domains, the corresponding target model will be expressed as a combination (e.g., linear combination) of the source models cleverly embodied in the lightweight ensemble.

[0070] Example Training Policy

[0071] To better define the latent space of every batch normalization layer, example implementations replicate the same procedure described in the previous sections to also compute predictions at training time for samples from known domains. In one illustrative example, a training batch is composed of K domain batches with an equal number of samples. During every training step, (i) the domain batches are first propagated to update the corresponding domain population statistics Then, (ii) all the samples are forward propagated without assuming hard domain membership to collect their instance statistics, analogously to how explained for a target sample at inference time. Finally, (iii) each sample is propagated under K multiple domain assumptions and the resulting domain-specific predictions are weighted according to Eq. 12. Applying this procedure during training encourages the creation of a well-defined batch normalization latent space.

[0072] In some implementations, since the model is initialized with certain weights (e.g., pre-trained on ImageNet), each domain-specific batch normalization branch needs to be specialized before starting this training procedure, otherwise convergence problems might occur. Therefore, in some implementations, domain-specific batch normalization statistics can be pre-computed with a warm-up epoch where the model is trained on the whole dataset following the standard training procedure, except that domain batches are propagated through the corresponding batch normalization branch (e.g., to accumulate domain-specific batch normalization statistics).

Example Devices and Systems

[0073] Figure 5A depicts a block diagram of an example computing system 100 according to example embodiments of the present disclosure. The system 100 includes a user computing device 102, a server computing system 130, and a training computing system 150 that are communicatively coupled over a network 180.

[0074] The user computing device 102 can be any type of computing device, such as, for example, a personal computing device (e.g., laptop or desktop), a mobile computing device (e.g., smartphone or tablet), a gaming console or controller, a wearable computing device, an embedded computing device, or any other type of computing device.

[0075] The user computing device 102 includes one or more processors 112 and a memory 114. The one or more processors 112 can be any suitable processing device (e.g., a processor core, a microprocessor, an ASIC, a FPGA, a controller, a microcontroller, etc.) and can be one processor or a plurality of processors that are operatively connected. The memory 114 can include one or more non-transitory computer-readable storage mediums, such as RAM, ROM, EEPROM, EPROM, flash memory devices, magnetic disks, etc., and combinations thereof. The memory 114 can store data 116 and instructions 118 which are executed by the processor 112 to cause the user computing device 102 to perform operations. [0076] In some implementations, the user computing device 102 can store or include one or more machine-learned models 120. For example, the machine-learned models 120 can be or can otherwise include various machine-learned models such as neural networks (e.g., deep neural networks) or other types of machine-learned models, including non-linear models and/or linear models. Neural networks can include feed-forward neural networks, recurrent neural networks (e.g., long short-term memory recurrent neural networks), convolutional neural networks or other forms of neural networks.

[0077] In some implementations, the one or more machine-learned models 120 can be received from the server computing system 130 over network 180, stored in the user computing device memory 114, and then used or otherwise implemented by the one or more processors 112. In some implementations, the user computing device 102 can implement multiple parallel instances of a single machine-learned model 120.

[0078] Additionally or alternatively, one or more machine-learned models 140 can be included in or otherwise stored and implemented by the server computing system 130 that communicates with the user computing device 102 according to a client-server relationship. For example, the machine-learned models 140 can be implemented by the server computing system 140 as a portion of a web service (e.g., a domain generalization service). Thus, one or more models 120 can be stored and implemented at the user computing device 102 and/or one or more models 140 can be stored and implemented at the server computing system 130. [0079] The user computing device 102 can also include one or more user input component 122 that receives user input. For example, the user input component 122 can be a touch-sensitive component (e.g., a touch-sensitive display screen or a touch pad) that is sensitive to the touch of a user input object (e.g., a finger or a stylus). The touch-sensitive component can serve to implement a virtual keyboard. Other example user input components include a microphone, a traditional keyboard, or other means by which a user can provide user input.

[0080] The server computing system 130 includes one or more processors 132 and a memory 134. The one or more processors 132 can be any suitable processing device (e.g., a processor core, a microprocessor, an ASIC, a FPGA, a controller, a microcontroller, etc.) and can be one processor or a plurality of processors that are operatively connected. The memory 134 can include one or more non-transitory computer-readable storage mediums, such as RAM, ROM, EEPROM, EPROM, flash memory devices, magnetic disks, etc., and combinations thereof. The memory 134 can store data 136 and instructions 138 which are executed by the processor 132 to cause the server computing system 130 to perform operations.

[0081] In some implementations, the server computing system 130 includes or is otherwise implemented by one or more server computing devices. In instances in which the server computing system 130 includes plural server computing devices, such server computing devices can operate according to sequential computing architectures, parallel computing architectures, or some combination thereof.

[0082] As described above, the server computing system 130 can store or otherwise include one or more machine-learned models 140. For example, the models 140 can be or can otherwise include various machine-learned models. Example machine-learned models include neural networks or other multi-layer non-linear models. Example neural networks include feed forward neural networks, deep neural networks, recurrent neural networks, and convolutional neural networks.

[0083] The user computing device 102 and/or the server computing system 130 can train the models 120 and/or 140 via interaction with the training computing system 150 that is communicatively coupled over the network 180. The training computing system 150 can be separate from the server computing system 130 or can be a portion of the server computing system 130.

[0084] The training computing system 150 includes one or more processors 152 and a memory 154. The one or more processors 152 can be any suitable processing device (e.g., a processor core, a microprocessor, an ASIC, a FPGA, a controller, a microcontroller, etc.) and can be one processor or a plurality of processors that are operatively connected. The memory 154 can include one or more non-transitory computer-readable storage mediums, such as RAM, ROM, EEPROM, EPROM, flash memory devices, magnetic disks, etc., and combinations thereof. The memory 154 can store data 156 and instructions 158 which are executed by the processor 152 to cause the training computing system 150 to perform operations. In some implementations, the training computing system 150 includes or is otherwise implemented by one or more server computing devices.

[0085] The training computing system 150 can include a model trainer 160 that trains the machine-learned models 120 and/or 140 stored at the user computing device 102 and/or the server computing system 130 using various training or learning techniques, such as, for example, backwards propagation of errors. For example, a loss function can be backpropagated through the model(s) to update one or more parameters of the model(s) (e.g., based on a gradient of the loss function). Various loss functions can be used such as mean squared error, likelihood loss, cross entropy loss, hinge loss, and/or various other loss functions. Gradient descent techniques can be used to iteratively update the parameters over a number of training iterations.

[0086] In some implementations, performing backwards propagation of errors can include performing truncated backpropagation through time. The model trainer 160 can perform a number of generalization techniques (e.g., weight decays, dropouts, etc.) to improve the generalization capability of the models being trained.

[0087] In particular, the model trainer 160 can train the machine-learned models 120 and/or 140 based on a set of training data 162. The training data 162 can include, for example, data that is assigned to different source domains. Source domains can include different types of data, different sources of data, different structures of data, data associated with different entities, data associated with different conditions, etc.

[0088] In some implementations, if the user has provided consent, the training examples can be provided by the user computing device 102. Thus, in such implementations, the model 120 provided to the user computing device 102 can be trained by the training computing system 150 on user-specific data received from the user computing device 102. In some instances, this process can be referred to as personalizing the model.

[0089] The model trainer 160 includes computer logic utilized to provide desired functionality. The model trainer 160 can be implemented in hardware, firmware, and/or software controlling a general purpose processor. For example, in some implementations, the model trainer 160 includes program files stored on a storage device, loaded into a memory and executed by one or more processors. In other implementations, the model trainer 160 includes one or more sets of computer-executable instructions that are stored in a tangible computer-readable storage medium such as RAM hard disk or optical or magnetic media. [0090] The network 180 can be any type of communications network, such as a local area network (e.g., intranet), wide area network (e.g., Internet), or some combination thereof and can include any number of wired or wireless links. In general, communication over the network 180 can be carried via any type of wired and/or wireless connection, using a wide variety of communication protocols (e.g., TCP/IP, HTTP, SMTP, FTP), encodings or formats (e.g., HTML, XML), and/or protection schemes (e.g., VPN, secure HTTP, SSL).

[0091] Figure 5A illustrates one example computing system that can be used to implement the present disclosure. Other computing systems can be used as well. For example, in some implementations, the user computing device 102 can include the model trainer 160 and the training dataset 162. In such implementations, the models 120 can be both trained and used locally at the user computing device 102. In some of such implementations, the user computing device 102 can implement the model trainer 160 to personalize the models 120 based on user-specific data. [0092] Figure 5B depicts a block diagram of an example computing device 10 according to example embodiments of the present disclosure. The computing device 10 can be a user computing device or a server computing device.

[0093] The computing device 10 includes a number of applications (e.g., applications 1 through N). Each application contains its own machine learning library and machine-learned model(s). For example, each application can include a machine-learned model. Example applications include a text messaging application, an email application, a dictation application, a virtual keyboard application, a browser application, etc.

[0094] As illustrated in Figure 5B, each application can communicate with a number of other components of the computing device, such as, for example, one or more sensors, a context manager, a device state component, and/or additional components. In some implementations, each application can communicate with each device component using an API (e.g., a public API). In some implementations, the API used by each application is specific to that application.

[0095] Figure 5C depicts a block diagram of an example computing device 50 according to example embodiments of the present disclosure. The computing device 50 can be a user computing device or a server computing device.

[0096] The computing device 50 includes a number of applications (e.g., applications 1 through N). Each application is in communication with a central intelligence layer. Example applications include a text messaging application, an email application, a dictation application, a virtual keyboard application, a browser application, etc. In some implementations, each application can communicate with the central intelligence layer (and model(s) stored therein) using an API (e.g., a common API across all applications).

[0097] The central intelligence layer includes a number of machine-learned models. For example, as illustrated in Figure 5C, a respective machine-learned model (e.g., a model) can be provided for each application and managed by the central intelligence layer. In other implementations, two or more applications can share a single machine-learned model. For example, in some implementations, the central intelligence layer can provide a single model (e.g., a single model) for all of the applications. In some implementations, the central intelligence layer is included within or otherwise implemented by an operating system of the computing device 50.

[0098] The central intelligence layer can communicate with a central device data layer. The central device data layer can be a centralized repository of data for the computing device 50. As illustrated in Figure 5C, the central device data layer can communicate with a number of other components of the computing device, such as, for example, one or more sensors, a context manager, a device state component, and/or additional components. In some implementations, the central device data layer can communicate with each device component using an API (e.g., a private API).

Additional Disclosure

[0099] The technology discussed herein makes reference to servers, databases, software applications, and other computer-based systems, as well as actions taken and information sent to and from such systems. The inherent flexibility of computer-based systems allows for a great variety of possible configurations, combinations, and divisions of tasks and functionality between and among components. For instance, processes discussed herein can be implemented using a single device or component or multiple devices or components working in combination. Databases and applications can be implemented on a single system or distributed across multiple systems. Distributed components can operate sequentially or in parallel.

[0100] While the present subject matter has been described in detail with respect to various specific example embodiments thereof, each example is provided by way of explanation, not limitation of the disclosure. Those skilled in the art, upon attaining an understanding of the foregoing, can readily produce alterations to, variations of, and equivalents to such embodiments. Accordingly, the subject disclosure does not preclude inclusion of such modifications, variations and/or additions to the present subject matter as would be readily apparent to one of ordinary skill in the art. For instance, features illustrated or described as part of one embodiment can be used with another embodiment to yield a still further embodiment. Thus, it is intended that the present disclosure cover such alterations, variations, and equivalents.