Few-shot classification via semi-supervised density-based agglomerative clustering
摘要
Few-shot classification aims to train deep classification models with limited labeled samples. To mitigate overfitting risks, existing methods often employ a simple yet robust classification module, which limits the ability to fit complex class distributions. To address this issue, we propose using semi-supervised clustering as the classification module. Density-based clustering has proven effective in capturing arbitrarily complex distribution but it often struggles with density variations and parameter sensitivity. This paper proposes a semi-supervised density-based agglomerative clustering algorithm that employs two distinct strategies: one for connecting high-density points that form the backbone of clusters, and another for handling sparse points situated on the periphery of the clusters. Additionally, we design an automatic parameter optimization method for density-based clustering. Based on the semi-supervised clustering results, we define a loss function to optimize the embedding network. By incorporating a dynamic margin adjustment term, this function effectively guides the embedding network to learn a metric space with more distinct class distribution. Furthermore, we propose a method for generating and adaptively weighting pseudo-labeled samples to alleviate the scarcity of labeled samples. Extensive experiments on three benchmark datasets demonstrate that our method outperforms 27 state-of-the-art algorithms under both 1-shot and 5-shot settings. The source code and pretrained models are available at: https://github.com/nblnbl/SSC-FSC .