# Channel Pruning-Based YOLOv7 Deep Learning Algorithm for Identifying Trolley Codes
## 3 Results and Analysis
### Comparison with Other Target Detection Algorithms  
To assess the efficacy of the proposed method, a comparison was conducted with five widely used target detection algorithms, namely YOLOv5x, YOLOv4, YOLOv5m, YOLOv5s, and YOLOv5n. The findings are presented in Table 5.  
The rapid and precise detection of both large and small openings can not only be used to identify trolley codes, but also to generate insights for the identification of other targets in the field of engineering. The results indicate that the mean average precision (mAP) values for the six target detection algorithms were 98.38%, 97.52%, 98.21%, 98.06%, 97.73%, and 99.24%. Additionally, the sizes of the corresponding models were 166 MB, 243.97 MB, 40.8 MB, and 141 MB. The sizes of the files were 2.87 MB, 3.87 MB, and 47.63 MB, and the durations of the forward inference processes were 114 ms, 163 ms, 33.9 ms, 18.8 ms, 8.6 ms, and 8.1 ms.  
In relation to mean average precision (mAP), our proposed method demonstrates an outstanding achievement of 99.24% mAP, surpassing the performance of all five models. In contrast to YOLOv5x, YOLOv4, YOLOv5m, YOLOv5s, and YOLOv5n, our model demonstrates a significant improvement in accuracy for object detection tasks. Specifically, our model achieves a mAP increase of 0.86%, 1.72%, 1.03%, 1.18%, and 1.51% for YOLOv5x, YOLOv4, YOLOv5m, YOLOv5s, and YOLOv5n, respectively. This highlights the superior performance of our model in accurately detecting objects.  
Moving forward to the inference time, the proposed method demonstrates exceptional performance with a mere 8.1 ms, thereby establishing a new benchmark among the five models. In comparison to YOLOv5x, YOLOv4, YOLOv5m, YOLOv5s, and YOLOv5n, our model demonstrates a significant reduction in inference time, with decreases of 105.9 ms, 154.9 ms, 25.8 ms, 10.7 ms, and 0.5 ms, respectively. This statement highlights the advantageous positioning of our model, enabling efficient processing of input images to meet the requirements of real-time applications and high-performance scenarios.  
Figure 10: Results of the fine-tuned model in terms of detecting holes. (**a–c**) are its precision, recall and mAP_0.5, respectively.  
\begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Algorithm** & **Number of Parameters** & \begin{tabular}{c} **Model Size** \\ **(MB)** \\ \end{tabular} & \
\begin{tabular}{c} **mAP (\%)** \\ \end{tabular} &
\begin{tabular}{c} **Forward Propagation** \\ **Time (ms)** \\ \end{tabular} \\ \hline YOLOv5x & 88,922,205 & 166 & 98.38 & 114 \\ YOLOv4 & 62,941,672 & 237.83 & 97.52 & 163 \\ YOLOv5m & 21,172,173 & 40.8 & 98.21 & 33.9 \\ YOLOv5s & 7,025,023 & 14.1 & 98.06 & 18.8 \\ YOLOv5n & 1,867,405 & 3.87 & 97.73 & 8.6 \\ Ours & 24,813,245 & 47.63 & 99.24 & 8.1 \\ \hline \hline \end{tabular}
\end{table}
Table 5: Results of different target detection algorithms in terms of identifying small and large holes.  
Regarding the size of the model, our proposed method is 122.37 MB and 196.34 MB smaller than YOLOv5x and YOLOv4, respectively. In contrast to YOLOv5s, YOLOv5m, and YOLOv5n, our model exhibits larger sizes of 8.27 MB, 6.83 MB, and 43.76 MB, respectively. However, it still maintains its advantage in terms of overall size efficiency. This indicates that our model is highly effective in minimizing storage space consumption, making it particularly well-suited for deployment in resource-constrained environments, such as small end devices.  
In summary, our model demonstrates several advantages in terms of its model size, average accuracy, and forward inference time. Our model demonstrates superior performance compared to YOLOv5x and YOLOv4 in terms of model size. Additionally, it outperforms the other five models in terms of average accuracy and forward inference time. This implies that our model possesses a reduced model size, yet it maintains a high level of accuracy and low inference time. Consequently, it becomes more appropriate for implementation in compact end devices and environments with limited resources.