# Optimization Algorithm for Surface Defect Detection of Aircraft Engine Components Based on YOLOv5
## 3 Improvement Methods and Improved Models
### C3-Faster: Based on the Lightweight FasterNet Model  
In order to improve the speed of object detection algorithms, [PERSON] et al. [28] proposed a new method called PConv (Partial Convolution). The basic idea of this method is to only convolve the non-zero parts of the input, while leaving the zero parts untouched. This approach reduces redundant computations and memory access, allowing for a more efficient extraction of spatial features. Based on this idea, they introduced the FasterNet network, which significantly improves detection speed without compromising accuracy.  
Building on this, this paper further proposes the C3-Faster module to replace the C3 module used for feature extraction in YOLOv5. The C3-Faster module utilizes the constructor function of the C3 module and introduces the PConv layer and Faster_Block module.  
Both the Partial Convolution layer and Faster_Block module adopt a similar concept to PConv, where a portion of the weights in the convolutional kernel is set to 0, effectively ignoring certain pixels. This partial convolution operation enhances the model's robustness, generalization ability, and non-linear expression, leading to improved detection accuracy. The Faster_Block processes the input feature map using partial convolutions, reducing computational complexity and model parameters to improve algorithm efficiency. This design allows for a more effective utilization of computational resources and accelerates the inference speed of the model. The structure of the Faster_Block is shown in Figure 3. In the diagram, \"conv\" is an abbreviation for convolution, referring to the convolution operation.  
In the figure above, * stands for the convolution operation. \(h\) and \(w\) represent the height and width of the feature map; \(c_{p}\) refers to the channel number used in PConv; \(k\) represents the size of the convolution kernel; Identity denotes the identity mapping, which is used to maintain the input and output sizes consistent.  
In the forward propagation process of the Faster_Block module, the connection paths can be disabled by modifying parameters to enable the DropPath (Dropout with Paths) functionality during training. DropPath is a regularization technique for deep neural networks, which can be seen as a structured form of dropout operation. It helps improve the model's generalization ability, allowing it to better adapt to new, unseen data. DropPath applies dropout operation at each level of the network architecture by randomly \"dropping\" or disabling certain connection paths with a certain probability. Unlike traditional dropout, DropPath operates on the network's connection paths rather than individual neurons. During training, DropPath randomly sets certain connection paths to zero, simulating the random disconnection of connections during inference. This encourages the network to learn more robust feature representations in the presence of partially disconnected connections, thus increasing the network's generalization ability.  
In summary, this paper introduces the concept of partial convolution and further proposes the C3-Faster module based on the FasterNet network to replace the original C3 module in order to improve detection speed, reduce algorithm size, and strive to maintain detection accuracy as much as possible.  
Figure 3: The structure of C3-Faster.