Year: 2022

Abstract:
Self-supervised learning has recently shown great potential in vision tasks through contrastive learning, which aims to discriminate each image, or instance, in the dataset. However, such instance-level learning ignores the semantic relationship among instances and sometimes undesirably repels the anchor from the semantically similar samples, termed as “false negatives”. In this work, we show that the unfavorable effect from false negatives is more significant for the large-scale datasets with more semantic concepts. To address the issue, we propose a novel self-supervised contrastive learning framework that incrementally detects and explicitly removes the false negative samples. Specifically, following the training process, our method dynamically detects increasing high-quality false negatives considering that the encoder gradually improves and the embedding space becomes more semantically structural. Next, we discuss two strategies to explicitly remove the detected false negatives during contrastive learning. Extensive experiments show that our framework outperforms other self-supervised contrastive learning methods on multiple benchmarks in a limited resource setup. The source code is available at https://github.com/tsaishien-chen/IFND.

heading: 1 INTRODUCTION
text: Self-supervised learning of visual representation (Doersch et al., 2015; Pathak et al., 2016; Noroozi & Favaro, 2016; Oord et al., 2018; Gidaris et al., 2018; Chen et al., 2020a) aims to learn a semanticaware embedding space based on the image data without the supervision of human-labeled annotations. Recently, significant advances have been made by contrastive learning approaches (Hjelm et al., 2019; Tian et al., 2019; Chen et al., 2020b;c; He et al., 2020; Chen et al., 2020d) to reduce the performance gap with the supervised counterparts. Most unsupervised contrastive learning methods are developed based on the instance discrimination assumption. These approaches treat each training image as an individual instance and learn the representations that discriminate every single sample. Specifically, considering an arbitrary image as an anchor, the only positive sample is generated by applying a different data augmentation to the anchor image, while all other images are treated as negative samples. The training objective is to attract the positive to the anchor while repelling the negative samples from the anchor.
While instance-level contrastive learning has shown impressive performance, these methods do not take the semantic relationship among images into consideration. Although some images share similar semantic concepts with the anchor, they are still considered as negative samples and are equally pushed away from the anchor with all other negatives. We define these samples as “false negatives” in self-supervised contrastive learning, which would adversely affect the representation learning (Saunshi et al., 2019). One might argue that such undesirable effects might be minor for the datasets with diverse semantic concepts since the probabilities of drawing false negatives are relatively low. However, as shown in Figure 1, we empirically find the opposite results that the performance drops due to training with false negative samples are more significant on large-scale datasets with more semantic categories. These results bring up the issue of instance-level contrastive learning when it is applied to datasets with more complex semantic contents.
Figure 1: Effect of false negative for contrastive learning. To study the effect of false negatives, we compare two frameworks: SimCLR (Chen et al. (2020b), blue) representing instance-level contrastive learning which is trained with false negatives, and SupCon (Khosla et al. (2020), red) benefiting from human-labeled annotations to exclude false negatives. We observe that training with false negatives leads to larger performance gaps (orange) on the datasets with more semantic categories. The proposed approach (green) effectively alleviates such adverse effects by explicitly removing the detected false negatives for self-supervised contrastive learning. See Section 4.3 for experimental details.
To handle the false negative issue, we propose a novel framework to incrementally detect and explicitly remove false negatives for self-supervised contrastive learning. During training, we cluster samples in the embedding space and assign the cluster indices as the pseudo labels to the training images. Instances with an identical label to the anchor are then detected as false negatives. However, we notice that the pseudo labels generated in the earlier training stages are comparably unreliable to represent the semantic relationship among instances since the semantic structure of the embedding space is still under development. Therefore, we propose a novel strategy to assign the pseudo labels in an incremental manner. In the early training stage, we only use a small portion of pseudo labels with higher confidence while treating other samples as individual instances. In the later training stage, as the pseudo labels become more reliable, we dynamically include more confident labels to detect and remove false negatives and hence, can benefit semantic-aware representation learning.
Furthermore, we discuss two types of training objectives to explicitly address the detected false negatives during contrastive learning: elimination and attraction. We theoretically show that they are the generalization of triplet loss (Schroff et al., 2015). While both objectives avoid discriminating the anchor and its false negatives, the attraction objective further minimizes the distances between them. Empirically, we find that such a more aggressive strategy is less tolerant to noisy pseudo labels and unsuitable to our self-supervised framework. The main contributions of this paper are summarized as follows:
• We highlight the issue of false negatives in contrastive learning, especially on the largescale datasets with more diverse semantic contents. • We propose a novel contrastive learning framework with incremental false negative detection (IFND) that smoothly bridges instance-level and semantic-aware contrastive learning. Our approach explicitly detects and incrementally removes false negatives as the embedding space becomes more semantically structural through the training process. • Our approach performs favorably against the existing self-supervised contrastive learning frameworks on multiple benchmarks under a limited training resource setup. Besides, we introduce two metrics: mean true positive/negative rates to evaluate the clustering quality.

