《计算机应用》唯一官方网站 ›› 2022, Vol. 42 ›› Issue (2): 638-645.DOI: 10.11772/j.issn.1001-9081.2021020227

• 前沿与综合应用 • 上一篇    

基于可变形卷积和自适应空间特征融合的硬币表面缺陷检测算法

王品学1,2, 张绍兵1,2,3(), 成苗1,2,3, 何莲1,3, 秦小山1,2   

  1. 1.中国科学院 成都计算机应用研究所, 成都 610041
    2.中国科学院大学 计算机科学与技术学院, 北京 100049
    3.深圳市中钞科信金融科技有限公司, 深圳 518206
  • 收稿日期:2021-02-05 修回日期:2021-04-02 接受日期:2021-04-12 发布日期:2021-04-15 出版日期:2022-02-10
  • 通讯作者: 张绍兵
  • 作者简介:王品学(1993—),男,四川成都人,硕士研究生,CCF会员,主要研究方向:小样本学习、表面缺陷检测;
    张绍兵(1979—),男,四川成都人,研究员级高级工程师,硕士,主要研究方向:高速图像处理、缺陷检测、深度学习;
    成苗(1983—),男,四川成都人,高级工程师,硕士,主要研究方向:人工智能、机器视觉;
    何莲(1983—),女,四川西充人,高级工程师,博士,主要研究方向:人工智能、机器视觉;
    秦小山(1995—),男,四川资阳人,硕士研究生,主要研究方向:计算机视觉。

Coin surface defect detection algorithm based on deformable convolution and adaptive spatial feature fusion

Pinxue WANG1,2, Shaobing ZHANG1,2,3(), Miao CHENG1,2,3, Lian HE1,3, Xiaoshan QIN1,2   

  1. 1.Chengdu Institute of Computer Application,Chinese Academy of Sciences,Chengdu Sichuan 610041,China
    2.School of Computer Science and Technology,University of Chinese Academy of Sciences,Beijing 100049,China
    3.Shenzhen CBPM-KEXIN Banking Technology Company Limited,Shenzhen Guangdong 518206,China
  • Received:2021-02-05 Revised:2021-04-02 Accepted:2021-04-12 Online:2021-04-15 Published:2022-02-10
  • Contact: Shaobing ZHANG
  • About author:WANG Pinxue, born in 1993, M. S. candidate. His research interests include few-shot learning, surface defect detection.
    ZHANG Shaobing, born in 1979, M. S., professor of engineering. His research interests include high-speed image processing, defect detection, deep learning.
    CHENG Miao, born in 1983, M. S., senior engineer. His research interests include artificial intelligence, machine vision.
    HE Lian, born in 1983, Ph. D., senior engineer. Her research interests include artificial intelligence, machine vision.
    QIN Xiaoshan, born in 1995, M. S. candidate. His research interests include computer vision.

摘要:

针对硬币表面缺陷较小、形状多变且易与背景混淆而不易检出的问题,改进YOLOv3算法并提出基于可变形卷积和自适应空间特征融合的硬币表面缺陷检测算法DCA-YOLO。首先,由于缺陷形状的多变设计了3种在主干网络中不同位置添加可变形卷积模块的网络结构,通过卷积学习偏移量和调节参数来提高缺陷的提取能力;然后,使用自适应空间特征融合网络学习权重参数来调整不同尺度特征图中各像素点的贡献度以更好地适应不同尺度的目标;最后,改进先验锚框比例,动态调节类别权重,优化并对比网络性能,从而提出在主干网络输出特征进行多尺度融合的上采样前增加可变形卷积的模型网络。实验结果表明,在硬币缺陷数据集上,DCA-YOLO算法检测平均精度均值(mAP)接近于Faster-RCNN,达到了92.8%;而相较于YOLOv3,所提算法的检测速度基本持平,在检测mAP上提高了3.3个百分点,F1分数提升了3.2个百分点。

关键词: YOLOv3算法, 硬币, 表面缺陷检测, 可变形卷积, 自适应空间特征融合

Abstract:

Concerning the problem that the surface defects of the coin are small, variable in shape, easily confused with the background and difficult to be detected, an improved algorithm of coin surface defect detection named DCA-YOLO (Deformable Convolution and Adaptive space feature fusion-YOLO) was proposed. First of all, due to the different shapes of defects, three network structures with deformable convolution modules added at different positions in the backbone network were designed, and the ability to extract defects was improved through convolution learning offset and adjusting parameters. Then, the adaptive spatial feature fusion network was used to learn the weight parameters to better adapt to targets with different scales by adjusting the contribution of each pixel in the feature maps of different scales. Finally, the anchor ratio was adjusted, the category weights were dynamically adjusted, the comparison network performance was optimized, thus, a model network to add deformable convolution before upsampling for multi-scale fusion of the output features of the backbone network was proposed. Experimental results show that on the coin defect dataset, the detection mAP (mean Average Precision) of DCA-YOLO algorithm reaches 92.8%, which is close to that of Faster-RCNN (Faster Region-based Convolutional Neural Network); compared with YOLOv3, the proposed algorithm has the detection speed basically the same with 3.3 percentage points improvement on detection mAP, and 3.2 percentage points increase on F1-score.

Key words: YOLO (You Look Only Once) v3 algorithm, coin, surface defect detection, deformable convolution, adaptive spatial feature fusion

中图分类号: