Contextuality Helps Representation Learning for Generalized Category Discovery

Tingzhang Luo, Mingxuan Du, Jiatao Shi, Xinxiang Chen, Bingchen Zhao, Shaoguang Huang

Abstract

Generalized Category Discovery (GCD) presents a significant challenge in computer vision: identifying both known and novel categories within unlabeled data. Traditional methods often treat images in isolation, leading to suboptimal representation learning for new classes. This paper introduces a dual-context approach that leverages instance-level and cluster-level contextual mining. By incorporating $k$-reciprocal nearest neighbors and prototypical contrastive learning, the proposed method mimics human-like group recognition. Experimental results across eight benchmarks, including CIFAR, ImageNet, and fine-grained datasets like CUB, demonstrate that this context-aware strategy significantly improves classification accuracy, particularly for novel categories.

Introduction

In the evolving landscape of computer vision, "Closed-Set" recognition—where all test categories are seen during training—has reached high levels of maturity. However, real-world scenarios are often "Open-World," requiring models to handle unseen categories. Generalized Category Discovery (GCD) serves as a bridge between these paradigms. In GCD, a model is provided with a small labeled dataset of known categories and a large unlabeled dataset containing both known and entirely novel categories. The goal is to categorize all instances in the unlabeled set.

Existing GCD frameworks typically rely on contrastive learning, focusing on individual image instances and their augmentations. While effective, this approach often ignores the broader context: how an image relates to its neighbors or how groups of images form cohesive clusters. This neglect of contextual relationships can lead to "degraded representation learning," where the model fails to establish clear boundaries for novel categories.

Proposed Method

The authors propose a framework that builds upon the SimGCD baseline by integrating two layers of contextuality: Instance-Level and Cluster-Level Contextual Mining.

Conceptual overview of Instance-Level and Cluster-Level Contextual Mining.

Instance-Level Neighborhood Contextual Mining

Instead of treating each image as an island, the model identifies $k$-reciprocal nearest neighbors. Two data points are considered contextually similar if they are mutual neighbors and share the same pseudo-label. A dedicated loss function ($L_n$) is employed to pull these contextually similar pairs together in the feature space while pushing dissimilar ones apart. This ensures that local neighborhood structures are preserved and leveraged for better feature discrimination.

Cluster-Level Contextual Mining

To provide global stability, the model maintains "prototypes" (centroids) for every discovered category. Through prototypical contrastive learning ($L_c$), the model ensures that the prototype for a category remains consistent across different "views" or augmentations of the data. This group-level consistency acts as a "moving anchor," which is particularly crucial for novel categories that lack ground-truth labels.

Context-Aware Batch Construction

To facilitate effective contextual mining, the authors implement a specific sampling strategy. During training, each mini-batch is constructed by selecting a "query" image and intentionally including its top $k-1$ neighbors. This ensures that the necessary contextual information is present within each batch for the loss functions to operate effectively.

Experimental Results

The proposed method was rigorously evaluated on eight diverse benchmarks, ranging from general image recognition (CIFAR-10/100, ImageNet-100/1K) to fine-grained classification (CUB, Stanford Cars, FGVC-Aircraft, Herbarium 19).

Performance comparison on CIFAR10, CIFAR100, and ImageNet-100 datasets.

As shown in the results, the dual-context approach consistently outperforms state-of-the-art methods. On the CUB dataset, the model achieved an overall accuracy of 64.5%, a substantial improvement over the 60.3% achieved by the SimGCD baseline. On ImageNet-100, it reached 84.6% accuracy, surpassing previous benchmarks by approximately 1.5%.

A key strength of the model is its performance on the "New" (novel) categories. By leveraging the "group effect"—the idea that similar objects appearing in similar contexts likely belong to the same category—the model draws more accurate boundaries around unseen classes. This is further evidenced by its performance on the highly imbalanced Herbarium 19 dataset, where it showed marked improvements in discovering novel plant species despite the long-tail distribution.

Discussion and Insights

The success of this approach highlights several key insights:

  • Human-Centric Categorization: Mimicking the human ability to use context and group relationships provides a powerful inductive bias for discovery tasks.
  • Reliability of Reciprocity: Using $k$-reciprocal neighbors significantly reduces noise compared to simple nearest neighbors, providing more reliable pairs for contrastive learning.
  • Stability via Prototypes: Prototypes provide a necessary global structure that stabilizes the learning process for novel categories, which are otherwise prone to representation drift.

Conclusion

This paper demonstrates that contextuality is a vital component for effective representation learning in Generalized Category Discovery. By mining relationships at both the instance and cluster levels, the proposed model achieves superior performance across a wide array of benchmarks. While the method introduces some computational overhead and sensitivity to hyperparameters like neighborhood size ($k$), it sets a new standard for discovering novel categories in unlabeled data. Future research may focus on refining pseudo-label generation to further reduce noise and enhance the scalability of contextual mining.

Summary updated

BibTeX
@inproceedings{luo2024contextuality,
  author = {Tingzhang Luo and Mingxuan Du and Jiatao Shi and Xinxiang Chen and Bingchen Zhao and Shaoguang Huang},
  title = {{Contextuality Helps Representation Learning for Generalized Category Discovery}},
  booktitle = {ICIP},
  year = {2024},
  doi = {10.1109/icip51287.2024.10647298},
}
Figure