A Lightweight Crop Pest Detection Method Based on Improved RTMDet
Abstract
:1. Introduction
- We proposed a lightweight and accurate pest detection model RTMDet++ by improving the RTMDet model.
- We adopt the pruning strategy to optimize the RTMDet structure and reduce model complexity, and introduce shortcut connection module to enhance the model’s feature extraction capabilities and improve detection accuracy.
- We conduct experiments on the IP102 dataset containing natural environmental pest and disease data to evaluate our proposed model RTMDet++, as shown in Figure 1, ensuring that the research methods are applicable to real-world crop pest detection tasks.
2. Materials and Methods
2.1. RTMDet Model
2.2. Pruning the RTMDet Model
2.3. Shortcut Connection Module
2.4. Dataset Preparation
2.5. Training and Testing
3. Results
4. Discussion
5. Conclusions
- We provided a useful method RTMDet++ for the real-time monitoring and control of crop pests and diseases in practice, which holds important theoretical and practical value.
- We made the RTMDet model lightweight through pruning technology, reducing the number of parameters by 15.5% and the computation by 25.0%, significantly lowering the model’s complexity.
- We introduced a shortcut connection module, which enhanced the RTMDet model’s feature learning capability, resulting in a 0.3% improvement in average precision, reaching 94.1%. This increased the detection accuracy while keeping the model lightweight.
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
References
- Godfray, H.C.J.; Beddington, J.R.; Crute, I.R.; Haddad, L.; Lawrence, D.; Muir, J.F.; Pretty, J.; Robinson, S.; Thomas, S.M.; Toulmin, C. Food Security: The Challenge of Feeding 9 Billion People. Science 2010, 327, 812–818. [Google Scholar] [CrossRef] [PubMed]
- Oerke, E.C. Crop losses to pests. J. Agric. Sci. 2006, 144, 31–43. [Google Scholar] [CrossRef]
- Skovgaard, M.; Renjel Encinas, S.; Jensen, O.C.; Andersen, J.H.; Condarco, G.; Jørs, E. Pesticide Residues in Commercial Lettuce, Onion, and Potato Samples From Bolivia—A Threat to Public Health? Environ. Health Insights 2017, 11, 1178630217704194. [Google Scholar] [CrossRef] [PubMed]
- Xu, J.; Zhu, J.H.; Yang, Y.L.; Tang, H.; Lü, H.P.; Fan, M.S.; Shi, Y.; Dong, D.F.; Wang, G.J.; Wang, W.X.; et al. Status of Major Diseases and Insect Pests of Potato and Pesticide Usage in China. Sci. Agric. Sin. 2019, 52, 2800–2808. [Google Scholar] [CrossRef]
- Editorial Committee of China Agricultural Yearbook. Chinese Agriculture Yearbook; China Agriculture Press: Beijing, China, 2017. [Google Scholar]
- Zhang, F.; Chen, X.; Vitousek, P. An experiment for the world. Nature 2013, 497, 33–35. [Google Scholar] [CrossRef]
- Gullino, M.; Albajes, R.; Al-Jboory, I.; Angelotti, F.; Chakraborty, S.; Garrett, K.; Hurley, B.; Juroszek, P.; Makkouk, K.; Pan, X.; et al. Scientific Review of the Impact of Climate Change on Plant Pests: A Global Challenge to Prevent and Mitigate Plant-Pest Risks in Agriculture, Forestry and Ecosystems; Food and Agriculture Organization of the United Nations: Rome, Italy, 2021. [Google Scholar]
- Shi, F.; Zhao, K.; Meng, Q.; Ma, L. Research on Image Segmentation of Rice Blast Based on Support Vector Machine. J. Northeast. Agric. Univ. 2013, 44, 128–135. [Google Scholar] [CrossRef]
- Ebrahimi, M.; Khoshtaghaza, M.H.; Minaei, S.; Jamshidi, B. Vision-based pest detection based on SVM classification method. Comput. Electron. Agric. 2017, 137, 52–58. [Google Scholar] [CrossRef]
- Zhu, J.H.; Wu, A.; Li, P. Corn leaf diseases diagnostic techniques based on image recognition. In Proceedings of the Communications and Information Processing: International Conference, ICCIP 2012 Aveiro, Portugal, March 7–11, 2012 Revised Selected Papers, Part I; Springer: Berlin/Heidelberg, Germany, 2012; pp. 334–341. [Google Scholar] [CrossRef]
- Zhang, Y.; Jiang, M.; Yu, P.; Yao, Q.; Yang, B.; Tang, J. Agricultural pest identification based on multi-feature fusion and sparse representation. Sci. Agric. Sin. 2018, 51, 2084–2093. [Google Scholar] [CrossRef]
- Lecun, Y.; Bottou, L.; Bengio, Y.; Haffner, P. Gradient-based learning applied to document recognition. Proc. IEEE 1998, 86, 2278–2324. [Google Scholar] [CrossRef]
- Krizhevsky, A.; Sutskever, I.; Hinton, G.E. ImageNet classification with deep convolutional neural networks. Commun. ACM 2017, 60, 84–90. [Google Scholar] [CrossRef]
- Redmon, J.; Divvala, S.; Girshick, R.; Farhadi, A. You only look once: Unified, real-time object detection. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Las Vegas, NV, USA, 27–30 June 2016; pp. 779–788. [Google Scholar]
- Redmon, J.; Farhadi, A. YOLOv3: An incremental improvement. arXiv 2018, arXiv:1804.02767. [Google Scholar]
- Jocher, G.; Chaurasia, A.; Stoken, A.; Borovec, J.; Kwon, Y.; Michael, K.; Fang, J.; Wong, C.; Yifu, Z.; Montes, D.; et al. ultralytics/yolov5: v6.2-YOLOv5 Classification Models, Apple M1, Reproducibility, ClearML and Deci.ai integrations. Zenodo 2022. [Google Scholar] [CrossRef]
- Wang, C.Y.; Bochkovskiy, A.; Liao, H.Y.M. YOLOv7: Trainable bag-of-freebies sets new state-of-the-art for real-time object detectors. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Vancouver, BC, Canada, 17–24 June 2023; pp. 7464–7475. [Google Scholar] [CrossRef]
- Reis, D.; Kupec, J.; Hong, J.; Daoudi, A. Real-time flying object detection with YOLOv8. arXiv 2023, arXiv:2305.09972. [Google Scholar]
- Esgario, J.G.; de Castro, P.B.; Tassis, L.M.; Krohling, R.A. An app to assist farmers in the identification of diseases and pests of coffee leaves using deep learning. Inf. Process. Agric. 2022, 9, 38–47. [Google Scholar] [CrossRef]
- Zhang, M.; Liang, H.; Wang, Z.; Wang, L.; Huang, C.; Luo, X. Damaged apple detection with a hybrid YOLOv3 algorithm. Inf. Process. Agric. 2022, 11, 163–171. [Google Scholar] [CrossRef]
- Park, H.M.; Park, J.H. YOLO Network with a Circular Bounding Box to Classify the Flowering Degree of Chrysanthemum. AgriEngineering 2023, 5, 1530–1543. [Google Scholar] [CrossRef]
- Fu, X.; Ma, Q.; Yang, F.; Zhang, C.; Zhao, X.; Chang, F.; Han, L. Crop pest image recognition based on the improved ViT method. Inf. Process. Agric. 2023, 11, 249–259. [Google Scholar] [CrossRef]
- Simhadri, C.G.; Kondaveeti, H.K.; Vatsavayi, V.K.; Mitra, A.; Ananthachari, P. Deep learning for rice leaf disease detection: A systematic literature review on emerging trends, methodologies and techniques. Inf. Process. Agric. 2024. [Google Scholar] [CrossRef]
- He, Y.T.; Lin, Y.; Zeng, Y.L. Improved detection of coffee leaf diseases and insect pests based on YOLOv5. J. Anhui Agric. Sci. 2023, 51, 221–226. [Google Scholar] [CrossRef]
- Zhang, L.; Ding, G.; Li, C.; Li, D. DCF-Yolov8: An Improved Algorithm for Aggregating Low-Level Features to Detect Agricultural Pests and Diseases. Agronomy 2023, 13, 2012. [Google Scholar] [CrossRef]
- Lyu, C.; Zhang, W.; Huang, H.; Zhou, Y.; Wang, Y.; Liu, Y.; Zhang, S.; Chen, K. RTMDet: An empirical study of designing real-time object detectors. arXiv 2022, arXiv:2212.07784. [Google Scholar]
- Ge, Z.; Liu, S.; Wang, F.; Li, Z.; Sun, J. Yolox: Exceeding yolo series in 2021. arXiv 2021, arXiv:2107.08430. [Google Scholar]
- Lyu, C.; Zhang, W.; Huang, H.; Zhou, Y.; Wang, Y.; Liu, Y.; Zhang, S.; Chen, K. RTMDet Configs: An Empirical Study of Designing Real-Time Object Detectors 2022. Available online: https://github.com/open-mmlab/mmyolo/tree/main/configs/rtmdet (accessed on 10 August 2023).
- He, K.; Zhang, X.; Ren, S.; Sun, J. Deep residual learning for image recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Las Vegas, NV, USA, 27–30 June 2016; pp. 770–778. [Google Scholar] [CrossRef]
- Wu, X.; Zhan, C.; Lai, Y.K.; Cheng, M.M.; Yang, J. Ip102: A large-scale benchmark dataset for insect pest recognition. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Long Beach, CA, USA, 15–20 June 2019; pp. 8787–8796. [Google Scholar] [CrossRef]
- Chen, K.; Wang, J.; Pang, J.; Cao, Y.; Xiong, Y.; Li, X.; Sun, S.; Feng, W.; Liu, Z.; Xu, J.; et al. MMDetection: Open mmlab detection toolbox and benchmark. arXiv 2019, arXiv:1906.07155. [Google Scholar]
- Lyu, C.; Zhang, W.; Huang, H.; Zhou, Y.; Wang, Y.; Liu, Y.; Zhang, S.; Chen, K. MMYOLO: OpenMMLab YOLO Series Toolbox and Benchmark. 2022. Available online: https://github.com/open-mmlab/mmyolo/tree/main (accessed on 10 August 2023).
- Chetlur, S.; Woolley, C.; Vandermersch, P.; Cohen, J.; Tran, J.; Catanzaro, B.; Shelhamer, E. cuDNN: Efficient Primitives for Deep Learning. 2014. Available online: https://developer.nvidia.com/cudnn (accessed on 20 January 2023).
- Powers, D.M. Evaluation: From precision, recall and F-measure to ROC, informedness, markedness and correlation. arXiv 2020, arXiv:2010.16061. [Google Scholar]
- Liu, W.; Anguelov, D.; Erhan, D.; Szegedy, C.; Reed, S.; Fu, C.Y.; Berg, A.C. SSD: Single shot multibox detector. In Proceedings of the Computer Vision–ECCV 2016: 14th European Conference, Amsterdam, The Netherlands, October 11–14, 2016, Proceedings, Part I 14; Springer: Berlin/Heidelberg, Germany, 2016; pp. 21–37. [Google Scholar] [CrossRef]
Platform | Version |
---|---|
System | Ubuntu-20.04 |
CUDA | 11.3 |
CuDNN | 8.2 |
Python | 3.8 |
PyTorch | 1.10.1 |
GPU | Nvidia RTX4090 |
Hyperparameter | Configuration |
---|---|
input | 512 × 512 |
batch | 32 |
optimizer | AdamW |
learning rate | 0.004 |
weight decay | 0.05 |
score threshold | 0.1 |
train epochs | 150 |
IoU threshold | 0.5 |
Method | mAP | P | R | F1 | Params | FLOPs |
---|---|---|---|---|---|---|
SSD | 83.6 | 81.7 | 81.9 | 81.8 | 2.124 | 4.119 |
Yolov3 | 87.8 | 90.5 | 90.3 | 90.4 | 2.765 | 2.521 |
YoloX | 91.4 | 90.8 | 90.7 | 90.7 | 5.033 | 3.937 |
Yolov7 | 91.8 | 92.1 | 92.4 | 92.3 | 6.015 | 3.406 |
Faster-RCNN | 92.1 | 92.4 | 92.5 | 92.4 | 28.279 | 40.751 |
RTMDet | 93.8 | 91.9 | 92.1 | 92.0 | 4.873 | 4.173 |
RTMDet++ | 94.1 | 92.5 | 92.7 | 92.6 | 4.117 | 3.130 |
Pruning | Shortcut | mAP | P | R | F1 | Params | FLOPs |
---|---|---|---|---|---|---|---|
93.8 | 91.9 | 92.1 | 92.0 | 4.873M | 4.173G | ||
√ | 93.6 | 91.3 | 91.1 | 91.2 | 4.117M | 3.129G | |
√ | √ | 94.1 | 92.5 | 92.7 | 92.6 | 4.117M | 3.130G |
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. |
© 2024 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 (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Wang, W.; Fu, H. A Lightweight Crop Pest Detection Method Based on Improved RTMDet. Information 2024, 15, 519. https://doi.org/10.3390/info15090519
Wang W, Fu H. A Lightweight Crop Pest Detection Method Based on Improved RTMDet. Information. 2024; 15(9):519. https://doi.org/10.3390/info15090519
Chicago/Turabian StyleWang, Wanqing, and Haoyue Fu. 2024. "A Lightweight Crop Pest Detection Method Based on Improved RTMDet" Information 15, no. 9: 519. https://doi.org/10.3390/info15090519
APA StyleWang, W., & Fu, H. (2024). A Lightweight Crop Pest Detection Method Based on Improved RTMDet. Information, 15(9), 519. https://doi.org/10.3390/info15090519