To reduce the detection cost of motor commutator defects,and improve detection efficiency,and meet the balanced requirements of detection accuracy and speed in practical engineering,an optimized and improved surface defect detection algorithm based on the YOLOv5m model is proposed.The collected data is enhanced through Mosica data augmentation to enhance the robustness of model.In other layers,the bidirectional feature pyramid network(BiFPN)layer is used instead of the path aggregation network(PANet)layer,introducing bidirectional connections and cross-layer feature fusion mechanisms,and adding a Criss-Cross attention mechanism to better capture relevant information in the input sequence,and enhance network feedback at different scales,and verified through ablation experiments.The results show that compared to the traditional YOLOv5m model,the average precision(AP),accuracy,and recall of the optimized and improved YOLOv5m model increases by 17%,28.3%,and 8.2%,respectively.While ensuring detection accuracy,the detection time for defects is shortened,better meeting the balanced requirements of detection accuracy and speed in defect detection engineering.
关键词
电机换向器/表面缺陷/YOLOv5m/注意力机制/特征融合
Key words
motor commutator/surface defect/YOLOv5m/attention mechanism/feature fusion