A Detection Algorithm for Citrus Huanglongbing Disease Based on an Improved YOLOv8n
Abstract
:1. Introduction
- (1)
- To improve the modeling ability to focus on citrus Huanglongbing, the EMA attention module is added to the backbone network of YOLO-EAF to enhance the model’s feature extraction ability.
- (2)
- We introduce an adaptive spatial feature fusion module, which assigns different spatial weights to different levels of Huanglongbing features, enhances the importance of key levels, and reduces the impact of contradictory information from different scale objects.
- (3)
- To accelerate the convergence of the model, improve the accuracy, and optimize the sample imbalance problem of the bounding box regression task, the Focal–EIOU is utilized to replace the existing loss function to improve the detection accuracy of the citrus Huanglongbing target.
2. Materials and Methods
2.1. Dataset
2.1.1. Data Acquisition and Analysis
2.1.2. Image Annotation and Data Enhancement
2.2. Related Theoretical Background
2.2.1. The Principle of YOLOv8 Algorithm
2.2.2. Attention Mechanism
2.2.3. Feature Pyramid
2.3. The Architecture of YOLO-EAF
2.4. Algorithm Improvement Methods
2.4.1. EMA Attention Module
2.4.2. ASFF Adaptive Spatial Feature Fusion Module
2.4.3. Focal–EIOU Loss Function
3. Results and Analysis
3.1. Experimental Environment and Parameters
3.2. Model Evaluation Indicators
3.3. Performance Comparison of Various Attention Mechanisms on YOLOv8n
3.4. Performance Comparison of Various Loss Functions on The YOLOv8n Model
3.5. Ablation Experiment
3.6. Visual Comparison of Detection Effect between YOLO-EAF and YOLOv8n
3.7. Comparison of Different Models
4. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Lee, S.; Choi, G.; Park, H.; Choi, C. Automatic Classification Service System for Citrus Pest Recognition Based on Deep Learning. Sensors 2022, 22, 8911. [Google Scholar] [CrossRef] [PubMed]
- Chen, S.; Zhai, L.; Zhou, Y.; Xie, J.; Shao, Y.; Wang, W.; Li, H.; He, Y.; Cen, H. Early diagnosis and mechanistic understanding of citrus Huanglongbing via sun-induced chlorophyll fluorescence. Comput. Electron. Agric. 2023, 215, 0168–1699. [Google Scholar] [CrossRef]
- Acosta, M.; Quiñones, A.; Munera, S.; Paz, J.; Blasco, J. Rapid Prediction of Nutrient Concentration in Citrus Leaves Using Vis-NIR Spectroscopy. Sensors 2023, 23, 6530. [Google Scholar] [CrossRef] [PubMed]
- Wang, Y.; Yao, X.; Li, B.; Xu, S.; Yi, Z.; Zhao, J. Recognition algorithm of sweet pepper malformed fruit based on improved YOLO v7-tiny. Agric. Mach. J. 2023, 54, 236–246. [Google Scholar]
- Karami, E.; Shehata, M.; Smith, A. Image Identification Using SIFT Algorithm: Performance Analysis against Different Image Deformations. arXiv 2017, arXiv:1710.02728. [Google Scholar]
- Bay, H.; Tuytelaars, T.; Gool, L. SURF: Speeded Up Robust Features; Springer: Berlin/Heidelberg, Germany, 2006; pp. 404–417. [Google Scholar]
- Rosten, E.; Drummond, T. Machine Learning for High-Speed Corner Detection; Springer: Berlin/Heidelberg, Germany, 2006; pp. 430–443. [Google Scholar]
- O’Mahony, N.; Campbell, S.; Carvalho, A.; Harapanahalli, S.; Hernandez, G.V.; Krpalkova, L.; Riordan, D.; Walsh, J. Deep Learning vs. Traditional Computer Vision. arXiv 2019, arXiv:1910.13796. [Google Scholar]
- 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]
- 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] [PubMed]
- He, K.; Gkioxari, G.; Dollár, P.; Girshick, R. Mask R-CNN. arXiv 2017, arXiv:1703.06870. [Google Scholar]
- Kong, T.; Yao, A.; Chen, Y.; Sun, F. HyperNet: Towards Accurate Region Proposal Generation and Joint Object Detection. arXiv 2016, arXiv:1604.00600,2016. [Google Scholar]
- Liu, W.; Anguelov, D.; Erhan, D.; Szegedy, C.; Reed, S.; Fu, C.; Berg, A.C. SSD: Single Shot MultiBox Detector. arXiv 2015, arXiv:1512.02325. [Google Scholar]
- Redmon, J.; Divvala, S.K.; Girshick, R.B.; 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]
- Redmon, J.; Farhadi, A. YOLOv3: An Incremental Improvement. arXiv 2018, arXiv:1804.02767. [Google Scholar]
- Bochkovskiy, A.; Wang, C.Y.; Liao, H.Y.M. YOLOv4: Optimal Speed and Accuracy of Object Detection. arXiv 2020, arXiv:2004.10934. [Google Scholar]
- Dou, S.; Wang, L.; Fan, D.; Miao, L.; Yan, J.; He, H. Classification of Citrus Huanglongbing Degree Based on CBAM-MobileNetV2 and Transfer Learning. Sensors 2023, 23, 5587. [Google Scholar] [CrossRef] [PubMed]
- Woo, S.; Park, J.; Lee, J.; Kweon, L. CBAM: Convolutional Block Attention Module. arXiv 2018, arXiv:1807.06521. [Google Scholar]
- Sandler, M.; Howard, A.; Zhu, M.; Zhmoginov, A.; Chen, L. MobileNetV2: Inverted Residuals and Linear Bottlenecks. arXiv 2018, arXiv:1801.04381. [Google Scholar]
- Lin, Y.; Huang, Z.; Liang, Y.; Liu, Y.; Jiang, W. AG-YOLO: A Rapid Citrus Fruit Detection Algorithm with Global Context Fusion. Agriculture 2024, 14, 114. [Google Scholar] [CrossRef]
- Li, J.; Xia, X.; Li, W.; Li, H.; Wang, X.; Xiao, X.; Wang, R.; Zheng, M.; Pan, X. Next-ViT: Next Generation Vision Transformer for Efficient Deployment in Realistic Industrial Scenarios. arXiv 2022, arXiv:2207.05501. [Google Scholar]
- Lyu, S.; Ke, Z.; Li, Z.; Xie, J.; Zhou, X.; Liu, Y. Accurate Detection Algorithm of Citrus Psyllid Using the YOLOv5s-BC Model. Agronomy 2023, 13, 896. [Google Scholar] [CrossRef]
- Hu, J.; Shen, L.; Albanie, S.; Sun, G.; Wu, E. Squeeze-and-Excitation Networks. arXiv 2017, arXiv:1709.01507v4. [Google Scholar]
- Jia, X.; Jiang, X.; Li, Z.; Mu, J.; Wang, Y.; Niu, Y. Application of Deep Learning in Image Recognition of Citrus Pests. Agriculture 2023, 13, 1023. [Google Scholar] [CrossRef]
- Du, L.; Sun, Y.; Chen, S.; Feng, J.; Zhao, Y.; Yan, Z.; Zhang, X.; Bian, Y. A Novel Object Detection Model Based on Faster R-CNN for Spodoptera frugiperda According to Feeding Trace of Corn Leaves. Agriculture 2022, 12, 248. [Google Scholar] [CrossRef]
- Lin, T.; Dollár, P.; Girshick, R.; He, K.; Hariharan, B.; Belongie, S. Feature Pyramid Networks for Object Detection. arXiv 2016, arXiv:1612.03144v2. [Google Scholar]
- Zhu, Z.; He, Y.; Li, W.; Cai, Z.; Wang, Q.; Ma, M. Recognition and location of duck eggs in complex environment based on improved YOLOv7 model. J. Agric. Eng. 2023, 39, 274–285. [Google Scholar]
- Jocher, G.; Chaurasia, A. Ultralytics YOLO (Version 8.0.0) [Computer Software]. Available online: https://github.com/ultralytics/ultralytics (accessed on 9 June 2020).
- Jocher, G. YOLOv5 Release v6.1. Available online: https://github.com/ultralytics/yolov5/releases/tag/v6.1,2022 (accessed on 10 January 2023).
- Yue, X.; Qi, K.; Na, X.; Zhang, Y.; Liu, Y.; Liu, C. Improved YOLOv8-Seg Network for Instance Segmentation of Healthy and Diseased Tomato Plants in the Growth Stage. Agriculture 2023, 13, 1643. [Google Scholar] [CrossRef]
- Ge, Z.; Liu, S.; Wang, F.; Li, Z.; Sun, J. YOLOX: Exceeding YOLO Series in 2021. arXiv 2021, arXiv:2107.08430. [Google Scholar]
- Xu, D.; Xiong, H.; Liao, Y.; Wang, H.; Yuan, Z.; Yin, H. EMA-YOLO: A Novel Target-Detection Algorithm for Immature Yellow Peach Based on YOLOv8. Sensors 2024, 24, 3783. [Google Scholar] [CrossRef] [PubMed]
- Yang, G.; Lei, J.; Zhu, Z.; Cheng, S.; Feng, Z.; Liang, R. AFPN: Asymptotic Feature Pyramid Network for Object Detection. arXiv 2023, arXiv:2306.15988. [Google Scholar]
- Li, Y.; Rao, Y.; Jin, X.; Jiang, Z.; Wang, Y.; Wang, T.; Wang, F.; Luo, Q.; Liu, L. YOLOv5s-FP: A Novel Method for In-Field Pear Detection Using a Transformer Encoder and Multi-Scale Collaboration Perception. Sensors 2023, 23, 30. [Google Scholar] [CrossRef] [PubMed]
- Liu, S.; Qi, L.; Qin, H.; Shi, J.; Jia, J. Path Aggregation Network for Instance Segmentation. arXiv 2018, arXiv:1803.01534. [Google Scholar]
- Hou, Q.; Zhou, D.; Feng, J. Coordinate Attention for Efficient Mobile Network Design. arXiv 2021, arXiv:2103.02907. [Google Scholar]
- Ouyang, D.; He, S.; Zhang, G.; Luo, M.; Guo, H.; Zhan, J.; Huang, Z. Efficient Multi-Scale Attention Module with Cross-Spatial Learning. arXiv 2023, arXiv:2305.13563. [Google Scholar]
- Sun, D.; Zhang, K.; Zhong, H.; Xie, J.; Xue, X.; Yan, M.; Wu, W.; Li, J. Efficient Tobacco Pest Detection in Complex Environments Using an Enhanced YOLOv8 Model. Agriculture 2024, 14, 353. [Google Scholar] [CrossRef]
- Liu, S.; Huang, D.; Wang, Y. Learning Spatial Fusion for Single-Shot Object Detection. arXiv 2019, arXiv:1911.09516. [Google Scholar]
- Zheng, Z.; Wang, P.; Ren, D.; Liu, W.; Ye, R.; Hu, Q.; Zuo, W. Enhancing Geometric Factors in Model Learning and Inference for Object Detection and Instance Segmentation. arXiv 2020, arXiv:2005.03572. [Google Scholar] [CrossRef] [PubMed]
- Zhang, Y.; Ren, W.; Zhang, Z.; Jia, Z.; Wang, L.; Tan, T. Focal and Efficient IOU Loss for Accurate Bounding Box Regression. arXiv 2021, arXiv:2101.08158. [Google Scholar] [CrossRef]
- Ma, S.; Xu, Y. MPDIoU: A Loss for Efficient and Accurate Bounding Box Regression. arXiv 2023, arXiv:2307.07662. [Google Scholar]
- Selvaraju, R.; Cogswell, M.; Das, A.; Vedantam, R.; Parikh, D.; Batra, D. Grad-CAM: Visual Explanations from Deep Networks via Gradient-based Localization. arXiv 2016, arXiv:1610.02391. [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]
Attention | P% | R% | mAP% | F1-Score% | Params/M | GFLOPs | FPS |
---|---|---|---|---|---|---|---|
SE | 75.7 | 70.1 | 75.7 | 72.79 | 3 | 8.1 | 110.2 |
CBAM | 74.6 | 72.3 | 76.9 | 73.43 | 3 | 8.1 | 103.5 |
CA | 71.2 | 74.3 | 78.2 | 72.72 | 3 | 8.1 | 109.1 |
EMA | 80.7 | 72.3 | 82.4 | 76.27 | 3 | 8.1 | 112.8 |
Loss Function | P% | R% | mAP% | F1-Score% | Params/M | GFLOPs | FPS |
---|---|---|---|---|---|---|---|
CIOU | 74.3 | 74.7 | 81.4 | 74.50 | 3 | 8.1 | 118.4 |
MPDIOU | 75.2 | 74.4 | 81.6 | 74.80 | 3 | 8.1 | 105.3 |
EIOU | 79.2 | 69.3 | 81.9 | 73.92 | 3 | 8.1 | 117.2 |
Focal–EIOU | 79.4 | 71.9 | 82.1 | 75.46 | 3 | 8.1 | 116.7 |
YOLOv8n | EMA | ASFF | Focal–EIOU | P% | R% | mAP% | F1-Score% | Params/M | GFLOPs | FPS |
---|---|---|---|---|---|---|---|---|---|---|
√ | 74.3 | 74.7 | 81.4 | 74.50 | 3 | 8.1 | 118.4 | |||
√ | √ | 80.7 | 72.3 | 82.4 | 76.27 | 3 | 8.1 | 112.8 | ||
√ | √ | 75.4 | 75.9 | 83.3 | 75.65 | 3 | 8.2 | 95.5 | ||
√ | √ | 79.4 | 71.9 | 82.1 | 75.46 | 3 | 8.1 | 116.7 | ||
√ | √ | √ | 75.9 | 74.8 | 83.2 | 75.35 | 3 | 8.2 | 83.3 | |
√ | √ | √ | 76.9 | 75.1 | 83.7 | 75.99 | 3 | 8.1 | 109.4 | |
√ | √ | √ | 75.3 | 78.3 | 84.1 | 76.77 | 3 | 8.2 | 91.1 | |
√ | √ | √ | √ | 82.7 | 73.5 | 84.7 | 77.83 | 3 | 8.2 | 94.4 |
Model | P% | R% | mAP% | F1-Score% | Params/M | GFLOPs | FPS |
---|---|---|---|---|---|---|---|
SSD | 62.39 | 55.73 | 54.97 | 58.87 | 100.2 | 125.7 | 25.2 |
Faster-RCNN | 51.74 | 64.82 | 57.27 | 57.55 | 108.8 | 144.2 | 6.3 |
YOLOv5s | 73.0 | 75.9 | 79.0 | 74.42 | 7.7 | 20.9 | 48.2 |
YOLOv7-tiny | 78.5 | 73.4 | 80.2 | 75.86 | 6.3 | 13.2 | 64.7 |
YOLOv8n | 74.3 | 74.7 | 81.4 | 74.50 | 3 | 8.1 | 118.4 |
YOLOv9t | 74.3 | 69.5 | 75.1 | 71.8 | 2 | 7.6 | 126.1 |
YOLOv10n | 69.7 | 75.5 | 78.7 | 72.5 | 2.7 | 8.2 | 86.8 |
YOLO-EAF | 82.7 | 73.5 | 84.7 | 77.83 | 3 | 8.2 | 94.4 |
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
Xie, W.; Feng, F.; Zhang, H. A Detection Algorithm for Citrus Huanglongbing Disease Based on an Improved YOLOv8n. Sensors 2024, 24, 4448. https://doi.org/10.3390/s24144448
Xie W, Feng F, Zhang H. A Detection Algorithm for Citrus Huanglongbing Disease Based on an Improved YOLOv8n. Sensors. 2024; 24(14):4448. https://doi.org/10.3390/s24144448
Chicago/Turabian StyleXie, Wu, Feihong Feng, and Huimin Zhang. 2024. "A Detection Algorithm for Citrus Huanglongbing Disease Based on an Improved YOLOv8n" Sensors 24, no. 14: 4448. https://doi.org/10.3390/s24144448