Year: 2021

Abstract:
Though remarkable progress has been achieved in various vision tasks, deep neural networks still suffer obvious performance degradation when tested in out-ofdistribution scenarios. We argue that the feature statistics (mean and standard deviation), which carry the domain characteristics of the training data, can be properly manipulated to improve the generalization ability of deep learning models. Common methods often consider the feature statistics as deterministic values measured from the learned features and do not explicitly consider the uncertain statistics discrepancy caused by potential domain shifts during testing. In this paper, we improve the network generalization ability by modeling the uncertainty of domain shifts with synthesized feature statistics during training. Specifically, we hypothesize that the feature statistic, after considering the potential uncertainties, follows a multivariate Gaussian distribution. Hence, each feature statistic is no longer a deterministic value, but a probabilistic point with diverse distribution possibilities. With the uncertain feature statistics, the models can be trained to alleviate the domain perturbations and achieve better robustness against potential domain shifts. Our method can be readily integrated into networks without additional parameters. Extensive experiments demonstrate that our proposed method consistently improves the network generalization ability on multiple vision tasks, including image classification, semantic segmentation, and instance retrieval.

heading: 1 INTRODUCTION
text: Deep neural networks have shown impressive success in computer vision, but with a severe reliance on the assumption that the training and testing domains follow an independent and identical distribution (Ben-David et al., 2010; Vapnik, 1992). This assumption, however, does not hold in many real-world applications. For instance, when employing segmentation models trained on sunny days for rainy and foggy environments (Choi et al., 2021), or recognizing art paintings with models that trained on photographs (Li et al., 2017), inevitable performance drop can often be observed in such out-of-distribution deployment scenarios. Therefore, the problem of domain generalization, aiming to improve the robustness of the network on various unseen testing domains, becomes quite important.
Previous works (Huang & Belongie, 2017; Li et al., 2021) demonstrate that feature statistics (mean and standard deviation), as the moments of the learned features, carry informative domain characteristics of the training data. Domain characteristics primarily refer to the information that is more specific to the individual domains but less relevant to the task objectives, such as the photo style and capturing environment information in object recognition. Consequently, domains with different data distributions generally have inconsistent feature statistics (Wang et al., 2020b; 2019a; Gao et al., 2021a). Most deep learning methods follow Empirical Risk Minimization principle (Vapnik, 1999) to minimize their average error over the training data (Shen et al., 2021). Despite the satisfactory performance on the training domain, these methods do not explicitly consider the uncertain statistics discrepancy caused by potential domain shifts during testing. As a result, the trained models tend to overfit the training domain and show vulnerability to the statistic changes at testing time, substantially limiting the generalization ability of the learned representations.
Intuitively, the test domains may bring uncertain statistics shifts with different potential directions and intensities compared to the training domain (as shown in Figure 1), implying the uncertain
nature of domain shifts. Considering such “uncertainty” of potential domain shifts, synthesizing novel feature statistics variants to model diverse domain shifts can improve the robustness of the trained network to different testing distributions. Towards this end, we introduce a novel probabilistic method to improve the network generalization ability by properly modeling Domain Shifts with Uncertainty (DSU), i.e., characterizing the feature statistics as uncertain distributions.
In our method, instead of treating each feature statistic as a deterministic point measured from the feature, we hypothesize that the feature statistic, after considering potential uncertainties, follows a multi-variate Gaussian distribution. The distribution “center” is set as each feature’s original statistic value, and the distribution “scope” represents the variant intensity considering underlying domain shifts. Uncertainty estimation is adopted here to depict the distribution “scope” of probabilistic feature statistics. Specifically, we estimate the distribution “scope” based on the variances of the mini-batch statistics in an efficient non-parametric manner. Subsequently, feature statistics variants are randomly sampled from the estimated Gaussian distribution and then used to replace the original deterministic values for modeling diverse domain shifts, as illustrated in Figure 2. Due to the generated feature statistics with diverse distribution possibilities, the models can be trained to properly alleviate the domain perturbations and encode better domain-invariant features.
Our proposed method is simple yet fairly effective to alleviate performance drop caused by domain shifts, and can be readily integrated into existing networks without bringing additional model parameters or loss constraints. Comprehensive experiments on a wide range of vision tasks demonstrate the superiority of our proposed method, indicating that introducing uncertainty to feature statistics can well improve models’ generalization against domain shifts.

heading: 2 RELATED WORK

heading: 2.1 DOMAIN GENERALIZATION
text: Domain generalization (DG) has been attracting increasing attention in the past few years, which aims to achieve out-of-distribution generalization on unseen target domains using only single or multiple source domain data for training (Blanchard et al. (2011)). Research on addressing this problem has been extensively conducted in the literature (Zhou et al. (2021a); Wang et al. (2021); Shen et al. (2021)). Here some studies that are more related to our work are introduced below.
Data Augmentation: Data augmentation is an effective manner for improving generalization ability and relieving models from overfitting in training domains. Most augmentation methods adopt various transformations at the image level, such as AugMix (Hendrycks et al. (2020)) and CutMix
(Yun et al. (2019)). Besides using handcraft transformations, mixup (Zhang et al. (2018)) trains the model by using pair-wise linearly interpolated samples in both the image and label spaces. Manifold Mixup (Verma et al. (2019)) further adopts this linear interpolation from image level to feature level. Some recent works extend the above transformations to feature statistics for improving model generalization. MixStyle (Zhou et al. (2021b)) adopts linear interpolation on feature statistics of two instances to generate synthesized samples. The pAdaIn (Nuriel et al. (2021)) swaps statistics between the samples applied with a random permutation of the batch.
Invariant Representation Learning: The main idea of invariant representation learning is to enable models to learn features that are invariant to domain shifts. Domain alignment-based approaches (Li et al. (2018c;b)) learn invariant features by minimizing the distances between different distributions. Instead of enforcing the entire features to be invariant, disentangled feature learning approaches (Chattopadhyay et al. (2020); Piratla et al. (2020)) decouple the features into domain-specific and domain-invariant parts and learn their representations simultaneously. In addition, normalizationbased methods (Xingang Pan & Tang (2018); Choi et al. (2021)) can also be used to remove the style information to obtain invariant representations.
Learning Strategies: There are also some effective learning strategies that can be leveraged to improve generalization ability. Ensemble learning is an effective technique in boosting model performance. The ensemble predictions using a collection of diverse models (Zhou et al. (2020b)) or modules (Seo et al. (2020)) can be adopted to improve generalization and robustness. Meta-learningbased methods (Finn et al. (2017); Li et al. (2018a)) learn to simulate the domain shifts following an episode training paradigm. Besides, self-challenging methods, such as RSC (Huang et al. (2020)), force the model to learn a general representation by discarding dominant features activated on the training data.

heading: 2.2 UNCERTAINTY IN DEEP LEARNING
text: Uncertainty capturing the “noise” and “randomness” inherent in the data has received increasing attention in deep representation learning. Variational Auto-encoder (Kingma & Welling (2013)), as an important method for learning generative models, can be regarded as a method to model the data uncertainty in the hidden space. Dropout (Srivastava et al. (2014)), which is widely used in many deep learning models to avoid over-fitting, can be interpreted to represent model uncertainty as a Bayesian approximation (Gal & Ghahramani (2016)). In some works, uncertainty is used to address the issues of low-quality training data. In person re-identification, DistributionNet (Gal & Ghahramani (2016)) adopts uncertainty to model the person images of noise-labels and outliers. In face recognition, DUL (Chang et al. (2020)) and PFE ((Shi & Jain, 2019)) apply data uncertainty to simultaneously learn the feature embedding and its uncertainty, where the uncertainty is learned through a learnable subnetwork to describe the quality of the image. Different from the aforementioned works, our proposed method is used to model the feature statistics uncertainty under potential domain shifts and acts as a feature augmentation method for handling our-of-distribution generalization problem.

