Abstract
Hierarchical semantic structures naturally exist in an image dataset, in which several semantically relevant image clusters can be further integrated into a larger cluster with coarser-grained semantics. Capturing such structures with image representations can greatly benefit the semantic understanding on various downstream tasks. Existing contrastive representation learning methods lack such an important model capability. In addition, the negative pairs used in these methods are not guaranteed to be semantically distinct, which could further hamper the structural correctness of learned image representations. To tackle these limitations, we propose a novel contrastive learning framework called Hierarchical Contrastive Selective Coding (HCSC). In this framework, a set of hierarchical prototypes are constructed and also dynamically updated to represent the hierarchical semantic structures underlying the data in the latent space. To make image representations better fit such semantic structures, we employ and further improve conventional instance-wise and prototypical contrastive learning via an elaborate pair selection scheme. This scheme seeks to select more diverse positive pairs with similar semantics and more precise negative pairs with truly distinct semantics. On extensive downstream tasks, we verify the superior performance of HCSC over state-of-the-art contrastive methods, and the effectiveness of major model components is proved by plentiful analytical studies.
Introduction
In self-supervised representation learning, contrastive learning has emerged as a dominant paradigm. The core principle involves pulling together "positive" pairs (different augmentations of the same image) and pushing apart "negative" pairs (randomly sampled images) in a latent space. However, current state-of-the-art methods suffer from two significant limitations:
- The "Flat" World Assumption: Standard methods treat all images as equally distinct. In reality, semantic relationships are nested; a Labrador is semantically closer to a Poodle than to a toaster. Existing models lack the structural awareness to capture these hierarchical relationships.
- The False Negative Problem: Since negative samples are chosen at random, a model may inadvertently push a "Labrador" query away from a "Golden Retriever" negative. This "semantic noise" confuses the model and degrades feature quality.
Methodology: Hierarchical Contrastive Selective Coding
HCSC introduces a structured approach to the latent space by organizing representations into a semantic hierarchy.
Hierarchical Prototypes
Instead of simple image-to-image comparisons, HCSC implements Hierarchical K-means clustering. This process groups images into fine-grained clusters (e.g., specific breeds), which are then aggregated into mid-level clusters (e.g., dogs), and finally into coarse-grained clusters (e.g., mammals). These cluster centers, or "prototypes," are dynamically updated throughout the training process, allowing the model to refine its understanding of the data's inherent structure.
Selective Coding Scheme
The primary innovation of HCSC is its selective coding mechanism, which uses the hierarchy to act as a semantic filter:
- Instance-wise Selection: To mitigate the false negative problem, HCSC calculates the similarity between a query and negative candidates. If a candidate is too similar to the query's current cluster, it is identified as a potential false negative and discarded via a probabilistic Bernoulli sampling process.
- Prototypical Selection: The model contrasts images against the cluster prototypes themselves. By leveraging the tree structure, HCSC ensures it only repels images from clusters that are truly distant in the hierarchy (e.g., repelling a "Dog" from "Furniture" but not necessarily from "Cat").
Experimental Evaluation
The framework was evaluated across several standard benchmarks to test its transferability and representational quality.
- ImageNet-1K: Used for primary pre-training. HCSC achieved 69.2% Top-1 accuracy under linear evaluation (200 epochs), outperforming PCL v2 (67.6%) and MoCo v2 (67.5%). With multi-crop augmentation, performance reached 73.3%.
- Zero-Shot Transfer: On the CUB-200-2011 bird dataset, HCSC achieved 26.9% accuracy, a significant improvement over MoCo v2's 23.1%, demonstrating superior capture of fine-grained semantic details.
- Downstream Tasks: The model showed robust performance on PASCAL VOC and MS COCO for object detection and instance segmentation, as well as Places205 for scene recognition.
Conclusion and Future Work
HCSC demonstrates that incorporating hierarchical priors into contrastive learning leads to more organized and interpretable latent spaces. By prioritizing the quality of negative samples over sheer quantity, the model achieves state-of-the-art results without human labels.
While the hierarchical prototypes currently serve as training "scaffolding," future work may explore utilizing this rich semantic information during inference. Additionally, while the current hierarchy depth is a fixed hyperparameter, future iterations could investigate dynamic hierarchy growth to better adapt to varying data complexities.
Summary updated