Improving Self-supervised Learning with Automated Unsupervised Outlier Arbitration
Year: 2021

Abstract:
Our work reveals a structured shortcoming of the existing mainstream selfsupervised learning methods. Whereas self-supervised learning frameworks usually take the prevailing perfect instance level invariance hypothesis for granted, we carefully investigate the pitfalls behind. Particularly, we argue that the existing augmentation pipeline for generating multiple positive views naturally introduces out-of-distribution (OOD) samples that undermine the learning of the downstream tasks. Generating diverse positive augmentations on the input does not always pay off in benefiting downstream tasks. To overcome this inherent deficiency, we introduce a lightweight latent variable model UOTA, targeting the view sampling issue for self-supervised learning. UOTA adaptively searches for the most important sampling region to produce views, and provides viable choice for outlier-robust self-supervised learning approaches. Our method directly generalizes to many mainstream self-supervised learning approaches, regardless of the loss’s nature contrastive or not. We empirically show UOTA’s advantage over the state-of-the-art self-supervised paradigms with evident margin, which well justifies the existence of the OOD sample issue embedded in the existing approaches. Especially, we theoretically prove that the merits of the proposal boil down to guaranteed estimator variance and bias reduction. Code is available: https://github.com/ssl-codelab/uota.

heading: 1 Introduction
text: Self-supervised learning is an increasingly appealing direction in learning effective deep representations. In the regime of computer vision, natural language processing and machine learning tasks, multiple milestones under such self-supervised learning frameworks have been established [4, 5, 14, 12, 18, 32, 31, 33, 39, 43, 47, 48, 49]. The premise here is that self-supervised learning methods usually generate multiple views and assume one view be predictive of another.
So far, the most prevailing assumption is to force views from the same instance invariant in the feature space [7, 18, 33, 47]. While it is certainly natural to consider generating diverse augmentations to spread the feature distribution and force consistency in between views, we reveal a structured shortcoming of such popular augmentation pipeline: excessive distortions applied on original image would produce samples that deviate drastically in the semantics. We find these produced views have semantically deviated from the original instance and thus behave like out of distribution (OOD) samples. The model therefore fail to generalize in some certain parameter region due to the interference of the OOD samples.
We support our claim by empirically verifying the non-negligible detrimental impact of the OOD noise on downstream task performances. Particularly, we conduct extensive experiments and show that importance sampling technique and the associated analysis can help effectively differentiate the noises. The proposed new model suppresses the effect of noisy samples and efficiently improve the downstream task performance over a broad spectrum of state-of-the-art self-supervised learning
35th Conference on Neural Information Processing Systems (NeurIPS 2021).
approaches. This indicates the evident failure of baseline model in some parameter space owing to the OOD noise. Our contribution in this paper are summarized as follows: 1. We present the first formal analysis of OOD issue under the currently prevailing self-supervised learning framework. 2. We propose a lightweight latent variable model UOTA that is able to differentiate noise from original instance’s semantics. The new model does not introduce extra computational complexity whereas it can efficiently suppress the influence of OOD samples. In contrast to existing SSL paradigms, the proposal method is able to automatically balance the bias-variance trade-off in the mean squared error (MSE) of the deep estimator: We do desire large data variance through strong augmentations, on the other hand, we should be careful not to introduce extra estimator bias through extremely large data distortions. We argue that in the context of self-supervised learning, the hidden OOD samples and such bias-variance trade-off have a clear and non-negligible impact that should be attended to.

