| Contact lens defect detection is an important task in the production process of contact lenses to ensure their factory quality.Due to the complex and diverse printing patterns of contact lenses and the small size of common defects,there are certain challenges in detecting and locating their defects.Traditional contact lens defect detection mainly utilizes instruments and equipment to assist in manual naked eye detection,and the detection results are easily influenced by the subjective consciousness of quality inspectors,with low detection efficiency,high missed and false detection rates.In order to solve the problems of manual inspection,this article aims to construct a deep learning based contact lens defect detection system,achieving efficient and automated detection of contact lenses.On the basis of studying deep learning theory and machine vision defect detection methods,the paper developed a machine vision defect detection system based on deep learning.The system includes an image acquisition module,an automatic feeding module,a defect detection algorithm module,and a detection system software module.Firstly,this article proposes an image acquisition system suitable for detecting small defects in contact lenses in liquid environments,which highlights the edges of defects through backlighting and small hole illumination.Secondly,a turntable type automatic feeding device is designed,which uses the pulse signal generated by the motion controller to drive the stepping motor,which drives the lens carrier plate to rotate at a specific angle through the flange coupling,and automatically transmits the lens to be inspected to the right below the industrial camera to complete image acquisition.Then,the YOLOv5 model was selected as the original network for the defect detection algorithm in the paper.In response to the problems of small contact lens defect area and low recognition rate,the feature extraction module structure of the original network was improved,and attention mechanism was introduced to improve the detection accuracy of the model.Finally,a contact lens defect detection system software was developed,and comparative experiments were conducted on different types of defects under different defect detection network models,and the experimental data was analyzed.The experimental results show that the contact lens defect detection system developed in this article based on deep learning can accurately collect contact lens images in real-time.The improved YOLOv5 model can accurately detect different types of defects,achieving efficient and automated contact lens detection. |