heading: 2 RELATED WORK
text: Instance-level contrastive learning. Learning semantic-aware visual representation without human supervision is an essential but challenging task. Numerous approaches are developed based on the instance discrimination task (Dosovitskiy et al., 2015; Wu et al., 2018; Ye et al., 2019; Misra & Maaten, 2020), where each instance in the dataset is treated as an individual sample and a representation is learned to classify or contrastively separate samples. Recently, with the contrastive loss (Gutmann & Hyvärinen, 2010) and a set of image transformations or augmentations (Chen et al., 2020b), the instance-level contrastive learning methods (Hjelm et al., 2019; Tian et al., 2019; Chen et al., 2020b;c; He et al., 2020; Chen et al., 2020d) achieve state-of-the-art results and even outperform some supervised pre-training approaches. While significant improvement is achieved, instance-level contrastive learning frameworks typically do not take high-level semantics into ac-
count. For example, any two samples in the dataset would be considered as a negative pair and be pushed apart by the contrastive loss although some of them are semantically similar and should be nearby in the embedding space. Especially when the huge amounts of negative samples (8192 for Chen et al. (2020b), 65536 for He et al. (2020)) play a critical role in the success of contrastive learning, these instance-level approaches inevitably draw some “false negatives” and learn less effective representation models as shown by a recent study (Saunshi et al., 2019). In this paper, we further show that the performance gap between the contrastive learning trained with and without false negatives is more significant on the datasets with more semantic classes.
Semantic-aware contrastive learning. To address the limitation of instance-level contrastive learning, several methods are developed to exploit the semantic relationship among images. Chuang et al. (2020) show that the original instance-level sampling strategy includes a sampling bias and propose a debiased contrastive loss. However, this method does not explicitly handle false negative samples. Huynh et al. (2020) determine false negatives of an anchor by finding top k similar samples without referring to global embedding distribution. Khosla et al. (2020) propose a supervised contrastive loss that utilizes label information and treats images of the same class (i.e., false negatives) as positives. However, manually annotated labels cannot be acquired in the unsupervised setting. Closely related to our method, PCL (Li et al., 2021) discovers the representative prototypes for each semantic concept and encourages an image embedding to be closer to its belonging prototype. There are two fundamental differences between PCL and the proposed method: a) PCL uses all assigned prototypes regardless of inferior clustering results in early stages, which cannot properly reflect the semantic relationship among images, b) without treating semantically similar samples as false negatives, PCL applies instance-level InfoNCE loss (Oord et al., 2018) as the primary supervision, which fails to avoid the images within the same prototype being pushed apart. In contrast, leveraging the progressive detection and explicit removal of false negatives, our framework achieves greater clustering quality and representation learning. More comparisons are in Section 4.2 and Appendix E.
Clustering for deep unsupervised learning. A few unsupervised learning methods have recently benefited from clustering techniques to construct more effective representation models (Caron et al., 2018; Yang et al., 2016; Xie et al., 2016; Caron et al., 2019; Zhuang et al., 2019; Asano et al., 2020). The main idea is to use cluster indices as pseudo labels and learn visual representations in a supervised manner. However, most existing methods require all pseudo labels to optimize the supervised loss, e.g., cross-entropy. In this work, we show that the pseudo labels obtained in earlier training processes are relatively unreliable, and the full adoption of pseudo labels in the early stage would further disrupt the representation learning. To handle this issue, we incorporate instance-level learning with clustering which allows us to only use a set of pseudo labels with sufficient confidence while treating the others as individual instances.

heading: 3 METHODOLOGY

heading: 3.1 INSTANCE-LEVEL CONTRASTIVE LEARNING
text: An instance-level contrastive learning method learns a representation that discriminates one sample from every other. Given M randomly sampled images from a training set X , a contrastive training mini-batch I consists of 2M images obtained by applying two sets of data augmentation on each sampled image. For any anchor image i ∈ I, the only positive sample is another view (or transformation) of the same image, denoted as i′, while the other 2(M − 1) images jointly constitute the set of negative samples N (i). The instance-level discrimination is then optimized by the following contrastive loss:
Linst = ∑ i∈I − log sim(zi, zi ′)∑ s∈S(i) sim(zi, zs) , S(i) ≡ {i′, n | n ∈ N (i)}, (1)
where zi = g(f(i)) is the embedding of the image i from an encoder f and a projection head g, sim(u,v) = exp( 1τ (u·v) ‖u‖‖v‖ ) is the similarity of two input vectors, and τ represents a temperature hyper-parameter. For instance-level contrastive learning, the negative sample set N (i) inevitably includes some samples with similar semantic content as the anchor i, which we term as false negatives, especially when a larger M is commonly used. Consequently, it would separate semantically similar image pairs, which is suboptimal for learning good semantic-aware visual representations.

heading: 3.2 INCREMENTAL FALSE NEGATIVE DETECTION
text: To learn an effective semantic-aware representation by self-supervised contrastive learning, our method explicitly detects and removes the false negative samples. Specifically, we follow the same procedure in PCL (Li et al., 2021) to perform k-means clustering on the features f(i) of all training images {i ∈ X} and cluster the features into k groups. We use the centroids to represent the embeddings of the discovered semantic concepts and denote the centroid representation of k-th cluster as ck. The pseudo label yi of the image i is assigned based on the closest centroid, formally yi = arg mink ‖f(i)− ck‖. In the learning process, two images with an identical assigned pseudo label would be treated as a false negative pair.
Nonetheless, as illustrated in the leftmost of Figure 2(a) (or Figure 3 for a realistic case), we observe that the semantic structure of early embedding space is less reliable and could generate noisy pseudo labels, which would disrupt the representation learning. We provide a quantitative analysis of this effect in Section 4.4 and Appendix F. To tackle this problem, in early training stages, we only adopt the pseudo labels with higher confidence while treating the other images as individual samples. For an arbitrary image i, the desired confidence κi should be larger when the image embedding f(i) is not only closer to the centroid of the belonging group, i.e., cyi, but also farther to the other centroids. To this end, we measure the confidence of an assigned pseudo label by:
κi = sim(zi, cyi)∑k j=1 sim(zi, cj) , (2)
which is the softmax of cosine similarities between the image representation and every centroid. We then only assign a specific rate (termed as acceptance rate) of pseudo labels with larger confidence. As plotted in the rest part of Figure 2 (or Figure 3), following the training process, the encoder is better trained and the semantic structure of embedding space is more clear which can generate more reliable pseudo labels. Hence, we propose to incrementally increase the acceptance rate and leverage semantic-aware representation learning. In Section 4.4, we demonstrate that a simple strategy that linearly increases the acceptance rate from 0% to 100% throughout the whole training process can achieve a significant improvement.
Hierarchical semantic definition. In an unsupervised setting, the precise class number of a dataset is usually unknown, and also, a different number of classes can be selected by choosing a different level of granularity. To enhance the flexibility and robustness of our method, we incorporate hierarchical clustering techniques (Johnson, 1967; Corpet, 1988; Murtagh & Legendre, 2014; Li et al., 2021) into our framework. Specifically, we perform multiple times of k-means with different cluster numbers to define the false negatives in the different levels of granularity. As such, the objective function (will be introduced in Section 3.3) is revised as the average of the original ones computed by the false negatives defined in different levels of granularity.

