Journal of Computer Applications ›› 2025, Vol. 45 ›› Issue (2): 383-391.DOI: 10.11772/j.issn.1001-9081.2024020253

• Artificial intelligence • Previous Articles    

Few-shot image classification method based on contrast learning

Xuewen YAN, Zhangjin HUANG()   

  1. School of Computer Science and Technology,University of Science and Technology of China,Hefei Anhui 230027,China
  • Received:2024-03-12 Revised:2024-04-09 Accepted:2024-04-11 Online:2024-06-04 Published:2025-02-10
  • Contact: Zhangjin HUANG
  • About author:YAN Xuewen, born in 1999, M. S. candidate. Her research interests include computer vision, few-shot learning.
  • Supported by:
    Key Project of Anhui Provincial Major Science and Technology(202203a05020016)

基于对比学习的小样本图像分类方法

严雪文, 黄章进()   

  1. 中国科学技术大学 计算机科学与技术学院,合肥 230027
  • 通讯作者: 黄章进
  • 作者简介:严雪文(1999—),女,江西赣州人,硕士研究生,CCF会员,主要研究方向:计算机视觉、小样本学习;
  • 基金资助:
    安徽省科技重大专项(202203a05020016)

Abstract:

Deep learning-based image classification algorithms usually rely on huge amounts of training data. However, it is often difficult to obtain sufficient large-scale high-quality labeled samples in real scenarios. Aiming at the problem of insufficient generalization ability of classification models in few-shot scenarios, a few-shot image classification method based on contrast learning was proposed. Firstly, global contrast learning was added as an auxiliary target in training to enable the feature extraction network to obtain richer information from instances. Then, the query samples were split into patches and used to calculate the local contrast loss, thereby promoting the model to gain the ability to infer the global thing the local things. Finally, saliency detection was used to mix the important regions of the query samples, and complex samples were constructed, so as to improve the model generalization ability. Experimental results of 5-way 1-shot and 5-way 5-shot image classification tasks on two public datasets, miniImageNet and tieredImageNet, show that compared to the few-shot learning baseline model, Meta-Baseline, the proposed method improves the classification accuracy by 5.97 and 4.25 percentage points respectively on miniImageNet, and by 3.86 and 2.84 percentage points respectively on tieredImageNet. Besides, the classification accuracy of the proposed method on miniImageNet is improved by 1.02 and 0.72 percentage points respectively compared to that of DFR (Disentangled Feature Representation) model. It can be seen that the proposed method improves the accuracy of few-shot image classification effectively with good generalization ability.

Key words: few-shot learning, image classification, contrast learning, data augmentation, saliency detection

摘要:

基于深度学习的图像分类算法通常依赖大量训练数据,然而在实际场景中通常难以获取足够大规模的高质量标注样本。针对小样本场景下分类模型泛化能力不足的问题,提出一种基于对比学习的小样本图像分类方法。首先,在训练中增加全局对比学习作为辅助目标,从而使特征提取网络从实例中获得更丰富的信息;其次,对问询样本分块并用于计算局部对比损失,从而促进模型获得从局部推断整体的能力;最后,利用显著性检测混合查询样本的重要区域,并构造复杂样本,以增强模型泛化能力。在2个公开数据集miniImageNet和tieredImageNet上进行的5-way 1-shot和5-way 5-shot的图像分类任务实验结果表明:相较于小样本学习的基线模型Meta-Baseline,所提方法在miniImageNet上的分类准确率分别提高了5.97和4.25个百分点,在tieredImageNet上的分类准确率分别提高了3.86和2.84个百分点;并且,所提方法在miniImageNet上的分类准确率比DFR(Disentangled Feature Representation)模型分别提高了1.02和0.72个百分点。可见,所提方法有效提高了小样本图像分类的准确率,具有良好的泛化能力。

关键词: 小样本学习, 图像分类, 对比学习, 数据增强, 显著性检测

CLC Number: