# Optimization Algorithm for Surface Defect Detection of Aircraft Engine Components Based on YOLOv5
## 1 Introduction
[12] added an anchor-free feature selection mechanism to the YOLOv3 algorithm to shorten model computation time and enhance the representation capability of a specially designed dense convolution block. This achieved the surface defect detection of steel strips. [PERSON] et al. [13] improved the YOLOv5 algorithm by utilizing channel attention and spatial attention mechanisms to strengthen the fusion of features in neural network fusion. They improved the original networks' multi-scale feature fusion structure based on the PANet structure and achieved the efficient and accurate detection of remote sensing images. [PERSON] et al. [14] proposed an improved YOLOv5 algorithm, which added a micro-scale detection layer based on the original algorithm and incorporated the CBAM (Convolutional Block Attention Module) attention mechanism to control the feature information loss of small target defects and significantly improve the efficiency and accuracy of wind turbine blade defect detection. [PERSON] et al. [15] proposed an improved detection model based on Yolov4-micro for detecting blade crack defects in aircraft engines. They introduced an attention mechanism in the backbone network to enhance background discrimination and improved the effect of multi-scale feature fusion by implementing bilinear interpolation in the upsampling module, which greatly improved the detection performance. [PERSON] et al. [16] proposed an improved YOLOv5 model for crack detection by introducing the Focal-GIOU loss function and replacing CIOU with GIOU to adapt to more irregular targets, thereby enhancing the effectiveness of crack detection. Significant progress has been made in terms of detection accuracy and speed in the extensive research on object detection. However, the internal space of aircraft engines is narrow and complex, often densely populated with various potential areas of defects. Moreover, there is a wide variety of defect types, which still require further targeted improvements. [PERSON] et al. [17] used Faster R-CNN to detect damage on aircraft engine blades, achieving high levels of accuracy in detecting dents and punctures. [PERSON] et al. [18] addressed the issues of complex structures and low detection accuracy in traditional algorithms for aircraft engine sensor fault detection by proposing an Inception-CNN model. They applied this model to aircraft engine sensor fault detection, achieving a detection accuracy of 95.41% on a sensor fault dataset. [PERSON] et al. [19] added attention mechanisms to YOLOv4, enhancing the algorithm's detection accuracy for welding damages on aircraft engines. [PERSON] et al. [20] achieved further improvements in engine component surface defect detection accuracy and speed by recalculating the parameters of preset anchors using the k-means clustering algorithm, adding the ECA-Net (Efficient Channel Attention) attention mechanism in the network, and replacing the Neck structure in the YOLOv5 algorithm. Building on the above, this article establishes a dedicated dataset for the detection of defects in aircraft engine components, which maximally reproduces the defect features of aircraft engine components in actual usage scenarios. Based on these defect features, an improved YOLOv5 object detection algorithm is proposed with the aim of improving detection accuracy and reducing model size. The improved YOLOv5 algorithm adds a dual-route attention mechanism to enhance detection accuracy, optimizes the C3 module to make the model lightweight, introduces the NWD index to improve small object detection performance, and adds the CARAFE upsampling operator to enhance content-awareness. These improvements enable the effective detection of surface defects in aircraft engine components.