Sharpness-aware Dynamic Anchor Selection for Generalized Category Discovery

Zhimao Peng, Enguang Wang, Fei Yang, Xialei Liu, Ming-Ming Cheng

TL;DR

This paper introduces a novel parametric approach for Generalized Category Discovery (GCD) that directly combats noisy pseudo-labels by flattening the model's loss landscape. By combining a Loss Sharpness Penalty (LSP) with a Dynamic Anchor Selection (DAS) strategy, the method prevents over-fitting to trivial features and establishes highly accurate decision boundaries for novel classes, achieving state-of-the-art performance across multiple benchmarks.

What Problem Does This Paper Address?

In the real world, machine learning models frequently encounter categories they have never seen before. Generalized Category Discovery (GCD) tackles this challenge: given a set of labeled data from "known" classes, the model must cluster an unlabeled dataset that contains a mix of both known and entirely unknown ("novel") classes.

Current state-of-the-art parametric methods rely on self-distillation techniques (like DINO), where a model's sharpened prediction on one view of an image serves as a pseudo-label to guide another view. However, large pre-trained vision models suffer from representation bias—they naturally prefer specific visual patterns. This causes them to latch onto spurious correlations in unlabeled data, generating highly noisy pseudo-labels for novel classes. While previous attempts tried to smooth out this noise after the fact (e.g., using mean-teacher architectures), they failed to prevent the model from overfitting to the noise in the first place.

Comparison of existing post-hoc smoothing methods vs. the proposed direct suppression approach.

Methods

The authors propose a two-pronged framework to directly suppress noise generation during training:

  1. Loss Sharpness Penalty (LSP): Instead of just minimizing standard training loss, LSP introduces a small perturbation to the model's weight parameters to locate the "worst-case" failure scenario (maximizing loss local to the current weights). It then minimizes this worst-case loss. This optimization forces the model to find a flatter region on the loss surface. A flatter loss surface means the model is less sensitive to minor input variations and noise, effectively preventing it from encoding trivial, non-generalizable features.
  2. Dynamic Anchor Selection (DAS): Sharpness penalties can struggle when applied blindly to novel classes because the gradients themselves are computed from noisy pseudo-labels. To stabilize this, DAS identifies highly reliable "anchor points" for novel clusters at the end of each epoch. It uses a K-Nearest Neighbor (KNN) density peak estimation to find the true semantic centers of clusters, filters them by classification confidence, and assigns hard (one-hot) pseudo-labels to these anchors for the next training epoch.
The overall framework of the proposed method, highlighting the interaction between DAS and LSP modules.

Datasets

The method was rigorously evaluated across six diverse image classification datasets, split into labeled and unlabeled subsets:

  • Generic Datasets: CIFAR-100 and ImageNet-100.
  • Fine-Grained Datasets: CUB (birds), Stanford Cars, and FGVC-Aircraft.
  • Long-Tailed Fine-Grained Dataset: Herbarium 19.

Key Insights and Ideas

  • Prevention over Cure: Previous methods like $\mu$GCD and LegoGCD act as "post-hoc" fixes—they smooth noisy predictions but don't stop the model from learning bad habits. Flattening the loss surface via LSP acts as a preventative measure, stopping the network from learning spurious shortcuts.
  • The Synergy of Hard and Soft Labels: While soft pseudo-labels are great for general self-distillation, injecting high-purity hard labels via DAS for cluster anchors calibrates the pre-trained model's feature space much faster, correcting the confidence imbalance between old and new classes.
  • Density Peaks Bypass Overfitting: Simply picking samples with the highest classification confidence as anchors often fails because the model can confidently overfit to noise. By finding the density peak (the geometric center of a cluster in feature space) first, DAS ensures the selected anchors are genuinely representative.

Key Results

The proposed method achieved state-of-the-art results, outperforming both parametric and non-parametric baselines on almost all datasets.

Quantitative clustering accuracy comparison across generic and fine-grained datasets.

Key quantitative highlights include:

  • Generic Benchmarks: Outperformed the baseline SimGCD by 3.5% on CIFAR-100 and 4.1% on ImageNet-100 in overall clustering accuracy ("All" ACC).
  • Fine-Grained Benchmarks: Achieved massive boosts on complex datasets, outperforming SimGCD by 8.7% on CUB and 11.7% on Stanford Cars.
  • Robustness to Class Estimation: Even when the true number of novel classes was unknown and had to be estimated, the method maintained a significant performance edge over competing frameworks.
  • Flatter Minima: Hessian matrix analysis empirically verified that the method successfully converged to a significantly flatter loss landscape compared to standard training.

Limitations and Future Work

While highly effective, the paper notes that the hyperparameter $\beta$ (which dictates the size of the candidate anchor set) requires careful tuning depending on the dataset type. For fine-grained datasets with fewer samples per class, $\beta$ must be set lower to prevent the model from accidentally pulling in noisy samples into the anchor set. Future work could explore automating this thresholding dynamically based on cluster compactness.

Summary updated

BibTeX
@article{peng2026sharpness,
  author = {Zhimao Peng and Enguang Wang and Fei Yang and Xialei Liu and Ming-Ming Cheng},
  title = {{Sharpness-aware Dynamic Anchor Selection for Generalized Category Discovery}},
  journal = {IEEE Transactions on Multimedia},
  year = {2026},
  url = {https://openreview.net/forum?id=TJrg3k8CZm},
}
Figure