## 3 Method
### Model Improvement and Optimization
#### 3.3.1 Ghost Lightweight Model  
The traditional feature extraction approaches used for convolutional neural networks include the use of convolution mapping operations on all input channels using a number of convolution kernels. However, stacking several convolutional layers results in rich, often redundant feature maps and requires a significant amount of processing and parameters. Figure 3 shows a crack picture from the dataset after a typical convolution. The feature network extraction layer's initial convolution layer may be seen to have several redundant pictures that are quite similar to one another. Although these redundant feature maps are useful for network training as well, creating them requires a lot of computation and is costly. We also anticipate that the concept will be portable to traditional hardware platforms or mobile devices in terms of actual use. This study enhanced model lightweight operation for the original YOLOv5 method based on the two reasons mentioned above. Huawei Noah's Ark Lab proposed the GhostNet lightweight model at the 2020 CVPR conference, and its core module is the Ghost module. The purpose of the Ghost module is to substitute portions of the standard convolution for feature extraction via linear transformation. Some redundant feature maps may be modified from the conventional convolution feature maps that are obtained to collect comparable feature maps. This greatly reduces the number of convolution calculations and parameters, and it can be easily integrated into other networks. The difference between the ordinary convolution module and the Ghost convolution module is shown in Figure 4. \begin{table}
\begin{tabular}{c c c c c} \hline
**Num 1** & **From 2** & **Params 4** & **Module 5** & **Arguments 6** \\ \hline
0 & \(-\)1 3 & 3520 & Conv & [3, 32, 6, 2, 2] \\
1 & \(-\)1 & 10,144 & GhostConv & [32, 64, 3, 2] \\
2 & \(-\)1 & 11,344 & CAC3 Ghost & [64, 64, 1] \\
3 & \(-\)1 & 38,720 & GhostConv & [64, 128, 3, 2] \\
4 & \(-\)1 & 43,512 & CAC3 Ghost & [128, 128, 2] \\
5 & \(-\)1 & 151,168 & GhostConv & [128, 256, 3, 2] \\
6 & \(-\)1 & 177,872 & CAC3 Ghost & [256, 256, 3] \\
7 & \(-\)1 & 597,248 & GhostConv & [256, 512, 3, 2] \\
8 & \(-\)1 & 614,944 & CAC3 Ghost & [512, 512, 1] \\
9 & \(-\)1 & 656,896 & SPPF & [512, 512, 5] \\
10 & \(-\)1 & 69,248 & GhostConv & [512, 256, 1, 1] \\
11 & \(-\)1 & 0 & Upsample & [None, 2, 'nearest'] \\
12 & \([-\)1, 6] & 0 & Concat & [1] \\
13 & \(-\)1 & 208,608 & C3 Ghost & [512, 256, 1, False] \\
14 & \(-\)1 & 18,240 & GhostConv & [256, 128, 1, 1] \\
15 & \(-\)1 & 0 & Upsample & [None, 2, 'nearest'] \\
16 & \([-\)1, 4] & 0 & Concat & [1] \\
17 & \(-\)1 & 53,104 & C3 Ghost & [256, 128, 1, False] \\
18 & \(-\)1 & 75,584 & GhostConv & [128, 128, 3, 2] \\
19 & \([-\)1, 14] & 0 & Concat & [1] \\
20 & \(-\)1 & 143,072 & C3 Ghost & [256, 256, 1, False] \\
21 & \(-\)1 & 298,624 & GhostConv & [256, 256, 3, 2] \\
22 & \([-\)1, 10] & 0 & Concat & [1] \\
23 & \(-\)1 & 564,672 & C3 Ghost & [512, 512, 1, False] \\ \hline \end{tabular}  
* In the table, 1 represents the network layer serial number; 2 represents which layer the input of the current network comes from, 3 represents the output from the previous layer, 4 represents the size of the parameter, 5 is the network module, and 6 represents the information of the module parameters (including the number of input channels, the number of output channels, the size of the convolution kernel, and the step size information).  
\end{table} 
Table 3: The network structure of YOLOv5-G. Suppose \(X=[x_{1},x_{2},\ldots x_{c_{r}}]\in R^{c\times h\times w}\) is the size of the input feature map, \(f\in R^{c\times k\times w}\) is the size of the convolution kernel of the layer, and \(Y=[y_{1},y_{2},\ldots y_{n}]\in R^{n\times h\times w}\) is the size of the output feature map, where c and n represent the number of channels of the input and output feature maps, \(h/h^{\prime}\) and \(w/w^{\prime}\) represent the height and width of the feature maps, and k represents the size of the convolution kernel.