heading: 2 Related Work
text: Self-supervised learning. Without access to any data annotations, self-supervised learning (SSL) approaches impose additional constraints or hypothesis among distinct views of the original input data [2, 7, 13, 14, 32, 33, 39, 41, 44, 52]. Recently, mainstream approaches require that different views out of the same instance should be predicative of each others. Such line of research can be roughly classified into several sub-directions. The first family is inspired from the seminal NCE approach [16] and capitalizes on contrastive loss [5, 7, 17, 18, 24, 33, 38, 42]. These approaches usually rely on the construction of both the positive and negative views of a single instance. In these work, positive samples usually are augmented views of the same reference instance; Negative samples are defined as any views from a distinct instance other than that reference instance. Contrastive loss is then expected to learn useful semantics when forced to distinguish between positive and negative views on each instance. The second line of research further simplify the contrastive assumption, which only imposes invariant constraints between paired positive samples [9, 15, 46, 47] in the absence of the negative samples.
Bias correction for contrastive learning. Existing literature prioritize the sampling bias issue for negative samples, while positive samples are usually considered clean. In [10], debiased contrastive learning corrects the sampling bias in the negative samples in order to reduce the effect of false negatives. In [24, 37], harder negatives are created for training in order to improve the learning. The work in [30] is the only work we are aware of, that touches the noise issue in positive pairs. But [30] is motivated exclusively for observed caption-frames misalignments issues in narrated videos, and the loss is tailored for applications that are based on contrastive loss only. In contrast, we reveal that OOD noise actually exists in a broader coverage of self-supervised learning frameworks and is influencing the downstream tasks with a non-negligible strength.
OOD detection and noisy label problem. Outlier detection is an important problem in machine learning. A popular and intuitive framework for detecting OOD inputs is to train a generative model on training data and use that to detect OOD inputs at test time. For instance, in [34], a likelihood ratio method is proposed to correct for the background statistics between inliers and outliers. In the meanwhile, for supervised learning tasks, robust training in the presence of noisy labels is also a practical and challenging issue. In [50], a generalized cross entropy loss is used to mitigate the label noise issue. In [23], Mentor-net capitalizes on tailored network architecture to down-weight the samples likely to be associated with noisy labels. All of these work were targeting conventional supervised learning approaches, whereas the noise under the SSL framework is rarely explored.
Comparison to existing works. We unveil that the intrinsic positive sample noises exist broadly behind various mainstream SSL frameworks. To both justify and to mitigate the issue, we propose a latent variable framework that is capable improving the SSL optimization via automatic Unsupervised OuTlier Arbitration (UOTA). We are also aware of a contemporary work in [51] that attempts to change the sampling distribution via assigning sample weights to each positive sample. But motivation in [51] is completely opposite to ours, as they oversample the region whenever a positive sample turns out to be remote to its query, while they still assume a perfect invariance on positive keys as critical supporting prerequisite. In [26], a Mahalanobis distance-based confidence score is defined to modify sampling distribution for supervised learning tasks. Note our work differentiates from [26] in many aspects: we analyze the OOD issue particularly for unsupervised SSL frameworks, whereas [26] strongly hinges on data labels to compute confidence. We model the associated sampling ratio as a latent variable model which is exclusively suitable for the SSL problem, and is supported by rigorous analysis. Our model also naturally jettisons the need of any threshold as used in [26].

heading: 3 Method
text: In this section, we reveal that OOD noise is inherently existing in positive view sampling pipelines for a broad range of mainstream SSL approaches. Most importantly, we showcase that these OOD samples are highly structured, and disrupt the downstream tasks with a non-negligible strength. We borrow basic analytic tool from importance sampling to investigate the source of OOD problem specifically for SSL frameworks. We identify an important bias-variance trade-off behind the sampling distribution options for positive views (augmentations), and we analyze the impact of such bias-variance trade-off on the estimator MSE (mean squared error) via rigorous justification. Our model UOTA is motivated to adaptively balance the sampling distribution trade-off via a novel latent variable model, and the proposed method is agnostic to the form of SSL loss. We show that the model is able to effectively suppress the OOD sampling noise for positive samples.

