Improved YOLOv7 for dust and point defects detection of optical lens
-
Graphical Abstract
-
Abstract
During the production and detection process of optical lens, it is inevitable that dust will adhere to the surface. Its appearance is similar to hole and pockmark defects, however it does not have a substantial impact on the performance of the lens. In order to solve this problem, a set of optical lens surface defect acquisition device was designed to collect high-contrast images and use an improved You Only Look Once version 7 (YOLOv7) network to achieve detection and classification. Firstly, the enhanced network incorporated depthwise separable convolutions within feature extraction module and improved the spatial pyramid pooling structure to decrease the parameter count and broaden the receptive area. Secondly, when integrated multi-channel fusion feature enhancement module into the backbone network, this module could enhance the accuracy of similar feature recognition and add the ability of information interaction between channels. Finally, the loss function was modified to normalized Gaussian Wasserstein Distance_Smoothed Intersection over Union (NWD_SIoU) to improve the network's attention to small targets. The experimental results show that the mean average precision for the final network's detection capabilities attains 92.9%, alongside a reduction of 11.8 MB in the model's weight and the frames per second reaches 62.4 f·s−1, which illustrates that the method can distinguish dust from pitting and sand defects quickly and effectively.
-
-