计算机工程与应用 ›› 2025, Vol. 61 ›› Issue (21): 242-252.DOI: 10.3778/j.issn.1002-8331.2407-0205

• 图形图像处理 • 上一篇    下一篇

基于对比学习与去噪扩散模型的薄膜表面瑕疵图像分类

邓皓文,王恒升   

  1. 1.中南大学 机电工程学院,长沙 410083 
    2.中南大学 高性能复杂制造国家重点实验室,长沙 410083
  • 出版日期:2025-11-01 发布日期:2025-10-31

Image Classification for Film Surface Defect Based on Contrastive Learning and Diffusion Model

DENG Haowen, WANG Hengsheng   

  1. 1.College of Mechanical and Electrical Engineering, Central South University, Changsha 410083, China
    2.Laboratory of High Performance and Complex Manufacturing, Central South University, Changsha 410083, China
  • Online:2025-11-01 Published:2025-10-31

摘要: 薄膜材料在生产过程中会出现多种类别的表面瑕疵,薄膜表面瑕疵具有类间差异小、图像数据集不平衡的特点,导致分类性能差。针对上述问题提出了基于对比学习与去噪扩散模型的分类方法。在图像类别数据集上训练去噪扩散模型,得到去噪扩散模型中的噪声预测网络的中间编码输出,即噪声特征;并行地,使用卷积神经网络提取图像特征,并与噪声特征进行融合,得到图像在特征空间中的表达,称为图像的融合特征。使用标签嵌入对比学习方法,将图像类别标签映射到特征空间中作为原型特征,计算融合特征与原型特征之间的对比损失,优化不同类别图像的原型特征在特征空间中的分布,最终得到类别间的特征差异。在锂电池铝塑膜表面瑕疵数据集上进行实验,获得了96.97%的最佳准确率,优于目前的主流方法。

关键词: 对比学习, 度量学习, 去噪扩散模型, 图像分类, 特征融合

Abstract: The surface defects from the manufacturing process of film materials are usually in multiple categories. The properties of small inter-class differences and imbalanced datasets are the main reasons of poor classification performance. A classification method based on contrastive learning and diffusion model is proposed to address the aforementioned issues in this paper. A diffusion model is trained on the image dataset, and the noise features are obtained from the encoded outputs of the noise prediction network which is a part of this diffusion model. On the other hand, the image features are extracted from a CNN model, which are fused with noise features to obtain the enhanced representation of defect images (called the fused feature of image) in the feature space. Using label-embedding contrastive learning to map labels into the feature space, the prototype features are obtained, which are used to calculate the contrastive loss with respect to the fused features in the learning process, and finally the distribution of prototype features of different image categories is optimized in the feature space, which shows the delicate differences among image classes. Experimental validation on classifying surface defects of lithium battery aluminum-plastic films achieves a maximum accuracy of 96.97%, surpassing current mainstream methods.

Key words: contrastive learning, metric learning, diffusion model, image classification, feature fusion