Abstract
Traditional image recognition models operate under closed-set assumptions, where all categories are known a priori, or unsupervised settings, where no labels are provided. However, real-world scenarios often involve a mixture of known and unknown categories. This paper discusses Generalized Category Discovery (GCD), a task where a model must categorize a pool of unlabeled data containing both seen and novel classes. We present a method leveraging Vision Transformers (ViTs), contrastive learning, and semi-supervised clustering to address this challenge. Our approach demonstrates significant performance improvements across generic and fine-grained datasets, establishing a new state-of-the-art for open-world recognition.
1. Introduction
In computer vision, supervised learning and unsupervised learning represent two ends of a spectrum. Supervised learning assumes a fixed set of labels, while unsupervised learning seeks structure without guidance. Real-world learning, much like human development, falls in between. An agent may recognize certain objects from prior instruction while simultaneously encountering and needing to categorize entirely new entities.
Generalized Category Discovery (GCD) formalizes this requirement. In this setting, a model is provided with a labeled dataset and a larger unlabeled dataset. Crucially, the unlabeled data contains instances from the labeled classes as well as instances from categories never seen during training. The objective is to correctly categorize all instances in the unlabeled set.
2. Related Work and Problem Definition
GCD bridges the gap between several existing frameworks:
- Semi-Supervised Learning (SSL): Assumes all unlabeled data belongs to the known classes.
- Novel Category Discovery (NCD): Assumes unlabeled data contains only novel classes.
- Open-Set Recognition (OSR): Identifies "unknowns" but does not attempt to cluster them into meaningful new categories.
GCD removes these constraints, requiring the model to perform joint classification (for known classes) and clustering (for novel classes) within a single unlabeled pool.
3. Methodology
The proposed framework moves away from traditional parametric classifiers, which often overfit to labeled data and fail to generalize to unseen categories. Instead, the method relies on representation learning and non-parametric clustering.
3.1 Representation Learning with Vision Transformers
The backbone of the architecture is a Vision Transformer (ViT) pretrained using the DINO self-supervised method. ViTs are particularly suited for this task because their feature space exhibits strong "nearest neighbor" properties, making them naturally conducive to clustering.
3.2 Dual-Contrastive Fine-tuning
To refine the feature space for GCD, the authors employ a dual-loss strategy:
- Unsupervised Contrastive Loss: Applied to all data to maintain a coherent and organized feature manifold.
- Supervised Contrastive Loss: Applied to the labeled subset to pull instances of the same known category closer together, creating distinct "anchors" in the feature space.
3.3 Semi-supervised $k$-means
For final label assignment, a modified $k$-means algorithm is used. This approach utilizes the ground-truth labels of the labeled subset to constrain the clustering process. Labeled instances act as fixed points that guide the formation of clusters, while unlabeled instances are free to either associate with these known clusters or form new ones.
3.4 Estimating the Number of Categories
A significant challenge in GCD is determining the total number of classes ($k$) in the unlabeled data. The authors propose a "black-box" optimization technique: they perform clustering with various values of $k$ and select the value that maximizes accuracy on the labeled portion of the dataset. This proxy-based estimation proves highly effective in practice.
4. Experimental Results
The method was evaluated on generic object datasets (CIFAR-10, CIFAR-100, ImageNet-100) and fine-grained benchmarks (CUB, Stanford Cars, Herbarium19).
- Performance Gains: On the Herbarium19 dataset, the method achieved a ~27% proportional improvement over previous state-of-the-art baselines like RankStats and UNO.
- Accuracy: On CIFAR-100, the model reached 73.0% overall accuracy, compared to a baseline $k$-means performance of 52.0%.
- Estimation Accuracy: The class estimation strategy typically predicted the number of novel categories within a 0-10% margin of error.
5. Discussion: Why ViTs Excel in GCD
Qualitative analysis of the ViT's attention mechanisms reveals that fine-tuning leads to specialized attention heads. For instance, in fine-grained bird classification, specific heads focus on discriminative features like beaks or wing patterns. Since these features are shared across both known and novel species, the model can leverage its supervised knowledge of "parts" to effectively cluster unseen categories. Furthermore, ViTs produce cleaner, more separable clusters than traditional ResNet architectures even before task-specific tuning.
6. Limitations and Conclusion
While GCD represents a significant advancement, several challenges remain. The current model assumes that labeled and unlabeled data share the same domain distribution. It also operates in a static batch setting, requiring re-training for new data arrivals. Future work should explore domain-robust and continual learning versions of GCD.
In conclusion, Generalized Category Discovery provides a more realistic and challenging benchmark for image recognition. By combining the strengths of ViT representations with contrastive learning and semi-supervised clustering, this work provides a robust foundation for models that can truly learn in the "wild."
Summary updated