计算机与现代化 ›› 2021, Vol. 0 ›› Issue (06): 61-68.

• 人工智能 • 上一篇    下一篇

基于改进深度度量学习算法的表面缺陷检测

  

  1. (1.南京航空航天大学机电学院,江苏南京210016; 2.南京航空航天大学无锡研究院,江苏无锡214187)
  • 出版日期:2021-07-05 发布日期:2021-07-05
  • 作者简介:王伟(1995—),男,山西阳泉人,硕士研究生,研究方向:计算机视觉,测试技术,E-mail: WongWai95@qq.com; 余厚云(1975—),男,安徽合肥人,讲师,博士,研究方向:智能检测,机器视觉,E-mail: meehyyu@nuaa.edu.cn。
  • 基金资助:
    国家自然科学基金资助项目(51975293)

Surface Defect Detection Based on Improved Deep Metric Learning Algorithm

  1. (1. College of Mechanical and Electrical Engineering, Nanjing University of Aeronautics and Astronautics, Nanjing
    210016, China; 2. Wuxi Institute, Nanjing University of Aeronautics and Astronautics, Wuxi 214187, China)
  • Online:2021-07-05 Published:2021-07-05

摘要: 为了解决小批量、多品种工业产品的表面质量检测问题,提出一种基于改进深度度量学习的缺陷检测算法。该算法对VGG16网络模型做改进,更有利于原始图像的隐空间映射。针对产品表面缺陷检测的任务,提出条件三元组损失函数以加强神经网络的拟合能力。同时,在隐空间中进行缺陷判定时,抛弃原始度量学习中基于KNN算法的归类方法,提出基于高斯分布概率的归类模型。在检测新类型产品时,在已训练好的网络模型的基础上,使用新产品的图像数据作为输入对网络进行微调。利用该算法在纽扣缺陷数据集上经K-Fold交叉验证,在只需50个无缺陷样本和50个有缺陷样本的小样本情况下,该算法在不同的查询集上的检测准确率均在90%以上,最高可达99.89%,与传统深度度量学习算法相比,检测准确率提升10%以上。实验结果表明,改进深度度量学习算法可以很好地解决小批量、多品种工业产品的表面缺陷检测问题。

关键词: 表面质量, 视觉检测, 神经网络, 深度度量学习, 小样本学习, 条件三元组损失, 高斯分布

Abstract: An algorithm based on deep metric learning is proposed for the surface defect detection of small batches and multiple varieties of industrial products. The algorithm improves the VGG16 network model, which is more suitable for mapping the original image to the latent space; for the task of product surface defect detection, a conditional triplet loss function is proposed to strengthen the fitting ability of neural network. When the defect is judged in the latent space, the classification model based on the KNN algorithm in the original metric learning algorithm is discarded, and the classification method based on the Gaussian distribution probability is proposed. When new types of products are detected, on the basis of the trained network model, the network is finely tuned by using the image data of the new product as input. Through the above improvements to the deep metric learning algorithm for the defect detection task, after K-Fold cross-validation on the button defect data set, the accuracy on different query sets is over 90%, and the highest can reach 99.89%, by providing 50 non-defective samples and 50 defective samples for training the network. And compared with traditional deep metric learning algorithms, the accuracy is increased by about 10%. The experimental results show that the improved deep metric learning algorithm can well solve the surface defect detection problem of small batch and multi-variety industrial products.

Key words: surface quality, vision detection, neural network, deep metric learning, few-shot learning, conditional triplet loss, Gaussian distribution