I NCREMENTAL F ALSE N EGATIVE D ETECTION FOR C ONTRASTIVE L EARNING
Anonymous authors
Paper under double-blind review
A BSTRACT
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 signiﬁcant 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.
Speciﬁcally, 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 and pre-trained models will be available to the public.
I NTRODUCTION
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, signiﬁcant 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.
Speciﬁcally, 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 deﬁne 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 containing images with diverse semantic concepts since the probabilities of drawing false negatives are relatively low.
However, as shown in Figure 1, we empirically ﬁnd the opposite results that the performance drops due to training with false negative samples are more signiﬁcant on large-scale datasets with more semantic classes.
These results bring up the issue of the capability of instancelevel contrastive learning when it is applied to datasets with more complex semantic contents.
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, only use a small portion of pseudo labels with higher conﬁdence while treating other samples as individual instances.
In the later training stage, as the pseudo labels becomes more reliable, we dynamically include more conﬁdent labels to detect and remove false negatives and hence, can beneﬁt 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 ﬁnd that such a more aggressive strategy is less tolerant to the noisy pseudo labels and unsuitable to our self-supervised framework.
The main contributions of this paper are summarized as follows:
• We highlight issue of false negative in constrastive learning, especially on the large-scale 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 removes false negatives in an incremental manner 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.
R ELATED W ORK
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 & Hyv¨arinen, 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 signiﬁcant improvement is achieved, instance-level contrastive learning frameworks typically do not take high-level semantics into account.
For example, any two samples in the dataset would be considered as a negative pair and pushed apart by the contrastive loss although some of them are semantically close 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 signiﬁcant 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 ﬁnding 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 the 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 reﬂect 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 both 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 beneﬁted 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 of the 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 sufﬁcient conﬁdence while treating the others as individual instances.
P ROPOSED M ETHOD 3. I NSTANCE -L EVEL C ONTRASTIVE L EARNING
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 2 M 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 (cid:48) , 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:
[Equation]
where z i =
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 ) (cid:107) u (cid:107)(cid:107) v (cid:107) ) 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.
3. I NCREMENTAL F ALSE N EGATIVE D ETECTION
To learn an effective semantic-aware representation with self-supervised contrastive learning, our method explicitly detects and removes the false negative samples. Speciﬁcally, we perform k -means clustering on the features f ( i ) of all training images { i ∈ X} to 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 c k .
The pseudo label y i of the image i is assigned based on the closest centroid, formally y i =
arg min k (cid:107) f
( i ) − c k (cid:107) .
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 learned 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 conﬁdence while treating the other images as individual samples.
For an arbitrary image i , the desired conﬁdence κ i should be larger when the image embedding f ( i ) is not only closer to the centroid of the belonging group, i.e., c yi , but also farther to the other centroids.
To this end, we measure the conﬁdence of an assigned pseudo label by:
[Equation]
which is the softmax of cosine similarities between the image representation and every centroid.
We then only assign a speciﬁc rate (termed as acceptance rate) of pseudo labels with larger conﬁdence.
As plotted in the rest part of Figure 2 (or Figure 3), with the training progressing, 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 signiﬁcant improvement.
Hierarchical semantic deﬁnition.
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 ﬂexibility and robustness of our method, we incorporate hierarchical clustering techniques (Johnson, 1967; Corpet, 1988; Murtagh & Legendre, 2014) into our framework.
In practice, we perform multiple times of k -means with different cluster numbers to deﬁne 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 deﬁned in different levels of granularity.
3. C ONTRASTIVE L EARNING WITHOUT F ALSE N EGATIVE
Given the assigned pseudo labels
[Equation]
our next goal is to revise the objective of instance-level contrastive learning,
i
[Equation]
e., L inst 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:
[Equation]
Second, considering that the anchor and its false negatives are assigned with the same psuedo label
[Equation]
we view the false negatives as additional positive samples:
[Equation]
Behaviors of elimination and attraction strategies.
Compared to the original constrative learning objective L inst , L elim removes the similarities between the anchor and its false negatives from the denominator while on the other hand, L attr 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 z i as:
[Equation]
and
[Equation]
where σ is the weighted coefﬁcient.
The detailed formulation and derivation are in Appendix A.
Based on their gradients in Equation 5, L elim and L attr 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 ) , y n = y i } ) from the negative samples and avoid them being pushed apart from the anchor, L attr 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 L attr with manual label annotations, we ﬁnd L elim 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.
E XPERIMENTS
We validate and analyze our framework on several benchmarks.
Due to the limited resource, 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 efﬁcacy of our proposed method.
4. I MPLEMENTATION D ETAILS
We use ResNet-50 (He et al., 2016) as the encoder, following by a 3-layer MLP as the projection head to obtain 128-D features z .
We apply the proposed method on ImageNet (Deng et al., 2009) and CIFAR (Krizhevsky et al., 2009).
For ImageNet pre-training, we follow the same setting in MoCo v (Chen et al., 2020d) and PCL (Li et al., 2021) for fair comparisons.
Speciﬁcally, 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 samples for contrastive learning in default.
We set the temperature parameter τ to 0 .
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 deﬁne 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 L elim 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.
[Table] [Table]
[Table] [Table]
4. C OMPARISON WITH THE S TATE - OF - THE -A RTS
Linear evaluation and transfer learning on image classiﬁcation benchmarks.
We ﬁrst assess the performance of the image representations after pre-training on ImageNet training set.
We train a
[Table]
linear classiﬁer with the ﬁxed representations as input on three benchmarks: ImageNet (Deng et al., 2009), VOC2007 (Everingham et al., 2010) and Places205 (Zhou et al., 2014) for both linear evaluation and the validation of transfer learning.
We 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 to incrementally detect and explicitly remove the false negatives in contrastive learning.
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 ﬁnetune the pretrained encoder.
The results are shown in Table 2.
IFND outperforms the prior approaches within the similar setup and, notably, when using 1% label, it can achieve more superior performance than
SimCLR trained with 16 times larger batchsize and 5 times more training epochs.
Clustering quality on ImageNet.
We also measure the quality of clustering on the representations pre-training on ImageNet and report the results across ﬁve runs of k -means in Table 3.
Compared to our baseline framework, MoCo v2 (Chen et al., 2020d), the proposed method leverages semanticaware learning that encourages the semantically similar samples concentrating in a cluster and shows a signiﬁcant improvement of 9 . 2% on NMI.
Moreover, IFND achieves the best clustering quality compared to prior deep clustering-based contrastive learning frameworks.
In Appendix F, we further analyze the clusterings on the intermediate embedding spaces during the training process to better study our incremental manner to apply the clustering assignments.
4. E FFECT OF F ALSE N EGATIVE S AMPLES
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 re-deﬁne the semantic classes in different depths of hierarchy.
The dataset deﬁned at a deeper level owns more ﬁner classes.
More details can be found in Appendix D. We then train and perform the linear evaluation for three frameworks on each dataset and report the results in Table 4.
Based on the performance drops of SimCLR compared to SupCon ( ∆ (SupCon, SimCLR) in Table 4), we observe that the adverse effect of false negatives is more signiﬁcant on the datasets with more object categories, although it is less likely to sample false negatives during contrastive learning.
Similar results are observed on both CIFAR and ImageNet.
The results clearly show a critical issue of vanilla instance-level contrastive learning when it is applied to the datasets with more complex semantic concepts.
With the explicit elimination of the detected false negatives, IFND effectively
[Table]
narrows the gap between self-supervised and supervised frameworks, numerically reducing 51 .
7% of the performance gap between SimCLR and SupCon on ImageNet with original labels (Depth 18)
[Table]
4. S TRATEGY FOR F ALSE N EGATIVE D ETECTION AND R EMOVAL
In this section
[Table]
we ﬁrst introduce a novel and 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 5.
More interpretable metric for clustering performance.
In Section 4.2, we use Normalized Mutual Information (Strehl & Ghosh, 2002) to evaluate the clustering results.
However, considering that the pseudo labels are essentially used to detect false negatives, in this section, we propose a more interpretable metric for the quality of clustering: Mean True Positive/Negative Rate (MTPR/MTNR).
To compute MTPR, we ﬁrst evaluate the true positive rate (Fawcett, 2006) for each image, describing “the probability that an actual false negative (i.e., an actual positive) will be detected as a false negative sample”.
MTPR is then deﬁned as the average of true positive rates of all training images.
On the other hand, MTNR indicates the average probability that an actual negative is still treated as a negative sample.
Take an instance-level contrastive learning framework as a toy example, it does not perform false negative detection, so MTNR is 100% but MTPR is 0% .
The goal of the proposed method is to increase MTPR of the clustering while keeping MTNR as high as possible.
Strategies for pseudo label assignment.
First, we compare three schemes to determine the pseudo label acceptance rate, including constant ([b], as in DeepCluster (Caron et al., 2018)), step ([c], as in PCL (Li et al., 2021)) and linear ([g], Ours ).
The linear strategy achieves both higher MTPR and
MTNR compared to the other two strategies.
The results validate that using the clustering indices in an incremental manner can ﬁnd the false negatives more effectively, and further improves the performance of contrastive learning.
Next, we analyze the effect of using different ﬁnal acceptance rates for the linear strategy ([d,e,f,g]).
Intuitively, higher acceptance rates for assigning the pseudo labels indicate more false negatives can be detected (MTPR increases) but more true negatives are also improperly found and removed (MTNR decreases).
However, we ﬁnd that using the 100% ﬁnal acceptance rate ([g]) can averagely detect nearly a half ( 43 . 26% ) 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 classiﬁcation accuracy from 71 .
5% to 74 .
Strategies for false negative removal.
Finally, we compare the elimination and attraction losses ([g,h]).
We ﬁnd that the learned embeddings through minimizing L attr are unstable and more rely on the high quality of pseudo labels at the beginning.
This observation is consistent with the theoretical analysis in Section 3.3 indicating that L attr applies a more aggressive scheme which would even pull the instance embeddings with the same given pseudo labels closer and therefore, would be more sensitive to noisy pseudo labels.
Empirically, we observe that the model supervised by L attr performs even worse than the instance-level learning.
V ISUALIZATION OF E MBEDDING S PACE
In Figure 3, we visualize the learned 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., 100 th epoch), the semantic structure of the embedding space is still under-developed.
Hence, IFND only adopts a little portion of pseudo labels with higher conﬁdence 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 beneﬁt the semantic-aware representation learning.
Finally, we compare the embedding spaces learned through SimCLR (Chen et al., 2020b),
SupCon (Khosla et al., 2020), 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.
C ONCLUSION
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.
A T HEORETICAL A NALYSIS FOR E LIMINATION AND A TTRACTION L OSSES
In this section, we show the derivation of the gradients of two discussed objective functions: elimination loss L elim (Equation 3) and attraction loss L attr (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
[Equation]
we use i to represent an arbitrary anchor image, and re-write the two losses as:
[Equation]
and
[Equation] [Equation]
We then derive the gradient of L elim
[Equation]
i with regard to the embedding of the anchor image z i : ∂ L elim,i
[Equation]
where σ
[Equation]
z
[Equation]
i ·
[Equation]
and
[Equation]
are the coefﬁcient terms respectively for the negative or positive sample x .
Next, the gradient of L attr,i is derived in a similar way:
[Equation]
i
[Equation]
where
[Equation]
and
[Equation]
Note that the coefﬁcient terms σ + x and σ − x in Equation 9 and 11 are determined by sim( z i , z x ) .
Larger coefﬁcients 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 anchors or attracting the “hard positives” which are far away from the anchors.
B
P SEUDO C ODE contrastive in the beginning
// contrastive learning with false negative elimination
end then // pseudo label assignment v = f
( { x ∼ X} ) c , y
= k -means ( v , k ) κ = sim
( z , c y ) / (cid:80) kj =1 sim( z , c j )
14 end
C P RE - TRAINING AND E VALUATION D ETAILS
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 .
The learning rate is set to 0 .
03 initially which is 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 ﬁrst 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 deﬁne semantic concepts.
For linear evaluation on ImageNet, we train the classiﬁer (a fully connected layer followed by softmax) with the ﬁxed pre-trained representations for 100 epochs.
Following the the same hyperparameter 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 the semi-supervised learning, we ﬁne-tune the pre-trained ResNet50 model and the classiﬁer using the subsets of 1% or 10% ImageNet labeled training data (note that we use the same subsets of ImageNet training data as SimCLR (Chen et al., 2020b)).
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 classiﬁer is
.(for 10% ImageNet) or 1 (for 1% ImageNet).
All learning rates are multiplied by 0 .
2 at 12 nd and 16 th epochs.
[Table]
D H IERARCHICAL C LASS D EFINITION FOR I MAGE N ET
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
[Table]
and the relations of hypernym or hyponym as the edges.
We then re-deﬁne the semantic class with different granularities in different depths of the tree.
In Section 4.3, we employ the datasets deﬁned in Depth = { 3, 5, 7, 9, 18 } .
Here, we show some example images with the semantic classes deﬁned in these depths in Figure
[Table]
E I N -D EPTH A BLATION C OMPARISON WITH PCL
Here, we provide an ablation comparison with PCL (Li et al., 2021).
The experimental setup is the same as Section 4.3.
Brieﬂy, 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 6.
Compared to SimCLR, PCL applies L ProtoNCE as the objective function which also uses instancelevel NCE loss (Gutmann & Hyv¨arinen, 2010)
(i.e., L inst ) as the primary supervision but auxiliary with prototypical contrastive loss to concentrate the samples within the same prototype.
In contrast, IFND applies L elim which completely eliminates the detected false negatives from negative sample set (as shown in Section 3.3) and performs favorably against L ProtoNCE .
Additionally, for the adoption of the clustering indices, PCL uses the “step” strategy to warm up the framework by instance-level contrastive learning.
On the contrary, IFND dynamically includes increasing conﬁdent labels which relatively better ﬁts the gradually well-trained encoder and greater clustering quality (as demonstrated in Appendix F).
Finally, with both L elim and linear strategy for pseudo label assignment, IFND outperforms PCL and improves the Top-1 classiﬁcation accuracy from 72 . 8% to 74 .
F C LUSTERING Q UALITY THROUGH T RAINING P ROCESS
In this section, we measure the clustering results in different training stages to ﬁrst 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.
Following the training, we observe that the clustering is gradually improved and becomes better to reﬂect the semantic relationship among images.
Take this effect into consideration, we dynamically adopt increasing high-quality labels which can beneﬁt semantic-aware learning and further lead to a greater clustering in the following stages.
As for the model that consistently applies all assigned pseudo labels, although it can achieve a better clustering in the early stages, however, the earlier inferior labels (compared to the ones generated in the latter stages) instead disturb the training and ﬁnally result in both worse representation learning and clustering as in Table 5 and Figure 6.
G V ISUALIZATION OF E MBEDDING S PACE THROUGH T RAINING P ROCESS
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 L attr ), (c) IFND (trained by L elim ), and (d) SupCon (Khosla et al., 2020), through the training process in Figure 7.
Compared to IFND trained by L elim , the one trained by L attr learns the embedding spaces 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 5 being less than 100% ).
Consequently, the attraction loss may inappropriately pull the true negative samples closer to the anchor.
We can then ﬁnd that although the learned embedding space in the rightmost of Figure 7(b) shows more concentrated clusters, nonetheless, a cluster is not actually constituted by the image embeddings representing the same semantic content.
Also, as shown in Table 5, the attraction loss leads to inferior representation performance compared to the elimination objective.
As for IFND trained by L elim , which is the ﬁnal proposed method, it learns a similar embedding space as SimCLR in the early stage, since the acceptance rate for assigning the pseudo label is still low and the proposed framework behaves like the instance-level contrastive learning (e.g., SimCLR) in earlier processes.
However, with more reliable pseudo labels generated in later stages,
L elim avoids more detected false negatives being pushed apart from the anchor.
Finally, the model effectively bridges the instance-level and semantic-aware representation learning and learns a more favorable embedding space against SimCLR.