Few-shot Novel Category Discovery
Proceedings of the Thirty-Fourth International Joint Conference on Artificial Intelligence. Main Track. Pages 1350-1358.
https://doi.org/10.24963/ijcai.2025/151
Keywords
- Computer Vision: CV: Transfer, low-shot, semi- and un- supervised learning
- Machine Learning: ML: Open-World/Open-Set/OOD Learning
Abstract
The recently proposed Novel Category Discovery (NCD) adapt paradigm of transductive learning hinders its application in more real-world scenarios. In fact, few labeled data in part of new categories can well alleviate this burden, which coincides with the ease that people can label few of new category data. Therefore, this paper presents a new setting in which a trained agent is able to flexibly switch between the tasks of identifying examples of known (labelled) classes and clustering novel (completely unlabeled) classes as the number of query examples increases by leveraging knowledge learned from only a few (handful) support examples. Drawing inspiration from the discovery of novel categories using prior-based clustering algorithms, we introduce a novel framework that further relaxes its assumptions to the real-world open set level by unifying the concept of model adaptability in few-shot learning. We refer to this setting as Few-Shot Novel Category Discovery (FSNCD) and propose Semi-supervised Hierarchical Clustering (SHC) and Uncertainty-aware K-means Clustering (UKC) to examine the model's reasoning capabilities. Extensive experiments and detailed analysis on five commonly used datasets demonstrate that our methods can achieve leading performance levels across different task settings and scenarios. Code is available at: https://github.com/Ashengl/FSNCD.
- [Arthur and Vassilvitskii, 2007] David Arthur and Sergei Vassilvitskii. k-means++: the advantages of careful seed- ing. In Proceedings of the Eighteenth Annual ACM- SIAM Symposium on Discrete Algorithms, SODA '07, page 1027-1035, 2007.
- [Caron et al., 2021] Mathilde Caron, Hugo Touvron, Ishan Misra, Hervé Jégou, Julien Mairal, Piotr Bojanowski, and Armand Joulin. Emerging properties in self-supervised vi- sion transformers. In Proceedings of the IEEE/CVF in- ternational conference on computer vision, pages 9650- 9660, 2021.
- [Chapelle et al., 2009] O. Chapelle, B. Scholkopf, and A. Zien, Eds. Semi-supervised learning. IEEE Transac- tions on Neural Networks, 20(3):542-542, 2009.
- [Chen et al., 2019] Wei-Yu Chen, Yen-Cheng Liu, Zsolt Kira, Yu-Chiang Wang, and Jia-Bin Huang. A closer look at few-shot classification. In International Conference on Learning Representations, 2019.
- [Dhillon et al., 2020] Guneet Singh Dhillon, Pratik Chaud- hari, Avinash Ravichandran, and Stefano Soatto. A base- line for few-shot image classification. In International Conference on Learning Representations, 2020.
- [Dosovitskiy et al., 2021] Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Min- derer, Georg Heigold, and Sylvain Gelly. An image is worth 16x16 words: Transformers for image recognition at scale. In International Conference on Learning Repre- sentations, 2021.
- [Du et al., 2023] Ruoyi Du, Dongliang Chang, Kongming Liang, Timothy Hospedales, Yi-Zhe Song, and Zhanyu Ma. On-the-fly category discovery. In IEEE/CVF Interna- tional Conference on Computer Vision and Pattern Recog- nition (CVPR), 2023.
- [Fei-Fei et al., 2006] Li Fei-Fei, Robert Fergus, and Pietro Perona. One-shot learning of object categories. IEEE transactions on pattern analysis and machine intelligence, 28(4):594-611, 2006.
- [Finn et al., 2017] Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-agnostic meta-learning for fast adaptation of deep networks. In International conference on machine learning, pages 1126-1135. PMLR, 2017.
- [Grandvalet and Bengio, 2004] Yves Grandvalet and Yoshua Bengio. Semi-supervised learning by entropy minimiza- tion. In Proceedings of the 17th International Conference on Neural Information Processing Systems, page 529-536, 2004.
- [Han et al., 2020] Kai Han, Sylvestre-Alvise Rebuffi, Se- bastien Ehrhardt, Andrea Vedaldi, and Andrew Zisserman. Automatically discovering and learning new visual cate- gories with ranking statistics. In International Conference on Learning Representations, 2020.
- [He et al., 2016] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recog- nition. In Proceedings of the IEEE Conference on Com- puter Vision and Pattern Recognition (CVPR), pages 770- 778, 2016.
- [He et al., 2022] Kaiming He, Xinlei Chen, Saining Xie, Yanghao Li, Piotr Dollár, and Ross Girshick. Masked au- toencoders are scalable vision learners. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pat- tern Recognition, pages 15979-15988, 2022.
- [Jeong et al., 2021] Minki Jeong, Seokeon Choi, and Chang- ick Kim. Few-shot open-set recognition by transforma- tion consistency. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 12561- 12570, 2021.
- [Jiang et al., 2024] Bingbing Jiang, Xingyu Wu, Xiren Zhou, Yi Liu, Anthony G. Cohn, Weiguo Sheng, and Huanhuan Chen. Semi-supervised multiview feature selection with adaptive graph learning. IEEE Transactions on Neural Networks and Learning Systems, 35(3):3615-3629, 2024.
- [Khosla et al., 2020] Prannay Khosla, Piotr Teterwak, Chen Wang, Aaron Sarna, Yonglong Tian, Phillip Isola, Aaron Maschinot, Ce Liu, and Dilip Krishnan. Supervised con- trastive learning. In Advances in neural information pro- cessing systems, volume 33, pages 18661-18673, 2020.
- [Koch et al., 2015] Gregory Koch, Richard Zemel, Ruslan Salakhutdinov, et al. Siamese neural networks for one- shot image recognition. In ICML deep learning workshop, volume 2, 2015.
- [Krause et al., 2013] Jonathan Krause, Michael Stark, Jia Deng, and Li Fei-Fei. 3d object representations for fine- grained categorization. In Proceedings of the IEEE inter- national conference on computer vision workshops, pages 554-561, 2013.
- [Krizhevsky et al., 2009] Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny im- ages. Technical report, Univeristy of Toronto, 2009.
- [Krizhevsky et al., 2012] Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. In Advances in neural in- formation processing systems, 2012.
- [Lee and others, 2013] Dong-Hyun Lee et al. Pseudo-label: The simple and efficient semi-supervised learning method for deep neural networks. In Workshop on challenges in representation learning, page 896, 2013.
- [Li et al., 2023] Wenbin Li, Ziyi Wang, Xuesong Yang, Chuanqi Dong, Pinzhuo Tian, Tiexin Qin, Jing Huo, Yinghuan Shi, Lei Wang, Yang Gao, et al. Libfewshot: A comprehensive library for few-shot learning. IEEE Trans- actions on Pattern Analysis and Machine Intelligence, 2023.
- [Liu and Tuytelaars, 2023] Yu Liu and Tinne Tuytelaars. Residual tuning: Toward novel category discovery with- out labels. IEEE Transactions on Neural Networks and Learning Systems, 34(10):7271-7285, 2023.
- [Liu et al., 2020] Bo Liu, Hao Kang, Haoxiang Li, Gang Hua, and Nuno Vasconcelos. Few-shot open-set recogni- tion using meta-learning. In Proceedings of the IEEE con- ference on computer vision and pattern recognition, pages 8795-8804, 2020.
- [Madani et al., 2018] Ali Madani, Mehdi Moradi, Alexan- dros Karargyris, and Tanveer Syeda-Mahmood. Semi- supervised learning with generative adversarial networks for chest x-ray classification with ability of data domain adaptation. In 2018 IEEE 15th International Symposium on Biomedical Imaging (ISBI 2018), pages 1038-1042, 2018.
- [Ravi and Larochelle, 2016] Sachin Ravi and Hugo Larochelle. Optimization as a model for few-shot learning. In International conference on learning representations, 2016.
- [Reed et al., 2016] Scott Reed, Zeynep Akata, Honglak Lee, and Bernt Schiele. Learning deep representations of fine- grained visual descriptions. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 49-58, 2016.
- [Rizve et al., 2022] Mamshad Nayeem Rizve, Navid Kar- dan, Salman Khan, Fahad Shahbaz Khan, and Mubarak Shah. Openldn: Learning to discover novel classes for open-world semi-supervised learning. In European Con- ference on Computer Vision, pages 382-401, 2022.
- [Roy et al., 2022] Subhankar Roy, Mingxuan Liu, Zhun Zhong, Nicu Sebe, and Elisa Ricci. Class-incremental novel class discovery. In European Conference on Com- puter Vision, pages 317-333, 2022.
- [Snell et al., 2017] Jake Snell, Kevin Swersky, and Richard Zemel. Prototypical networks for few-shot learning. In Advances in neural information processing systems, vol- ume 30, 2017.
- [Sung et al., 2018] Flood Sung, Yongxin Yang, Li Zhang, Tao Xiang, Philip HS Torr, and Timothy M Hospedales. Learning to compare: Relation network for few-shot learn- ing. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 1199-1208, 2018.
- [Tarvainen and Valpola, 2017] Antti Tarvainen and Harri Valpola. Mean teachers are better role models: Weight- averaged consistency targets improve semi-supervised deep learning results. In Advances in neural information processing systems, volume 30, 2017.
- [Tian and Xie, 2023] Pinzhuo Tian and Shaorong Xie. An adversarial meta-training framework for cross-domain few-shot learning. IEEE Transactions on Multimedia, 25:6881-6891, 2023.
- [Vaze et al., 2022a] Sagar Vaze, Kai Han, Andrea Vedaldi, and Andrew Zisserman. Generalized category discov- ery. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 7492-7501, June 2022.
- [Vaze et al., 2022b] Sagar Vaze, Kai Han, Andrea Vedaldi, and Andrew Zisserman. Open-set recognition: a good closed-set classifier is all you need? In International Con- ference on Learning Representations, 2022.
- [Vinyals et al., 2016] Oriol Vinyals, Charles Blundell, Timo- thy Lillicrap, Daan Wierstra, et al. Matching networks for one shot learning. Advances in neural information pro- cessing systems, 29, 2016.
- [Wen et al., 2023] Xin Wen, Bingchen Zhao, and Xiaojuan Qi. Parametric classification for generalized category dis- covery: A baseline study. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), pages 16590-16600, 2023.
- [Xu et al., 2024] Jian Xu, Bo Liu, and Yanshan Xiao. A multitask latent feature augmentation method for few-shot learning. IEEE Transactions on Neural Networks and Learning Systems, 35(5):6976-6990, 2024.
- [Yang et al., 2023] Xiangli Yang, Zixing Song, Irwin King, and Zenglin Xu. A survey on deep semi-supervised learn- ing. IEEE Transactions on Knowledge and Data Engineer- ing, 35(9):8934-8954, 2023.
- [Yang et al., 2024] Xihong Yang, Xiaochang Hu, Sihang Zhou, Xinwang Liu, and En Zhu. Interpolation-based con- trastive learning for few-label semi-supervised learning. IEEE Transactions on Neural Networks and Learning Sys- tems, 35(2):2054-2065, 2024.
- [Zhao et al., 2022] Yuyang Zhao, Zhun Zhong, Nicu Sebe, and Gim Hee Lee. Novel class discovery in semantic seg- mentation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 4340- 4349, 2022.
- [Zhong et al., 2023] Xian Zhong, Cheng Gu, Mang Ye, Wenxin Huang, and Chia-Wen Lin. Graph complemented latent representation for few-shot image classification. IEEE Transactions on Multimedia, 25:1979-1990, 2023.
- [Zhou, 2008] Zhi-Hua Zhou. Semi-supervised learning by disagreement. In IEEE International Conference on Gran- ular Computing, pages 93-93, 2008.
- [Zhu et al., 2023] Meiqi Zhu, Xiao Wang, Chuan Shi, Yibo Li, and Junping Du. Towards adaptive information fusion in graph convolutional networks. IEEE Transactions on Knowledge and Data Engineering, 35(12):13055-13069, 2023.
References were extracted automatically from the PDF and may contain errors.
Full text extracted automatically from the PDF; figures, tables and equations may differ. The PDF is the version of record.
1 Introduction
Most deep learning methods [He et al., 2016; He et al., 2022; Dosovitskiy et al., 2021] aim to excel in supervised learning, where models assign labels to test samples using knowledge from training. However, this approach poorly reflects real-world scenarios, where unlabelled data may include both known and novel classes. Few-shot Learning (FSL) [Finn et al., 2017; Sung et al., 2018; Fei-Fei et al., 2006; Vinyals et al., 2016; Li et al., 2023] addresses this by mimicking human ability to learn from limited examples. Despite its potential, FSL has a critical drawback: if not all categories are annotated, it forces classification of unseen classes into existing ones, contradicting open-world reasoning.
∗Corresponding Author.
The advent of Novel Category Discovery (NCD) [Rizve et al., 2022] and Generalized Category Discovery (GCD) [Vaze et al., 2022a] lifts the learning agent to a new level, where the novel examples are allowed to be grouped into a few clusters based on their inherent characteristics. Notwithstanding, the key of these two tasks will degenerate into solving a cross-domain clustering problem if unlabelled data are not presented. A recent research, On-the-fly Category Discovery (OCD) [Du et al., 2023] was proposed to mitigate the limitation of transductive learning involved in NCD and GCD by determining novel classes according to the values derived from decoupling features into symbolic features and absolute features. However, the over-relaxed constraints imposed on the hash encoding for novel classes lead to a phenomenon in which a higher number of clusters formed than initial expectation.
To enhance the adaptability of learning agent to real-world scenarios, we adapt the assumptions and training strategies in NCD. Similar to FSL, we ensure no overlap between training and test label spaces, and the test set's query label space extends beyond the support set to include novel categories. Unlike semi-supervised strategies in NCD [Rizve et al., 2022] and GCD [Vaze et al., 2022a], we adopt episodic metalearning to better evaluate the model's adaptability to new tasks.
We call this new problem Few-Shot Novel Category Discovery (FSNCD), and it is intersected conception at the FSL [Fei-Fei et al., 2006] and NCD [Rizve et al., 2022], empowering a learning agent with the capability to be inductively adaptive to the discovery of both novel classes and clusters. The key setting of this problem is illustrated in Fig. 1, and it builds upon the existing setting of NCD [Rizve et al., 2022] which was introduced to cluster novel classes by hints of both labelled and unlabelled data. This scenario assumes that a learning agent can both extract features from labeled data and learn patterns from unlabeled data. Our proposed setting challenges this by restricting access to unlabeled data, focusing instead on enhancing the model's adaptability and plasticity to improve generalization.
FSNCD leverages a DINO [Caron et al., 2021] pre-trained ViT-B [Dosovitskiy et al., 2021] model, differing from traditional few-shot learning by tackling novel category discovery, which involves clustering novel classes rather than simple detection. We introduce a hierarchical clustering method with a stopping criterion based on inter-class distances of visible classes, addressing bias from excessive novel categories through balanced sparsity. Additionally, an improved Kmeans algorithm incorporates uncertainty clustering to handle distributions. Unlike existing methods reliant on prior category counts, our approach restructures K-means and hierarchical clustering to flexibly estimate category numbers in few-shot settings, facilitating the discovery of new categories. To sum up, our contributions are as follows:

