A few-sample image classification method based on contrastive learning and data augmentation
Abstract
Few-Shot Image Classification (FSL) aims to identify and classify new image categories using only a very small number of labeled samples. Addressing the shortcomings of existing meta-learning and metric learning methods, such as insufficient generalization of feature representations with very few samples, overfitting, and blurred inter-class boundaries, this paper proposes a novel FSL method based on contrastive learning and task-aware data augmentation (CLDA-FSL). We design a dynamic task-aware data augmentation module that significantly enriches the sample diversity of the base classes by combining nonlinear mixing and cropping transformations in the feature space and pixel space. We propose a multi-level supervised contrastive learning framework that shortens the feature distance between samples of the same class while widening the distance between samples of different classes during the pre-training stage, thereby obtaining a highly discriminative feature space. In the meta-learning fine-tuning stage, a cosine prototype network classifier is introduced to further optimize the cluster centers. We conduct extensive experiments on two benchmark datasets (miniImageNet and tieredImageNet). Experimental results show that the proposed method achieves state-of-the-art performance on both 5- way 1-shot and 5-way 5-shot tasks, with accuracies of 68.45% and 85.12% on miniImageNet, respectively, fully validating the effectiveness and robustness of the algorithm.