Crop Pest Identification and Real-Time Monitoring System Design Based on Improved YOLOv8s
Abstract
1. Introduction
2. Materials and Methods
2.1. Dataset
2.2. Small Target Detection Algorithm for Pests Based on Improved YOLOv8
2.3. Improved C2f_GAM Module
2.4. EfficientNetv2 Lightweight Network
2.5. Environmental Configuration and Parameter Settings
2.6. Evaluation Index
3. Results and Discussions
3.1. Performance Between FusedGM-YOLOv8 and Other Models
3.2. Performance of YOLOv8 Models Based on Different Attention Mechanisms
3.3. Ablation Experiments
3.4. Performance of Models Under Different Detection Scenarios
3.5. Visual Analysis of Model Features
3.6. Experimental Validation
3.7. Design of the Real-Time Monitoring System
4. Conclusions
- A dataset containing nine categories of crop pests was constructed, with a total of 7101 images, providing a pest dataset targeting pest states for subsequent research.
- Based on the YOLOv8 model, a lightweight attention mechanism and a feature enhancement module were incorporated. The results showed that under the same experimental conditions, the FusedGM-YOLOv8 model exhibited better detection performance on the self-constructed pest dataset than the Faster R-CNN, YOLOv5s, YOLOv8s, YOLOv10s and YOLOv11s models. Compared with the original YOLOv8s model, its mAP0.5 and mAP0.5–0.99 increased by 0.6% and 0.8%, respectively. Compared with YOLOv8 models integrated with other attention mechanisms, the improved model proposed in this study achieved overall improvements in P, R, and mAP metrics while maintaining nearly identical parameter counts and exhibited significant advantages, especially in terms of comprehensive accuracy and multi-scale target detection capability.
- Under three typical scenarios (single target, normal target, and dense target), the FusedGM-YOLOv8 model exhibited better pest detection performance than the original YOLOv8s model. It can not only accurately identify smaller-sized pest individuals but also improve the recognition accuracy of various pests, fully demonstrating the optimization effect of the improved strategy on detection performance. Feature map visualization results indicated that the FusedGM-YOLOv8 model possessed a stronger ability to perceive the correct pest and disease targets and could focus on the key features of pest and disease regions.
- The FusedGM-YOLOv8 model also exhibited significant advantages on the IP102 dataset with unbalanced data volume distribution. Compared with the original YOLOv8s model, its P, mAP0.5, and mAP0.5–0.95 increased by 2.6%, 2.7%, and 1.4%, respectively.
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
References
- Júnior, T.D.C.; Rieder, R. Automatic identification of insects from digital images: A survey. Comput. Electron. Agric. 2020, 178, 105784. [Google Scholar] [CrossRef]
- Kariyanna, B.; Sowjanya, M. Unravelling the use of artificial intelligence in management of insect pests. Smart Agric. Technol. 2024, 8, 100517. [Google Scholar] [CrossRef]
- Zhang, Y.; Zhong, W.; Pan, H. Identification of stored grain pests by modified residual network. Comput. Electron. Agric. 2021, 182, 105983. [Google Scholar] [CrossRef]
- Lippi, M.; Bonucci, N.; Carpio, R.F.; Contarini, M.; Speranza, S.; Gasparri, A. A YOLO-based pest detection system for precision agriculture. In Proceedings of the 2021 29th Mediterranean Conference on Control and Automation (MED), Puglia, Italy, 22–25 June 2021; IEEE: New York, NY, USA, 2021; pp. 342–347. [Google Scholar]
- Wen, C.J.; Chen, H.R.; Ma, Z.Y.; Zhang, T.; Yang, C.; Su, H.Q.; Cheng, H.B. Pest-YOLO: A model for large-scale multi-class dense and tiny pest detection and counting. Front. Plant Sci. 2022, 13, 973985. [Google Scholar] [CrossRef]
- Sun, C.L.; Azman, A.B.; Wang, Z.Y.; Gao, X.X.; Ding, K. YOLO-UP: A high-throughput pest detection model for dense cotton crops utilizing UAV-captured visible light imagery. IEEE Access 2025, 13, 19937–19945. [Google Scholar] [CrossRef]
- Luo, D.H.; Xue, Y.J.; Deng, X.R.; Yang, B.; Chen, H.F.; Mo, Z.J. Citrus diseases and pests detection model based on self-attention YOLOV8. IEEE Access 2023, 11, 139872–139881. [Google Scholar] [CrossRef]
- Vilar-Andreu, M.; García, L.; Garcia-Sanchez, A.J.; Asorey-Cacheda, R.; Garcia-Haro, J. Enhancing precision agriculture pest control: A generalized deep learning approach with YOLOv8-based insect detection. IEEE Access 2024, 12, 84420–84434. [Google Scholar] [CrossRef]
- Zhang, L.N.; Yu, S.P.; Yang, B.; Zhao, S.; Huang, Z.Y.; Yang, Z.Y.; Yu, H.L. YOLOv8 forestry pest recognition based on improved re-parametric convolution. Front. Plant Sci. 2025, 16, 1552853. [Google Scholar] [CrossRef]
- de Melo Lima, B.P.; Borges, L.A.B.; Hirose, E.; Borges, D.L. A lightweight and enhanced model for detecting the Neotropical brown stink bug, Euschistus heros (Hemiptera: Pentatomidae) based on YOLOv8 for soybean fields. Ecol. Inform. 2024, 80, 102543. [Google Scholar] [CrossRef]
- Wang, X.W.; Zha, H.N.; Lu, H.N.; Wang, Y.B.; Wu, D.S.; Wang, X.F.; Hu, C.; Chen, X.S. Multi-category pest identification algorithm and monitoring system based on YOLO v8-STSF. Trans. Chin. Soc. Agric. Mach. 2025, 56, 228–236. [Google Scholar]
- Zhu, R.; Hao, F.; Ma, D. Research on polygon pest-infected leaf region detection based on YOLOv8. Agriculture 2023, 13, 2253. [Google Scholar] [CrossRef]
- Sun, D.Z.; Zhang, K.; Zhong, H.S.; Xie, J.N.; Xue, X.Y.; Yan, M.L.; Wu, W.B.; Li, J.H. Efficient tobacco pest detection in complex environments using an enhanced YOLOv8 model. Agriculture 2024, 14, 353. [Google Scholar] [CrossRef]
- Wang, Z.J.; Zhang, S.H.; Chen, L.J.; Wu, W.D.; Wang, H.Q.; Liu, X.H.; Fan, Z.P.; Wang, B.J. Microscopic insect pest detection in tea plantations: Improved YOLOv8 model based on deep learning. Agriculture 2024, 14, 1739. [Google Scholar] [CrossRef]
- Zhang, L.J.; Ding, G.C.; Li, C.R.; Li, D.M. DCF-Yolov8: An improved algorithm for aggregating low-level features to detect agricultural pests and diseases. Agronomy 2023, 13, 2012. [Google Scholar] [CrossRef]
- Liu, G.S.; Di, J.N.; Wang, Q.; Zhao, Y.; Yang, Y. An enhanced and lightweight YOLOv8-based model for accurate rice pest detection. IEEE Access 2025, 13, 91046–91064. [Google Scholar] [CrossRef]
- Liu, L.; Kai, X.; Qi, J. Intelligent detection of maize pests based on StyleGAN2-ADA and FNW YOLOv8. Meas. Sci. Technol. 2024, 36, 015421. [Google Scholar] [CrossRef]
- Zheng, Y.; Zheng, W.; Du, X. A lightweight rice pest detection algorithm based on improved YOLOv8. Sci. Rep. 2024, 14, 29888. [Google Scholar] [CrossRef]
- Xie, J.C.; Xie, X.L.; Xie, W.; Xie, Q.X. An improved YOLOv8-based method for detecting pests and diseases on cucumber leaves in natural backgrounds. Sensors 2025, 25, 1551. [Google Scholar] [CrossRef]
- Priya, A.P.; Sudhakar, C.V.; Kumar, A.P. Pest Detection and Prevention for Agricultural Crops Using YoloV8 Algorithm. In Proceedings of the 2024 International Conference on Intelligent Systems for Cybersecurity (ISCS), Gurugram, India, 3–4 May 2024. [Google Scholar]
- Wu, X.P.; Zhan, C.; Lai, Y.K.; Cheng, M.M.; Yang, J.F. IP102: A large-scale benchmark dataset for pest recognition. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Seattle, WA, USA, 15–20 June 2019. [Google Scholar]
- Tan, S.Q.; Chen, H.; Zhu, L.; Sun, H.R.; Zhang, Z.B.; Yin, L.; Huang, W.W. Identifying pests in rice fields using improved YOLOv8m. Trans. Chin. Soc. Agric. Eng. 2025, 41, 185–195. [Google Scholar]
- Varghese, R.; Sambath, M. YOLOv8: A novel object detection algorithm with enhanced performance and robustness. In Proceedings of the 2024 International Conference on Advances in Data Engineering and Intelligent Computing Systems (ADICS), Chennai, India, 18–19 April 2024. [Google Scholar]
- Selcuk, B.; Serif, T. A comparison of YOLOv5 and YOLOv8 in the context of mobile UI detection. In Proceedings of the International Conference on Mobile Web and Intelligent Information Systems, Marrakech, Morocco, 14–16 August 2023. [Google Scholar]
- Barkan, O.; Armstrong, O.; Hertz, A.; Caciularu, A.; Katz, O.; Malkiel, I.; Koenigstein, N. Gam: Explainable visual similarity and classification via gradient activation maps. In Proceedings of the 30th ACM International Conference on Information & Knowledge Management, Queensland, Australia, 1–5 November 2021. [Google Scholar]
- Tan, M.; Le, Q. Efficientnetv2: Smaller models and faster training. In Proceedings of the 38th International Conference on Machine Learning, Online, 18–24 July 2021. [Google Scholar]
- Zhang, X.A.; Qiao, H.B.; Xi, L.; Ma, C.W.; Xu, X.; Hui, X.H.; Tang, Q.; Zhang, H. Small-target detection method for field crop pests based on improved YOLOv8. Trans. Chin. Soc. Agric. Eng. 2025, 41, 225–233. [Google Scholar]
- Huang, S.R.; Wang, T.Y.; Wen, T.; Zhou, J.L. Crop pest and disease recognition based on improved YOLOv7. J. Agric. Sci. Technol. 2024, 26, 107–116. [Google Scholar]
- Guo, J.X.; Wang, R.F.; Nan, J.H.; Li, X.H.; Jiao, C.Z. YOLOv5 model integrated with GRN attention mechanism for insect pest recognition. Trans. Chin. Soc. Agric. Eng. 2024, 40, 159–170. [Google Scholar]
- 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, Nashville, TN, USA, 16–22 June 2021. [Google Scholar]
- Wang, Q.L.; Wu, B.G.; Zhu, P.F.; Li, P.H.; Zuo, W.M.; Hu, Q.H. ECA-Net: Efficient channel attention for deep convolutional neural networks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), Seattel, WA, USA, 13–19 June 2020. [Google Scholar]
- 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), Munich, Germany, 8–14 September 2018. [Google Scholar]
- Hu, J.; Shen, L.; Sun, G. Squeeze-and-excitation networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Salt Lake City, UT, USA, 18–22 June 2018. [Google Scholar]
- Selvaraju, R.R.; Cogswell, M.; Das, A.; Vedantam, R.; Parikh, D.; Batra, D. Grad-CAM: Visual explanations from deep networks via gradient-based localization. In Proceedings of the IEEE International Conference on Computer Vision, Piscataway, NJ, USA, 22–29 October 2017. [Google Scholar]









| Pest Types | Training Set | Validation Set | Test Set |
|---|---|---|---|
| Bollworm | 4401 | 595 | 538 |
| Meadow borer | 3341 | 432 | 390 |
| Gryllotalpa orientalis | 3138 | 360 | 467 |
| Little Gecko | 1395 | 169 | 120 |
| Nematode trench | 1932 | 313 | 247 |
| Athetis lepigone | 890 | 138 | 135 |
| Armyworm | 1093 | 168 | 122 |
| Anomala corpulenta | 4529 | 578 | 614 |
| Holotrichia parallela | 853 | 115 | 142 |
| Model | P/% | R/% | mAP0.5/% | mAP0.5–0.95/% | Parameters/×106 M |
|---|---|---|---|---|---|
| FasterR-CNN | 43.1 | 58.0 | 47.7 | 37.5 | 41.4 |
| YOLOv5s | 86.2 | 84.6 | 88.1 | 55.7 | 7.2 |
| YOLOv8s | 85.6 | 86.0 | 89.2 | 58.7 | 11.1 |
| YOLOv10s | 86.5 | 84.9 | 89.4 | 58.2 | 7.2 |
| YOLOv11s | 85.0 | 84.5 | 89.2 | 58.6 | 9.5 |
| FusedGM_YOLOv8 | 86.3 | 86.0 | 89.8 | 59.5 | 10.2 |
| Model | P/% | R/% | mAP0.5/% | mAP0.5–0.95/% | Parameters/×106 M |
|---|---|---|---|---|---|
| YOLOv8s | 85.6 | 86.0 | 89.2 | 58.7 | 11.1 |
| YOLOv8_CA | 85.3 | 86.2 | 89.0 | 58.5 | 11.2 |
| YOLOv8_ECA | 85.3 | 86.3 | 89.1 | 58.7 | 11.5 |
| YOLOv8_CBAM | 85.1 | 86.3 | 89.3 | 58.6 | 11.8 |
| YOLOv8_SE | 85.1 | 86.4 | 89.1 | 58.6 | 11.2 |
| YOLOv8_GAM | 85.7 | 85.9 | 89.7 | 59.1 | 11.2 |
| GAM | MB | P/% | R/% | mAP0.5/% | mAP0.5–0.95/% | Parameters/×106 M | Inference Speed/Frames Per Seconds |
|---|---|---|---|---|---|---|---|
| × | × | 85.6 | 86.0 | 89.2 | 58.7 | 11.1 | 225.38 |
| × | √ | 85.9 | 86.0 | 89.8 | 59.2 | 10.3 | 286.64 |
| √ | × | 85.7 | 85.9 | 89.7 | 59.1 | 11.2 | 208.30 |
| √ | √ | 86.3 | 86.0 | 89.8 | 59.5 | 10.2 | 249.76 |
| Model | P/% | R/% | mAP0.5/% | mAP0.5–0.95/% |
|---|---|---|---|---|
| YOLOv8s | 55.5 | 59.8 | 57.6 | 37.7 |
| FusedGM_YOLOv8 | 58.1 | 56.6 | 60.3 | 39.1 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.
Share and Cite
Gao, Q.; Shi, C.; Ji, Y.; Wang, M. Crop Pest Identification and Real-Time Monitoring System Design Based on Improved YOLOv8s. Sensors 2026, 26, 404. https://doi.org/10.3390/s26020404
Gao Q, Shi C, Ji Y, Wang M. Crop Pest Identification and Real-Time Monitoring System Design Based on Improved YOLOv8s. Sensors. 2026; 26(2):404. https://doi.org/10.3390/s26020404
Chicago/Turabian StyleGao, Qiang, Chongchong Shi, Yu Ji, and Meili Wang. 2026. "Crop Pest Identification and Real-Time Monitoring System Design Based on Improved YOLOv8s" Sensors 26, no. 2: 404. https://doi.org/10.3390/s26020404
APA StyleGao, Q., Shi, C., Ji, Y., & Wang, M. (2026). Crop Pest Identification and Real-Time Monitoring System Design Based on Improved YOLOv8s. Sensors, 26(2), 404. https://doi.org/10.3390/s26020404

