| Magnetic tile is a core component of a permanent magnet motor,the quality of the magnetic tile is directly related to the motor’ s life span and performance.Therefore,it is necessary to conduct the surface defect detection of magnetic tiles.At present,most magnetic tile manufacturers still adopt manual defect detection,which would cause great negative effect on manufacturing efficiency and product quality.Besides,owing to the diversified types of surface defects and complicated surface patterns of magnetic tiles,it is difficult to accurately identify and classify the surface defects of magnetic tiles by using image processing technology.Therefore,it is of great significance to study an automatic defect detection approach suitable for the manufacture of magnetic tiles.First of all,an improved YOLOv5 s defect detection model is proposed.The model takes YOLOv5 s as the basic framework,which enhances the ability of the network to extract global features by adding the transformer encoder module,and reduces the calculation of the model by replacing the original backbone network with a lightweight Rep VGG network.Aiming at the problem of poor detection accuracy of small target defects,it learns from the structural feature of Bi FPN,redesigns the Neck network,and fuses feature information of different scales to reduce the rate of missed detection.Comparative experiments indicate that the model can achieve a good balance between detection accuracy and detection efficiency and the proposed approach has more advantages than other target detection algorithms.Subsequently,aiming at dealing with the negative influence of uneven illumination on the detection accuracy of the magnetic tile surface,an improved image enhancement algorithm based on Retinex was proposed.The adaptive filter is used to estimate the illumination component,and then the magnetic tile image to be enhanced is processed in blocks,and the return illumination factor is set.According to the characteristics of the region,part of the light is returned to the reflection component in a certain way to obtain the detail component.The detailed component obtained in this way can better restore the properties of the magnetic tile image.Combined with improved local adaptive histogram equalization and gamma correction,the brightness and contrast of detail components are enhanced.The enhancement of magnetic tile images with uneven illumination is eventually realized.Finally,by combining the improved Retinex algorithm with the improved YOLOv5 s model,this paper conducts experiments on the surface defect data set of magnetic tiles.The results indicate that the proposed approach improves the detection accuracy of magnetic tile surface defects by 7.2% compared with that of the approach before improvement and shows dramatic effect and performance in defect detection. |