heading: 3.1 Problem Formulation of SSL
text: Mainstream SSL approaches, especially contrastive learning methods, often rely on a series transformation functions xi,k = g(xi,nk) to produce multiple “views” xi,k of input instance xi. The {nk : k = 1, . . . ,K} is the support of an “augmentation nuisances variable” n, representing a group of transformations such as flipping, scaling, cropping, or other augmentations acting on xi via function g. Subscript k indexes all possible augmentations, i indicates the i-th instance (each instance corresponds to a specific image input). Without labeling information, SSL relies on the invariance assumption so that deep feature extractor zi,k = f(xi,k,θ) is at least insensitive to such group of augmentation nuisances nk w.r.t. the network parameters θ. Existing work [5, 7, 18, 33] show that, while the deep extractor f(xi,k,θ) is trained to learn the shared semantics from distorted views xi,k, such pretrained network parameters θ effectively benefit further downstream tasks.
SSL approaches based on such pairwised instance invariance assumptions can be generally summarized as penalizing some form of inconsistency between paired of features zi,j , zi,k:
Lθ(xi, (nj ,nk)) = L(zi,j ,zi,k) (1)
where j, k indexes over the augmented views on instance xi. Without loss of generality, we expand the support of random variable n to pairwised {(nj ,nk) : j, k = 1, . . . ,K} to incorporate pairs of augmentation actions. Loss Lθ(xi, (nj ,nk)) represents such invariance loss under the pair of augmentation actions (nj ,nk). Here, the generic form of loss function L(zi,j , zi,k) imposes the desired cross-view invariance assumptions between zi,j and zi,k for the i-th instance. Take for instance, L(zi,j , zi,k) can be defined as contrastive loss in MoCo [18], clustered loss as in SwAV [5], or simply `2 norm as in BYOL [15]. Our idealized goal then is to sample from independent latent generative processes xi ∼ px and n ∼ p∗ such that zi,k = f(xi,k,θ) = f(g(xi,nk),θ) captures the same semantics as from original xi.
Assume we have access to such oracle distribution p∗, and with equal sampling probability for xi, the objective function is:
L∗ = Ex∼px,n∼p∗ [Lθ(x,n)] ≈ 1
N N∑ i=1 ∑ j,k L(zi,j ,zi,k) p ∗(nj ,nk). (2)
Optimizing Eq. (2) then corresponds to learning an M-estimator [22] with regard to network parameters θ.

heading: 3.2 Sampling Distribution p∗: a Heuristic
text: Augmented views are the bread and butter for self-supervised learning approaches. Intuitively, the network needs to see diverse augmentations from p∗(n) in order to train for invariance. But in the meanwhile, the learning process needs to also avoid training on those xi,k having excessive
distortions who have drastically deviated from the semantics of the original instance. There exists an implicit trade-off in our mind that controls the strength (hyperparameter) of the augmentation actions. The elusive definition on optimal distribution p∗(n) therefore seems to be best considered as a constrained distribution offering most data variance subject to the least semantic deviation from the original instance.
We illustrate this point in Fig. 1. The left-most picture is the original instance input, whereas the two rows of smaller images display the augmented views generated via the multi-crop augmentation pipeline as in SwAV [5]. Apparently, some of augmented views are highlighting the bunny, whereas the others capture the straw only. Under such generative process of augmentations, there is a good chance that a pair of (bunny, straw) features are imposed to be close in feature space. Such noisy invariance might intuitively disrupt the optimization, leading to suboptimal downstream generalization ability. Actually, the work in [36] has theoretically discussed the generalization ability of contrasive pretraining approaches on downstream tasks: if a negative sample is not from a different class of the positive, the upperbound of error on downstream linear classification is provably guaranteed to increase. Similarly, we can derive from [36] via mild modification that if a pair of constructed positive views are not from the same semantic class, the upperbound of linear classification error in the downstream tasks would also increase.
Nevertheless, in practice, while the optimal desired p∗(n) remains unknown and elusive, we usually take it for granted that all generated augmentations are equally good, and we tentatively sample n from some heuristically chosen p̃(n), a surrogate distribution that needs not coincide with the desired p∗(n) having the proper augmentation variance-bias trade-off. And instead of optimizing Eq. (2), we often optimize:
L̃ = Ex∼px,n∼p̃ [Lθ(x,n)] ≈ 1
N N∑ i=1 ∑ j,k L(zi,j ,zi,k) p̃(nj ,nk). (3)
As per our discussion above, since we ultimately hope to sample from the desired p∗(n) instead of the surrogate distribution p̃, we rewrite Eq. (2) using the basic change of measure rule from the importance sampling technique, and yield:
L∗ ≈ 1 N N∑ i=1 ∑ j,k L(zi,j ,zi,k) p ∗(nj ,nk) ≈ 1 N N∑ i=1 ∑ j,k L(zi,j ,zi,k) p̃(nj ,nk) · p∗(nj ,nk) p̃(nj ,nk) . (4)
Comparing Eq. (4) and Eq. (3), we notice that if we desire to optimize Eq. (2), whereas we insist sampling from p̃ instead of p∗, we should adjust for this change and compensate each loss term via the multiplicative likelihood ratio p∗(nj ,nk)/p̃(nj ,nk), rather than optimizing Eq. (3). This likelihood ratio detects how much chance we would miss the optimal sampling distribution if instead using the surrogate distribution p̃. If p∗ = p̃, then the objective function recovers the optimal sampling scheme as in Eq. (2) and no adjustment using likelihood ratio is needed.
In practice, SSL approaches usually freeze the optimization on either feature zi,j or zi,k, while only the other one is optimized via backpropagation [15, 18]. Therefore it is also reasonable to simplify the objective Lθ(x, (nj ,nk)) to Lθ(x,nj), and the likelihood ratio p∗(nj ,nk)/p̃(nj ,nk) to p∗(nj)/p̃(nj). In addition, forn = Id which is the identity transformation, Lθ(xi, Id) degenerates to the objective function on the original instance xi without augmentation, we denote it as Lθ(xi).

heading: 3.3 Sampling Distribution p∗: a Lemma
text: Unfortunately, we do not have access to ratio p∗/p̃ (as hard as knowing p∗). But we could define w(n) = p∗(n)/p̃(n), which is essentially the Radon Nikodym derivative, and we tentatively analyze how w would influence the MSE (mean squared error) of deep estimator. To reach this goal, we extend the result in [6], and have the following proposed Lemma on the MSE of deep estimator: Lemma 1 Define θ0 = arg minθ ExLθ(x), θG = arg minθ Ex[ ∫ Lθ(x,n)dp∗(n)], and θ̂G = arg minθ L∗. Let V 0 be the Hessian of θ → ExLθ(x) at θ0, and V G the Hessian of θ → Ex[ ∫ Lθ(x,n)dp̃(n)w(n)] at θG. Let M0(x) = ∇Lθ0(x)∇Lθ0(x)T , and MG(x) = ∇LθG(x)∇LθG(x)T , where ∇Lθ0(x) and ∇LθG(x) are gradients of Lθ(x) at θ = θ0 and θ = θG respectively. Similarly, denoteMG(x,n) = ∇LθG(x,n)∇LθG(x,n)T . Denote the trace
of matrixX as tr(X). Then, with C a constant invariant of w, under mild conditions, we have:
MSE(θ̂G) ∼C + ‖θG − θ0‖22 + 1 N Ex[ ∫ tr(V −1G (MG(x,n)−MG(x))V −1 G ) dp̃(n)w(n)] (5)
+ 1 N Ex [ tr(V −1G (MG(x)−M0(x))V −1 G ) ]
(6)
+ 1 N tr((V −1G − V −1 0 )Covx∇Lθ0(x)(V −1 G − V −1 0 )) (7) − 1 N tr(V −1G Ex [Covw∇LθG(x,n)]V −1 G ), (8)
where Covw(∇LθG(x,n)) is the covariance matrix of Lθ(x,n) at θG under measure p∗(n).
Lemma 1 is very busy. But we can still summarize clear variance-bias trade-off implication from it. The key term in Eq. (8) is the covariance matrix of the gradient of loss w.r.t. augmentation measures. In the special case of one-dimensional θ, this term is reflective of the Fisher information and thus larger values lead to better variance reduction for the estimator θ̂G and smaller MSE. This means we desire more diverse data. In the meanwhile, terms in Eq. (5) and (6) measure the difference of squared loss gradient between an augmented view and its original instance. If an augmented view is showing a much different gradientMG(x,n) in loss than the original clean instance, i.e., gradient MG(x) (as measured in Eq. (5)); or showing a very different gradientMG(x) than the gradient on original instance M0(x) (as in Eq. (6)), then the biases represented in Eq. (5) combined with (6) will increase, and thus the MSE will also increase.
Lemma 1 also explains our intuition in the previous section: we desire large data variance via sampling from p∗(n), such that we can reduce the estimator variance Eq. (8). But data variance is a double-edged sword. A radical sampling distribution on n with excessive distortions can simply contradict the desired prerequisite hypothesis (invariance) and increases estimator bias. Through Lemma 1, we are now clear why we would tune the strength of the augmentations to reach the sweet spot for downstream tasks!
Balancing the bias-variance trade-off to reduce MSE in Lemma 1 is tricky. Fortunately, we still have w(n) variable to associate with each term in Eq. (5), Eq. (6) and Eq. (8). Recall, the message from Lemma 1 is: if a certain zi,j under the augmentation action of nj shows a strongly deviating direction from original instance xi’s semantics, it is potentially not representative of the i-th instance at all, it perhaps is signaling an out of distribution outlier, and might increase the estimation bias. The variable w(n) should be suppressing the effect of these samples. But what is the semantics that original instance xi mostly cares, the bunny or the straw? The most efficient way is to let all views vote, and to compute a mean feature µi using these augmented views. This µi feature hopefully represents the original semantics. Eq. (5) also implies that, if there is only a single augmented view available, we can additionally forward the original instance without augmentation (i.e., xi) and use feature zi = f(xi,θ) to approximate µi (more discussion in Section 4.2). Note, deep neural networks eventually will fit whatever OOD noises via memorization [1], even if the paired invariance is noisy and wrong. We expect to avoid this happening through the influence of w to at least reduce bias term in Eq. (5) and (6) without sacrificing much data diversity.

heading: 3.4 Optimizing Ratio w = p∗/p̃ as a Latent Variable
text: Under measures p∗ and p̃ for n, the probabilities of sampling xi,j = g(xi,nj), where g is invertible, are px(xi) · p∗(nj) and px(xi) · p̃(nj), respectively, due to independence of sampling procedure of xi and nj . And the likelihood ratio at xi,j is (px(xi) ·p∗(nj))/(px(xi) · p̃(nj)) = p∗(nj)/p̃(nj) = w(nj). Therefore, to find the desired w(nj) that reduces the MSE in Lemma 1, it suffices to find likelihood ratio in sampling xi,j . By the one-one correspondence between xi,j and zi,j , it further boils down to calculating weights wi,j for zi,j .
With all of these implications from Lemma 1, we correspondingly define the ratio wi,j as: p∗
p̃ ∝ wi,j = exp[−(zi,j − µi)T (τΣ)−1(zi,j − µi)], (9)
where the µi and Σ are defined as:
µi = 1
M M∑ j zi,j , Σ = 1 NM N∑ i M∑ j (zi,j − µi)(zi,j − µi) T . (10)
Here, zi,j , j ∈ {1, ...,M} are features out of M augmentations on xi. Each (zi,j−µi) measures the difference between a specific augmentation feature zi,j and µi. Hyperparameter τ is the temperature that controls the dependency strength of wi,j on such distance. The distance is then normalized through Σ among view augmentations. Σ normalizes the distance measurement such that all dimensions in (zi,j − µi) are of similar magnitude, avoiding risking a single dimension dominating the distance measure. Eq. (10) computes the covariance using all the augmentation of all instances in the current batch and requires all instances share the same Σ. This seemingly strong hypothesis is absolutely not a simplification. It is rather intended to unveil an appealing unique signature of self-supervised learning that helps shrink the search region of the parameters: the source of variance on all instances are only explained by the same set of augmentation actions. Supervised learning does not enjoy similar assumption, as variance of data comes from wild possibilities across classes. Note the construction of the Radon Nikodym derivative wi,j are also supported by the observations in [1]: real data examples are consistently shown to be easier to fit than noise during the training, i.e., the deep model usually first learns the simple and general patterns of the real data before fitting the noise. We wouldn’t sacrifice learning true general patterns during the process of suppressing noise.

heading: 3.5 The Unsupervised OuTlier Arbitration Approach (UOTA)
text: According to the discussion above, the complete UOTA training procedure of wi,j is described as follows (see pseudocode in the supplementary material). We further normalize the ratio value wi,j across the whole batch of samples into w̄i,j :
p∗
p̃ ∝ w̄i,j = wi,j∑N i ∑M j wi,j . (11)
Our loss function Eq. (4) eventually boils down to:
Lours = N∑ i=1 M∑ j=1 w̄i,jLθ(xi,nj). (12)
During training, one can replace the placeholder loss Lθ(xi,nj) in Eq. (12) by particular form of losses defined in a variety of SSL approaches such as the contrastive loss in MoCo, pairwise `2 loss in BYOL or any alternative losses based on pairwise feature invariance assumption. During each training iteration, we firstly forward the training data xi, and update w̄i,j according to Eq. (9) and Eq. (11), where µi and Σ are computed using Eq. (10). The value of w̄i,j is then freezed and we backpropogate the loss defined by Eq. (12) only through feature variable zi,j (depending on the SSL loss), to update the network parameters θ. The whole optimizing procedure is an alternating optimization procedure and iterates between updating the latent variable w̄i,j (Eq. (9) and Eq. (11)) given fixed θ; and updating θ (backpropogate Eq. (12) given fixed w̄i,j). Note, the update of w̄i,j in Eq. (11) is motivated from our Lemma 1 and the importance sampling technique, which conveniently jettisons any threshold selection issues in [25, 26, 50]. Particularly we further have the following theorem:
Theorem 1 Given mild condition, the optimization of loss Eq. (12) according to the wi,j definition in Eq. (9) leads to a reduced MSE defined as in Lemma 1 than having constant w̄i,j .
The proof is in the supplementary file. The above theorem implies that UOTA procedure and the associated loss function in Eq. (12) are able to effectively correct the estimator bias. We train a network under UOTA procedure, and present the augmentations in Fig. 1 according to descending order of each associated wi,j . Interestingly, most augmentations clearly capturing bunny object has higher wi,j values, whereas the straw is arbitrated as highly possible OOD samples (smaller wi,j).