- We propose a new task setting named Few-Shot Novel Category Discovery (FSNCD). It unifies few-shot learning and Novel Category Discovery, realising a selectivity between tasks of identifying examples from labelled classes in a real-time inference manner and clustering novel classes as the query examples increase.
- We introduce two clustering algorithms as baseline methods: Semi-supervised Hierarchical Clustering (SHC) and Uncertainty-aware K-means Clustering (UKC). Both approaches take into account the specific features required to address the complexities of open-set recognition, extending beyond conventional data clustering techniques.
- We conducted experiments on five datasets, analyzing and elucidating the viability of the proposed new setting.
2 RelatedWork
2.1 Semi-Supervised Learning
In traditional supervised learning, we need a large amount of labeled data to train the model [Chapelle et al., 2009; Yang et al., 2023]. To address the problem of insufficient labeled samples, semi-supervised learning is proposed to utilize labeled and unlabeled data to improve model performance with limited labeled data [Grandvalet and Bengio, 2004; Zhou, 2008; Jiang et al., 2024; Yang et al., 2024]. The most intuitive approach is perhaps Pseudo-Labels selftraining [Lee and others, 2013], where a model trained on labeled data generates categorical pseudo-labels for the unlabeled examples. SSL techniques often utilize unlabeled data in various ways, such as employing strategies like consistency regularization [Tarvainen and Valpola, 2017], generative model based methods [Madani et al., 2018], or graph based method [Zhu et al., 2023].
2.2 Novel Category Discovery
Novel Category Discovery (NCD) addresses limited labeled data by leveraging unlabeled samples for automatic classification. Pioneered by DTC [Rizve et al., 2022], the field has expanded with methods like AutoNovel [Han et al., 2020], which combines self-supervised pretraining with pseudo-label generation via ranking. Recent extensions include Novel Category Discovery in semantic segmentation [Zhao et al., 2022], incremental learning frameworks [Liu and Tuytelaars, 2023; Roy et al., 2022], and Generalized Category Discovery (GCD) [Vaze et al., 2022a] that jointly identifies known/novel categories. SimGCD [Wen et al., 2023] enhances GCD with parametric classification, while OCD [Du et al., 2023] introduces real-time hash coding for efficient novel class detection. These advances demonstrate NCD's growing versatility in handling diverse real-world scenarios.
2.3 Few-Shot Learning
Few-shot learning (FSL) is a method used to address the issue of limited sample size [Fei-Fei et al., 2006; Finn et al., 2017; Snell et al., 2017; Xu et al., 2024; Zhong et al., 2023]. It aims to learn an effective classification model from a few labeled training examples. There are two main types of FSL methods: meta-learning-based [Finn et al., 2017; Ravi and Larochelle, 2016; Tian and Xie, 2023] and metriclearning-based approaches [Snell et al., 2017; Koch et al., 2015]. Additionally, some methods employ a Non-episodicbased strategy [Chen et al., 2019; Dhillon et al., 2020], i.e., fine-tuning a pre-trained model at test time. Although current methods for Few-shot Open-set Recognition [Liu et al., 2020; Jeong et al., 2021] are capable of detecting out-of-distribution samples, they lack the ability to cluster or classify these outof-distribution samples.
| Method | Training | Test | Transferring Manner | Support | Query |
|---|---|---|---|---|---|
| SSL | Y L ∪ Y L† Y L ∪ Y U† | Y L | Inductive | - | - |
| NCD | - | Transductive | - | - | |
| GCD | Y L ∪Y U† ∪Y L† | - | Transductive | - | - |
| FSL | Y L | Y U | Inductive | Y S | Y S |
| FSNCD | Y L | Y U | Inductive | Y S | Y S ∪Y N |
3 Few-Shot Novel Category Discovery
3.1 ProblemDefinition
NCD: The training data for NCD is provided in two distinct sets, including a labelled set DL = {(xli , yl i )}Ni=1 and an unlabeled set DU = {xui }Mi=1 , where an instance is denoted as xli or xui depending on which set the data is derived from, yl i ∈ Y L = {1, . . . ,C L} is the corresponding class label of DL and Y U is the label space of DU . The goal is to train a model on both DL and DU , and then aggregate DU into C U clusters that are associated with Y U = {1, . . . ,C U} where Y L ∩Y U = ∅. GCD further relaxes the assumptions of NCD, with an emphasis on identifying both labelled data and novel categories, where the label space of DU changes to Y L ∪ Y U instead of Y U .
FSL: In FSL, a dataset D is usually partitioned into two sets, the training set containing base classes DBase and the test set containing novel classes DNovel . It creates N training tasks T = {T1, . . . , TN} to assemble a finite set of training episodes where each training task Tn consists of different classes, represented by Tn =< S,Q >, where S and Q denote examples chosen from the support set and query set, respectively. During testing, the model receives new tasks with the novel classes which have no overlap with those encountered during training.
FSNCD: We approach Few-Shot Novel Category Discovery as a scenario where the dataset is organized under the setting defined in FSL with training set containing base classes DBase and the test set containing novel classes DNovel . However, an episode in FSNCD contains a query set Q = {(xq , yq )} ∈ X ×Y Q , and a support set S = {(xsl , ys l )}NK l=1 ∈ X × Y S of K image-label pairs for each N classes, referring to an N-way K-shot setting. However, the label space in FSNCD is defined as Y Q = Y S ∪ Y N rather than Y Q = Y S as defined in standard FSL. The primary objective for the learning agent therefore is to identify examples of categories in Y S while discovering unknown categories in Y N .
The characteristics of the proposed setting are summarised in Table 1 and Fig. 1. SSL is an inductive approach leveraging both labeled and unlabeled data within the same label space for test set classification. GCD relaxes the closedset assumption, allowing the label space of unlabeled data to encompass that of labeled data, following a transductive paradigm. Transitioning from NCD and GCD to FSL introduces FSNCD, which combines few-shot classification with the discovery of novel categories. A key distinction between FSNCD and traditional FSL is that in the testing phase of FSNCD, certain samples may not match any of the support categories. Unlike Few-Shot Open Set Recognition (FSOSR), which only detects outliers, FSNCD requires models to detect and accurately cluster these outliers. Additionally, in contrast to open-world recognition, categories appearing in testing phase of FSNCD are not seen during training, though a limited number of samples are provided during testing.
3.2 Training of FSNCD
The training procedure for a learning agent in FSNCD is divided into two consecutive phases: representation learning and classifier construction. For the former phase, the learning model is dedicated to training a feature extractor F and a projection head ϕ, ϕ ◦ F : X → Z, with Z signifying the embedding space generated from input images X via ϕ ◦ F. The latter phase is responsible for constructing a classifier capable of recognizing query examples and discovering novel categories. An overview of our approach is demonstrated in Fig. 2. A detailed explanation of each phase will be presented in the sequel below.
Phase 1: Representation Learning Given that the training process only involves the use of labelled data, the supervised contrastive learning loss [Khosla et al., 2020] is employed to learn more distinctive features for samples belonging to the same category and different categories within each batch. This mitigates the impact of using standard cross-entropy loss for prototype matching which is classification-prone rather than concentrating on the more critical clustering task, and avoids the occurrence of the visible-class bias described in ProtoNet [Snell et al., 2017]. Specifically, given an input image x, it uses the feature extractor F (x), together with a multilayer perceptron (MLP) projection ϕ to extract the feature embeddings z, denoted as z = ϕ (F (x)). Formally,
where N(i) signifies the images belonging to the same category as the input image xi in an episode, where I is an indicator function evaluating to 1 iff n ̸= i.
Phase 2: Classifier Construction Using the previously learned representations, the next task is to construct classifiers with the ability to classify query samples into known classes or group a set of examples into new categories. Due to our aim to propose solutions addressing more realistic problems, the varying number of novel categories and the uncertain number of samples per novel category make it hard to construct a fixed-parameterized classifier. Thus, two clustering algorithms, Semi-supervised Hierarchical Clustering (SHC) and Uncertainty-aware K-means Clustering (UKC), are specifically designed for FSNCD scenarios, enhancing data grouping in open-set scenarios by aligning more closely with their inherent properties.
Semi-Supervised Hierarchical Clustering. Hierarchical clustering is one of the most commonly used approaches for grouping data, distinguished by its ability to determine the number of clusters with no need to pre-specify the number of clusters. Grouped clusters that are visually represented in a hierarchical tree called a dendrogram whose structural characteristics are the key to achieving optimal clustering. However, it is always a challenge in practice to determine the best criteria to end the accumulation or division during clustering.

