• Laser & Optoelectronics Progress
  • Vol. 61, Issue 18, 1812003 (2024)
Ying Li, Yao Dong*, Zifen He, Hao Yuan..., Fuyang Sun and Lingxi Gong|Show fewer author(s)
Author Affiliations
  • Faculty of Mechanical and Electrical Engineering, Kunming University of Science and Technology, Kunming 650500, Yunnan, China
  • show less
    DOI: 10.3788/LOP232723 Cite this Article Set citation alerts
    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 Copy Citation Text show less
    Defects of color 2D code. (a) Fly-ink defect; (b) paste-ink defect; (c) line defect; (d) omission defect
    Fig. 1. Defects of color 2D code. (a) Fly-ink defect; (b) paste-ink defect; (c) line defect; (d) omission defect
    Results of different screening conditions
    Fig. 2. Results of different screening conditions
    Extraction process of 2D code area
    Fig. 3. Extraction process of 2D code area
    Structure of residual block
    Fig. 4. 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
    Fig. 5. 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
    Fig. 6. 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
    Fig. 7. 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
    Fig. 8. Flowchart of proposed algorithm
    Comparison of results of different models on validation set. (a) Loss curve; (b) accuracy curve
    Fig. 9. 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
    Fig. 10. 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
    Fig. 11. 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
    Fig. 12. Visual heat maps of model before and after improvement
    Sample images of six defects from the NEU-DET dataset
    Fig. 13. Sample images of six defects from the NEU-DET dataset
    Defect typeEnhanced training setOriginal training setValidation setTest set
    Total23781203402401
    LX62031110299
    FM601314101103
    HM593304100101
    LY5642749997
    Table 1. Dataset distribution
    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 2. Comparison of Classification Performance of Classical Models
    Defect typeResNet34ResNet34-TE
    Accuracy /%Recall /%F1-score /%Accuracy /%Recall /%F1-score /%
    FM909090969697
    HM878486989495
    LX909693969897
    LY1009899100100100
    Table 3. Defect classification results of model before and after improvement
    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 4. Different light test results
    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 5. Results of different encoder block depths
    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
    Table 6. Results of different models on the NEU-DET dataset
    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