Skip to main content
Log in

Real-time and effective detection of agricultural pest using an improved YOLOv5 network

  • Original Research Paper
  • Published:
Journal of Real-Time Image Processing Aims and scope Submit manuscript

Abstract

Pest detection and control can effectively guarantee the quality and yield of crops. The existing CNN-based object detection methods provide feasible strategies for pest detection; however, their low accuracy and speed have restricted the deployment and application in actual agricultural scenarios. In this paper, an improved YOLOv5 model for real-time and effective agricultural pest detection is proposed. First, a lightweight feature extraction network GhostNet is adopted as the backbone, and an efficient channel attention mechanism is introduced to enhance feature extraction. Then, high-resolution feature maps are added to the bidirectional feature pyramid network to enhance the data flow path of the neck, which enriches semantic information and highlights small pests. Furthermore, to assign dynamic weights to features at different receptive fields and highlight the unequal contributions of different receptive fields to global information, feature fusion with attentional multi-receptive fields is proposed. Finally, the experimental results on a large-scale public pest dataset (Pest24) demonstrate that our method exceeds the original YOLOv5 and other state-of-the-art models. The mAP improves from 71.5 to 74.1%, the detection speed improves from 79.4 FPS to 104.2 FPS, the FLOPs decrease by 42% and the model size is compressed by 39%. The proposed method enables real-time and effective pest detection.

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
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9
Fig. 10

Similar content being viewed by others

Data Availability

The data used to support the findings of this study are available from the corresponding author upon request.

References

  1. Ebrahimi, M.A., Khoshtaghaza, M.H., Minaei, S., Jamshidi, B.: Vision-based pest detection based on SVM classification method. Comput. Electron. Agric. 137, 52–58 (2017)

    Article  Google Scholar 

  2. Gadekallu, T.R., Rajput, D.S., Reddy, M.P.K., Lakshmanna, K., Bhattacharya, S., Singh, S., Alazab, M.: A novel PCA-whale optimization-based deep neural network model for classification of tomato plant diseases using GPU. J. Real-Time Image Proc. 18, 1383–1396 (2021)

    Article  Google Scholar 

  3. Yun, W., Kumar, J.P., Lee, S., Kim, D.S., Cho, B.K.: Deep learning-based system development for black pine bast scale detection. Sci. Rep. 12(1), 1–10 (2022)

    Article  Google Scholar 

  4. Lippi, M., Bonucci, N., Carpio, R. F., Contarini, M., Speranza, S., Gasparri, A.: A yolo-based pest detection system for precision agriculture. In: 2021 29th Mediterranean Conference on Control and Automation (MED) pp. 342–347 (June) (2021)

  5. Jiao, L., Dong, S., Zhang, S., Xie, C., Wang, H.: AF-RCNN: An anchor-free convolutional neural network for multi-categories agricultural pest detection. Comput. Electron. Agric. 174, 105522 (2020)

    Article  Google Scholar 

  6. Tang, Z., Chen, Z., Qi, F., Zhang, L., Chen, S.: Pest-YOLO: Deep image mining and multi-feature fusion for real-time agriculture pest detection. In: 2021 IEEE International Conference on Data Mining (ICDM), pp. 1348–1353 (December) (2021)

  7. Tan, M., Pang, R., Le, Q.V.: Efficientdet: scalable and efficient object detection. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition pp. 10781–10790 (2020)

  8. Amrani, A., Sohel, F., Diepeveen, D., Murray, D., Jones, M. G.: Insect detection from imagery using YOLOv3-based adaptive feature fusion convolution network. Crop Pasture Sci. (2022)

  9. Ding, P., Qian, H., Chu, S.: SlimYOLOv4: lightweight object detector based on YOLOv4. J. Real-Time Image Proc. 19(3), 487–498 (2022)

    Article  Google Scholar 

  10. Wang, S., Zhao, J., Ta, N., Zhao, X., Xiao, M., Wei, H.: A real-time deep learning forest fire monitoring algorithm based on an improved Pruned+ KD model. J. Real-Time Image Proc. 18(6), 2319–2329 (2021)

    Article  Google Scholar 

  11. Jocher G.: ultralytics/yolov5: v6.0 -yolov5n ‘nano’ models, roboflow integration, tensorflow export, opencv dnn support. https://doi.org/10.5281/zenodo.5563715 (2021)

  12. Liu, S., Qi, L., Qin, H., Shi, J., Jia, J.: Path aggregation network for instance segmentation. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 8759-8768 (2018)

  13. Han, K., Wang, Y., Tian, Q., Guo, J., Xu, C., Xu, C.: Ghostnet: more features from cheap operations. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 1580–1589 (2020)

  14. Wang, Q., Wu, B., Zhu, P., Li, P., Zuo, W., Hu, Q.: ECA-Net: efficient channel attention for deep convolutional neural networks. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 11534–11542 (2020)

  15. Wang, Q.J., Zhang, S.Y., Dong, S.F., Zhang, G.C., Yang, J., Li, R., Wang, H.Q.: Pest24: A large-scale very small object data set of agricultural pests for multi-target detection. Comput. Electron. Agric. 175, 105585 (2020)

    Article  Google Scholar 

  16. Ren, S., He, K., Girshick, R., Sun, J.: Faster r-cnn: towards real-time object detection with region proposal networks. In: IEEE Transactions on Pattern Analysis & Machine Intelligence, vol. 39(6), pp. 1137–1149 (2017)

  17. Cai, Z., Vasconcelos, N.: Cascade r-cnn: delving into high quality object detection. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 6154–6162 (2018)

  18. Redmon J, Farhadi A.: Yolov3: an incremental improvement. arXiv preprint arXiv:18040 (2018)

  19. Bochkovskiy, A., Wang, C. Y., Liao, H.Y.M.: Yolov4: optimal speed and accuracy of object detection. arXiv preprint arXiv:2004.10934 (2020)

  20. Duan, K., Bai, S., Xie, L., Qi, H., Huang, Q., Tian, Q.: Centernet: keypoint triplets for object detection. In: Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 6569–6578 (2019)

  21. Zhang, S., Chi, C., Yao, Y., Lei, Z., Li, S.Z.: Bridging the gap between anchor-based and anchor-free detection via adaptive training sample selection. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 9759–9768 (2020)

  22. Zhu, X., Su, W., Lu, L., Li, B., Wang, X., Dai, J. Deformable detr: deformable transformers for end-to-end object detection. arXiv preprint arXiv:2010.04159 (2020)

  23. Lin, T. Y., Dollár, P., Girshick, R., He, K., Hariharan, B., Belongie, S.: Feature pyramid networks for object detection. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 2117–2125 (2017)

  24. Li, Z., Sun, Y., Tian, G., Xie, L., Liu, Y., Su, H., He, Y.: A compression pipeline for one-stage object detection model. J. Real-Time Image Proc. 18, 1949–1962 (2021)

  25. Wu, C., Sun, Y., Wang, T., Liu, Y.: Underwater trash detection algorithm based on improved YOLOv5s. J. Real-Time Image Proc. 19(5), 911–920 (2022)

    Article  Google Scholar 

  26. Szegedy, C., Liu, W., Jia, Y., Sermanet, P., Reed, S., Anguelov, D., Rabinovich, A.: Going deeper with convolutions. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Eecognition, pp. 1-9 (2015)

  27. Gao, S.H., Cheng, M.M., Zhao, K., Zhang, X.Y., Yang, M.H., Torr, P.: Res2net: a new multi-scale backbone architecture. IEEE Trans. Pattern Anal. Mach. Intell. 43(2), 652–662 (2019)

    Article  Google Scholar 

  28. Zhang, X., Zhou, X., Lin, M., Sun, J.: Shufflenet: an extremely efficient convolutional neural network for mobile devices. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 6848–6856 (2018)

  29. Ma, N., Zhang, X., Zheng, H. T., Sun, J.: Shufflenet v2: Practical guidelines for efficient cnn architecture design. In: Proceedings of the European Conference on Computer Vision (ECCV), pp. 116–131 (2018)

  30. Howard, A., Sandler, M., Chu, G., Chen, L. C., Chen, B., Tan, M., Adam, H.: Searching for mobilenetv3. In: Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 1314–1324 (2019)

  31. Hu, J., Shen, L., Sun, G.: Squeeze-and-excitation networks. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 7132–7141 (2018)

  32. Woo, S., Park, J., Lee, J. Y., Kweon, I. S.: Cbam: convolutional block attention module. In: Proceedings of the European Conference on Computer Vision (ECCV), pp. 3–19 (2018)

  33. Hou, Q., Zhou, D., Feng, J.: Coordinate attention for efficient mobile network design. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 13713–13722 (2021)

  34. Mukherjee, S., Kottayil, N. K., Sun, X., Cheng, I.: CNN-based real-time parameter tuning for optimizing denoising filter performance. In: Image Analysis and Recognition: 16th International Conference, ICIAR 2019, Waterloo, ON, Canada, August 27-29, 2019, Proceedings, Part I 16 pp. 112–125 (2019)

  35. Fernández, A., García, S., Galar, M., Prati, R. C., Krawczyk, B., Herrera, F., Herrera, F.: Cost-sensitive learning. In: Learning from Imbalanced Data Sets, pp. 63–78 (2018)

Download references

Acknowledgements

This work is supported by the National Key Research and Development Program (No.2022YFD2101101), the Project of Scientific and Technological Innovation Planning of Hunan Province (No.2020NK2008), the earmarked fund for China Agriculture Research System (CARS-19), Hunan Province Modern Agriculture Technology System for Tea Industry and the High Performance Computing Center of Central South University.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Yuxiang Wang.

Ethics declarations

Conflict of interest

This paper does not contain any unethical studies on humans or animals. All 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.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Qi, F., Wang, Y., Tang, Z. et al. Real-time and effective detection of agricultural pest using an improved YOLOv5 network. J Real-Time Image Proc 20, 33 (2023). https://doi.org/10.1007/s11554-023-01264-0

Download citation

  • Received:

  • Accepted:

  • Published:

  • DOI: https://doi.org/10.1007/s11554-023-01264-0

Keywords

Navigation