Detection of Forestry Pests Based on Improved YOLOv5 and Transfer Learning
Abstract
:1. Introduction
2. Materials and Methods
2.1. Introduction of Pest Datasets
2.2. Composition of YOLOv5 Model
2.3. Improvements to the YOLOv5 Model
2.3.1. DyHead Module
2.3.2. C2f Module
2.4. Transfer Learning
2.5. Introduction of Correlation Models
2.5.1. Faster RCNN
2.5.2. YOLOv4-Tiny
2.5.3. YOLOv6
2.5.4. YOLOv7
2.5.5. YOLOv8
2.6. Model Evaluation Metrics
3. Results and Discussion
3.1. Experimental Environment and Setting
3.2. Ablation Experiment
3.3. Analysis of Transfer Learning Results
3.3.1. Analysis of Whole Detection Situation
3.3.2. Analysis of Single Type Pest
3.4. Confusion Matrix
3.5. Comparison with Existing Target Detection Methods
3.5.1. Detection Results of Different Models
3.5.2. Pest Detection Visualization Comparison
3.6. The Realization of the Model Deployed on a Laptop
4. Conclusions
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
References
- Hurley, B.P.; Slippers, J.; Wingfield, M.J.; Dyer, C.; Slippers, B. Perception and knowledge of the Sirex woodwasp and other forest pests in South Africa. Agric. For. Entomol. 2012, 14, 306–316. [Google Scholar] [CrossRef] [Green Version]
- Hiary, H.; Ahmad, S.B.; Reyalat, M.; Braik, M.; Al-Rahamneh, Z. Fast and Accurate Detection and Classification of Plant Diseases. Int. J. Comput. Appl. 2011, 17, 31–38. [Google Scholar]
- Ebrahimi, M.A.; 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]
- Zayas, I.Y.; Flinn, P.W. Detection of insects in bulk wheat samples with machine vision. Trans. Am. Soc. Agric. Eng. 1998, 41, 883–888. [Google Scholar] [CrossRef]
- Li, Y.; Xia, C.; Lee, J. Detection of small-sized insect pest in greenhouses based on multifractal analysis. Opt.-Int. J. Light Electron Opt. 2015, 126, 2138–2143. [Google Scholar] [CrossRef]
- Wang, J.; Lin, C.; Ji, L.; Liang, A. A new automatic identification system of insect images at the order level. Knowl.-Based Syst. 2012, 33, 102–110. [Google Scholar] [CrossRef]
- Liu, Z.; Gao, J.; Yang, G.; Zhang, H.; He, Y. Localization and Classification of Paddy Field Pests using a Saliency Map and Deep Convolutional Neural Network. Sci. Rep. 2016, 6, 20410. [Google Scholar] [CrossRef] [Green Version]
- Zhu, J.J.; Cheng, M.; Wang, Q.F.; Yuan, H.B.; Cai, Z.J. Grape Leaf Black Rot Detection Based on Super-Resolution Image Enhancement and Deep Learning. Front. Plant Sci. 2021, 12, 695749. [Google Scholar] [CrossRef]
- Xia, C.; Chon, T.-S.; Ren, Z.; Lee, J.-M. Automatic identification and counting of small size pests in greenhouse conditions with low computational cost. Ecol. Inform. 2015, 29, 139–146. [Google Scholar] [CrossRef]
- Girshick, R. Fast R-CNN. In Proceedings of the 2015 IEEE International Conference on Computer Vision (ICCV), Santiago, Chile, 7–13 December 2015; pp. 1440–1448. [Google Scholar]
- Cai, Z.; Vasconcelos, N. Cascade R-CNN: Delving into High Quality Object Detection. In Proceedings of the 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition, Salt Lake City, UT, USA, 18–23 June 2018; pp. 6154–6162. [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, Amsterdam, The Netherlands, 11–14 October 2016; pp. 21–37. [Google Scholar]
- Chen, Q.; Wang, Y.; Yang, T.; Zhang, X.; Cheng, J.; Sun, J. You Only Look One-level Feature. In Proceedings of the 2021 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), Nashville, TN, USA, 20–25 June 2021; pp. 13034–13043. [Google Scholar]
- Redmon, J.; Divvala, S.; Girshick, R.; Farhadi, A. You Only Look Once: Unified, Real-Time Object Detection. In Proceedings of the 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), Las Vegas, NV, USA, 27–30 June 2016; pp. 779–788. [Google Scholar]
- Roy, A.M.; Bhaduri, J. Real-time growth stage detection model for high degree of occultation using DenseNet-fused YOLOv4. Comput. Electron. Agric. 2022, 193, 106694. [Google Scholar] [CrossRef]
- Lawal, M.O. Tomato detection based on modified YOLOv3 framework. Sci. Rep. 2021, 11, 1447. [Google Scholar] [CrossRef] [PubMed]
- Li, D.; Wang, R.; Xie, C.; Liu, L.; Zhang, J.; Li, R.; Wang, F.; Zhou, M.; Liu, W. A Recognition Method for Rice Plant Diseases and Pests Video Detection Based on Deep Convolutional Neural Network. Sensors 2020, 20, 578. [Google Scholar] [CrossRef] [PubMed] [Green Version]
- Sun, Y.; Liu, X.; Yuan, M.; Ren, L.; Wang, J.; Chen, Z. Automatic in-trap pest detection using deep learning for pheromone-based Dendroctonus valens monitoring. Biosyst. Eng. 2018, 176, 140–150. [Google Scholar] [CrossRef]
- Hong, S.-J.; Kim, S.-Y.; Kim, E.; Lee, C.-H.; Lee, J.-S.; Lee, D.-S.; Bang, J.; Kim, G. Moth Detection from Pheromone Trap Images Using Deep Learning Object Detectors. Agriculture 2020, 10, 170. [Google Scholar] [CrossRef]
- Jiao, L.; Li, G.Q.; Chen, P.; Wang, R.J.; Du, J.M.; Liu, H.Y.; Dong, S.F. Global Context-Aware-Based Deformable Residual Network Module for Precise Pest Recognition and Detection. Front. Plant Sci. 2022, 13, 895944. [Google Scholar] [CrossRef]
- Liu, B.; Liu, L.; Zhuo, R.; Chen, W.; Duan, R.; Wang, G. A Dataset for Forestry Pest Identification. Front. Plant Sci. 2022, 13, 857104. [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 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), Long Beach, CA, USA, 15–20 June 2019; pp. 8779–8788. [Google Scholar]
- Krizhevsky, A.; Sutskever, I.; Hinton, G.E. ImageNet classification with deep convolutional neural networks. Commun. ACM 2012, 60, 84–90. [Google Scholar] [CrossRef] [Green Version]
- Fu, L.; Yang, Z.; Wu, F.; Zou, X.; Lin, J.; Cao, Y.; Duan, J. YOLO-Banana: A Lightweight Neural Network for Rapid Detection of Banana Bunches and Stalks in the Natural Environment. Agronomy 2022, 12, 391. [Google Scholar] [CrossRef]
- Xiang, Q.; Huang, X.; Huang, Z.; Chen, X.; Cheng, J.; Tang, X. Yolo-Pest: An Insect Pest Object Detection Algorithm via CAC3 Module. Sensors 2023, 23, 3221. [Google Scholar] [CrossRef]
- Dai, X.Y.; Chen, Y.P.; Xiao, B.; Chen, D.D.; Liu, M.C.; Yuan, L.; Zhang, L.; Ieee Comp, S.O.C. Dynamic Head: Unifying Object Detection Heads with Attentions. In Proceedings of the 2021 IEEE/CVF Conference on Computer Vision and Pattern Recognition, CVPR 2021, Nashville, TN, USA, 20–25 June 2021; pp. 7369–7378. [Google Scholar]
- Zhuang, F.; Qi, Z.; Duan, K.; Xi, D.; Zhu, Y.; Zhu, H.; Xiong, H.; He, Q. A Comprehensive Survey on Transfer Learning. Proc. IEEE 2021, 109, 43–76. [Google Scholar] [CrossRef]
- Fraiwan, M.; Faouri, E.; Khasawneh, N. Classification of Corn Diseases from Leaf Images Using Deep Transfer Learning. Plants 2022, 11, 2668. [Google Scholar] [CrossRef] [PubMed]
- Han, L.; Zhao, Y.Y.; Chen, H.A.; Chandrasekar, V. Advancing Radar Nowcasting through Deep Transfer Learning. IEEE Trans. Geosci. Remote Sens. 2022, 60, 1–9. [Google Scholar] [CrossRef]
- Ren, S.; He, K.; Girshick, R.; Sun, J. Faster R-CNN: Towards Real-Time Object Detection with Region Proposal Networks. arXiv 2015, arXiv:1506.01497. [Google Scholar] [CrossRef] [PubMed] [Green Version]
- Ji, H.; Hu, C.; Zhang, S.; Zhang, L.; Yang, X. BiO(OH)xI1−x solid solution with rich oxygen vacancies: Interlayer guest hydroxyl for improved photocatalytic properties. J. Colloid Interface Sci. 2022, 605, 1–12. [Google Scholar] [CrossRef]
- Bochkovskiy, A.; Wang, C.-Y.; Liao, H.-Y.M. YOLOv4: Optimal Speed and Accuracy of Object Detection. arXiv 2020, arXiv:2004.10934. [Google Scholar] [CrossRef]
- Li, C.; Li, L.; Jiang, H.; Weng, K.; Geng, Y.; Li, L.; Ke, Z.; Li, Q.; Cheng, M.; Nie, W.; et al. YOLOv6: A Single-Stage Object Detection Framework for Industrial Applications. arXiv 2022, arXiv:2209.02976. [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. arXiv 2022, arXiv:2207.02696. [Google Scholar] [CrossRef]
- Khasawneh, N.; Fraiwan, M.; Fraiwan, L. Detection of K-complexes in EEG signals using deep transfer learning and YOLOv3. Clust. Comput. 2022. [Google Scholar] [CrossRef]
Class Index | Name | Train Target Tags | Test Target Tags |
---|---|---|---|
0 | Drosicha_contrahens_female | 541 | 53 |
1 | Drosicha_contrahens_male | 183 | 17 |
2 | Chalcophora_japonica | 116 | 11 |
3 | Anoplophora_chinensis | 369 | 36 |
4 | Psacothea_hilaris (Pascoe) | 198 | 16 |
5 | Apriona_germari (Hope) | 246 | 38 |
6 | Monochamus_alternatus | 147 | 18 |
7 | Plagiodera_versicolora (Laicharting) | 390 | 49 |
8 | Latoia_consocia_Walker | 245 | 25 |
9 | Hyphantria_cunea | 392 | 37 |
10 | Cnidocampa_flavescens (Walker) | 253 | 26 |
11 | Cnidocampa_flavescens (Walker_pupa) | 229 | 43 |
12 | Erthesina_fullo | 276 | 23 |
13 | Erthesina_fullo_nymph-2 | 2143 | 385 |
14 | Erthesina_fullo_nymph | 185 | 25 |
15 | Spilarctia_subcarnea (Walker) | 171 | 16 |
16 | Psilogramma_menephron | 189 | 15 |
17 | Sericinus_montela | 342 | 45 |
18 | Sericinus_montela_larvae | 268 | 60 |
19 | Clostera_anachoreta | 251 | 26 |
20 | Micromelalopha_troglodyta (Graeser) | 161 | 21 |
21 | Latoia_consocia_Walker_larvae | 555 | 38 |
22 | Plagiodera_versicolora (Laicharting)_larvae | 826 | 47 |
23 | Plagiodera_versicolora (Laicharting)_ovum | 2716 | 227 |
24 | Spilarctia_subcarnea (Walker)_larvae | 161 | 19 |
25 | Cerambycidae_larvae | 392 | 20 |
26 | Micromelalopha_troglodyta (Graeser)_larvae | 142 | 14 |
27 | Cerambycidae_larvae | 370 | 27 |
29 | Micromelalopha_troglodyta (Graeser)_larvae | 342 | 48 |
29 | Hyphantria_cunea_larvae | 395 | 42 |
30 | Hyphantria_cunea_pupa | 336 | 45 |
Name | Parameter | |
---|---|---|
Hardware | CPU | Intel (R) Xeon (R) Silver 4215 CPU @ 2.50 GHz |
Memory | 252 G | |
GPU | GeForce RTX 3090 × 2 | |
Graphics card | 24 G × 2 | |
Operation system | Ubuntu 20.04 | |
Software | Deep Learning framework | Pytorch 1.13.0 |
Programming languages | Python 3.8 | |
CUDA | 11.6 | |
Algorithms | Iterations | 300 |
Batch size | 128 | |
Picture size | 640 × 640 | |
Learning rate | 0.01 | |
Momentum | 0.937 | |
Weight decay | 0.0005 |
YOLOv5 | DyHead | C2f | Precision (%) | Recall (%) | [email protected]:.95 (%) |
---|---|---|---|---|---|
✓ | 97.6 | 95.6 | 82.7 | ||
✓ | ✓ | 96.8 | 97.0 | 83.6 | |
✓ | ✓ | 97.7 | 96.2 | 84.7 | |
✓ | ✓ | ✓ | 97.8 | 97.2 | 85.4 |
Models | Precision (%) | Recall (%) | [email protected]:.95 (%) |
---|---|---|---|
Faster RCNN | 92.3 | 90.4 | 58.7 |
YOLOv4-Tiny | 96.0 | 93.0 | 64.3 |
YOLOv6 | 98.0 | 97.4 | 84.0 |
YOLOv7 | 97.7 | 98.1 | 83.8 |
YOLOv8 | 98.0 | 96.0 | 86.0 |
Ours | 98.1 | 97.5 | 88.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. |
© 2023 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
Liu, D.; Lv, F.; Guo, J.; Zhang, H.; Zhu, L. Detection of Forestry Pests Based on Improved YOLOv5 and Transfer Learning. Forests 2023, 14, 1484. https://doi.org/10.3390/f14071484
Liu D, Lv F, Guo J, Zhang H, Zhu L. Detection of Forestry Pests Based on Improved YOLOv5 and Transfer Learning. Forests. 2023; 14(7):1484. https://doi.org/10.3390/f14071484
Chicago/Turabian StyleLiu, Dayang, Feng Lv, Jingtao Guo, Huiting Zhang, and Liangkuan Zhu. 2023. "Detection of Forestry Pests Based on Improved YOLOv5 and Transfer Learning" Forests 14, no. 7: 1484. https://doi.org/10.3390/f14071484
APA StyleLiu, D., Lv, F., Guo, J., Zhang, H., & Zhu, L. (2023). Detection of Forestry Pests Based on Improved YOLOv5 and Transfer Learning. Forests, 14(7), 1484. https://doi.org/10.3390/f14071484