留言板

尊敬的读者、作者、审稿人, 关于本刊的投稿、审稿、编辑和出版的任何问题, 您可以本页添加留言。我们将尽快给您答复。谢谢您的支持!

姓名
邮箱
手机号码
标题
留言内容
验证码

基于改进ACGAN的钢表面缺陷视觉检测方法

李可 祁阳 宿磊 顾杰斐 苏文胜

李可, 祁阳, 宿磊, 顾杰斐, 苏文胜. 基于改进ACGAN的钢表面缺陷视觉检测方法[J]. 机械工程学报, 2022, 58(24): 32-40. doi: 10.3901/JME.2022.24.032
引用本文: 李可, 祁阳, 宿磊, 顾杰斐, 苏文胜. 基于改进ACGAN的钢表面缺陷视觉检测方法[J]. 机械工程学报, 2022, 58(24): 32-40. doi: 10.3901/JME.2022.24.032
LI Ke, QI Yang, SU Lei, GU Jiefei, SU Wensheng. Visual Inspection of Steel Surface Defects Based on Improved Auxiliary Classification Generation Adversarial Network[J]. JOURNAL OF MECHANICAL ENGINEERING, 2022, 58(24): 32-40. doi: 10.3901/JME.2022.24.032
Citation: LI Ke, QI Yang, SU Lei, GU Jiefei, SU Wensheng. Visual Inspection of Steel Surface Defects Based on Improved Auxiliary Classification Generation Adversarial Network[J]. JOURNAL OF MECHANICAL ENGINEERING, 2022, 58(24): 32-40. doi: 10.3901/JME.2022.24.032

基于改进ACGAN的钢表面缺陷视觉检测方法

doi: 10.3901/JME.2022.24.032
基金项目: 

国家自然科学基金 51775243

国家自然科学基金 11902124

江苏省市场监督管理局科技计划 KJ196043

详细信息
    作者简介:

    李可,男,1978年出生,博士,教授,博士研究生导师。主要研究方向为机器视觉、信号处理、故障诊断。E-mail:like_jiangnan@163.com

    通讯作者:

    宿磊(通信作者),男,1986年出生,博士,副教授,硕士研究生导师。主要研究方向为微电子封装无损检测、机器视觉、故障诊断。E-mail:lei_su2015@jiangnan.edu.cn

  • 中图分类号: TP29

Visual Inspection of Steel Surface Defects Based on Improved Auxiliary Classification Generation Adversarial Network

  • 摘要: 为提高小样本环境下钢表面缺陷检测精度,提出一种基于改进辅助分类生成对抗网络(Auxiliary classifier generative adversarial network, ACGAN)的钢表面缺陷检测方法。利用残差块优化ACGAN的网络结构,提高模型的特征提取能力;其次,为提高模型训练的稳定性,在网络的卷积层中添加谱范数归一化,防止模型异常的梯度变化;基于正-未标记分类的思想优化判别器的损失函数,提高生成样本的质量;同时,为缓解生成对抗网络的模式崩塌问题,在损失函数中添加梯度惩罚来约束判别器的梯度;通过生成器和判别器的对抗优化训练实现样本扩充。通过对钢表面缺陷数据集的试验,验证了提出的方法能准确有效地实现小样本环境下钢表面缺陷检测。与经典的SVM、ResNet50以及一些小样本分类模型相比,所提方法具有更高的检测精度。

     

    为提高小样本环境下钢表面缺陷检测精度,提出一种基于改进辅助分类生成对抗网络(Auxiliary classifier generative adversarial network, ACGAN)的钢表面缺陷检测方法。利用残差块优化ACGAN的网络结构,提高模型的特征提取能力;其次,为提高模型训练的稳定性,在网络的卷积层中添加谱范数归一化,防止模型异常的梯度变化;基于正-未标记分类的思想优化判别器的损失函数,提高生成样本的质量;同时,为缓解生成对抗网络的模式崩塌问题,在损失函数中添加梯度惩罚来约束判别器的梯度;通过生成器和判别器的对抗优化训练实现样本扩充。通过对钢表面缺陷数据集的试验,验证了提出的方法能准确有效地实现小样本环境下钢表面缺陷检测。与经典的SVM、ResNet50以及一些小样本分类模型相比,所提方法具有更高的检测精度。
  • 图  GAN与ACGAN的总体框架

    图  改进ACGAN的结构

    图  残差块的具体网络结构图

    图  钢表面缺陷的类型

    图  不同样本量下分类结果趋势图

    图  改进ACGAN生成样本

    算法1:改进ACGAN的伪代码
    输入:真实样本和标签{X, C},批次大小B,学习率$ \alpha $,判别器训练次数m,训练次数N,参数$ \delta $、$ \lambda $和$ \gamma $;
    初始化判别器$ D $和生成器$ G $的参数$ {\theta _D} $和$ {\theta _G} $;
    1:    for epoch=1 to N do
    2:        从真实样本X中随机采样大小为Bx,从均匀分布中随机采样{z, c};
    3:        通过将{z, c}输入生成器生成新样本$ G(z, c) $;
    4:        将生成样本和真实样本输入判别器中获得判别概率和类别概率;
    5:        通过同批次真实样本x加偏差$ \varphi $,得到扰动样本$ (x + \varphi ) $,并输入判别器得到判别概率,并通过公式(13)计算梯度惩罚项;
    6:        for i=1 to m do
    7:            通过式(14)计算判别器损失L(D);
    8:            通过$ {\theta _D} \leftarrow {\text{Adam}}({\nabla _{{\theta _D}}}(L(D)), {\theta _D}, \alpha ) $更新判别器网络;
    9:        end for
    10:       通过式(15)计算生成器损失L(G);
    11:       通过$ {\theta _G} \leftarrow {\text{Adam}}({\nabla _{{\theta _G}}}(L(G)), {\theta _G}, \alpha ) $更新生成器网络;
    12:       if epoch/10000==0 then
    13:           保存当前模型参数;
    14:       end if
    15:   end for
    输出:判别器参数$ {\theta _D} $、生成器参数$ {\theta _G} $和训练准确率。
    下载: 导出CSV

    表  1  不同训练样本量的平均分类准确率

    每类 平均测试准确率(%) 对比ACGAN的增加(%)
    样本量 ACGAN 改进ACGAN
    240 95.00 99.44 4.44
    200 92.78 99.28 6.50
    150 91.00 98.97 7.97
    100 87.27 98.39 11.12
    50 76.67 96.73 20.06
    10 40.56 82.30 41.74
    下载: 导出CSV

    表  2  不同方法下钢表面缺陷检测精度

    方法 平均准确率(%)
    240 200 150 100 50 10
    HOG+SVM 92.78 91.11 90.83 88.10 85.28 77.78
    LBP+SVM 94.72 93.5 90.67 89.67 87.20 77.70
    ResNet50 97.22 95.72 93.61 90.00 80.80 56.40
    Res-ACGAN 97.27 96.76 95.57 92.14 81.90 70.27
    Res-WGAN 97.79 97.54 96.87 95.00 90.83 71.67
    Res-WGAN-GP 98.61 97.41 97.22 95.04 91.66 72.78
    Mult-DA[19] 99.00 98.33 98.06 97.79 96.39 78.95
    OSLNet[20] 99.20 99.16 98.05 97.22 95.27 71.85
    改进ACGAN 99.44 99.28 98.97 98.39 96.73 82.30
    下载: 导出CSV

    表  3  不同模型MS值和FID值比较

    方法 MS FID
    ACGAN 1.343 0.337
    Res-ACGAN 1.368 0.314
    Res-WGAN 1.375 0.312
    Res-WGAN-GP 1.382 0.309
    改进ACGAN 1.384 0.295
    下载: 导出CSV
  • [1] LUO Q, FANG X, LIU L, et al. Automated visual defect detection for flat steel surface: A survey[J]. IEEE Transactions on Instrumentation and Measurement, 2020, 69(3): 626-644. doi: 10.1109/TIM.2019.2963555
    [2] SONG G, SONG K, YAN Y. EDRNet: Encoder-decoder residual network for salient object detection of strip steel surface defects[J]. IEEE Transactions on Instrumentation and Measurement, 2020, 69(12): 9709-9719. doi: 10.1109/TIM.2020.3002277
    [3] HE Y, SONG K, MENG Q, et al. An end-to-end steel surface defect detection approach via fusing multiple hierarchical features[J]. IEEE Transactions on Instrumentation and Measurement, 2019, 69(4): 1493-1504.
    [4] LI H, ZHU B, CHEN Z, et al. Realtime in-plane displacements tracking of the precision positioning stage based on computer micro-vision[J]. Mechanical Systems and Signal Processing, 2019, 124: 111-123. doi: 10.1016/j.ymssp.2019.01.046
    [5] WANG H, ZHANG J, TIAN Y, et al. A simple guidance template-based defect detection method for strip steel surfaces[J]. IEEE Transactions on Industrial Informatics, 2019, 15(5): 2798-2809. doi: 10.1109/TII.2018.2887145
    [6] FU G, SUN P, ZHU W, et al. A deep-learning-based approach for fast and robust steel surface defects classification[J]. Optics and Lasers in Engineering, 2019, 121: 397-405. doi: 10.1016/j.optlaseng.2019.05.005
    [7] ZHENG X, ZHENG S, KONG Y, et al. Recent advances in surface defect inspection of industrial products using deep learning techniques[J]. The International Journal of Advanced Manufacturing Technology, 2021, 113: 35-58. doi: 10.1007/s00170-021-06592-8
    [8] ZHANG S, ZHANG Q, GU J, et al. Visual inspection of steel surface defects based on domain adaptation and adaptive convolutional neural network[J]. Mechanical Systems and Signal Processing, 2021, 153: 107541. doi: 10.1016/j.ymssp.2020.107541
    [9] 姜洪权, 贺帅, 高建民, 等. 一种改进卷积神经网络模型的焊缝缺陷识别方法[J]. 机械工程学报, 2020, 56(8): 235-242. doi: 10.3901/JME.2020.08.235

    JIANG Hongquan, HE Shuai, GAO Jianmin, et al. An improved convolutional neural network for weld defect recognition[J]. Journal of Mechanical Engineering, 2020, 56(8): 235-242. doi: 10.3901/JME.2020.08.235
    [10] GOODFELLOW I J, POUGET-ABADIE J, MIRZA M, et al. Generative adversarial networks[J]. Advances in Neural Information Processing Systems, 2014, 3: 2672-2680.
    [11] JIN Q, LIN R, YANG F. E-WACGAN: Enhanced generative model of signaling data based on WGAN-GP and ACGAN[J]. IEEE Systems Journal, 2019, 14(3): 3289-3300.
    [12] 黄南天, 杨学航, 蔡国伟, 等. 采用非平衡小样本数据的风机主轴承故障深度对抗诊断[J]. 中国电机工程学报, 2020, 40(2): 563-573. https://www.cnki.com.cn/Article/CJFDTOTAL-ZGDC202002018.htm

    HUANG Nantian, YANG Xuehang, CAI Guowei, et al. A deep adversarial diagnosis method for wind turbine main bearing fault with imbalanced small sample scenarios[J]. Proceedings of the CSEE, 2020, 40(2): 563-573. https://www.cnki.com.cn/Article/CJFDTOTAL-ZGDC202002018.htm
    [13] SUN G, DING S, SUN T, et al. SA-CapsGAN: Using capsule networks with embedded self-attention for generative adversarial network[J]. Neurocomputing, 2021, 423(5): 399-406.
    [14] BEKKER J, DAVIS J. Learning from positive and unlabeled data: A survey[J]. Machine Learning, 2020, 109(4): 719-760. doi: 10.1007/s10994-020-05877-5
    [15] GUO T, XU C, HUANG J, et al. On positive-unlabeled classification in GAN[C]// 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition, Seattle, WA, USA, 2020: 8382-8390.
    [16] 王坤峰, 苟超, 段艳杰, 等. 生成式对抗网络GAN的研究进展与展望[J]. 自动化学报, 2017, 43(3): 321-332. https://www.cnki.com.cn/Article/CJFDTOTAL-MOTO201703001.htm

    WANG Kunfeng, GOU Chao, DUAN Yanjie, et al. Generative adversarial networks: The state of the art and beyond[J]. Acta Automatica Sinica, 2017, 43(3): 321-332. https://www.cnki.com.cn/Article/CJFDTOTAL-MOTO201703001.htm
    [17] LIU F, XU M, LI G, et al. Adversarial symmetric GANs: Bridging adversarial samples and adversarial networks[J]. Neural Networks, 2021, 133: 148-156. doi: 10.1016/j.neunet.2020.10.016
    [18] DONG H, SONG K, HE Y, et al. PGA-Net: Pyramid feature fusion and global context attention network for automated surface defect detection[J]. IEEE Transactions on Industrial Informatics, 2020, 16(12): 7448-7458. doi: 10.1109/TII.2019.2958826
    [19] LI X, ZHANG W, DING Q, et al. Multi-Layer domain adaptation method for rolling bearing fault diagnosis[J]. Signal Processing, 2019, 157: 180-197.
    [20] LI X, CHANG D, MA Z, et al. OSLNet: Deep small-sample classification with an orthogonal softmax layer[J]. IEEE Transactions on Image Processing, 2020, 29: 6482-6495.
    [21] ARJOVSKY M, CHINTALA S, BOTTOU L. Wasserstein generative adversarial networks[C]// Precup D, Teh YW (eds) Proceedings of the 34th International Conference on Machine Learning, PMLR, International Convention Centre, Sydney, Australia. Proceedings of Machine Learning Research, 2017, 70: 214-223.
    [22] GULRAJANI I, AHMED F, ARJOVSKY M, et al. Improved training of Wasserstein GANs[C]// Proceedings of the 2017 Advances in Neural Information Processing Systems. Long Beach, CA, USA, Curran Associates, Inc, 2017: 5767-5777.
    [23] TRAN N T, TRAN V H, NGUYEN N B, et al. On data augmentation for GAN training[J]. IEEE Transactions on Image Processing, 2021, 30: 1882-1897.
  • 加载中
图(7) / 表(4)
计量
  • 文章访问数:  22
  • HTML全文浏览量:  17
  • PDF下载量:  0
  • 被引次数: 0
出版历程
  • 收稿日期:  2022-01-20
  • 修回日期:  2022-09-03
  • 网络出版日期:  2024-03-07
  • 刊出日期:  2022-12-20

目录

    /

    返回文章
    返回