Abstract
In the manufacturing process of cardboard boxes, rapid and accurate surface defect detection is crucial for ensuring quality and preventing resource waste. However, current target detection models have large parameters that impact real-time processing and hinder deployment on devices with limited computational power, reducing both efficiency and applicability. To solve this challenge and better align with real-world application demands, a lightweight improved YOLOv5s model for detecting surface defects on cardboard boxes has been proposed in this study. Inspired by the lightweight features of ShuffleNetV2 and the Ghost model, and with the aim of achieving model lightweighting, the backbone is initially restructured through the incorporation of the ShuffleNetV2 primitive unit. Subsequently, we replace C3 and CBS with C3_Ghost and G_CBS, developing a lightweight backbone and neck structure. Ultimately, inter-layer skip connections are employed to design a feature fusion network applied in the neck to compensate for accuracy. The expriment results demonstrates that the improved YOLOv5-S-G-B model achieves significant reductions in parameters, GFLOPs, and weight dimensions-74.3%, 78.5%, and 72.3%, respectively, compared to the original YOLOv5s. It maintains an average accuracy of 94% and the average detection rate on less powerful CPUs increases from 7.00 frames per second (FPS). The YOLOv5-S-G-B model maintains high accuracy while featuring a significantly lightweight structure, making it better suited for real-world cardboard box defect detection applications.













Similar content being viewed by others
Data availability
The codes used during the current study are available from the corresponding author upon reasonable request.
References
Coelho, P.M., Corona, B., ten Klooster, R., Worrell, E.: Sustainability of reusable packaging-current situation and trends. Resourc. Conserv. Recycl: X 6, 100037 (2020)
Ahmad, S., Utomo, D.S., Dadhich, P., Greening, P.: Packaging design, fill rate and road freight decarbonisation: a literature review and a future research agenda. Clean. Logist. Supply Chain 4, 100066 (2022)
Zhang, A.: Investment analysis of artificial intelligence. Highlights Bus. Econ. Manag. 24, 647–652 (2024)
Wu, Y., Lu, Y.: An intelligent machine vision system for detecting surface defects on packing boxes based on support vector machine. Meas. Control 52, 1102–1110 (2019)
Yang, X., Han, M., Tang, H., Li, Q., Luo, X.: Detecting defects with support vector machine in logistics packaging boxes for edge computing. IEEE Access 8, 64002–64010 (2020)
Zheng, X., Zheng, S., Kong, Y., Chen, J.: Recent advances in surface defect inspection of industrial products using deep learning techniques. Int. J. Adv. Manuf. Technol. 113, 35–58 (2021)
Lakshmi, G., Sankar, V.U., Sankar, Y.S.: A survey of PCB defect detection algorithms. J. Electron. Test. 39, 541–554 (2023)
Jayagopal, P., et al.: A modified generative adversarial networks with yolov5 for automated forest health diagnosis from aerial imagery and tabu search algorithm. Sci. Rep. 14, 4814 (2024)
Jiang, L., Nie, W., Zhu, J., Gao, X., Lei, B.: Lightweight object detection network model suitable for indoor mobile robots. J. Mech. Sci. Technol. 36, 907–920 (2022)
Zhou, H., Zhao, Z., Liu, X.: Detection of urban underground sewage pipeline system based on YOLOv5-Shufflenet lightweight model. In: International Conference on Computer, Artificial Intelligence, and Control Engineering (CAICE 2023), pp. 126450E (2023). https://doi.org/10.1117/12.2680902
Li, Z., Lei, X., Liu, S.: A lightweight deep learning model for cattle face recognition. Comput. Electron. Agric. 195, 106848 (2022)
Agarwal, P., Alam, M.: A lightweight deep learning model for human activity recognition on edge devices. Procedia Comput. Sci. 167, 2364–2373 (2020). International Conference on Computational Intelligence and Data Science
Razfar, N., True, J., Bassiouny, R., Venkatesh, V., Kashef, R.: Weed detection in soybean crops using custom lightweight deep learning models. J. Agric. Food Res. 8, 100308 (2022)
Liu, G., Hu, Y., Chen, Z., Guo, J., Ni, P.: Lightweight object detection algorithm for robots with improved yolov5. Eng. Appl. Artif. Intell. 123, 106217 (2023)
Ma, N., Zhang, X., Zheng, H.-T., Sun, J.: Shufflenet v2: practical guidelines for efficient CNN architecture design (2018). arXiv:1807.11164. Available online: Accessed on 20 Dec. 2023
Han, K., Wang, Y., Tian, Q., Guo, J., Xu, C., Xu, C.: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pp. 1580–1589 (2020)
Chen, J., Mai, H., Luo, L., Chen, X., Wu, K.: Effective feature fusion network in bifpn for small object detection. In: 2021 IEEE International Conference on Image Processing (ICIP), pp. 699–703 (2021)
Kou, X., Liu, S., Cheng, K., Qian, Y.: Development of a yolo-v3-based model for detecting defects on steel strip surface. Measurement 182, 109454 (2021)
Yao, J., et al.: A real-time detection algorithm for kiwifruit defects based on yolov5. Electronics 10, 1711 (2021)
Dlamini, S., Kao, C.-Y., Su, S.-L., Jeffrey Kuo, C.-F.: Development of a real-time machine vision system for functional textile fabric defect detection using a deep yolov4 model. Text. Res. J. 92, 675–690 (2022)
Li, Z., Zhang, Z., Ma, J., Tian, L.: Improved YOLOV5 based industrial surface defect detection method. In: 2023 International Conference on Computers, Information Processing and Advanced Education (CIPAE), pp. 367–370 (2023). https://doi.org/10.1109/CIPAE60493.2023.00077
Jiang, P., Ergu, D., Liu, F., Cai, Y., Ma, B.: A review of yolo algorithm developments. Procedia Comput. Sci. 199, 1066–1073 (2022)
Wang, D., He, D.: Channel pruned yolo v5s-based deep learning approach for rapid and accurate apple fruitlet detection before fruit thinning. Biosys. Eng. 210, 271–281 (2021)
Redmon, J., Farhadi, A.: Yolov3: an incremental improvement (2018). arXiv:1804.02767. Available online: Accessed on 20 Dec. 2023
Zhao, H., et al.: Mixed yolov3-lite: a lightweight real-time object detection method. Sensors 20, 1861 (2020)
Bochkovskiy, A., Wang, C.-Y., Liao, H.-Y.M.: Yolov4: optimal speed and accuracy of object detection (2020). arXiv:2004.10934. Available online: Accessed on 20 Dec. 2023
Parico, A., Ahamed, T.: Real time pear fruit detection and counting using yolov4 models and deep sort. Sensors 21, 4803 (2021)
Martindez-Diaz, Y., Luevano, L.S., Mendez-Vazquez, H., Nicolas-Diaz, M., Chang, L., Gonzalez-Mendoza, M.: Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV) (2019)
Zhang, S., et al.: Edge device detection of tea leaves with one bud and two leaves based on shufflenetv2-yolov5-lite-e. Agronomy 13, 577 (2023)
Cengil, E., Çınar, A., Yıldırım, M.: An efficient and fast lightweight-model with shufflenetv2 based on yolov5 for detection of hardhat-wearing. Rev. Comput. Eng. Stud. 9, 116–123 (2022)
Liu, H., Sun, F., Gu, J., Deng, L.: Sf-yolov5: a lightweight small object detection algorithm based on improved feature fusion mode. Sensors 22, 5817 (2022)
Qing, Y., Liu, W., Feng, L., Gao, W.: Improved yolo network for free-angle remote sensing target detection. Remote Sens. 13, 2171 (2021)
Hu, X., et al.: Real-time detection of uneaten feed pellets in underwater images for aquaculture using an improved yolo-v4 network. Comput. Electron. Agric. 185, 106135 (2021)
Zheng, Z., et al.: Enhancing geometric factors in model learning and inference for object detection and instance segmentation. IEEE Trans. Cybern. 52, 8574–8586 (2021)
Tan, M., Pang, R., Le, Q.V.: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pp. 10781–10790 (2020)
Dewi, C., Chen, R.C., Jiang, X., et al.: Deep convolutional neural network for enhancing traffic sign recognition developed on yolo v4. Multimedia Tools Appl. 81, 37821–37845 (2022). https://doi.org/10.1007/s11042-022-12962-5
Lin, G., Liu, K., Xia, X., Yan, R.: An efficient and intelligent detection method for fabric defects based on improved yolov5. Sensors 23, 97 (2023)
Bie, M., Liu, Y., Li, G., Hong, J., Li, J.: Real-time vehicle detection algorithm based on a lightweight you-only-look-once (yolov5n-l) approach. Expert Syst. Appl. 213, 119108 (2023)
Zhao, H., Zhang, H., Zhao, Y.: Yolov7-sea: Object detection of maritime UAV images based on improved yolov7 (2023)
Acknowledgements
Thanks to everyone in the laboratory for your dedication and guidance, and thanks for your corrections.
Funding
This study was supported by the National Natural Science Foundation of China (No. 42004057) .
Author information
Authors and Affiliations
Contributions
All the authors contributed extensively to the manuscript. YM and LZ contributed to data collection and algorithm development. XW and ZZ helped with the formatting review and editing of the paper. All authors read and approved the final version of the manuscript.
Corresponding author
Ethics declarations
Conflict of interest
The authors declare that they have no conflict of interest.
Additional information
Publisher's Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Rights and permissions
Springer Nature or its licensor (e.g. a society or other partner) holds exclusive rights to this article under a publishing agreement with the author(s) or other rightsholder(s); author self-archiving of the accepted manuscript version of this article is solely governed by the terms of such publishing agreement and applicable law.
About this article
Cite this article
Yang, M., Li, D., Luo, P. et al. YOLOv5-S-G-B: a lightweight intelligent detection model for cardboard surface defects. SIViP 18, 6997–7011 (2024). https://doi.org/10.1007/s11760-024-03369-w
Received:
Revised:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s11760-024-03369-w