Author Login Editor-in-Chief Peer Review Editor Work Office Work

Computer Engineering ›› 2024, Vol. 50 ›› Issue (3): 36-43. doi: 10.19678/j.issn.1000-3428.0067599

• Research Hotspots and Reviews • Previous Articles     Next Articles

Few-Shot Metal Surface Defect Classification Based on Contrastive Learning

Guanrong WU*(), Yuanxiang LI, Yilin WANG, Yuhan LU, Xiuhua CHEN   

  1. School of Aeronautics and Astronautics, Shanghai Jiao Tong University, Shanghai 200240, China
  • Received:2023-05-10 Online:2024-03-15 Published:2023-08-09
  • Contact: Guanrong WU

基于对比学习的小样本金属表面损伤分类

吴冠荣*(), 李元祥, 王艺霖, 陆雨寒, 陈秀华   

  1. 上海交通大学航空航天学院, 上海 200240
  • 通讯作者: 吴冠荣

Abstract:

The existing few-shot classification methods are limited to inducing intra class commonalities from each round of support information, ignoring inter class correlations and category information carried by the samples themselves during the iteration process. Due to the fine and varied texture of metal damage, the resulting feature distribution has small inter class distance and large intra class distance. A few-shot metal surface damage classification method based on an inner and outer two-layer training model architecture is proposed, as the poor aggregation of feature distribution leads to a decrease in the performance of few-shot classification and a decrease in the generalization of new classes. The inner model uses metric methods to complete the metal classification task, while the outer model incorporates bimodal features as signals in the feature space. In the new mapping space, category label information is used to supervise the comparison of image features from different categories and optimize the feature distribution, resulting in improved inter-class discrimination and intra-class aggregation. During the training phase, the external model enhances the representation ability of the original space through backpropagation contrastive loss, thereby enhancing the measurement level of the internal model and improving classification accuracy. Additionally, the use of category embedding as a dynamic category center effectively reduces noise interference in small sample problems and enhances model generalization performance. Experimental results on three commonly used metal damage datasets, GC10, NEU, and APSD, demonstrate that the proposed method achieves superior classification accuracy compared to mainstream methods such as ProtoNet, MatchingNet, and RelationNet. In particular, the generalization ability of new categories is significantly improved. Under the 5-way 5-shot setting, the classification accuracy is by at least 5.24, 1.39, and 6.37 percentage points, with classification error reduction rates of 36.00%, 17.94%, and 66.15%, respectively. Specifically, the accuracy of new class classification increases from 36.53%, 82.43%, and 31.89% to 69.12%, 91.57%, and 48.23%, respectively. Under the 5-way 1-shot setting, the classification accuracy is improved by at least 8.34, 3.01, and 4.61 percentage points, with classification error reduction rates of 28.32%, 23.37%, and 46.57%, respectively.

Key words: metal surface defect, contrastive learning, metric learning, meta-learning, few-shot classification

摘要:

现有小样本分类方法局限于从每轮支持信息中归纳出类内共性,忽略了在迭代过程中类间关联性以及样本本身携带的类别信息。由于金属损伤纹理细微、多变,因此所形成的特征分布类间距离小、类内距离大。因特征分布聚合性差导致小样本分类性能降低且新类泛化性变差,提出一种基于内外双层训练模型架构的小样本金属表面损伤分类方法。内模型在利用度量手段完成元分类任务的同时,引入双模态特征作为外模型特征空间的信号,即在新映射空间下利用类别标签信息有监督地对比不同类别的图像特征、优化特征分布,使类间区分度更大、类内聚合度更高。在训练阶段中外模型反传对比损失,间接加强原有特征空间的表征能力,从而提高内模型的度量水平,提升分类精度。同时,利用类别嵌入作为动态类别中心,可以有效减少小样本问题中的噪声干扰,加强模型泛化性能。在GC10、NEU及APSD 3个常用的金属损伤数据集上的实验结果表明,相比ProtoNet、MatchingNet、RelationNet等主流方法,该方法具有较优的分类精度, 特别是新类别的泛化能力得到大幅提升, 5-way 5-shot设定下分类精度至少提高了5.24、1.39和6.37个百分点,分类错误下降率分别为36.00%、17.94%和66.15%;此外,新类分类精度分别从36.53%、82.43%、31.89%提升至69.12%、91.57%、48.23%。5-way 1-shot设定下分类精度分别至少提高8.34、3.01和4.61个百分点,分类错误下降率分别为28.32%、23.37%和46.57%。

关键词: 金属表面损伤, 对比学习, 度量学习, 元学习, 小样本分类