Improved YOLOv8n Method for the High-Precision Detection of Cotton Diseases and Pests
Abstract
1. Introduction
- Due to low image resolution, the available feature information is limited, which can result in unclear visual characteristics of small objects.
- Effective feature extraction is critical for object detection tasks, as the quality of feature extraction directly impacts the accuracy of detection results. Compared to large-scale objects, the extraction of features from small objects presents greater challenges. This is primarily because essential features of small objects may be lost following multiple down-sampling operations during the detection process, further complicating the detection task.
- The complexity of field environments makes small objects prone to occlusion, which poses difficulties in distinguishing the target from the background.
2. Materials and Methods
2.1. Establishment of the Dataset
2.2. Cotton Pest and Disease Detection Methods
2.2.1. Introduction to the YOLOv8 Algorithm
2.2.2. Improved YOLOv8 Architecture
- (1)
- Multi-Scale Sliding Window Attention Module
- (2)
- C2f-DWR Module Design
- (3)
- MultiSEAMDetect Module Design
2.3. Experimental Environment Configuration
2.4. Model Evaluation Metrics
3. Results and Discussion
3.1. The Impact of the MSFE Module on the Algorithm
3.2. Ablation Experiments
3.3. Performance Comparison with Other Algorithms
3.4. Model Generalization Experiment
4. Conclusions
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
References
- Abbas, A. Toxicity of Selective Insecticides against Sap Sucking Insect Pests of Cotton (Gossypium Hirsutum). Pure Appl. Biol. 2021, 11, 72–78. [Google Scholar] [CrossRef]
- He, Y.; Xu, Y.; Chen, X. Biology, Ecology and Management of Tephritid Fruit Flies in China: A Review. Insects 2023, 14, 196. [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; pp. 342–347. [Google Scholar]
- Meng, F.; Li, J.; Zhang, Y.; Qi, S.; Tang, Y. Transforming Unmanned Pineapple Picking with Spatio-Temporal Convolutional Neural Networks. Comput. Electron. Agric. 2023, 214, 108298. [Google Scholar] [CrossRef]
- Ren, S.; He, K.; Girshick, R.; Sun, J. Faster R-CNN: Towards Real-Time Object Detection with Region Proposal Networks. IEEE Trans. Pattern Anal. Mach. Intell. 2017, 39, 1137–1149. [Google Scholar] [CrossRef]
- Zhou, G.; Zhang, W.; Chen, A.; He, M.; Ma, X. Rapid Detection of Rice Disease Based on FCM-KM and Faster R-CNN Fusion. IEEE Access 2019, 7, 143190–143206. [Google Scholar] [CrossRef]
- Liu, C. Farmland Pest Detection Based on YOLO-V5l and ResNet50. Artif. Intell. Robot. Res. 2022, 11, 236–247. [Google Scholar] [CrossRef]
- Deng, Z.; Wang, P.; Song, X.H. Research on Granary Pest Detection Based on SSD. J. Comput. Eng. Appl. 2020, 56, 214–218. [Google Scholar]
- Sun, J.; Yang, Y.; He, X.; Wu, X. Northern Maize Leaf Blight Detection Under Complex Field Environment Based on Deep Learning. IEEE Access 2020, 8, 33679–33688. [Google Scholar] [CrossRef]
- Liu, J.; Wang, X. Tomato Diseases and Pests Detection Based on Improved Yolo V3 Convolutional Neural Network. Front. Plant Sci. 2020, 11, 898. [Google Scholar] [CrossRef]
- Liu, J.; Wang, X.; Miao, W.; Liu, G. Tomato Pest Recognition Algorithm Based on Improved YOLOv4. Front. Plant Sci. 2022, 13, 814681. [Google Scholar] [CrossRef]
- Dai, M.; Dorjoy, M.M.H.; Miao, H.; Zhang, S. A New Pest Detection Method Based on Improved YOLOv5m. Insects 2023, 14, 54. [Google Scholar] [CrossRef]
- Zhang, Y.; Ma, B.; Hu, Y.; Li, C.; Li, Y. Accurate Cotton Diseases and Pests Detection in Complex Background Based on an Improved YOLOX Model. Comput. Electron. Agric. 2022, 203, 107484. [Google Scholar] [CrossRef]
- Zhang, N.; Zhang, X.; Bai, T.C. Identification Method of Cotton Leaf Pests and Diseases in Natural Environment Based on CBAM-YOLO v7. Trans. Chin. Soc. Agric. Mach. 2023, 54, 239–244. [Google Scholar]
- Guo, C.; Fan, B.; Zhang, Q.; Xiang, S.; Pan, C. AugFPN: Improving Multi-Scale Feature Learning for Object Detection. In Proceedings of the 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), Seattle, WA, USA, 13–19 June 2020. [Google Scholar]
- Deng, J.; Yang, C.; Huang, K.; Lei, L.; Ye, J.; Zeng, W.; Zhang, J.; Lan, Y.; Zhang, Y. Deep-Learning-Based Rice Disease and Insect Pest Detection on a Mobile Phone. Agronomy 2023, 13, 2139. [Google Scholar] [CrossRef]
- Bai, Y.; Zhang, Y.; Ding, M.; Ghanem, B. SOD-MTGAN: Small Object Detection via Multi-Task Generative Adversarial Network. In Computer Vision—ECCV 2018, Proceedings of the 5th European Conference, Munich, Germany, 8–14 September 2018; Lecture Notes in Computer Science; Springer: Heidelberg, Germany, 2018; pp. 210–226. [Google Scholar]
- Qiao, S.; Chen, L.-C.; Yuille, A. DetectoRS: Detecting Objects with Recursive Feature Pyramid and Switchable Atrous Convolution. In Proceedings of the 2021 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), Nashville, TN, USA, 20–25 June 2021. [Google Scholar]
- Lim, J.-S.; Astrid, M.; Yoon, H.-J.; Lee, S.-I. Small Object Detection Using Context and Attention. In Proceedings of the 2021 International Conference on Artificial Intelligence in Information and Communication (ICAIIC), Jeju Island, Republic of Korea, 13–16 April 2021; pp. 181–186. [Google Scholar] [CrossRef]
- Chen, G.; Wang, H.; Chen, K.; Li, Z.; Song, Z.; Liu, Y.; Chen, W.; Knoll, A. A Survey of the Four Pillars for Small Object Detection: Multiscale Representation, Contextual Information, Super-Resolution, and Region Proposal. IEEE Trans. Syst. Man Cybern. Syst. 2022, 52, 936–953. [Google Scholar] [CrossRef]
- Chen, Y.; Zheng, W.; Zhao, Y.; Song, T.; Shin, H. DW-YOLO: An Efficient Object Detector for Drones and Self-Driving Vehicles. arXiv 2004, arXiv:2403.15447. [Google Scholar] [CrossRef]
- Zhang, W.; Liu, Z.; Zhou, S.; Qi, W.; Wu, X.; Zhang, T.; Han, L. LS-YOLO: A Novel Model for Detecting Multiscale Landslides with Remote Sensing Images. IEEE J. Sel. Top. Appl. Earth Obs. Remote Sens. 2024, 17, 4952–4965. [Google Scholar] [CrossRef]
- 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 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), Seattle, WA, USA, 13–19 June 2020. [Google Scholar]
- Wei, H.; Liu, X.; Xu, S.; Dai, Z.; Dai, Y.; Xu, X. DWRSeg: Rethinking Efficient Acquisition of Multi-Scale Contextual Information for Real-Time Semantic Segmentation. arXiv 2022, arXiv:2212.01173. [Google Scholar]
- Yu, Z.; Huang, H.; Chen, W.; Su, Y.; Liu, Y.; Wang, X. YOLO-FaceV2: A Scale and Occlusion Aware Face Detector. arXiv 2024, arXiv:2208.02019. [Google Scholar] [CrossRef]
- Li, C.; Li, L.; Jiang, H.; Weng, K.; Geng, Y.; Li, L.; Ke, Z.; Li, Q.; Cheng, M.; Nie, W. YOLOv6: A Single-Stage Object Detection Framework for Industrial Applications. arXiv 2022, arXiv:2209.02976. [Google Scholar]
- Wang, C.; Bochkovskiy, A.; Liao, H. YOLOv7: Trainable Bag-of-Freebies Sets New State-of-the-Art for Real-Time Object Detectors. arXiv 2023, arXiv:2207.02696. [Google Scholar]
- Wang, C.; Yeh, I.; Liao, H. YOLOv9: Learning What You Want to Learn Using Programmable Gradient Information. arXiv 2024, arXiv:2402.13616. [Google Scholar]
- Wang, A.; Chen, H.; Liu, L.; Chen, K.; Lin, Z.; Han, J.; Ding, G. YOLOv10: Real-Time End-to-End Object Detection. arXiv 2024, arXiv:2405.14458. [Google Scholar]
- Lv, W.; Xu, S.; Zhao, Y.; Wang, G.; Wei, J.; Cui, C.; Du, Y.; Dang, Q.; Liu, Y. DETRs Beat YOLOs on Real-Time Object Detection. arXiv 2024, arXiv:2304.08069. [Google Scholar]
Training Parameters | Details |
---|---|
img-size (pixel) | 640 × 640 |
Epochs | 300 |
Batch | 32 |
Optimization algorithm | SGD |
Momentum | 0.937 |
Initial learning rate | 0.01 |
Models | Adjusting the Network | GFLOPs | P/% | R/% | mAP@0.5/% | mAP@0.5:0.95/% |
---|---|---|---|---|---|---|
YOLOv8n | - | 8.1 | 79 | 69.1 | 73.4 | 46.2 |
+MSFE | - | 8.4 | 82.4 | 71.9 | 75.1 | 46.8 |
√ | 8.6 | 80.4 | 72.2 | 75.2 | 47.8 | |
+MSFE + C2f-DWR + MultiSEAMDetect | - | 7.5 | 84.2 | 68.8 | 75 | 47.3 |
√ | 7.6 | 82.3 | 72.8 | 77.2 | 48.6 |
Experiment | MSFE | C2f-DWR | MultiSEAMDetect | GFLOPs | P/% | R/% | mAP@0.5/% | mAP@0.5:0.95/% |
---|---|---|---|---|---|---|---|---|
1 | - | - | - | 8.1 | 79 | 69.1 | 73.4 | 46.2 |
2 | √ | - | - | 8.6 | 80.4 | 72.2 | 75.2 | 47.8 |
3 | - | √ | - | 8.0 | 81.1 | 71.7 | 74.5 | 47.1 |
4 | - | - | √ | 7.3 | 82.3 | 69.9 | 75.1 | 46.1 |
5 | √ | √ | - | 8.5 | 83.1 | 72.2 | 75.4 | 48.1 |
6 | √ | - | √ | 7.7 | 80 | 73.6 | 75.7 | 47.3 |
7 | - | √ | √ | 7.2 | 84.1 | 70 | 75.6 | 47.9 |
8 | √ | √ | √ | 7.6 | 82.3 | 72.8 | 77.2 | 48.6 |
Model | R/% | mAP@0.5/% | GFLOPs | FPS | |
---|---|---|---|---|---|
YOLOv5n | 81.6 | 67.4 | 71.3 | 7.1 | 99 |
YOLOv6 | 79.2 | 68.4 | 72.2 | 11.8 | 277 |
YOLOv7-tiny | 69.8 | 72.7 | 70.4 | 13.1 | 161 |
YOLOv8n | 79 | 69.1 | 73.4 | 8.1 | 232 |
YOLOv9s | 84.6 | 72.6 | 76.9 | 26.7 | 145 |
YOLOv10n | 78.3 | 69.1 | 72.7 | 6.5 | 256 |
RT-DETR | 82.9 | 69.3 | 73.1 | 57.0 | 104 |
Ours | 82.3 | 72.8 | 77.2 | 7.6 | 227 |
Dataset | Model | P/% | R/% | mAP@0.5/% | mAP@0.5:0.95/% |
---|---|---|---|---|---|
A | YOLOv8n | 92.5 | 85.3 | 92.1 | 86 |
Ours | 92.4 | 86.6 | 93.2 | 87.1 | |
B | YOLOv8n | 96.3 | 92.9 | 97.6 | 92.5 |
Ours | 96.1 | 94.2 | 97.9 | 93.5 |
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. |
© 2025 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
Huang, J.; Huang, W. Improved YOLOv8n Method for the High-Precision Detection of Cotton Diseases and Pests. AgriEngineering 2025, 7, 232. https://doi.org/10.3390/agriengineering7070232
Huang J, Huang W. Improved YOLOv8n Method for the High-Precision Detection of Cotton Diseases and Pests. AgriEngineering. 2025; 7(7):232. https://doi.org/10.3390/agriengineering7070232
Chicago/Turabian StyleHuang, Jiakuan, and Wei Huang. 2025. "Improved YOLOv8n Method for the High-Precision Detection of Cotton Diseases and Pests" AgriEngineering 7, no. 7: 232. https://doi.org/10.3390/agriengineering7070232
APA StyleHuang, J., & Huang, W. (2025). Improved YOLOv8n Method for the High-Precision Detection of Cotton Diseases and Pests. AgriEngineering, 7(7), 232. https://doi.org/10.3390/agriengineering7070232