Abstract:Currently, defect detection of CNC machine tool bearing seats primarily relies on manual visual inspection, which cannot meet the demands for high precision, high efficiency, and low error rates in industrial production. To address these issues, a defect detection algorithm based on an improved YOLOv5s is proposed for CNC machine tool bearing seats. Firstly, the HardSwish activation function is used to replace the GELU in ConvNeXtv2, and a novel CSCConvNeXtv2-HS structure is introduced, incorporating the CSC module to replace the C3 module in the backbone network. This modification reduces computational complexity while enhancing the feature extraction capability of key information. In the Neck network, a Scale Sequence Feature Fusion module is introduced to improve the model′s ability to extract multi-channel information. Finally, The final proposal of the Focal-Inner Loss loss function not only improves the speed of training convergence but also reduces the impact brought about by the imbalance in class distribution. Experimental results show that the improved model achieves an accuracy of 91.09%, a recall rate of 81.97%, and a mean Average Precision of 84.40%, with a processing speed of 61.73 fps. All evaluation metrics show improvements of 2.52%, 4.47%, 6.7%, and 1.12 fps compared to the original YOLOv5s model, thereby satisfying industrial production requirements.