欢迎访问《图学学报》 分享到:

图学学报 ›› 2025, Vol. 46 ›› Issue (3): 568-577.DOI: 10.11996/JG.j.2095-302X.2025030568

• 图像处理与计算机视觉 • 上一篇    下一篇

类别不均衡的少样本工业产品表观缺陷检测

王素琴1(), 杜雨洁1, 石敏1(), 朱登明2,3   

  1. 1.华北电力大学控制与计算机工程学院,北京 102206
    2.中国科学院计算技术研究所,北京 100190
    3.太仓中科信息技术研究院,江苏 太仓 215400
  • 收稿日期:2024-06-20 接受日期:2024-12-22 出版日期:2025-06-30 发布日期:2025-06-13
  • 通讯作者:石敏(1975-),女,副教授,博士。主要研究方向为虚拟现实与人工智能、计算机视觉。E-mail:shi_min@ncepu.edu.cn
  • 第一作者:王素琴(1970-),女,副教授,硕士。主要研究方向为计算机视觉、智能软件技术。E-mail:wsq@ncepu.edu.cn
  • 基金资助:
    苏州市科技计划前沿技术研究项目(SYG202327)

Detection of apparent defects in a small sample of industrial products with category imbalance

WANG Suqin1(), DU Yujie1, SHI Min1(), ZHU Dengming2,3   

  1. 1. College of Control and Computer Engineering, North China Electric Power University, Beijing 102206, China
    2. Institute of Computing Technology, Chinese Academy of Sciences, Beijing 100190, China
    3. Taicang Institute of Information Technology, Taicang Jiangsu 215400, China
  • Received:2024-06-20 Accepted:2024-12-22 Published:2025-06-30 Online:2025-06-13
  • Contact: SHI Min (1975-), associate professor, Ph.D. Her main research interests cover virtual reality and artificial intelligence, computer vision. E-mail:shi_min@ncepu.edu.cn
  • First author:WANG Suqin (1970-), associate professor, master. Her main research interests cover computer vision, intelligent software technology. E-mail:wsq@ncepu.edu.cn
  • Supported by:
    Frontier Technology Research Project of Suzhou Science and Technology Programme(SYG202327)

摘要:

通用的目标检测网络在缺陷样本数量较少、缺陷类别分布不均衡时,总体检测精度偏低,在缺陷样本稀少的尾部类别上检测精度更低。为此,提出了一种基于改进YOLOv8s的工业产品表观缺陷检测方法。通过在Neck网络使用幻影卷积(GSConv),降低网络复杂度的同时增强网络非线性能力,以避免过拟合风险。利用聚合模块VoV-GSCSP进一步提取与融合不同层次特征,提升网络特征提取与融合能力。通过采用重加权损失函数以平衡不同类别样本的训练损失贡献,加大尾部类别样本的损失贡献占比,从而提高尾部类别缺陷的检测精度。相比基线模型,改进方法对针灸针表观缺陷检测精度mAP为93.3%,提高5.0%,样本最少的断针缺陷提升9.1%;药板表观缺陷检测精度mAP为91.4%,提高2.6%,样本最少的脏污缺陷提升3.2%。在样本较多且分布不均衡的钢材数据集上,整体缺陷检测精度mAP提高2.6%。实验表明,该改进方法在缺陷样本少且类别分布不均衡时,可有效提升工业产品表观缺陷总体检测精度,对样本稀少的尾部类别检测精度改善明显,泛化性良好。

关键词: 表观缺陷检测, 少样本, 类别不均衡, GSConv, 重加权损失函数

Abstract:

It has been demonstrated that generic target detection networks exhibit reduced overall detection accuracy when the number of defect samples is limited and the distribution of defect categories is uneven. Furthermore, the detection accuracy is markedly diminished for tail categories with particularly scarce defect samples. Based on these observations, an improved method for detecting apparent defects in industrial products using YOLOv8s was developed. Phantom convolution GSConv was employed in the Neck network to diminish the network complexity while simultaneously augmenting its nonlinearity, thus circumventing the potential issue of overfitting. Furthermore, the aggregation module VoV-GSCSP was employed to facilitate the extraction and fusion of features at varying levels, thereby enhancing the network’s capacity for feature extraction and fusion. A reweighted loss function was adopted to balance the training loss contributions across different categories of samples, increasing the loss contribution percentage for the tail category and thereby enhancing defect detection accuracy for the tail category. In comparison with the baseline model, the enhanced method achieved a mAP of 93.3% for the apparent defect detection accuracy in acupuncture needles, representing a 5.0% enhancement, and achieved a 9.1% improvement for broken needle defects. It should be noted that these improvements were achieved with the minimal number of samples. For medicinal plates, a mAP of apparent defect detection accuracy was achieved at 91.4%, representing a 2.6% improvement, and the improvement for dirty defects with the fewest samples was achieved at 3.2%. On the steel dataset, which featured a greater number of samples with uneven distribution, the overall defect detection accuracy improved by 2.6% in mAP. The experiments demonstrated that the enhanced methodology can markedly enhance the overall detection accuracy of apparent defects in industrial products under conditions of the limited number of defect samples and the imbalanced distribution of categories. Furthermore, it can markedly enhance the detection accuracy for categories with sparse samples, exhibiting excellent generalization capabilities.

Key words: apparent defect detection, small sample size, class imbalance, GSConv, re-weighting loss function

中图分类号: