Skip to main content
Log in

SPSO-Pruner: a network pruning method on YOLOv5 for fewer categories scenarios

  • Published:
Multimedia Tools and Applications Aims and scope Submit manuscript

Abstract

In recent years, object detection methods based on deep learning have developed rapidly, but we have found that comparing with public datasets, the categories of objects to be recognized in most practical scenarios are relatively small. In such scenarios, we proposed a network pruning method inspired by the PSO algorithm, named SPSO-Pruner to improve the detection accuracy and speed, while reducing the model parameters. To better fit the application scenarios, we used the up-to-date one stage detector - YOLOv5 to adapt to the real-time requirements. Comparing with regular network prune method such as slimming prune, our SPSO-pruner can reach better accuracy with less than 50% parameters. Besides, we proposed an optimization method for confidence Loss of YOLOv5 which can balance the Precision and Recall of our model, the F1 of our method is 4% higher than the baseline model.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4

Similar content being viewed by others

References

  1. Ashraf AH, Imran M, Qahtani AM, Alsufyani A, Almutiry O, Mahmood A, Attique M, Habib M (2022) Weapons detection for security and video surveillance using CNN and YOLO-v5s. CMC-Comput Mater Continua 70(2):2761–2775

    Article  Google Scholar 

  2. Bochkovskiy A, Wang C-Y, Liao H-YM (2020) Yolov4: Optimal speed and accuracy of object detection. arXiv:2004.10934

  3. Cai Z, Vasconcelos N (2018) Cascade r-cnn: Delving into high quality object detection. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp 6154–6162

  4. Deng J, Dong W, Socher R, Li L-J, Li K, Fei-Fei L (2009) Imagenet: A large-scale hierarchical image database. In: 2009 IEEE conference on computer vision and pattern recognition. IEEE, pp 248–255

  5. Duan K, Bai S, Xie, L, Qi H, Huang Q, Tian Q (2019) Centernet: Keypoint triplets for object detection. In: Proceedings of the IEEE/CVF international conference on computer vision. pp 6569–6578

  6. Everingham M, Van Gool L, Williams CK, Winn J, Zisserman A (2010) The pascal visual object classes (VOC) challenge. Int J Comput Vis 88(2):303–338

    Article  Google Scholar 

  7. Geiger A, Lenz P, Urtasun R (2012) Are we ready for autonomous driving? the kitti vision benchmark suite. In: 2012 IEEE conference on computer vision and pattern recognition. IEEE, pp 3354–3361

  8. Jianxiu H (2015) Adaptive second-order oscillation particle swarm optimization algorithm. Electornic Technol Softw Eng 1(20):182–183

    Google Scholar 

  9. Jianxiu H, Jianchao Z (2007) A two-order particle swarm optimization model. J Comput Res Dev 44(11):1825

    Article  Google Scholar 

  10. Jocher G, Stoken A, Borovec J, Chaurasia A, Changyu L, Laughing V, Hogan A, Hajek J, Diaconu L, Kwon Y, et al (2021) ultralytics/yolov5: v5. 0-yolov5-p6 1280 models aws supervise. ly and youtube integrations. Zenodo 11

  11. Kennedy J, Eberhart R (1995) Particle swarm optimization. In: Proceedings of ICNN’95-international conference on neural networks, vol 4. IEEE, pp 1942–1948

  12. Li B, Liu Y, Wang X (2019) Gradient harmonized single-stage detector. In: Proceedings of the AAAI conference on artificial intelligence, vol 33. pp 8577–8584

  13. Lin T-Y, Goyal P, Girshick R, He K, Dollár P (2017) Focal loss for dense object detection. In: Proceedings of the IEEE international conference on computer vision. pp 2980–2988

  14. Lin T-Y, Maire M, Belongie S, Hays J, Perona P, Ramanan D, Dollár P, Zitnick CL (2014) Microsoft coco: Common objects in context. In: European conference on computer vision. Springer, pp 740–755

  15. Liu W, Anguelov D, Erhan D, Szegedy C, Reed S, Fu C-Y, Berg AC (2016) SSD: Single shot multibox detector. In: European conference on computer vision. Springer, pp 21–37

  16. Liu Z, Sun M, Zhou T, Huang G, Darrell T (2018) Rethinking the value of network pruning. arXiv:1810.05270

  17. Liu Z, Li J, Shen Z, Huang G, Yan S, Zhang C (2017) Learning efficient convolutional networks through network slimming. In: Proceedings of the IEEE international conference on computer vision. pp 2736–2744

  18. Murugan SP, Chinnadurai M, Manikandan S (2022) Tour planning design for mobile robots using pruned adaptive resonance theory networks. CMC-Comput Mater Continua 70(1):181–194

    Article  Google Scholar 

  19. Murthy CB, Hashmi MF, Muhammad G, AlQahtani SA (2021) YOLOV2PD: An efficient pedestrian detection algorithm using improved YOLOv2 model. CMC-Comput Mater Continua 69(3):3015–3031

    Article  Google Scholar 

  20. Redmon J, Farhadi A (2018) Yolov3: An incremental improvement. arXiv:1804.02767

  21. Redmon J, Farhadi A (2017) YOLO9000: better, faster, stronger. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp 7263–7271

  22. Redmon J, Divvala S, Girshick R, Farhadi A (2016) You only look once: Unified, real-time object detection. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp 779–788

  23. Ren S, He K, Girshick R, Sun J (2015) Faster R-CNN: Towards real-time object detection with region proposal networks. Adv Neural Inf Process Syst 28:91–99

    Google Scholar 

  24. Sakthivel B, Jayaram K, Devarajan NM, Basha SM, Rajapriya S (2022) Machine learning-based pruning technique for low power approximate computing. Comput Syst Sci Eng 42(1):397–406

    Article  Google Scholar 

  25. Tanaka H, Kunin D, Yamins DL, Ganguli S (2020) Pruning neural networks without any data by iteratively conserving synaptic flow. arXiv:2006.05467

  26. Wang Y, Jia K, Liu P (2020) Impolite pedestrian detection by using enhanced YOLOv3-tiny. J Artif Intell 2(3):113

    Article  Google Scholar 

  27. Wang C, Ning X, Sun L, Zhang L, Li W, Bai X (2022) Learning discriminative features by covering local geometric space for point cloud analysis. IEEE Trans Geosci Remote Sens 60:1–15

    Google Scholar 

  28. Zhang Q, Xu J, Xu L, Guo H (2016) Deep convolutional neural networks for forest fire detection. In: Proceedings of the 2016 international forum on management, education and information technology application. Atlantis Press

  29. Zhang S, Benenson R, Schiele B (2017) Citypersons: A diverse dataset for pedestrian detection. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp 3213–3221

  30. Zhang S, Hong S, Wu C, Liu Y, Ju X (2020) Deep neural network pruning algorithm based on particle swarm. In: 2020 international conference on intelligent computing and human-computer interaction (ICHCI). IEEE, pp 367–371

  31. Zheng Q, Qiao X, Cao Y, Lau RW (2019) Distraction-aware shadow detection. In: Proceedings of the IEEE/CVF conference on computer vision and pattern recognition. pp 5167–5176

Download references

Funding

National Natural Science Foundation of China (CN) (61002011).

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Hongbo Wang.

Ethics declarations

Conflicts of interest

The author 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.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Zhang, Y., Liu, X., Chen, Y. et al. SPSO-Pruner: a network pruning method on YOLOv5 for fewer categories scenarios. Multimed Tools Appl 83, 11493–11506 (2024). https://doi.org/10.1007/s11042-023-16038-w

Download citation

  • Received:

  • Revised:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s11042-023-16038-w

Keywords

Navigation