Laser & Optoelectronics Progress, Volume. 61, Issue 18, 1812003(2024)

Defect Detection of Spray Printed Variable Color 2D Code Based on ResNet34-TE

Ying Li, Yao Dong*, Zifen He, Hao Yuan, Fuyang Sun, and Lingxi Gong
Author Affiliations
  • Faculty of Mechanical and Electrical Engineering, Kunming University of Science and Technology, Kunming 650500, Yunnan, China
  • show less
    Figures & Tables(19)
    Defects of color 2D code. (a) Fly-ink defect; (b) paste-ink defect; (c) line defect; (d) omission defect
    Results of different screening conditions
    Extraction process of 2D code area
    Structure of residual block
    Framework of the ResNet34-TE model. (a) Overall structure of the model; (b) structure of the residual module of model; (c) structure of Transformer-encoder
    Process of position embedding
    Structure of encoder. (a) Overall structure of encoder; (b) structure of multi-head attention mechanism; (c) structure of the multilayer perceptron block
    Flowchart of proposed algorithm
    Comparison of results of different models on validation set. (a) Loss curve; (b) accuracy curve
    Confusion matrices of contrasting models. (a) Confusion matrix for ResNet34 model; (b) confusion matrix for ResNet34-TE model
    Prediction results of various defects under different light intensities. (a) Flying ink defect; (b) ink smudging and dirt defect; (c) wire defect; (d) leakage defect
    Visual heat maps of model before and after improvement
    Sample images of six defects from the NEU-DET dataset
    • Table 1. Dataset distribution

      View table

      Table 1. Dataset distribution

      Defect typeEnhanced training setOriginal training setValidation setTest set
      Total23781203402401
      LX62031110299
      FM601314101103
      HM593304100101
      LY5642749997
    • Table 2. Comparison of Classification Performance of Classical Models

      View table

      Table 2. Comparison of Classification Performance of Classical Models

      ModelAccuracy /%Precision /%Recall /%F1-score /%Params /MBCPU /ms
      AlexNet66.3267.5567.9667.67217.09.26
      VGG1685.0085.9885.0385.94532.035.08
      MobileNet-V290.9091.0391.4391.568.39.56
      ShuffleNet-V279.8879.9480.6879.676.510.69
      ResNet3491.5291.9692.0291.9681.316.56
      ResNet5093.3094.3692.5892.2090.024.84
      EfficientNet-B02695.2695.5194.9795.1816.817.82
      MobileViT2796.3796.7896.4096.6510.821.85
      ResNet34-TE96.8096.8997.0496.9325.415.59
    • Table 3. Defect classification results of model before and after improvement

      View table

      Table 3. Defect classification results of model before and after improvement

      Defect typeResNet34ResNet34-TE
      Accuracy /%Recall /%F1-score /%Accuracy /%Recall /%F1-score /%
      FM909090969697
      HM878486989495
      LX909693969897
      LY1009899100100100
    • Table 4. Different light test results

      View table

      Table 4. Different light test results

      Defect typeLightAccuracy /%Average accuracy /%
      FM-30%94.1795.14
      Standard96.11
      +30%95.15
      HM-30%92.0893.07
      Standard94.05
      +30%93.07
      LX-30%96.9797.64
      Standard97.98
      +30%97.98
      LY-30%98.9799.65
      Standard100.00
      +30%100.00
    • Table 5. Results of different encoder block depths

      View table

      Table 5. Results of different encoder block depths

      DepthsAccuracy /%LossParams /MB
      193.50.105422.1
      294.30.084322.9
      394.90.073423.7
      496.10.057624.6
      596.80.042825.4
      694.70.077326.5
      794.20.081527.2
    • Table 6. Results of different models on the NEU-DET dataset

      View table

      Table 6. Results of different models on the NEU-DET dataset

      ModelAccuracy /%Precision %Recall /%F1-score /%
      ResNet3496.5296.9296.6196.62
      ViT92.1492.7891.8692.54
      CNN-PCA-DT3098.5197.4197.8298.34
      TARGAN3198.2598.5098.1098.30
      ResNet-TE98.8698.1098.4998.97
    Tools

    Get Citation

    Copy Citation Text

    Ying Li, Yao Dong, Zifen He, Hao Yuan, Fuyang Sun, Lingxi Gong. Defect Detection of Spray Printed Variable Color 2D Code Based on ResNet34-TE[J]. Laser & Optoelectronics Progress, 2024, 61(18): 1812003

    Download Citation

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

    Category: Instrumentation, Measurement and Metrology

    Received: Dec. 22, 2023

    Accepted: Jan. 29, 2024

    Published Online: Sep. 14, 2024

    The Author Email: Yao Dong (1823101813@qq.com)

    DOI:10.3788/LOP232723

    CSTR:32186.14.LOP232723

    Topics