To tackle this issue, we tend to make the most of the information represented by features extracted from the support set which are capable of explicitly characterizing discrepancies between multiple class prototypes. The idea behind this is that hierarchical clustering should cease as chosen prototypes that originate from different classes are merged. Concretely, we introduce an agglomerative hierarchical clustering approach, inspired by the Unweighted Pair Group Method with Arithmetic Mean (UPGMA) where the closest clusters are combined into a higher-level cluster at each step. For each step, the distance between any two clusters Ci and Cj is calculated by averaging the distance between elements within the cluster, expressed by,
where d(∗, ∗) denotes the distance function. In each iteration, the two clusters with the shortest distance are merged, and the clustering between all clusters is updated by,
The proposed clustering aims at merging the most similar classes according to the adopted cosine metric and triggers iteration termination until two different class prototypes are grouped. Furthermore, clustering is conditioned on the number of query samples, i.e., it will be considered a potential cluster P only if the amount of included samples exceeds a certain value, in which case the remaining clusters are designated as R. Moreover, in case there are support prototypes that are not assigned to any cluster, they will be incorporated into the potential class P at the end. With the available class prototypes of the potential classes, the remaining samples will be classified, demonstrating a flexible method of classifying or clustering query samples, called semi-supervised hierarchical clustering.
Uncertainty-Aware K-means Clustering. K-means clustering is an effective method to iteratively partition a certain number of data observations into K clusters, but the need for the pre-specified number of clusters always hinders its generalization to scenarios full of uncertainty. The adoption of Kmeans on synthetic experimental datasets is based on a prior on how human perception of the K values, which is unrealistic when dealing with real-world tasks where such values are difficult to determine. In addition to the heavy reliance on prior knowledge, the performance of standard K-means clustering strongly depends on the choice of the initialized cluster centroids, which is another uncertainty that needs to be addressed. K-means++ [Arthur and Vassilvitskii, 2007] presents a stepwise selection of cluster centers, primarily motivated by the idea that samples farther away from other cluster centers are more likely to be selected as the next cluster center. However, the initial number of categories is still an indispensable prior information.
We introduce a new strategy that builds on the assumption that when clustering is performed in the proposed FSNCD setting, both support and query examples lie in a uniform, high-dimensional feature space, and the uncertainty estimates of this space facilitate the choice of the number of centroids implied by novel categories. Specifically, we consider that the features of prototypes and query examples are located in a shared space, denoted by z, and represent standard K-means as K-means (·, ·, ·), then the corresponding potential cluster P can be achieved by,
where n is number of categories initialized with |YS|, c denotes the centroids and is initialized randomly. As the iteration k increases, the average quantity is calculated based on the previous clustering results, denoted as m = 1 |P k | ∑|P k | i=1 ∣∣P k i ∣∣. The estimation of the number of categories is then transformed into an acceptance criterion for a particular class in P k i that surpasses the average quantitym, denoted as α. We then need to split all potential classes where each class is assigned a category count by,
where δ(·) denotes the way to estimate the number of supported prototypes in a specific cluster, and µ(·) denotes the calculation of the number of query samples in Pi. Through regrouping the samples of each class into nP k i clusters, it yields
the centroid ck = [ck1 , ..., cknPk ], where nP k = ∑|P k | i=1 nP k i signifies each split in P k that serves as the initialization points for the next iteration denoted as,
The above iteration will terminate when the conditions max δ(Pi) = 1 and maxµ(P) < αm are satisfied simultaneously, which also guarantees convergence under the previously mentioned assumption. Moreover, choosing an appropriate acceptance threshold for this clustering approach facilitates the optimal proficiency to discover novel categories. It is worth noting that when α → +∞, this method will degenerate to continuously split the potential classes by δ(Pi) ≥ 2, which will undoubtedly lead to biases towards classes of existing support sets.
3.3 Scalable Clustering
Compared to the UKC which is an evolution from standard K-means clustering, the proposed SHC exhibits relatively high computational complexity and memory usage due to its need to calculate and store distances between all pairs of data points, which grows exponentially with the size of the largescale dataset, rendering it both computationally demanding and memory-intensive.
To mitigate the impact of the aforementioned issues, we employ a two-step strategy. In the first step, we randomly sample a smaller subset from the entire dataset, which is assumed to be representative since its distribution is consistent with that of the overall data distribution. The subsequent use of hierarchical clustering on this representative subset yields a set of potential clusters that can be viewed as initial prototypes. In the next step, these established prototypes serve as reference points for classifying the remaining data. Specifically, each data point will be merge to the tree which prototype is closest to it in the shared feature space. This strategy enables hierarchical clustering to be applied at scale, but its performance is influenced by the randomness of sampling and the quality of the initial clustering.
4 Experiments
4.1 Experimental Setup
Datasets. We evaluate our methods on two well-known large-scale datasets: CIFAR-100 [Krizhevsky et al., 2009] and ImageNet-100 [Krizhevsky et al., 2012], as well as two fine-grained datasets, including CUB-200 [Reed et al., 2016] and Stanford Cars [Krause et al., 2013]. Each dataset is split into two sets: labeled data is used to train the model, and unlabeled data is used for testing. SSB (Semantic Shift Benchmark) [Vaze et al., 2022b] provides a detailed evaluation dataset that includes precise "semantic change axes" and provides classifications for DU and DL in a semantically coherent manner. Statistics on the partitioning of adopted datasets are presented in Table 2.
| C100 | I-100 | CUB | Cars | Aircraft | ||
|---|---|---|---|---|---|---|
| Training | |Y Base | | 50 | 50 | 100 | 98 | 50 |
| |DBase | | 25k | 65k | 3k | 6.5k | 4.4k | |
| Test | |Y Novel | | 50 | 50 | 100 | 98 | 50 |
| |DNovel | | 25k | 65k | 3k | 8.1k | 4.4k |
Settings. Wemainly report results obtainedwith two different settings: 5-way 5-shot (5w5s) and 5-way 1-shot (5w1s). For better comparison, we set the number of new classes to 5 for both configurations (5n), denoted as nnew, with each class containing 15 images as the query set. Moreover, we initialize a real-time inference evaluation scenarios, which are in line with the objectives enabling the agent to freely switch between categorizing known and clustering novel classes. It is worth noting that for the real-time inference scenario, only one image from an individual class is allowed in the query set per episode.
A vision transformer [Dosovitskiy et al., 2021] (ViT-B-16) pre-trained on ImageNet [Krizhevsky et al., 2012] with DINO [Caron et al., 2021] is used for the feature extraction. Specifically, the outputs of [CLS] token are treated as feature representation which is different from the use of a projection head that has the potential to introduce more biases. The initial learning rate is set to 0.01.
Evaluation Protocol. We assess the performance of the proposed new setting by measuring the accuracies of three folders, they are visible, new classes and overall precision. Concretely, it uses ˆ YAll, ˆ YOld and ˆ YNew = ˆ YAll \ ˆ YOld to represent the predictions of examples from all, support set and new classes, respectively. Then, the metric for assessing new classes, commonly employed in the GCD approach, has been adapted to suit the FSNCD context. Formally,
where MNew = | ˆ YNew|, and P( ˆ YNew) defines how the predicted labels for test samples are matched to the true labels. This matching is achieved by using the Hungarian algorithm which identifies the permutation that minimizes the mismatch between predicted and true labels.
Instead of directly comparing all predictions to the ground truth like GCD, we adopt a different approach. More specifically, we filter out samples from the same class as the support prototypes and then measure the matches between the predicted labels and prototypes by
| CIFAR-100 | ImageNet-100 | CUB-200 | StanfordCars | FGVC-Aircraft | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Methods | All | Old | New | All | Old | New | All | Old | New | All | Old | New | All | Old | New |
| ProtoNet [Snell et al., 2017] RankStat [Han et al., 2020] SimGCD [Wen et al., 2023] OCD [Du et al., 2023] | 48.1 | 96.2 | - | 47.7 | 95.4 | - | 48.5 | 97.0 | - | 42.9 | 85.8 | - | 43.9 | 87.7 | - |
| 43.6 | 64.2 | 23.0 | 41.1 | 59.1 | 23.1 | 49.8 | 73.5 | 26.1 | 39.4 | 57.8 | 21.1 | 43.5 | 65.6 | 21.3 | |
| 34.6 | 33.5 | 35.7 | 31.1 | 30.9 | 31.3 | 25.1 | 24.9 | 25.4 | 17.1 | 16.2 | 18.0 | 19.2 | 17.6 | 20.8 | |
| 5way-5shot | 45.9 | 46.1 | 45.6 | 13.5 | 0.1 | 26.9 | 44.9 | 42.5 | 47.2 | 37.3 | 34.5 | 40.1 | 44.9 | 45.7 | 44.1 |
| GCD [Vaze et al., 2022a] | 63.8 | 92.7 | 34.7 | 62.9 | 91.9 | 33.9 | 68.7 | 95.0 | 42.5 | 48.2 | 78.6 | 17.8 | 50.0 | 80.5 | 19.5 |
| FSNCD (SHC) | 73.2 | 90.7 | 55.8 | 74.1 | 91.5 | 56.7 | 73.6 | 94.5 | 52.6 | 50.3 | 64.7 | 35.9 | 51.0 | 71.2 | 30.8 |
| FSNCD (UKC) | 84.3 | 90.9 | 77.8 | 84.4 | 87.5 | 81.4 | 85.8 | 92.5 | 79.1 | 48.8 | 57.2 | 40.3 | 49.5 | 57.3 | 41.8 |
| ProtoNet [Snell et al., 2017] | 43.9 | 87.8 | - | 42.6 | 85.2 | - | 45.3 | 90.7 | - | 33.0 | 66.0 | - | 35.5 | 71.0 | - |
| RankStat [Han et al., 2020] | 35.2 | 46.5 | 23.8 | 33.8 | 43.9 | 23.6 | 42.7 | 59.8 | 25.7 | 29.3 | 37.6 | 21.0 | 32.9 | 43.5 | 22.3 |
| SimGCD [Wen et al., 2023] | 34.3 | 32.5 | 36.1 | 31.2 | 29.5 | 32.9 | 25.2 | 23.3 | 27.1 | 17.3 | 15.7 | 18.8 | 18.5 | 16.5 | 20.4 |
| 5way-1shot OCD [Du et al., 2023] | 41.1 | 34.8 | 47.5 | 12.3 | 0.1 | 24.5 | 40.4 | 34.4 | 46.5 | 34.3 | 28.8 | 39.8 | 41.0 | 38.3 | 43.8 |
| GCD [Vaze et al., 2022a] | 63.4 | 77.3 | 49.6 | 65.0 | 77.6 | 52.5 | 66.7 | 83.1 | 50.3 | 41.2 | 50.1 | 32.3 | 44.2 | 55.1 | 33.3 |
| FSNCD (SHC) | 67.5 | 80.1 | 54.8 | 69.9 | 82.1 | 57.7 | 72.3 | 87.1 | 57.5 | 42.4 | 48.2 | 36.7 | 45.9 | 52.8 | 38.9 |
| FSNCD (UKC) | 75.9 | 78.9 | 72.9 | 76.6 | 76.5 | 76.6 | 84.2 | 88.6 | 79.9 | 38.9 | 41.5 | 36.3 | 41.8 | 46.5 | 37.1 |
| CIFAR-100 | ImageNet-100 | CUB-200 | StanfordCars | FGVC-Aircraft | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Methods | All | Old | New | All | Old | New | All | Old | New | All | Old | New | All | Old | New |
| Real-time ProtoNet [Snell et al., 2017] RankStat [Han et al., OCD [Du et al., (SHC) | 48.1 | 96.2 | - | 47.7 | 95.4 | - | 48.5 | 97.0 | - | 42.9 | 85.8 | - | 43.9 | 87.7 | - |
| 2020] | 59.7 | 63.6 | 55.8 | 59.1 | 60.1 | 58.0 | 61.9 | 73.7 | 50.1 | 53.6 | 58.9 | 48.3 | 54.4 | 64.3 | 44.5 |
| 2023] | 66.2 | 45.2 | 87.1 | 53.1 | 0.1 | 87.6 | 67.3 | 41.5 | 93.0 | 60.1 | 34.2 | 86.0 | 59.2 | 33.2 | 85.2 |
| FSNCD | 75.7 | 63.1 | 88.2 | 82.3 | 73.0 | 91.7 | 74.9 | 63.7 | 86.1 | 57.1 | 17.7 | 96.4 | 56.0 | 15.7 | 96.2 |
| FSNCD (UKC) | 78.3 | 70.0 | 86.6 | 83.3 | 79.9 | 86.7 | 78.1 | 74.8 | 81.4 | 61.2 | 29.6 | 92.8 | 61.0 | 30.4 | 91.6 |
where pold represents the one-to-one mapping from the label space of support prototypes YOld to ˆ YOld.
FSNCD Baselines. We present the following key benchmark methods as the strongest baselines for comparison with the proposed FSNCD. All methods employed ViT-B-16 pretrained on ImageNet with DINO.
- ProtoNet [Snell et al., 2017] aims to classify samples into prototypes based on maximum cosine similarity, in contrast, our FSNCD identifies known classes while also considering how to discover novel classes.
- OCD [Du et al., 2023] attempts to enhance the generalizability of GCD by using hash codes derived from disentangled features, while our FSNCD exploits a more general feature space to solve analogous generalization problems.
- AutoNovel [Han et al., 2020] uses feature ranking to determine whether a given sample belongs to positive pair, while we further extend its indexing ideas to the support prototypes. We use the two closest prototypes as category labels.
- SimGCD [Wen et al., 2023] attempts to utilize parametric classifier to solve GCD problem. Each episode of FSNCD can be regarded as a GCD problem with an extremely scarce sample size. We use the weights from Phase 1 and fine-tune using SimGCD to discover novel categories.
(4) GCD [Vaze et al., 2022a] proposes to estimate the number of novel categories with accuracy on labeled samples, and discover categories with semi-supervised K-means. We treat each episode as a GCD task, performing estimation and clustering to discover novel categories.
4.2 Main Results
Table 3 compares method performance across five datasets. We evaluate "old class" accuracy (support set samples) and "new class" accuracy (novel query set categories). ProtoNet fails to recognize new classes due to its forced classification into support set categories. Among clustering-based methods, GCD employs semi-supervised K-means for category estimation but struggles with coarse-grained datasets. Our method eliminates category number pre-estimation and achieves state-of-the-art performance, showing 9% (SHC) and 13% (UKC) average old-class accuracy drops versus ProtoNet, yet delivering 5% (SHC) and 10% (UKC) overall accuracy gains over GCD.
OCD exhibits consistent performance across tasks due to its overly strict hash code categorization (12-bit codes allow up to 212 classes) and underutilization of support feature distributions. While increasing support samples improves hash code precision as noted in [Du et al., 2023], its ultra-fine category division remains fundamentally limited.
RankStat achieves optimal performance when encoding the top two ranks but limits the number of categories to 20, showing strong retention of classification capability for old classes as expected. Its strict partitioning of feature space into 20
| CIFAR-100 | ImageNet-100 | |||||
|---|---|---|---|---|---|---|
| Methods | All | Old | New | All | Old | New |
| scale ProtoNet [Snell et al., 2017] RankStat [Han et al., 2020] | 49.0 | 95.1 | - | 47.7 | 95.4 | - |
| 57.8 | 61.3 | 54.4 | 52.5 | 50.4 | 54.6 | |
| OCD [Du et al., 2023] | 41.5 | 39.3 | 43.7 | 25.2 | 22.7 | 27.6 |
| Large FSNCD (SHC) | 71.4 | 89.7 | 53.1 | 76.4 | 94.6 | 58.2 |
| FSNCD (UKC) | 89.3 | 92.2 | 86.3 | 97.5 | 98.1 | 96.8 |
regions based on support samples slightly reduces labeling effectiveness for new classes.
We further conducted tests for real-time inference. As shown in Table 4, OCD easily identifies a sample as a new class, but it also tends to misclassify a substantial number of old classes as new. Although OCD achieves high accuracy in new class discovery, its utility is limited, indicating an excessive inclination toward categorizing instances as new classes. FSNCD with the SHC method achieves a more balanced performance in real-time inference, while FSNCD with the UKC exhibits lower capability in discovering new classes during real-time inference but still maintains excellent performance on old classes.
As shown in Table 5, OCD struggles with large-scale dataset annotation due to its dispersed category distribution, resembling On-the-fly Category Discovery in accuracy. In contrast, UKC leverages sufficient samples to better capture data distributions, achieving superior performance across multiple metrics. Notably, discrepancies between Table 3 and Table 5 are attributed to differing query sample sizes. Specifically, using centroids from small batches to classify large datasets enhances performance, aligning Cosine-trained models with Euclidean clustering. Additionally, in traditional GCD tasks, we found that the strategy of clustering and classification can significantly imporve performance. In extreme cases with limited query samples, it becomes challenging to determine whether a sample belongs to a new category, which is an inherent challenge in FSNCD.
4.3 Ablation Studies
To validate the model's performance across various scenarios, we compared its performance under different settings. For more details on related parameter studies, please refer to the supplementary materials.
Quantity of Query. Due to the discovery of novel categories relying on clustering results, the model may be more sensitive to the distribution of data. Simultaneously, to ensure real-time reasoning capability, we investigated the impact of query quantity on model metrics. Initially, we set the task as 5w5s5n.
Fig. 3 illustrates the accuracy variation with the number of query samples in each class using the 5w5s configuration. The accuracy of UKC change curve indicates that as the number of query samples in each class increases, the data distribution tends to be more reasonable, leading to a continuous improvement. Conversely, due to the weak dependence of hierarchical clustering on data distribution, the accuracy of the SHC based method is more stable.

| CUB-200 | ImageNet-100 | ||||||
|---|---|---|---|---|---|---|---|
| Method | All | Old | New | All | Old | New | |
| (1) | SHC | 52.4 | 91.9 | 42.5 | 57.9 | 93.9 | 48.9 |
| UKC | 61.2 | 86.5 | 54.9 | 73.6 | 91.1 | 69.3 | |
| (2) | SHC | 59.3 | 86.5 | 45.7 | 72.1 | 88.7 | 63.8 |
| UKC | 69.4 | 75.3 | 66.5 | 83.4 | 87.0 | 81.6 | |
| (3) | SHC | 48.8 | 84.1 | 40.0 | 63.0 | 88.2 | 56.7 |
| UKC | 50.0 | 55.8 | 48.6 | 79.4 | 80.4 | 79.1 | |
Effects of Different Settings. In response to distinct task configurations, we conducted further examinations on the outcomes associated with three specific task settings: (1) 5way 5-shot 20-new, (2) 10-way 5-shot 20-new, and (3) 10way 5-shot 40-new, and take 15 query images for each category. The results are shown in Table 6. Given that UKC is contingent on the underlying data distribution, the results obtained from UKC exhibit a comparatively stable trend. Our approach demonstrates improvements across all three evaluation metrics as the number of supported sample categories increases. Notably, even with the introduction of additional novel classes, our method consistently maintains a commendable level of accuracy on pre-existing classes. This robust performance underscores the efficacy of our method in handling diverse task settings and accommodating the challenges posed by both an increased number of supported categories and the introduction of new ones.
5 Conclusion
In this paper, we summarize the shortcomings of current Novel Category Discovery (NCD) tasks and Few-Shot Learning (FSL) tasks, considering FSL tasks that are closer to realworld scenarios, where new classes may appear in the query set. To address the aforementioned issues, we propose Fewshot Novel Category Discovery (FSNCD). In the inference stage, we introduce Semi-supervised Hierarchical Clustering (SHC) and Uncertainty-aware K-means Clustering (UKC) through supervised contrastive learning to represent learning in each episode and leverage them to classify old and cluster new classes accurately. We conduct comprehensive experiments on five datasets, validating the model's performance in general settings and its performance in extreme scenarios.
Acknowledgments
This work was partly supported by the National Natural Science Foundation of China (NSFC) under Grant No. 62371235, and partly by the Key Research and Development Plan of Jiangsu Province (Industry Foresight and Key Core Technology Project) under Grant BE2023008-2.
@inproceedings{ijcai2025p151,
title = {Few-shot Novel Category Discovery},
author = {Li, Chunming and Wang, Shidong and Zhang, Haofeng},
booktitle = {Proceedings of the Thirty-Fourth International Joint Conference on
Artificial Intelligence, {IJCAI-25}},
publisher = {International Joint Conferences on Artificial Intelligence Organization},
editor = {James Kwok},
pages = {1350--1358},
year = {2025},
month = {8},
note = {Main Track},
doi = {10.24963/ijcai.2025/151},
url = {https://doi.org/10.24963/ijcai.2025/151},
}
TY - CPAPER TI - Few-shot Novel Category Discovery AU - Li, Chunming AU - Wang, Shidong AU - Zhang, Haofeng T2 - Proceedings of the Thirty-Fourth International Joint Conference on Artificial Intelligence, IJCAI-25 PB - International Joint Conferences on Artificial Intelligence Organization PY - 2025 SP - 1350 EP - 1358 DO - 10.24963/ijcai.2025/151 UR - https://doi.org/10.24963/ijcai.2025/151 ER -Copied
Machine-readable versions of this paper, for tools and AI agents: