Journal of Applied Optics, Volume. 46, Issue 4, 868(2025)

Improved YOLOv7 for dust and point defects detection of optical lens

Xiaolei LIU and Shibo XU*
Author Affiliations
  • College of Physics and Electronic Information, Henan Polytechnic University, Jiaozuo 454000, China
  • show less
    Figures & Tables(11)
    Scattering of incident light by point defects and dust
    Image collection device
    Shapes of optical lens defects
    Structure diagram of SDCN-YOLOv7 network
    Structure diagram of SPPFRFB and DwELAN
    Images captured by image collection device
    Visualization results of detection networks
    • Table 0. [in Chinese]

      View table
      View in Article

      Table 0. [in Chinese]

      算法1 多通道融合特征增强核心代码
      输入:特征图x:[B, C, H, W],正则项lambda:10^−4 输出:增强后特征图 def forward (x, lambda):   # 单通道像素点数,减一是为了除去要计算的像素点   n = x.shape[2] * x.shape[3] – 1   # 单通道方差   v = x.mean(dim=[2, 3], keepdim=True)   # 多通道方差   v_mc = x.mean(dim=[1, 2, 3], keepdim=True).repeat_interleave(repeats=C, dim=1)   d = (x – 0.25 * v – 0.75 * v_mc).pow(2)   # 多通道融合神经元权重计算   E_inv = d / (4 * (d.sum(dim=[2, 3], keepdim=True) / n + lambda)) + 0.5   return x * sigmoid(E_inv) # 输出增强后结果
    • Table 1. Number of defects in dataset

      View table
      View in Article

      Table 1. Number of defects in dataset

      砂目麻点灰尘
      训练集1 3441 3841 438
      测试集610575501
    • Table 2. Network detection performance before and after improvement

      View table
      View in Article

      Table 2. Network detection performance before and after improvement

      模型平均精度均值/%准确率/%召回率/%推理速度/f·s−1平均精度/%
      麻点砂目灰尘
      YOLOv790.091.6984.2153.189.393.187.3
      SD-YOLOv789.189.6084.1365.488.892.086.5
      SD-YOLOv7+SimAM90.690.8684.8063.589.892.989.1
      SDC-YOLOv790.990.7285.4363.190.293.689.0
      SDC-YOLOv7+NWD91.692.0686.8962.891.395.686.9
      SDC-YOLOv7+SIoU92.091.1689.0563.192.193.890.6
      SDCN-YOLOv792.992.2590.9762.493.095.490.3
    • Table 3. Comparison of detection network performance

      View table
      View in Article

      Table 3. Comparison of detection network performance

      模型平均精度均值/%准确率/%参数量/M计算量模型大小/MB推理速度/f·s−1
      SSD73.379.523.9274.091.630.5
      DETR77.980.136.773.6158.021.1
      Centernet81.583.932.7109.7124.055.6
      Efficientdet85.881.63.87.415.079.2
      YOLOv8m87.989.92.679.149.655.8
      YOLOv5m89.890.82.148.248.263.4
      YOLOv790.091.73.7105.171.353.1
      SDCN-YOLOv792.992.32.983.659.562.4
    Tools

    Get Citation

    Copy Citation Text

    Xiaolei LIU, Shibo XU. Improved YOLOv7 for dust and point defects detection of optical lens[J]. Journal of Applied Optics, 2025, 46(4): 868

    Download Citation

    EndNote(RIS)BibTexPlain Text
    Save article for my favorites
    Paper Information

    Category:

    Received: Aug. 30, 2024

    Accepted: --

    Published Online: Sep. 16, 2025

    The Author Email: Shibo XU (徐诗博)

    DOI:10.5768/JAO202546.0403007

    Topics