U NCERTAINTY M ODELING FOR O UT - OF -D ISTRIBUTION G ENERALIZATION
Anonymous authors
Paper under double-blind review
A BSTRACT
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.
Speciﬁcally, 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 classiﬁcation, semantic segmentation, and instance retrieval.
I NTRODUCTION
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 speciﬁc 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 overﬁt 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 D omain S hifts with
U ncertainty (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.
Speciﬁcally, we estimate the distribution “scope” based on the variances of the mini-batch statistics in an efﬁcient 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.
R ELATED W ORK 2. D OMAIN G ENERALIZATION
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.
Research on addressing this problem has been extensively conducted in the literature (Zhou et al.
(2021a)
; Wang et al.
Shen et al.
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 overﬁtting in training domains.
Most augmentation methods adopt various transformations at the image level, such as AugMix (Hendrycks et al.
and CutMix
(Yun et al.
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.
Piratla et al.
decouple the features into domain-speciﬁc 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.
; 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.
, force the model to learn a general representation by discarding dominant features activated on the training data.
2. U NCERTAINTY IN D EEP L EARNING
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-ﬁtting, 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-identiﬁcation, DistributionNet (Gal &
Ghahramani (2016)) adopts uncertainty to model the person images of noise-labels and outliers.
In face recognition, DUL (Chang et al.
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.
M ETHOD 3. P RELIMINARIES
Given x ∈ R B × C × H × W to be the encoded features in the intermediate layers of the network, we denote µ ∈ R B × C and σ ∈ R B × C as the channel-wise feature mean and standard deviation of each instance in a mini-batch, respectively, which can be formulated as:
[Equation]
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.
Speciﬁcally, 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.
3. M ODELING D OMAIN SHIFTS WITH UNCERTAINTY
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 D omain S hifts with U ncertainty (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.
Speciﬁcally, 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.
3.2. U NCERTAINTY E STIMATION
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:
[Equation]
where Σ µ ∈ R C and Σ σ ∈ R C 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.
3.2. P ROBABILISTIC DISTRIBUTION OF FEATURE STATISTICS
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:
[Equation]
Here we use the re-parameterization trick (Kingma & Welling (2013)) to make the sampling operation differentiable, and (cid:15) µ and (cid:15) σ 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.
3.2. I MPLEMENTATION
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 ﬁnal form of the proposed method can be formulated as:
[Equation]
The above operation can be integrated at various positions of the network as a ﬂexible 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.
Beneﬁting 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.
E XPERIMENTS
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 classiﬁcation, 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.
4. G ENERALIZATION ON MULTI - DOMAIN CLASSIFICATION
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 ofﬁcial 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 shufﬂe version of MixStyle is adopted for fair comparisons, which does not use domain labels.
In addition to PACS, we also employ Ofﬁce-Home (Venkateswara et al., 2017) for multidomain generalization experiments in the Appendix.
Experiment Results: The experiments results, shown in Table 1, demonstrate our signiﬁcant 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 overﬁt the Photo style dataset beneﬁting from pretraining.
[Table]
4. G ENERALIZATION ON S EMANTIC S EGMENTATION
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
[Table]
[Table] Experiment Results: Table 2 shows the experiment results compared to related methods.
As for a pixel-level classiﬁcation 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 signiﬁcant improvement on mIOU and mAc by 6.1% and 5.5%, respectively.
The visualization result is shown in Figure 3.
4. G ENERALIZATION ON I NSTANCE R ETRIEVAL
Setup and Implementation Details: In this section, person re-identiﬁcation (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.
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.
[Table]
Experiment Results: ReID is a ﬁne-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.
4. R OBUSTNESS T OWARDS C ORRUPTIONS
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.
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. [Table]
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.
A BLATION S TUDY
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.
[Table]
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 ﬁrst 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 speciﬁed.
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.
Speciﬁcally, Random denotes directly adding random shifts draw from a ﬁxed 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-deﬁned 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.
[Table]
F URTHER A NALYSIS 6. Q UANTITATIVE A NALYSIS ON THE PROPOSED METHOD
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 beneﬁting 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.
6. V ISUALIZATION ON THE SYNTHETIC CHANGES
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 predeﬁned autoencoder 1 (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.
C ONCLUSIONS
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.
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.
A A PPENDIX A. A LGORITHM
The algorithm of the proposed method is illustrated in Algorithm 1.
[Equation] [Equation]
[Equation] [Equation]
[Equation] [Equation]
[Equation] [Equation]
A
M ULTI
- DOMAIN GENERALIZATION ON O FFICE H OME .
In addition to multi-domain classiﬁcation experiments on PACS
[Table]
we further evaluate the effectiveness of the proposed method on Ofﬁce-Home (Venkateswara et al., 2017), which contains 15, images of 65 classes for home and ofﬁce 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
[Table]
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.
[Table]
A. C HOICE OF UNCERTAINTY DISTRIBUTION
[Table]
Besides the analysis of the uncertainty estimation in the ablation study
[Table]
we also conduct a more intensive study about the effects of pre-deﬁned uncertainty estimations.
Speciﬁcally
[Table]
Rand ( s ) denotes directly imposing random shifts draw from a ﬁxed Gaussian N (0 , s ) .
The intensive study is shown in Table 8.
It can be observed that the results of different ﬁxed 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 ﬁxed value of uncertainty estimation might vary from different tasks.
By contrast, the proposed method can be adaptive to different tasks without any manual adjustment.
[Table]
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
[Table]
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. C OMPARISONS 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.
Speciﬁcally, we denote the random shufﬂe copies of the batch feature as (cid:98) x = shufﬂe ( x ) .
pAdaIN (Nuriel et al.
(2021)) generate new samples by swapping feature statistics between the batch samples applied with a random permutation, where β ( x ) = µ ( (cid:98) x ) and γ ( x ) = σ ( (cid:98) x ) .
MixStyle (Zhou et al.
(2021b))
generates synthesized domain samples by mixing feature statistics information of two instances, where β ( x )
= λµ ( x ) + (1 − λ ) µ ( (cid:98) x ) and γ ( x ) =
λσ ( x ) + (1 − λ )
σ ( (cid:98) 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.
Speciﬁcally, 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 speciﬁc 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. W ITHIN - 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 sacriﬁce the in-domain performance to gain the beneﬁts 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.
[Table]
[Table]
A BLATION S TUDY 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 ofin our paper, following the original setting in PACS (Li et al., 2017) for fair comparison.
[Table]