heading: 4 Empirical Analysis
text: In this section, we empirically evaluate the effectiveness of the proposed UOTA algorithm and justify correctiveness of Theorem 1. In detail, we replace the term Lθ(xi,nj) in Eq.(12) by specific losses defined by a variety of state-of-the-art SSL methods, i.e., MoCo [18], BYOL [15] and SwAV [5]. We then implement our proposed UOTA algorithm (see supplementary file for applying Eq.(12) to these methods) according to the training procedure in Section 3. For each “X+UOTA” model, we firstly train its baseline X for Nwarm warm up epochs, and then we resume the “X+UOTA” training till end
(see supplementary file for Nwarm values used for each experiment). Total number of training epochs of X+UOTA including warm up is the same as that for training X. We follow the standard evaluation protocols as in [18], and evaluate the algorithms as follows: (1) Linear evaluation on frozen pretrained features via UOTA or other various methods on both ImageNet100 [39] and ImageNet1K [11]; (2) Extensive ablation studies against hyperparmeter variations; (3) More downstream task accuracy (i.e., object detection, instance segmentation and keypoint detection) on MS COCO dataset [29] by finetuning pretrained network obtained via UOTA or other SSL approaches. Without specification, all tables with standard deviation (±x) are reported with 10 different runs pretraining the model.

