Polarizer is an important component of liquid crystal display.Because it is vulnerable to external interference during production and transportation,resulting in surface damage,which affects the imaging results of the display,the defective polarizer must be detected before it flows into the market.At present,the mainstream detection method at home and abroad is still manual,that is,to observe whether the polarizer has defects with human eyes.This method is time-consuming and laborious,and it is easy to cause false detection and missed detection.With the continuous development of computer vision technology,more and more manufacturers choose to replace manual production with computer vision technology.The main process is to capture the target with high-resolution camera instead of human eyes,and then transfer the image from the image acquisition card to the computer,and then the computer further operates the image.In view of the high precision and fast efficiency of this method,a detection method of polarizer can be designed by using computer vision technology.At present,the traditional machine vision algorithm is mainly used in the defect research of polarizer at home and abroad.This method is cumbersome,often requires the use of special equipment,such as fringe light source,and can not easily solve the problem of defect classification and location.In view of this,this paper adopts the popular YOLOv5 algorithm in deep learning,and makes a slight improvement on it,and makes a comparative experiment based on the two algorithms before and after the improvement.1.This experiment detects defects that are visible to the naked eye,such as scratches and bubbles.First,500 defect maps are collected as a data set,and then they are expanded to 1000 using scaling,clipping,blurring and other operations.They are divided into training sets and test sets according to the proportion of 8:1.Based on Python language,YOOv5 detection algorithm is used,and the deep learning framework is Py Torch.After 400 rounds of training,the detection experiment was carried out,and the detection accuracy reached 85.01%.2.In view of the low accuracy of YOLOv5 on small targets and even the problem of missing detection,some improvements are made according to the characteristics of the dataset in this paper: 1)Add a Transformer structure in the backbone network,in which the Multihead Attention module can associate features with each other,so as to improve the detection accuracy;2)Add the coordinate attention mechanism CA,so that the model can more accurately locate the target position;3)Modify the loss function to EIOU_Loss to improve the accuracy of border regression;4)The four scale feature output makes the modified network easier to detect small targets,and the generalization ability of the model is stronger.Compared with the original YOLOv5 algorithm,the improved algorithm in this paper is indeed better in detection accuracy and small target recognition ability,which also proves the superiority of the improved algorithm in this paper. |