heading: 3 METHOD

heading: 3.1 PRELIMINARIES
text: Given x ∈ RB×C×H×W to be the encoded features in the intermediate layers of the network, we denote µ ∈ RB×C and σ ∈ RB×C as the channel-wise feature mean and standard deviation of each instance in a mini-batch, respectively, which can be formulated as:
µ(x) = 1
HW H∑ h=1 W∑ w=1 xb,c,h,w, (1)
σ2(x) = 1
HW H∑ h=1 W∑ w=1 (xb,c,h,w − µ(x))2. (2)
As the abstraction of features, feature statistics can capture informative characteristics of the corresponding domain (such as color, texture, and contrast), according to previous works (Huang &
Belongie, 2017; Li et al., 2021). In out-of-distribution scenarios, the feature statistics often show inconsistency with training domain due to different domain characteristics (Wang et al., 2019a; Gao et al., 2021a), which is ill-suited to deep learning modules like nonlinearity layers and normalization layer and degenerates the model’s generalization ability (Wang et al., 2020b). However, most of the deep learning methods only treat feature statistics as deterministic values measured from the features while lacking explicit consideration of the potential uncertain statistical discrepancy. Owing to the model’s inherent vulnerability to such discrepancy, the generalization ability of the learned representations is limited. Some recent methods (Nuriel et al., 2021; Zhou et al., 2021b) utilize feature statistics to tackle the domain generalization problem. Despite the success, they typically adopt linear manipulation (i.e., exchange and interpolation) on pairwise samples to generate new feature statistics, which limits the diversity of synthetic changes. Specifically, the direction of their variants is determined by the chosen reference sample and such internal operation restricts their variant intensity. Thus these methods are sub-optimal when handling the diverse and uncertain domain shifts in real world.

heading: 3.2 MODELING DOMAIN SHIFTS WITH UNCERTAINTY
text: Given the arbitrary testing domains with uncertain feature statistic shifts in both direction and intensity, properly modeling the domain shifts becomes an important task for tackling the challenge of domain generalization problem.
Considering the uncertainty and randomness of domain shifts, it is promising to employ the methods of “uncertainty” to treat the “uncertainty” of domain shifts. In this paper, we propose a novel method by modeling Domain Shifts with Uncertainty (DSU). Instead of treating each feature statistic as a deterministic value measured from the learned feature, we hypothesize that the distribution of each feature statistic, after considering potential uncertainties, follows a multi-variate Gaussian distribution. This means each feature statistic has a probabilistic representation drawn from a certain distribution, i.e., the feature statistics mean and standard deviation follow N (µ,Σµ) and N (σ,Σσ), respectively. Specifically, the corresponding Gaussian distribution’s center is set as each feature’s original statistics, while the Gaussian distribution’s standard deviation describes the uncertainty scope for different potential shifts. Through randomly sampling diverse synthesized feature statistics with the probabilistic approach, the models can be trained to improve the robustness of the network against statistics shifts.

heading: 3.2.1 UNCERTAINTY ESTIMATION
text: Taking the uncertainty of domain shifts into consideration, the uncertainty estimation in our method aims to depict the uncertainty scope of each probabilistic feature statistic. However, the testing domain is unknown, which makes it challenging to obtain an appropriate variant range.
Some generative-based studies (Shen & Zhou, 2021; Wang et al., 2019b) show that the variances between features contain implicit semantic meaning and the directions with larger variances can imply potentials of more valuable semantic changes. Inspired by this, we propose a simple yet effective non-parametric method for uncertainty estimation, utilizing the variance of the feature statistics to provide some instructions:
Σ2µ(x) = 1
B B∑ b=1 (µ(x)− Eb[µ(x)])2, (3)
Σ2σ(x) = 1
B B∑ b=1 (σ(x)− Eb[σ(x)])2. (4)
where Σµ ∈ RC and Σσ ∈ RC represent the uncertainty estimation of the feature mean µ and feature standard deviation σ, respectively. The magnitudes of uncertainty estimation can reveal the possibility that the corresponding channel may change potentially. Although the underlying distribution of the domain shifts is unpredictable, the uncertainty estimation captured from the minibatch can provide an appropriate and meaningful variation range for each feature channel, which does not harm model training but can simulate diverse potential shifts.

heading: 3.2.2 PROBABILISTIC DISTRIBUTION OF FEATURE STATISTICS
text: Once the uncertainty estimation of each feature channel is obtained, the Gaussian distribution for probabilistic feature statistics can be established. To use randomness to model the uncertainty, we adopt the random sampling to further exploit the uncertainty in the probabilistic representations. The new feature statistics, mean β(x) ∼ N (µ,Σµ) and standard deviation γ(x) ∼ N (σ,Σσ), can be randomly drawn from the corresponding distributions as:
β(x) = µ(x) + µΣµ(x), µ ∼ N (0,1), (5) γ(x) = σ(x) + σΣσ(x), σ ∼ N (0,1). (6)
Here we use the re-parameterization trick (Kingma & Welling (2013)) to make the sampling operation differentiable, and µ and σ both follow the standard Gaussian distribution. By exploiting the given Gaussian distribution, random sampling can generate various new feature statistics information with different combinations of directions and intensities.

heading: 3.2.3 IMPLEMENTATION
text: The implementation of our method is by the means of AdaIN (Huang & Belongie (2017)), and replaces the feature statistics with the randomly drawing ones to achieve the transformation. The final form of the proposed method can be formulated as:
DSU(x) = (σ(x) + σΣσ(x))︸ ︷︷ ︸ γ(x)
( x− µ(x) σ(x) ) + (µ(x) + µΣµ(x))︸ ︷︷ ︸
β(x)
. (7)
The above operation can be integrated at various positions of the network as a flexible module. Note that the module only works during model training and can be discarded while testing. To trade off the strength of this module, we set a hyperparameter p that denotes the probability to apply it. The algorithm is described in the Appendix. Benefiting from the proposed method, the model trained with uncertain feature statistics will gain better robustness against potential statistics shifts, and thus acquires a better generalization ability.

heading: 4 EXPERIMENTS
text: In order to verify the effectiveness of the proposed method in improving the generalization ability of networks, we conduct the experiments on a wide range of tasks, including image classification, semantic segmentation, instance retrieval, and robustness towards corruptions, where the training and testing sets have different cases of distribution shifts, such as style shift, synthetic-to-real gap, scenes change, and pixel-level corruption.

heading: 4.1 GENERALIZATION ON MULTI-DOMAIN CLASSIFICATION
text: Setup and Implementation Details: We evaluate the proposed method on PACS (Li et al. (2017)), a widely-used benchmark for domain generalization with four different styles: Art Painting, Cartoon, Photo, and Sketch. The implementation follows the official setup of MixStyle (Zhou et al. (2021b)) with a leave-one-domain-out protocol and ResNet18 (He et al., 2016) is used as the backbone. The random shuffle version of MixStyle is adopted for fair comparisons, which does not use domain labels. In addition to PACS, we also employ Office-Home (Venkateswara et al., 2017) for multidomain generalization experiments in the Appendix.
Experiment Results: The experiments results, shown in Table 1, demonstrate our significant improvement over the baseline method, which shows our superiority to the conventional deterministic approach. Especially in Art and Sketch, our method has nearly 10% improvement in average accuracy. Furthermore, our method also outperforms the competing methods, which indicates our method that models diverse uncertain shifts on feature statistics is effective to improve network generalization ability against different domain shifts. Photo has similiar domain characteristics as ImageNet dataset and the slight drop might be due to the ImageNet pretraining (also discussed in (Xu et al., 2021)). Our DSU augments the features and enlarges the diversity of the training domains. In contrast, the baseline method preserves more pre-trained knowledge from ImageNet thus tends to overfit the Photo style dataset benefiting from pretraining.