heading: 4.1 Evaluating the Unsupervised Features on ImageNet100
text: In this section, we compare the result of various SSL approaches pretrained with the ResNet-18 Network [20] on ImageNet100 dataset, a subset of ImageNet1K dataset. This is because the suitable data scale allows us to reimplement and frequently tune all the models to reach their best performances. On ImageNet100, we pretrain all the approaches for 200 epochs with a batch size 128. We use each approach’s default optimizer (e.g., LARS [45], SGD) and architecture according to their official codes. Following the protocol in [18], we firstly pretrain the ResNet-18 with various SSL losses. We then train linear classifier on frozen features out of each pretrained ResNet-18 to evaluate the classification accuracy on test data. For detailed implementation of all approaches in this section, please see supplementary material.
Implementing UOTA on various SSL algorithms. In this section, we implement a variety of SSL algorithms and plug the corresponding losses into Eq. (12) to pretrain the network. We respectively evaluate the linear classification performances on the original baseline models in row “without UOTA” of Table 1, and we present each baseline’s performance with UOTA approach in the row “+UOTA”. The model MoCo-v2* is an additional baseline we implemented by applying the multi-crop augmentation (8 views 2 × 224 + 6 × 96) and other training techniques from SwAV to MoCo-v2 (LARS optimization, threshold, lr and etc., see supplementary file). Therefore, Table 1 actually covers a broad type of SSL approaches: plain contrasive loss based approach (MoCo-v2); non-contrastive loss with cross view `2 norm penalty (BYOL); cluster based multi-view contrastive loss (SwAV, 8 views); and finally contrastive loss with additional augmented views that are trained simultaneously (MoCo-v2*). As Table 1 demonstrates, UOTA is showing evident OOD removal effect with robust performance boost (always ≥ 0.9% gain) against the potential OOD samples in the training data. Comparison to other related works. We compare with other existing OOD detection techniques, some of which originally proposed for supervised learning scenarios. Focal loss [28] is a typical algorithm overweighting hard samples during training; In contrast, GCE [50] is shown to be robust against label noises for the supervised learning similar to self-paced raining procedure [25]. MILNCE [30] loss is particularly designed for caption-frames misalignments issues in narrated videos, and is tailored for contrastive loss. Debiased contrastive learning [10] (abbreviated in as Debiased in Table 2) only considers removing the sampling bias from the negative samples. In this section, we
use MoCo-v2* (defined in previous paragraph) as the baseline model, and implement all the relevant approaches on MoCo-v2* if applicable. We defer the implementation details into the supplementary material. In Table 2, MoCo-v2*+UOTA has achieved the best test accuracy across all the algorithms. Focal loss overweights samples that has the highest loss, thus fails when compared with the baseline model. In contrast, MIL-NCE does not adaptively update the sampling distribution depending on the data, therefore showing an inferior performance than ours. This verifies that OOD issue is indeed a unique issue for the SSL approaches having unique embedded noise structures compared to conventional supervised learning approaches. UOTA outperforms “Debiased”, which at least shows that addressing the noise issue in positive samples is equally important as in negative samples.
While UOTA tries to mute the intrinsic OOD samples from positive, the NDA approach in [37] even considers manually generating OOD samples as negatives. These two methods differ in motivation, but both would be provably shown to result in reduced error bound on the downstream linear classification tasks, as per the discussion in paper [36]. We compare scores reported in [37] by following the ResNet50 training setups of Table 6 in [37]. The results are reported in Table 4, showing the effectiveness of both methods while UOTA is relatively better.

heading: 4.2 Ablation Studies
text: In this section, we examine the impact of different hyperparamters in the UOTA framework on ImageNet100. We evaluate different settings on linear classification task as defined in Section 4.1, with the same pretraining set up for UOTA as described as in Section 4.1. The impact of τ , Nwarm and other hyperparameters of UOTA is included in supplementary material.
Impact of crop-min strength in augmentation We first investigate the effect of the crop-min value. The hyperparameter crop-min defines the minimal size of an augmentation via random cropping from the original instance. According to Lemma 1, there should be a sweet point of crop-min value best balancing the trade-off for the estimator MSE. Interestingly, we spot the expected sweetpoint for the MoCo-v2 baseline at value of 0.16, as in Fig. 2(a). Notice that MoCo-v2+UOTA has an evident effect in flattening the influence of crop-min against the accuracy. This well corroborates the efficient role of UOTA, which adaptively adjust for the sampling distribution to combat the OOD samples. In this way, UOTA guards the SSL approaches without suffering too much OOD noise.
Impact of number of views for each instance. We adopt the MoCo-v2* framework as the baseline to associate with UOTA. Fig. 2(b) shows, as the view numbers for MoCo-v2* increase, the UOTA approach consistently outperforms MoCo-v2* by a clear margin. This advantage is even slightly promoted as view number increases. We speculate that as the diversity of views grows, both algorithm benefit from increased data variance and reduced estimator variance through Lemma 1, while UOTA enjoys better performance gain via Theorem 1.
Impact of covariance estimate. In Section 3.4, we impose the constraint that all instances share the identical covariance. This implicit constraint is critical to practically reduce MSE defined in Lemma 1. In this section, we justify our hypothesis by comparing with two baselines on MoCo-v2* (8 views). The “local Σi” baseline computes a unique Σi for each instance i by only involving its own augmentations. “Σ = I” baseline further removes the whitening step (effectively a squared euclidean distance) when evaluating the feature distance (between zi,j and µi). In contrast, “global Σ” is our default option for UOTA as defined in Eq. (10), i.e., “global Σ” is estimated via all augmentations of all instances (all instances share the same Σ). As Table 3 shows, “global Σ” outperforms both “local Σ” and “Σ = I”, which demonstrates the benefit of proposed constraint.
Impact of mean estimate. In Section 3.3, we hypothesize that µi is around the value of original zi, as original zi feature can be regarded as effectively integrating out the augmentation nuisance
variable n given certain zi. We therefore examine the UOTA performance under the MoCo-v2* (8 views) framework using these two different mean estimates. “zi ” model means we replace the µi by using the original feature (without augmentation) zi in Eq. (10). The cost of this replacement is an extra forward of original xi, though. As observed in Table 3, there is slight difference between the two models, showing effectiveness using average µi to represent zi.

heading: 4.3 Evaluating the Unsupervised Features on ImageNet1K
text: Implementation details. In this section, we compare the result of various SSL approaches pretrained on the ResNet-50 [20]. Following the protocol in [18], we firstly pretrain the ResNet-50 with various SSL losses. We then implement further supervised downstream tasks by either finetuning on the pretrained network, or by directly using the frozen feature out of the pretrained network depending on the task. In this section, we implement the proposed UOTA algorithm by using the SwAV loss (multi-crop with 8 views 2× 224 + 6× 96), the exactly architecture and augmentation pool as in [5] to optimize Eq. (12). We train all relevant algorithms on 4 V100 GPUs, with a batch size 256. For other training details, please refer to supplementary task.
Evaluating the linear classification task on frozen features. We further train linear classifier on frozen features out of each pretrained ResNet-50 network to evaluate the classification accuracy on test data. As Table 6 displays, our proposed UOTA algorithm (associated with the SwAV approach) has achieved the best Top-1 accuracy (73.5%) and Top-5 accuracy (91.8%) across all the presented SSL pretraining algorithms. Particularly, the proposed SwAV+UOTA pretrained for 200 epochs even surpasses SimCLR [7] and Barlow Twin [47] trained for 1000 epochs. Besides, the SwAV+UOTA framework outperforms the original SwAV baseline by 0.8% accuracy. In the meanwhile, the total training time for SwAV+UOTA is 181.5 hours, with only negligible 2 hours more than SwAV’s training time 179.2 hours on 4 V100 GPUs. These results demonstrate clear evidence of our proposed hypothesis: OOD samples broadly exist in the training data. Importantly, the OOD issue is not vanishing as the the number of instances in training significantly grows (much more than in ImageNet100). Fortunately, our lightweight UOTA procedure is able to modify the sampling distribution and reduce the estimator bias, guaranteed by our Lemma 1 and Theorem 1. We think this 0.8% improvement effectively raises a warning flag to the community, and it verifies that OOD samples has a clear and non-negligible impact that should be attended to.
Binary classification between OOD data and clean data. In this section, we empirically verify that OOD samples and original image are linear separable on frozen features learned by UOTA. For this purpose, we choose ImageNet100 training data as training set and ImageNet1K val set (50,000 images) as test set. Each of the training data is randomly augmented into 5 views. We reorder all the samples according to their computed w̄ij value in an ascending order (Group 1 contains the lowest w̄ij valued samples, showing strongest sign of OOD sample; Group 5 has the highest w̄ij samples, best resembling the semantic of the original training sample). We sequentially split such reordered augmentation set into 5 groups with equal sample size. Different groups then reflect the detected semantic uncertainty via UOTA. The test data are augmented in the same way and split into 5 groups, too. We then train the binary classifier on top of the frozen pre-trained model (SwAV+UOTA model producing Table 6), by respectively treating each Group n as class 1 (OOD class), with clean data considered as class 0 (class 0 and 1 have equal number of training data). Group 6 is a baseline with equal size of clean data in two subsets representing class 1 and class 0 respectively. More training details are included in the supplementary file. As Table 5 shows, the binary linear classifier between OOD and clean data on their frozen features always show clear statistical significance and better separability against the reference baseline Group 6. Notably, as the data exhibits weaker OOD signs (e.g., Group 5), the training becomes harder and harder, returning lower training accuracy, while the OOD samples still demonstrate much stronger linear separability against the baseline model Group 6.
Finetuning on pretrained network for more downstream tasks. In this section, we evaluate the presented SSL algorithms by finetuning the pretrained ResNet50 equipped with FPN [27] on more downstream tasks. Table 7 respectively reports the performance on object detection, instance segmentation and keypoint detection tasks. These tasks, to some extent, evaluate the generalization capability of the pretrained features when transferred to other tasks and training datasets. According to Table 7, SwAV+UOTA still outperforms its baseline model SwAV on all evaluation metrics for the object detection and instance segmentation tasks. Notably, SwAV baseline drops drastically on the keypoint detection tasks in comparison to MoCo-v2. We speculate that the multi-resolution multi-crop augmentation has introduced more OOD samples into SwAV than in MoCO-v2, leading to vague semantic feature that is critical for successful key-point detection tasks. This well reveals that, even if we further finetune the pretrained network using alternative dataset, SwAV+UOTA is still able to benefit tasks by suppressing the OOD samples and balancing the estimator bias-variance trade-off during the pretrain. The advantage of UOTA is not erased due to the finetuning. Table 7 concludes that the down-weighted OOD samples through training using UOTA approach successfully forced the network to focus more on the true invariant semantics shared across multi-views, which plays pivotal importance on downstream task performance.

heading: 5 Conclusion
text: In this paper, we explore the potential OOD noise issue for SSL approaches. Most importantly, we demonstrate that these OOD samples are highly structured, and are interfering the downstream tasks with a non-negligible impact. We use importance sampling technique to investigate the source of OOD problem via estimator MSE decomposition, and we identify an important bias-variance trade-off behind the sampling distribution options for positive views. We propose a useful latent variable model UOTA to effectively balance such trade-off. Empirical study well corroborates our hypothesis and shows strong advantage of our UOTA approach over the state-of-the-art SSL approaches. Social Impact and Limitation. With our SSL approach, one can conveniently construct her own pretraining dataset by random crawling data. This is economic and beneficial for research purpose, but would potentially risk privacy and license issues. Also, given the easy access to data via unsupervised learning, one might risk abusing the use of AI technique and applying in appropriate occasions. Our approach also requires tuning extra hyperparameters depending on dataset.
Acknowledgments and Disclosure of Funding
Funding in direct support of this work: the National Key R&D Program of China under Grant No. 2020AAA0108600.

Review summaries:
This contribution is based on two main claims: i- using data augmentation to create different views from an image might result in out-of-distribution instances; and ii- employing such out-of-distribution views as positive instances in self-supervised approaches that rely on comparing representations from positive and negative views of an example, might be harmful for downstream performance. To address these issues, the authors proposed to apply an out-of-distribution detection approach to estimate how likely it is for a positive view to be out-of-distribution and use this information to weight the contribution of each positive pair when computing the learning criterion. The proposed strategy, named Unsupervised OuTlier Arbitration (UOTA), is then incorporated to three previously proposed self-supervised learning approaches and empirically validated on ImageNet and MS-COCO. Comparisons with other out-of-distribution detection techniques were also provided. Overall, UOTA showed to marginally improve the downstream performance of self-supervised pretraining both with respect to the compared detection approaches as well as self-supervised models without any mechanism to compensate for potential out-of-distribution positive views. 

The paper suggests that the different augmentations used as a positive pair during self-supervised training often lack the same semantic structure as the original image, and thus should be treated as an OOD sample. Using such OOD samples, they believe can hurt the downstream task performance. The aim should be to choose augmentations that offer the most data variance but are subject to the least semantic deviation. For this, they propose an importance sampling approach to weigh the loss for different augmentations differently. Empirically they obtain improvement for different downstream tasks across different datasets.

The paper is generally concerned with self-supervised contrastive learning, such as SimCLR. The authors posit that existing ways to generate (contrastive) views introduce out-of-distribution examples that actually harm performance. To remedy this, the authors propose a latent variable model they term UOTA that, based on importance sampling, suggest good view candidates. They show UOTA's theoretical properties and conduct extensive experiments, showing gains using UOTA against a large number of recent baselines. 

This paper presents an algorithm named UOTA for self-supervised representation learning. The method is based on the observation that some low-quality negative samples are generated during the learning procedure and these bad samples can confuse the deep networks. So, a Gaussian distribution is built to estimate the weight of each sample and added to the loss term. Experiments show consistent accuracy gain.