# Channel Pruning-Based YOLOv7 Deep Learning Algorithm for Identifying Trolley Codes
## 4 Conclusions  
Based on extensive research conducted on the yolov7 model, this paper utilizes the YOLOv7 architecture and integrates an optimized channel pruning algorithm to present a novel approach for accurately detecting trolley codes in real-time within standard operating scenarios. The primary purpose of this technology is to address the challenge of identifying trolley codes in real-world engineering applications. The primary outcomes of the study are succinctly outlined as follows:  
* The proposed method not only demonstrates a high level of accuracy, but also enables the efficient detection of trolley codes. By implementing the channel-pruning-based YOLOv7 deep learning algorithm, notable reductions in the number of parameters, model size, and forward inference time are achieved when compared to the unmodified model. Specifically, there is a decrease of 32.92% in the number of parameters, a reduction of 34.1% in model size, and a decrease of 48.8% in forward inference time. These enhancements have been implemented while ensuring accuracy is not compromised. Experiments have been conducted to demonstrate the method's resistance to variations in factors such as the target camera distance and ambient lighting. These experiments aim to ensure consistent results under typical operating conditions. This demonstration of robustness further validates the practical viability of the proposed method.
* The method presented in this study generates a simplified model that demonstrates the ability to accurately identify tram codes in typical operational environments. The experimental results exhibit a remarkable average precision (mAP) value of 99.24%, surpassing YOLOv5x, YOLOv4, YOLOv5m, YOLOv5s, and YOLOv5n by 0.86%, 1.72%, 1.03%, 1.18%, and 1.51%, respectively. In relation to the time taken for forward inference, the enhanced model achieved a duration of 8.1 ms, representing a reduction of 7.6 ms compared to YOLOv7. The objective of this study was to offer valuable technical insights into the implementation of tram code recognition models in compact terminals and the potential integration of automatic target detection models in engineering applications. The aforementioned contribution serves as a fundamental basis for future investigations within this particular field. In subsequent research, it is recommended to explore the development of algorithms aimed at enhancing feature extraction. This can be achieved through the implementation of attention mechanisms or other multi-scale fusion algorithms. By improving the feature extraction capabilities of the model, the performance of trolley coding detection can be significantly enhanced.  
Figure 12: Results of identification of large and small holes under different intensities of light. (**a**) A case of correctly identifying the hole position in sample 01111S under low light conditions. (**b**) A case of correctly identifying the position of the hole in sample 01111L under bright light conditions.  
**Author Contributions:** Conceptualization, J.Z.; methodology, J.Z.; software, R.Z.; validation, R.Z.; formal analysis, R.Z.; investigation, X.S.; resources, L.Y.; data curation, X.X.; writing--original draft preparation, R.Z.; writing--review and editing, R.Z.; visualization, J.Z.; supervision, J.Z.; project administration, J.Z. All authors have read and agreed to the published version of the manuscript.  
**Funding:** This research received no external funding.  
**Institutional Review Board Statement:** Not applicable.  
**Informed Consent Statement:** Not applicable.  
**Data Availability Statement:** Not applicable.  
**Conflicts of Interest:** The authors declare no conflict of interest.