heading: 4.2 GENERALIZATION ON SEMANTIC SEGMENTATION
text: Setup and Implementation Details: Semantic segmentation, as a fundamental application for automatic driving, encounters severe performance declines due to scenarios differences (Wang et al., 2020a). GTA5 (Richter et al., 2016) is a synthetic dataset generated from Grand Theft Auto 5 game engine, while Cityscapes (Cordts et al., 2016) is a real-world dataset collected from different cities in primarily Germany. To evaluate the cross-scenario generalization ability of segmentation models, we adopt synthetic GTA5 for training while using real CityScapes for testing. The experiments are conducted on FADA released codes (Wang et al. (2020a)), using DeepLab-v2 (Chen et al., 2018) segmentation network with ResNet101 backbone. Mean Intersection over Union (mIOU) and mean Accuracy (mAcc) of all object categories are used for evaluation.
Experiment Results: Table 2 shows the experiment results compared to related methods. As for a pixel-level classification task, improper changes of feature statistics might constrain the performances. The variants generated from our method are centered on the original feature statistics with different perturbations. These changes of feature statistics are mild for preserving the detailed information in these dense tasks. Meanwhile, our method can take full use of the diverse driving scenes
and generates diverse variants, thus show a significant improvement on mIOU and mAc by 6.1% and 5.5%, respectively. The visualization result is shown in Figure 3.

heading: 4.3 GENERALIZATION ON INSTANCE RETRIEVAL
text: Setup and Implementation Details: In this section, person re-identification (ReID), which aims at matching the same person across disjoint camera views, is used to verify the effectiveness of our method on the instance retrieval task. Experiments are conducted on the widely used DukeMTMC (Ristani et al. (2016)) and Market1501 (Zheng et al. (2015)) datasets. The implementation is based on MMT (Ge et al., 2020) released codes and ResNet50 is adopted as the backbone. Meanwhile, mean Average Precision (mAP) and Rank-1 (R1) precision are used as the evaluation criterions.
Experiment Results: ReID is a fine-grained instance retrieval task, where the subtle information of persons is important for retrieving an instance. MixStyle and pAdain rely on a reference sample to generate new feature statistics, which might introduce confounded information from the reference sample. Compared to them, our method does better in maintaining the original information and also has more variant possibilities. The experiment results are demonstrated in Table 3. Our method achieves huge improvement compared to the baseline method and also outperform MixStyle and pAdaIN by a big margin.

heading: 4.4 ROBUSTNESS TOWARDS CORRUPTIONS
text: Setup and Implementation Details: We validate the proposed method for robustness towards corruptions on ImageNet-C (Hendrycks & Dietterich (2019)), which contains 15 different pixel-level corruptions. ResNet50 is trained with 100 epochs for convergence on large-scale ImageNet-1K (Deng et al. (2009)) and the hyperparameter p is set as 0.1 for training in ImageNet. We also add our method on APR (Chen et al. (2021)), a recently state-of-the-art method on ImageNet-C, to verify that our method can be compatible with other image-level augmentation methods. Error is adopted as the evalution metric for clean ImageNet. Mean Corruption Error (mCE) is adopted as evaluation metric for ImageNet-C, which is computed as the average of the 15 different corruption errors and normalized by the corruption error of AlexNet (Krizhevsky et al. (2012)).
Experiment Results: Although the corruptions are imposed on the pixel level, they still introduce a shift in the statistics (Benz et al., 2021). So our method shows consistent improvement on ImageNet-
C. Meanwhile, the instances in the testing set may not always fall into the distribution of the training set, and they still have slight statistic shifts (Gao et al. (2021b)). Thus it can be seen that the withindataset ImageNet accuracy is also increased. When combining APR with our method, mCE can be decreased from 65.0 % to 64.1%, showing that our method can be compatible with state-of-the-art methods on ImageNet-C for further improvement.

heading: 5 ABLATION STUDY
text: In this section, we perform an extensive ablation study of the proposed method on PACS and segmentation task (GTA5 to Cityscapes) with models trained on ResNet. The effects of different inserted positions and hyper-parameter of the proposed method are analyzed below. Meantime, we also analyze the effects on different choices of uncertainty distribution.
Effects of Different Inserted Positions: DSU can be a plugand-play module to be readily inserted at any position. Here we name the positions of ResNet after first Conv, Max Pooling
layer, 1,2,3,4-th ConvBlock as 0,1,2,3,4,5 respectively. As shown in Table 5, no matter where the modules are inserted, the performances are consistently higher than the baseline method. The results show that inserting the modules at positions 0-5 would have better performances, which also indicates modeling the uncertainty in all training stages will have better effects. Based on the analysis, we plug the module into positions 0-5 in all experiments.
Effects of Hyper-parameter: The hyper-parameter of the probability p is to trade off the strength of feature statistics augmentation. As shown in Figure 4, the results are not sensitive to the probability setting and the accuracy reaches the best results when setting p as 0.5, which is also adopted as the default setting in all experiments if not specified.
Choices of Uncertainty Distribution: In our method, the Gaussian distribution with uncertainty estimation is
adopted as the default setting, we also conduct other distributions for comparisons in Table 6. Specifically, Random denotes directly adding random shifts draw from a fixed Gaussian N (0, 1), and Uniform denotes that the shifts are drawn from U(−Σ,Σ), where Σ is the scope obtained from our uncertainty estimation. As we can see, directly using Gaussian distribution with the improper variant scope will harm the model performances, indicating the variant range of feature statistics should have some instructions. Further analysis about different vanilla Gaussian distributions with pre-defined standard deviation are conducted in the Appendix. Meanwhile, the result of Uniform shows some improvement but is still lower than DSU, which indicates the boundless Gaussian distribution is more helpful to model more diverse variants.

heading: 6 FURTHER ANALYSIS

heading: 6.1 QUANTITATIVE ANALYSIS ON THE PROPOSED METHOD
text: In this subsection, we will analyze the effects of the proposed method on both intermediate features and feature representations. Quantitative experiments are conducted on PACS, where we choose Art Painting as the unseen testing domain and the rests are used as training domains.
To study the phenomena of feature statistic shifts, we capture the intermediate features after the second block in ResNet18 and measure the average feature statistics values of one category in the training and testing domain, respectively. The distributions of feature statistics are shown in Figure 5. As the previous works (Wang et al., 2020b; 2019a) show, the feature statistics extracted from the baseline model show an obvious shift due to different data distribution. It can be seen that the model trained with our method has less shift. Our method can help the model gain robustness towards domain shifts, as it properly models the potential feature statistic shifts.
To analyze the effects on feature representations, we visualize the feature representation vectors of different categories in unseen domain with t-SNE (Van der Maaten & Hinton, 2008) in Figure 6. The features of the same category become more compact benefiting from the proposed method. Because our method can alleviate the domain perturbations during training and make the model focus on content information, obtaining more invariant features representations.

heading: 6.2 VISUALIZATION ON THE SYNTHETIC CHANGES
text: Besides the quantitative experiment results, we also obtain a more intuitional view of the diverse changes provided by our method, through visualizing the reconstruction results using a predefined autoencoder1 (Huang & Belongie (2017)), where the proposed module is inserted into the encoder, and inverse the feature representations into synthetic images after the decoder. As the results shown in Figure 7, the reconstructed images obtained from our probabilistic approach show diverse synthetic changes, such as the environment, object texture, and contrast, etc.

