Photonics (Sep 2024)

A Study on the Improvement of YOLOv5 and the Quality Detection Method for Cork Discs

  • Liguo Qu,
  • Guohao Chen,
  • Ke Liu,
  • Xin Zhang

DOI
https://doi.org/10.3390/photonics11090825
Journal volume & issue
Vol. 11, no. 9
p. 825

Abstract

Read online

Combining machine vision and deep learning, optical detection technology can achieve intelligent inspection. To address the issues of low efficiency and poor consistency in the quality classification of cork discs used for making badminton heads, research on optimizing the YOLOv5 image-processing algorithm was conducted and applied to cork disc quality detection. Real-time images of cork discs were captured using industrial cameras, and a dataset was independently constructed. A GAN-based defect synthesis algorithm was employed to resolve the lack of defect samples. An attention mechanism was embedded in the YOLOv5 backbone network to enhance feature representation. The number of anchors in the YOLOv5 detection layer was reduced to address similar sample sizes, a center-matching strategy was designed to balance positive samples, and a shortest-distance label assignment algorithm was developed to eliminate ambiguities, improving accuracy and reducing postprocessing complexity. Detection results were integrated into quality classification. Experiments on the NVIDIA RTX3080 GPU demonstrated that the optimized algorithm improved the original YOLOv5 F1 score by 2.4% and mF1 score by 9.0%, achieving a quality classification F1 score of 95.1%, a processing speed of 178.5 FPS, and an mAP of 81.5%. Comparative experiments showed that the improved algorithm achieved the best detection accuracy on the cork disc dataset while maintaining high processing speed.

Keywords