Abstract:The detection of electrical cabinet parts is an important part of the production of electrical cabinets. Machine vision is used to automatically identify the type and installation location of parts in the electrical cabinet, and to detect the assembly defects of the electrical cabinet in time. However, the existing object detection in-depth learning model has low timeliness, which makes it difficult to meet the online detection requirements of electrical cabinet parts. In this paper, the YOLOv4 object detection model is pruned and optimized, and a lightweight object detection model SlimYOLO is proposed. SlimYOLO improves the feature extraction network structure, compresses the redundant feature layer, and improves the detection speed of the model. At the same time, the Kmeans++ clustering algorithm is used to cluster anchor box parameters, which improves the detection effect of the model for electrical cabinet parts. Based on the self-built data set of electrical cabinet parts, an experimental study was carried out. The average detection accuracy of SlimYOLO is 98.08%, which is 0.58% higher than YOLOv4, the model volume is reduced by 9.8%, the parameter is reduced by about 7 million, and the detection speed is increased by 10%, which lays a foundation for the fast and intelligent detection of electrical cabinet parts in the actual industrial scene.