heading: 3.3 CONTRASTIVE LEARNING WITHOUT FALSE NEGATIVE
text: Given the assigned pseudo labels, our next goal is to revise the objective of instance-level contrastive learning, i.e., Linst in Equation 1, to explicitly deal with the detected false negatives. We discuss two strategies to exploit false negatives. First, false negative elimination approach excludes the false negatives from the negative sample set N (i):
Lelim = ∑ i∈I − log sim(zi, zi ′)∑ s∈S(i) sim(zi, zs) , S(i) ≡ {i′, n | n ∈ N (i), yn 6= yi}. (3)
Second, considering that the anchor and its false negatives are assigned with the same pseudo label, we view the false negatives as additional positive samples:
Lattr = ∑ i∈I 1 |P(i)| ∑ p∈P(i) − log sim(zi, zp)∑ s∈S(i) sim(zi, zs) , { S(i) ≡ {i′, n | n ∈ N (i)} P(i) ≡ {i′, n | n ∈ N (i), yn = yi}.
(4)
Behaviors of elimination and attraction strategies. Compared to the original contrastive learning objective Linst, Lelim removes the similarities between the anchor and its false negatives from the denominator while on the other hand, Lattr places them on the numerator. They both show a great capability to enlarge the similarities between the anchor and the false negatives when the objective is minimized. To further explore and compare their behaviors, we derive the gradients with regard to the embedding of the anchor zi as:
∂Lelim,i ∂zi
= ∑
n∈N (i), yn 6=yi
σ−n τ zn − σ+i′ τ zi′ and ∂Lattr,i ∂zi
= ∑
n∈N (i), yn 6=yi
σ−n τ zn − ∑ p∈P(i) σ+p τ zp (5)
where σ is the weighted coefficient. The detailed formulation and derivation are in Appendix A. Based on their gradients in Equation 5,Lelim andLattr are the generalization of triplet loss† (Schroff et al., 2015) which would intrinsically repel the negatives and attract the positive(s) to the anchor. While both of them fully eliminate the detected false negatives (i.e., {n | n ∈ N (i), yn = yi}) from the negative samples and avoid them being pushed apart from the anchor, Lattr further minimizes the distances between the anchor and its false negatives. Such a more aggressive strategy results in less tolerance to noisy pseudo labels which are inevitably generated from an unsupervised clustering. Hence, although SupCon (Khosla et al., 2020) presents the effectiveness of Lattr with manual label annotations, we find Lelim is more stable and suitable to our self-supervised framework. Finally, we illustrate the framework in Figure 2(b) and present the pseudo code in Appendix B.

heading: 4 EXPERIMENTS
text: We validate and analyze our framework on several benchmarks. We train the model on 8 Nvidia V100 GPUs for all experiments. For fair comparisons, we group prior self-supervised algorithms with a similar setting to demonstrate the efficacy of our proposed method.

heading: 4.1 IMPLEMENTATION DETAILS
text: We use ResNet-50 (He et al., 2016) as the encoder, followed by a 3-layer MLP as the projection head to obtain 128-D features z. We apply the proposed method to ImageNet (Deng et al., 2009) and CIFAR (Krizhevsky et al., 2009). For ImageNet pre-training, we follow the same setting in MoCo v2 (Chen et al., 2020d) and PCL (Li et al., 2021) for fair comparisons. Specifically, we train the encoder for 200 epochs with a mini-batch size of 256 and use the memory-based method (He et al., 2020) to increase the number of contrastive samples in default. For pseudo label assignment, we employ k-means clustering implemented by Johnson et al. (2019) to re-assign the pseudo labels after every training epoch and use three cluster numbers {1000, 3000, 10000} to define semantic concepts. In default, we linearly increase the pseudo label acceptance rate from 0% to 100% through the whole training process and use the elimination loss Lelim as the objective. The training lasts for 60 hours of which 3.5 hours is spent on pseudo label assignment. More details and the setting for CIFAR pre-training are provided in Appendix C.
†The gradient of triplet loss ([ ‖zi − zp‖22 − ‖zi − zn‖ 2 2 + α ]+) w.r.t zi is (2zn − 2zp).

heading: 4.2 COMPARISON WITH THE STATE-OF-THE-ARTS
text: Linear evaluation and transfer learning on image classification benchmarks. We first assess the performance of the image representations after pre-training on ImageNet. We train a linear classifier with the fixed representations as input on three benchmarks: ImageNet (Deng et al., 2009), VOC2007 (Everingham et al., 2010) and Places205 (Zhou et al., 2014) and report the results in Table 1. IFND obtains consistent improvements compared to previous self-supervised contrastive learning approaches with a similar experiment setting. The direct comparison to PCL (Li et al., 2021) emphasizes the advantages of incrementally detecting and explicitly removing the false negatives in contrastive learning. We provide a more in-depth ablation study with PCL in Appendix E.
Semi-supervised learning on ImageNet. Next, we evaluate the embeddings pre-training on ImageNet in the semi-supervised setting. We follow the protocol described in SimCLR (Chen et al., 2020b) and use the same 1% or 10% fraction of ImageNet labeled training set to finetune the pretrained encoder. The results are shown in Table 2. IFND outperforms the prior approaches within a similar setup; notably, when using the 1% label, it can achieve more superior performance than SimCLR with 16 times larger batchsize and 5 times more training epochs.
Object detection and instance segmentation on COCO. We evaluate our representation on the tasks of object detection and semantic segmentation. Following the experiment setting in MoCo (He et al., 2020) and PCL, we finetune all layers end-to-end on the COCO (Lin et al., 2014) train2017
and evaluate on val2017 dataset. We report the results in Table 3. IFND outperforms MoCo, PCL, and supervised pre-training in all metrics.
Clustering quality on ImageNet. We also measure the clustering quality on the ImageNet pretraining representations and report the results in Table 4. Compared to MoCo v2, our method leverages semantic-aware learning and shows a significant improvement of 9.6% on NMI. Moreover, IFND achieves the best clustering quality compared to existing deep clustering-based contrastive learning frameworks. In Appendix F, we analyze the clusterings during the training process to better study our incremental manner to apply the clustering assignments.

heading: 4.3 THE EFFECT OF FALSE NEGATIVE SAMPLES
text: Experimental Setup. To study the effect of false negatives on self-supervised contrastive learning, we compare three representative frameworks, including SimCLR (Chen et al., 2020b) as instancelevel learning, SupCon (Khosla et al., 2020) as supervised learning using label information to completely exclude the false negatives, and our method. For a fair comparison, we reproduce SimCLR and SupCon by using the same data augmentations and network architecture (i.e., ResNet-50 with 3-layer MLP). We also apply SimCLR-based implementation for our method without maintaining a momentum feature bank in this section. Considering that the probability of sampling false negatives in a training mini-batch I is largely determined by the number of semantic classes, we conduct the experiments on CIFAR (Krizhevsky et al., 2009) and ImageNet (Deng et al., 2009) with different numbers of object categories. For ImageNet, we use WordNet (Miller, 1998) lexical hierarchy to redefine the semantic classes in different depths, as detailed in Appendix D. We then train and perform the linear evaluation for three frameworks on each dataset and report the results in Table 5.
Based on the performance drops of SimCLR compared to SupCon (∆(SupCon, SimCLR) in Table 5), we observe that the adverse effect of false negatives is more significant on the datasets with more object categories, although they are less likely to sample false negatives during contrastive learning. Similar results are observed on both CIFAR and ImageNet. The results convey an issue of vanilla instance-level contrastive learning when it is applied to datasets with more complex semantic concepts. With the explicit elimination of the detected false negatives, IFND effectively narrows the gap between self-supervised and supervised frameworks, numerically reducing 51.7% of the gap between SimCLR and SupCon on ImageNet with original labels (i.e., Depth 18).

heading: 4.4 STRATEGY FOR FALSE NEGATIVE DETECTION AND REMOVAL
text: In this section, we first introduce a comprehensible evaluation metric for clustering assignment and then present the quantitative study on different strategies to utilize the clustering labels or to remove the detected false negatives. The results on CIFAR-100 are shown in Table 6.
More interpretable metric for clustering performance. Considering that the pseudo labels are used to detect false negatives, we propose Mean True Positive/Negative Rate (MTPR/MTNR) to evaluate the clustering. MTPR is the average probability that an actual false negative (i.e., an actual positive) will be detected as a false negative sample, while MTNR indicates the average probability that an actual negative is still treated as a negative sample. Taking the instance-level contrastive learning as a toy example, it does not perform false negative detection, so MTPR is 0% while MTNR is 100%. The goal is to increase MTPR of the clustering but keep MTNR as high as possible.
Strategies for pseudo label assignment. First, we compare three schemes to determine the acceptance rate of the pseudo labels, including constant ([b], as in DeepCluster (Caron et al., 2018)), step ([c], as in PCL (Li et al., 2021)), and linear ([g], Ours) schemes. The linear strategy achieves both higher MTPR and MTNR. The results validate that using the clustering indices in an incremental manner can find the false negatives more effectively and further improve the performance of contrastive learning. Next, we analyze the effect of using different final acceptance rates for the linear strategy ([d,e,f,g]). Intuitively, higher acceptance rates indicate more false negatives can be detected (MTPR increases), but more true negatives are also improperly treated as false negative samples and removed (MTNR decreases). However, we find that using the 100% final acceptance rate ([g]) can averagely detect nearly a half (43.3%) of the actual false negatives with only a slight drop (0.35%) of MTNR compared to the instance-level approach ([a]). Along with the elimination loss, we improve the downstream Top-1 classification accuracy from 71.5% to 74.0%.
Strategies for false negative removal. Finally, we compare the elimination and attraction losses ([g,h]). We find that the representation learning through minimizing Lattr are unstable and rely on the high-quality pseudo labels at the early training stages. This observation can be explained by the theoretical analysis in Section 3.3 indicating that Lattr applies a more aggressive strategy that would be more sensitive to noisy pseudo labels. Empirically, we observe that the model supervised by Lattr performs even worse than the instance-level learning.

heading: 4.5 VISUALIZATION OF EMBEDDING SPACE
text: In Figure 3, we visualize the embedding spaces and corresponding pseudo label assignments in different training stages using t-SNE (Van der Maaten & Hinton, 2008). In the early stages (e.g., 100th epoch), the semantic structure of the embedding space is still under-developed. Hence, IFND only adopts a small portion of pseudo labels with higher confidence scores. Later in the training process, with the better-trained encoder and more semantically structural embedding space, incrementally including more high-quality pseudo labels can benefit the semantic-aware representation learning. Finally, we compare the embedding spaces learned through SimCLR, SupCon, and our approach in Figure 4. IFND can learn the embedding space with more compact clusters than the instance-level learning and is also more similar to the supervised framework. We present a quantitative analysis in Appendix F and also provide more visualizations and discussions in Appendix G.

heading: 5 CONCLUSION
text: In this work, we analyze the undesired effects of false negatives for self-supervised contrastive learning. To mitigate such adverse effects, we then introduce an incremental false negative detection approach to progressively detect and remove the false negatives through the training stage. Extensive experiment results validate the effectiveness of the proposed framework on several benchmarks and also demonstrate the capability to reduce the gap from the supervised framework.

heading: A THEORETICAL ANALYSIS FOR ELIMINATION AND ATTRACTION LOSSES
text: In this section, we show the derivation of the gradients of two discussed objective functions: elimination loss Lelim (Equation 3) and attraction loss Lattr (Equation 4). Furthermore, we demonstrate that they have the inherent capability of hard sample mining (Oh Song et al., 2016; Harwood et al., 2017; Wu et al., 2017). Without loss of generality, we use i to represent an arbitrary anchor image, and re-write the two losses as:
Lelim,i = − log exp(zi · zi′/τ)∑
s∈S(i) exp(zi · zs/τ)
, S(i) ≡ {i′, n | n ∈ N (i), yn 6= yi}, and (6)
Lattr,i = 1 |P(i)| ∑ p∈P(i) − log exp(zi · zp/τ)∑ s∈S(i) exp(zi · zs/τ) , { S(i) ≡ {i′, n | n ∈ N (i)} P(i) ≡ {i′, n | n ∈ N (i), yn = yi}.
(7) We then derive the gradient of Lelim,i with regard to the embedding of the anchor image zi:
∂Lelim,i ∂zi = ∂ ∂zi − log exp(zi · zi ′/τ)∑ s∈S(i) exp(zi · zs/τ)
= ∂
∂zi log ∑ s∈S(i) exp(zi · zs/τ)− ∂ ∂zi log(exp(zi · zi′/τ))
= ∑ s∈S(i)  exp(zi · zs/τ)∑ s∈S(i) exp(zi · zs/τ) · zs τ − zi′ τ = ∑
n∈N (i), yn 6=yi
 exp(zi · zn/τ)∑ s∈S(i) exp(zi · zs/τ) · zn τ − 1− exp(zi · zi′/τ)∑ s∈S(i) exp(zi · zs/τ)  · zi′ τ
= ∑
n∈N (i), yn 6=yi
σ−n τ zn − σ+i′ τ zi′ ,
(8)
where
σ−x = exp(zi · zx/τ)∑
s∈S(i) exp(zi · zs/τ)
= sim(zi, zx)∑
s∈S(i) sim(zi · zs)
, and
σ+x = 1− exp(zi · zx/τ)∑
s∈S(i) exp(zi · zs/τ) = 1− sim(zi, zx)∑ s∈S(i) sim(zi · zs)
(9)
are the coefficient terms respectively for the negative or positive sample x.
Next, the gradient of Lattr,i is derived in a similar way:
∂Lattr,i ∂zi = ∂ ∂zi 1 |P(i)| ∑ p∈P(i) − log exp(zi · zp/τ)∑ s∈S(i) exp(zi · zs/τ)
= 1 |P(i)| ∑ p∈P(i)  ∂ ∂zi log ∑ s∈S(i) exp(zi · zs/τ)− ∂ ∂zi log exp(zi · zp/τ)  = 1
|P(i)| ∑ p∈P(i)  ∑ s∈S(i)  exp(zi · zs/τ)∑ s∈S(i) exp(zi · zs/τ) · zs τ − zp τ  = ∑ s∈S(i)  exp(zi · zs/τ)∑ s∈S(i) exp(zi · zs/τ) · zs τ − ∑ p∈P(i) 1 |P(i)| zp τ = ∑
n∈N (i), yn 6=yi
 exp(zi · zn/τ)∑ s∈S(i) exp(zi · zs/τ) · zn τ 
− ∑ p∈P(i)  1|P(i)| − exp(zi · zp/τ)∑ s∈S(i) exp(zi · zs/τ)  · zp τ
= ∑
n∈N (i), yn 6=yi
σ−n τ zn − ∑ p∈P(i) σ+p τ zp,
(10)
where
σ−x = exp(zi · zx/τ)∑
s∈S(i) exp(zi · zs/τ)
= sim(zi, zx)∑
s∈S(i) sim(zi · zs)
, and
σ+x = 1 |P(i)| − exp(zi · zx/τ)∑
s∈S(i) exp(zi · zs/τ)
= 1 |P(i)| − sim(zi, zx)∑
s∈S(i) sim(zi · zs)
.
(11)
Note that the coefficient terms σ+x and σ − x in Equation 9 and 11 are determined by sim(zi, zx). Larger coefficients are given when negative/positive samples are relatively more similar/dissimilar to the anchor. This observation indicates that these two loss functions have the implicit capability of hard sample mining, i.e., focusing on differentiating the “hard negatives” that are near the anchor and attracting the “hard positives” which are far away from the anchor.

heading: B PSEUDO CODE
text: Algorithm 1: Contrastive Learning with Incremental False Negative Detection Input: encoder f , projection head g, training samples X , and number of clusters k
// instance-level contrastive learning at the beginning 1 Initialize completely different pseudo labels y∗ for each sample 2 while Epoch ∈ Training Epoch do
// contrastive learning with false negative elimination 3 for mini-batch I do 4 z = g(f({i ∼ I})) 5 update encoder f and projection head g to minimize Lelim(z, y∗) 6 end 7 if Epoch ∈ Clustering Epoch then // pseudo label assignment 8 v = f({x ∼ X}) 9 c, y = k-means(v, k)
10 κ = sim(z, cy)/ ∑k j=1 sim(z, cj) 11 determine the acceptance rate of the pseudo label as (Epoch / Training Epoch) 12 update pseudo labels y∗ by a part of y with larger κ 13 end 14 end

heading: C PRE-TRAINING AND EVALUATION DETAILS
text: As described in Section 4.1, we use the proposed method to pre-train ResNet-50 (He et al., 2016) on ImageNet (Deng et al., 2009), CIFAR-10, and CIFAR-100 (Krizhevsky et al., 2009). For ImageNet pre-training, we follow the setting of previous work (He et al., 2020; Chen et al., 2020d) that uses SGD optimizer (Kiefer et al., 1952) with a weight decay of 0.0001 and a momentum of 0.9. The learning rate is set to 0.03 initially and then multiplied by 0.1 at 120 and 160 epochs. For CIFAR-10 and CIFAR-100 pre-training, we train the encoder for 1000 epochs with a mini-batch size of 1024. Because of the larger mini-batch size, we implement our framework based on SimCLR (Chen et al., 2020b) structure without maintaining a memory bank for the momentum instance features. We also use SGD optimizer with the same weight decay and momentum. But, we set the initial learning rate to 0.5 and use a linear warm-up strategy for the first 10 epochs. In the rest of the training, we decay the learning rate with the cosine annealing schedule (Loshchilov & Hutter, 2016). For pseudo label assignment, we re-assign the pseudo labels after every 20 training epochs (due to more training epochs and fewer training images) for CIFAR and also use three cluster numbers, {10, 30, 100} for CIFAR-10 and {100, 300, 1000} for CIFAR-100, to hierarchically define semantic concepts. For linear evaluation on ImageNet, we train the classifier (a fully connected layer followed by softmax) with the fixed pre-trained representations for 100 epochs. Following the same hyper-parameter setting used in MoCo v2 (Chen et al., 2020d) and PCL (Li et al., 2021), we optimize the model by SGD optimizer with a batch size of 256, an initial learning rate of 10, a momentum of 0.9, and a weight decay of 0. As for semi-supervised learning, we fine-tune the pre-trained ResNet-50 model and the classifier using the subsets of 1% or 10% ImageNet labeled training data (note that we use the same subsets of ImageNet training data as in SimCLR). The model is trained using SGD optimizer for 20 epochs, a batch size of 256, a momentum of 0.9, and a weight decay of 0.0005. The learning rate for ResNet-50 is 0.01 while the one for the linear classifier is 0.1 (for 10% ImageNet) or 1 (for 1% ImageNet). All learning rates are multiplied by 0.2 at 12nd and 16th epochs.

heading: D HIERARCHICAL CLASS DEFINITION FOR IMAGENET
text: Based on WordNet (Miller, 1998) lexical database, we use the corresponding synset IDs to represent original 1000 classes in ImageNet and recursively trace the “hypernyms” (parent synset) for each class until the coarsest synset, “entity”, in WordNet. Then, we construct the tree structure with entity synset as the root, the synsets of original classes as the leaves, and the relations of hypernym or hyponym as the edges. We then re-define the semantic class with different granularities in different
depths of the tree. In Section 4.3, we employ the datasets defined in Depth = {3, 5, 7, 9, 18}. Here, we show some example images with the semantic classes defined in these depths in Figure 5.
E IN-DEPTH ABLATION COMPARISON WITH PCL
Here, we provide an ablation comparison with PCL (Li et al., 2021) in terms of 1) objective function, 2) pseudo label assignment, 3) numbers of clusters, and 4) confidence estimation. The experimental setup is the same as in Section 4.3. Briefly, we re-implement PCL and our IFND with SimCLR (Chen et al., 2020b) based implementation and evaluate the frameworks on CIFAR-100 (Krizhevsky et al., 2009). The results are reported in Table 7.
Objective function. PCL applies LProtoNCE which includes instance-level infoNCE loss (Gutmann & Hyvärinen, 2010), i.e., Linst, and would suffer from the false negative effect. In contrast, IFND applies Lelim that explicitly eliminates the detected false negatives from negative sample set (as proven in Section 3.3) and performs favorably against LProtoNCE. Pseudo label assignment. For the utilization of clustering indices, PCL uses Step scheme that first warms up the framework by instance-level learning and adopts all indices afterward. On the other hand, IFND progressively includes increasing confident labels, which better fits the gradually well-trained encoder (as demonstrated in Appendix F).
Numbers of clusters. The performance of the PCL approach degrades significantly when the number of clusters becomes smaller while the proposed method is more robust to the number of clusters. It is worth mentioning that with smaller numbers of clusters, PCL performs similarly to the attraction strategy (69.9% versus 70.2% as in Table 6).
Confidence estimation. PCL estimates a single confidence score for the instances within the same cluster. On the contrary, our method computes the confidence score for each individual instance and also refers to the centroids of other clusters for the estimation. As a result, the representation learning with our confidence estimation performs more favorably.