heading: 7 CONCLUSIONS
text: In this paper, we propose a probabilistic approach to improve the network generalization ability by modeling the uncertainty of domain shifts with synthesized feature statistics during training. Each feature statistic in our method is hypothesized to follow a multi-variate Gaussian distribution for modeling the diverse potential shifts. Due to the generated feature statistics with diverse distribution possibilities, the models can gain better robustness towards diverse domain shifts. Experiments conducted on different vision tasks demonstrate the effectiveness of our method in improving the network generalization ability.
1The pretrained weights are from https://github.com/naoto0804/pytorch-AdaIN.
Reproducibility Statement: The training details and hyper-parameter settings are described in Setup and Implementation Details of experiment subsections and Ablation Study. The algorithm of the proposed method is shown in Appendix. Meanwhile, the codes will be released at the beginning of the discussion stage via a link to an anonymous repository in the comment.

heading: A APPENDIX
text: A.1 ALGORITHM
The algorithm of the proposed method is illustrated in Algorithm 1.
Algorithm 1: The algorithm of the proposed method (DSU) Input: Intermediate feature x ∈ RB×C×H×W , probability p to forward this module; Output: Intermediate feature x̂ ∈ RB×C×H×W after considering potential statistics shifts;
1 Sample p0 ∼ U(0, 1); 2 if p0 < p and Training then 3 Compute the channel-wise mean and standard deviation of each instance in a mini-batch;
4 µ(x) = 1 HW H∑ h=1 W∑ w=1 xb,c,h,w,
5 σ2(x) = 1 HW H∑ h=1 W∑ w=1 (xb,c,h,w − µ(x))2. 6 Uncertainty estimation on feature statistics;
7 Σ2µ(x) = 1 B B∑ b=1 (µbc(x)− Eb(µbc(x)))2,
8 Σ2σ(x) = 1 B B∑ b=1 (σbc(x)− Eb(σbc(x)))2.
9 Compute the synthetic feature statistics randomly sampling from the given Guassian distributions; 10 β(x) = µ(x) + µΣµ(x), µ ∼ N (0,1), 11 γ(x) = σ(x) + σΣσ(x), σ ∼ N (0,1). 12 Obtain the feature after considering potential statistics shifts; 13 x̂ = γ(x)× x−µ(x)
σ(x) + β(x).
14 return the feature x̂ with uncertain feature statistics. 15 else 16 adopt the original feature x and skip this module. 17 end
A.2 MULTI-DOMAIN GENERALIZATION ON OFFICE HOME.
In addition to multi-domain classification experiments on PACS, we further evaluate the effectiveness of the proposed method on Office-Home (Venkateswara et al., 2017), which contains 15,500 images of 65 classes for home and office recognition. The experiment results with ResNet18 backbone are shown in Table 7. It can be observed that our method brings obvious improvement over the baseline method and also outperforms the competing methods. By introducing the feature statistics uncertainty, the models trained with our method can learn to alleviate the domain perturbations, such as the style information, and obtain more domain-invariant features. For example, huge improvement can be observed from the results on Clipart, which is a domain with much different style from others.
A.3 CHOICE OF UNCERTAINTY DISTRIBUTION
Besides the analysis of the uncertainty estimation in the ablation study, we also conduct a more intensive study about the effects of pre-defined uncertainty estimations. Specifically, Rand(s) denotes directly imposing random shifts draw from a fixed Gaussian N (0, s). The intensive study is shown in Table 8. It can be observed that the results of different fixed distributions are all much lower than the proposed method. Some conclusions could be obtained from the results. (a): Imposing excessive uncertainty might harm the model training and degrade the performance. (b): The best fixed value of uncertainty estimation might vary from different tasks. By contrast, the proposed method can be adaptive to different tasks without any manual adjustment.
We also conduct the experiment to test the effectiveness of treating different channels with different potentials. Channel-share denotes all channels of the sample share the same uncertainty distribution, i.e., using the average uncertainty estimation among channels. As shown in Table 9, the results indicate that sharing the same uncertain distribution among different channels is less effective, which ignores the different potentials of channels and will limit their performances. Meanwhile, the proposed method explicitly considers the different potentials of different channels and brings better performances.
A.4 COMPARISONS TO THE RELATED METHODS
Some related methods (Zhou et al., 2021b; Nuriel et al., 2021) also tackle the domain generalization problem by producing synthetic feature statistics. Specifically, we denote the random shuffle copies of the batch feature as x̂ = shuffle(x). pAdaIN (Nuriel et al. (2021)) generate new samples by swapping feature statistics between the batch samples applied with a random permutation, where β(x) = µ(x̂) and γ(x) = σ(x̂). MixStyle (Zhou et al. (2021b)) generates synthesized domain samples by mixing feature statistics information of two instances, where β(x) = λµ(x) + (1 − λ)µ(x̂) and γ(x) = λσ(x) + (1− λ)σ(x̂) and λ ∈ (0, 1) is a random interpolation weight. Despite the success, they typically adopt linear manipulation on pairwise samples to generate new feature statistics, which limits the diversity of synthetic changes. Specifically, the direction of the variants is determined by the chosen reference sample and the internal operation also restricts the variant intensity. Our method, not relies on a specific reference sample, is based on the Gaussian distribution that can produce not only linear changes but diverse variants with more possibilities. Due to the boundless range of the Gaussian distribution, our method has the ability to generate feature statistics beyond the scope of training domain, which also breaks the limitation of inner interpolation between training samples. The visualization of the comparisons is shown in Figure 8.
A.5 WITHIN-DATASET PERFORMANCE
In Table 4, we tested the within-dataset performance on the large-scale dataset ImageNet, denoted as ”Clean”. We observed that the top-1 error rate declines from 23.8% to 23.4% after training with the proposed DSU, indicating that DSU does not sacrifice the in-domain performance to gain the benefits on out-of-distribution domains.The reason might be that instances in the testing set may not always fall into exactly the same distribution of the training set, and they still have slight statistic shifts (Gao et al., 2021a). The proposed DSU can help the trained model improve the robustness to statistics shifts and thus gain better performance in within-dataset ImageNet.
Besides the experiments on ImageNet, we also supplement the within-dataset performances on PACS. According to the multi-source training protocol on PACS (Li et al., 2017), the within-domain performance is averaged over multiple training-domain datasets (P,A,C,S denotes Art, Cartoon, Photo and Sketch respectively). As shown in Table 10, it can be observed that the within-dataset performance of our DSU also slightly beats the baseline, verifying the conclusion as on ImageNet.
A.6 ABLATION STUDY ON BATCH SIZE
In Table 11, we conduct an ablation study on the batch size. As shown in the table, consistent performance gains are observed with various batch sizes on PACS. Note we use the batch size of 64 in our paper, following the original setting in PACS (Li et al., 2017) for fair comparison.

Review summaries:
In this paper, the authors proposed to model uncertainty with multivariate Gaussian distribution for better network generalization. Experiments on multiple benchmark datasets show improved result. Several visualizations and analysis also illustrate the effectiveness of the proposed approach.

This paper studies the problem of out-of-distribution generalization by modeling uncertainty in feature statistics. It improves the network generalization ability by modeling the uncertainty of domain shifts with synthesized feature statistics during training. Instead of being deterministic values, the feature statistics are hypothesized to follow a multivariate Gaussian distribution. The proposed method is tested on various tasks including image classification, semantic segmentation, and instance retrieval, and shows strong performance compared to state-of-the-art methods.

This paper proposed a feature augmentation method for domain generalization by generating probabilistic feature statistics, where the distribution of feature statistics enlarges the feature domain with possible domain shifts. The proposed method is evaluated on various vision tasks, including image classification, semantic segmentation, and instance retrieval. It achieves competitive results compared with recent domain generalization methods.