Abstract:
Aiming at the problem of the insufficient precision and frequent oversights or misidentifications in casting detection, a YOLOv5 casting automatic detection algorithm based on multi-scale feature is proposed. This algorithm uses a binocular camera to capture images of castings and builds a dataset of casting images. To extract more comprehensive features of the castings, a multi-scale feature fusion module is employed, and adding an extra detection layer to identify castings of different scales. To capture more detailed features, a Convolutional Block Attention Module (CBAM) is embedded in the Feature Pyramid Network to enhance the ability to extract key features of casting images. At the same time, the Swish activation function in the convolutional layer is replaced with Hardswish to reduce the amount of model parameters. Experimental results demonstrate that this algorithm achieves a mean average precision (mAP) of 96.5%, representing a 2.6% improvement compared to the original YOLOv5 algorithm, effectively meeting the precision and real-time requirements for casting automatic detection.