heading: F CLUSTERING QUALITY THROUGH TRAINING PROCESS
text: In this section, we measure the clustering results in different training stages to first verify the claim that the clusterings are comparably unreliable in the early training stages and also study the practical effect of our incremental manner to adopt clustering indices. We compute Normalized Mutual Information (Strehl & Ghosh, 2002) between the ground truth labels and the clustering indices of all training images and plot the results in Figure 6.
We can observe that following the training, the clustering is gradually improved and becomes better to reflect the semantic relationship among images. Hence, for the model that consistently uses all pseudo labels (green line in Figure 6), the earlier inferior labels would disturb the training. In contrast, the proposed model (blue line in Figure 6) progressively applies increasing high-quality labels that can benefit semantic-aware learning and finally achieve both better representation learning and clustering as in Table 6 and Figure 6.
G VISUALIZATION OF EMBEDDING SPACE THROUGH TRAINING PROCESS
In this section, we visualize and compare the embedding spaces learned by four contrastive learning frameworks, including (a) SimCLR (Chen et al., 2020b), (b) IFND (trained by Lelim), (c) IFND (trained by Lattr), and (d) SupCon (Khosla et al., 2020), through the training process in Figure 7. Compared to IFND trained by Lelim, the one trained by Lattr learns the embedding space with more concentrated clusters, which are more similar to SupCon due to using similar attraction objective function. However, during training, the unsupervised clustering would inevitably produce some noisy pseudo labels (as supported by the MTNR in Table 6 being less than 100%). Consequently, the attraction loss may inappropriately pull actual negative samples closer to the anchor. We can then find that although the embedding space in the rightmost of Figure 7(c) shows more concentrated clusters, nonetheless, a cluster is not constituted by the image embeddings of the same semantic
content. Also, as shown in Table 6, the attraction loss leads to inferior representation performance compared to the elimination objective.
For the final proposed method, i.e., IFND trained by Lelim, it learns a similar embedding space as SimCLR in the early stage since the acceptance rate for assigning the pseudo label is still low. Following the training process, with increasing reliable pseudo labels, the proposed framework effectively bridges the instance-level and semantic-aware representation learning and learns a more favorable embedding space against SimCLR.

Review summaries:
This paper deals with the very important topic of “false negatives” in SSL and shows that “false negatives” have a huge impact on performance of SSL methods. One of the most interesting experiments they show is that as they increase the number of classes in the dataset the performance drops more and more. They propose a clustering based method which reduces the  “false negatives” and shows improved performances as compared to other state-of-the-art baselines. 

Briefly, this paper presents a simple yet effective method (i.e., IFND) for self-supervised contrastive learning by effectively handling the false-negative samples. Specifically, the authors propose to cluster samples in the embedding space and assign the cluster indices as pseudo labels in an incremental manner during training. The experimental results are extensive and demonstrate the effectiveness of the proposed method.

The paper proposes incremental false-negative detection (IFND), which has several improvements over prototypical contrastive learning (PCL). The key idea of PCL is to alternatively update (a) the pseudo-labels based on the current encoder and (b) update the encoder based on the current pseudo-labels. However, PCL often converges to the local minima since the bad encoder produces falsy pseudo-labels, further harming the encoder. To tackle the issue, INFD suggests including the confident pseudo-labels while uncertain ones incrementally. IFND consistently improves the PCL in all considered scenarios.