| Magnetic ring is a kind of permanent magnet ferrite with a circular ring.It is widely used in various electrical devices in the industries of electronic timer,automobile manufacturing and instrument devices,etc.It is an important antiinterference equipment in the circuit.Its quality greatly affects the performance of the equipment.However,in the current production process,because of the impact of raw material composition,processing technology and equipment conditions,the surface of the magnetic ring will inevitably appear some processing defects,such as gaps,cracks and stains,etc.,these defects will affect the service life and performance of the magnetic ring.At present,some common defects on the surface of magnetic rings are mainly detected by experienced workers to observe whether there are defects on the surface of magnetic rings with the naked eye.This detection method has low efficiency and is prone to visual fatigue owing to subjective human influence.Therefore,the development of an intelligent and efficient magnetic ring defect detection system is of great significance to the actual production.In recent years,with the extensive application of deep learning,remarkable achievements have been made in the field of industrial production.In order to make the magnetic ring production line more intelligent and precise,this paper applies the deep learning technology to the magnetic ring defect detection task to detect the surface defects of the magnetic ring and measure the size of its inner and outer rings.The main work of the article is as follows:Firstly,the selection of hardware equipment such as industrial cameras,lenses and light sources was carried out.By analyzing the imaging characteristics of magnetic ring objects,the hardware platform of image acquisition and the appropriate lighting method were designed according to the system design scheme to obtain magnetic ring images with clear features.Secondly,a magnetic ring defect detection method based on improved YOLOv3 is proposed.Based on the structure of YOLOv3 algorithm,the k-means clustering method was used to generate the initial anchor frame for the magnetic ring data set.Then,according to the characteristics of the magnetic ring defect size,a more streamlined feature extraction network structure YOLO-T was proposed,and a space pyramid pooling module was added at the end to enrich the extracted defect features,and the improved magnetic ring defect detection algorithm YOLO-TS was obtained.The experimental results show that the average recognition accuracy of the proposed method is 96.64%,and the test time of each image is about 16 ms.Compared with the traditional YOLOv3 algorithm,the optimized model not only ensures the original accuracy,but also significantly reduces the amount of computation,which can meet the real-time requirements of the defect detection system.Thirdly,aiming at the size measurement problem of magnetic ring,first the magnetic ring image was processed by filtering denoising and threshold segmentation,and then the Canny operator was selected as the image edge extraction method by comparing the processing results of other similar algorithms.Finally,based on the camera calibration,the radius size of the magnetic ring is calculated according to the least square principle.Through the actual test,the measurement accuracy of this system can reach 0.05 mm,which can meet the high-precision detection requirement of magnetic ring size. |