| With the improvement of social living standards,leather is one of the common consumer goods in daily life and production.The application fields of leather are very wide,covering the main industries such as tanning,shoemaking,leather clothing,leather goods,fur and its products,as well as the supporting industries such as leather chemical industry,leather hardware,leather machinery and accessories.However,leather products are prone to defects or defects in the production and manufacturing process,which will damage their appearance and affect sales,which is not conducive to the development of the leather industry.Therefore,it is necessary to detect the leather in the whole production process and screen out the defective leather.The traditional leather defect detection mainly includes manual detection and detection based on machine vision,but the accuracy is low,time-consuming and inefficient,so it can not achieve the purpose of real-time detection.At present,the target detection algorithm based on deep learning is becoming more and more mature,especially the YOLOv3 algorithm has low background false detection rate and good robustness,but it has the problems of poor small target detection effect and poor location accuracy.To sum up,according to the needs of a cooperative leather production enterprise,this thesis proposes an improved real-time automatic target detection algorithm model of YOLOv3,so as to detect the defects produced in the leather production process with high efficiency and precision.The main work and innovations of this thesis are as follows:(1)Improve the network structure of YOLOv3 algorithm.In order to improve the accuracy of the model for leather defects,especially small target detection,Se attention mechanism is added to the original YOLOv3 network structure to distribute different weights to the feature information,so as to change the way of average distribution of the original feature information,make the model pay more attention to the feature information with richer weights,and suppress the useless feature information,so as to improve the accuracy of model detection.(2)A priori box of improved YOLOv3 algorithm.Since the prior frame of the improved YOLOv3 algorithm is clustered from the coco data set,it is quite different from the defect target scale in the leather defect data set,resulting in inaccurate detection and positioning,resulting in missed detection.Therefore,this thesis re clusters the leather defect data set,so as to obtain a priori frame closer to the target defect scale,and further improve the AP(average accuracy)and detection speed of the model.(3)Improve the loss function of YOLOv3 algorithm.In order to improve the poor detection of leather defect target by the model,this thesis analyzes the loss function of YOLOv3 algorithm,and replaces the IOU regression loss of the original model with giou regression loss.The average detection accuracy of the improved model is improved as a whole.(4)Improve the activation function of YOLOv3 algorithm.In order to improve the stability of model training and the accuracy of leather detection and improve the generalization ability of leather defect detection,this thesis replaces the leakyrelu activation function in YOLOv3 algorithm with the mish activation function.Although the detection speed is slightly reduced,the generalization ability of the improved model is better,so as to improve the average detection accuracy of leather detection as a whole.In this thesis,NVIDIA A10 graphics card is used to apply the above improved YOLOv3 algorithm.The experimental results show that:(1)first add se attention mechanism to YOLOv3 model,so that the model map(mean average accuracy)is 0.2% higher than the original model,and the average detection time is 0.3ms longer;(2)Then the leather defect data set is re clustered,and the improved a priori frame is used to improve the model map by0.5% and reduce the average detection time by 0.1ms;(3)Then,the improved loss function is used,which is 1.2% higher than the improved map,and the average detection time remains unchanged;(4)Finally,using the improved activation function,the map of the model is 0.7% higher than that before the improvement,and the average detection time is2.8ms longer.Finally,the improved model map reached 78.2%,and the average detection time of a 512 * 512 leather picture was 11.4ms.According to the above experimental results,the improved model not only meets the needs of real-time detection of leather defects,but also has higher accuracy than the original YOLOv3 model,which is more suitable for leather defect detection in the production process of actual enterprises. |