A Lightweight Algorithm for Recognizing Pear Leaf Diseases in Natural Scenes Based on an Improved YOLOv5 Deep Learning Model
Abstract
:1. Introduction
2. Materials and Methods
2.1. Dataset Construction
2.1.1. Data Collection
2.1.2. Image Enhancement
2.2. Detection Algorithm of Pear Leaf Disease
2.2.1. Baseline Model Selection
2.2.2. Improvement of the YOLOv5n Model
- (1)
- Creating the C3CA module. At the 4th and 6th layers of the backbone network, the C3CA module is created by integrating the CA into the BottleNeck of the C3 module (Figure 5). This module can enhance the valuable feature information within the network and improve the feature extraction of pear leaf features to reduce interference with background information.
- (2)
- Adding the up-sampling operator. The CARAFE up-sampling operator is integrated into the neck layer. This operation can expand the receptive field to better capture target information and improve target accuracy.
- (3)
- Replacing Conv with GSConv. The Conv is replaced by GSConv in the neck network layer. This process can strengthen feature fusion, improve image representation, and reduce the parameters and computational cost.
- Coordinate attention (CA) mechanism
- (1)
- Embedding global information
- (2)
- Coordinate Attention Generation
- 2
- CARAFE up-sampling operator
- (1)
- Channel compression. To reduce the parameter number and computing cost for subsequent steps, the feature map is compressed from H × W × C to H × W × Cm, where Cm represents the number of compression channels and is set to 64.
- (2)
- Content encoding and up-sampling kernel prediction. The up-sampling kernel (size: σH × σW × kup2) is obtained and predicted by using a Kencoder × Kencoder convolutional layer. Here, kup and Kencoder are set to 5 and 3, respectively.
- (3)
- Up-sampling normalization. The above predicted up-sampling kernel is normalized by the Softmax function.
- (4)
- Content-aware feature reorganization. The convolution operation is performed by combining the predicted up-sampling kernel mentioned above with the input features.
- 3
- GSConv module
- (1)
- The input feature map with a channel number of C1 has been processed by standard convolution and depth-separable convolution (DSC) to produce two types of feature maps with a channel number of C2/2.
- (2)
- These two feature maps are concatenated to obtain and output an object feature map with a channel number of C2.
- (3)
- The channel with a number of C2 is uniformly shuffled to strengthen the feature fusion and improve the representability of the image feature.
2.3. Equipment Environment
2.4. Model Evaluation
3. Results and Discussion
3.1. Performance Comparison of the Attention Mechanisms
3.2. Ablation Experiments
3.3. Performance Comparison of Different Mainstream Algorithms
3.4. Robustness Comparison
4. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Data Availability Statement
Conflicts of Interest
References
- Liu, L.; Tao, H.; Fang, J.; Zheng, W.; Wang, L.; Jin, X. Identifying Anthracnose and Black Spot of Pear Leaves on Near-infrared Hyperspectroscopy. Trans. Chin. Soc. Agric. Mach. 2022, 53, 221–230. [Google Scholar]
- Xue, W.; Yi, W.; Kang, Y.; Xu, Y.; Dong, C. Recognition of pear leaf small anthracnose spot based on multi-resolution and multi-class feature fusion. J. Nanjing Agric. Univ. 2021, 44, 982–992. [Google Scholar]
- Su, P.; Li, H.; Wang, X.; Wang, Q.; Hao, B.; Feng, M.; Sun, X.; Yang, Z.; Jing, B.; Wang, C.; et al. Improvement of the YOLOv5 Model in the Optimization of the Brown Spot Disease Recognition Algorithm of Kidney Bean. Plants 2023, 12, 3765. [Google Scholar] [CrossRef] [PubMed]
- Yang, F.; Li, F.; Zhang, K.; Zhang, W.; Li, S. Influencing factors analysis in pear disease recognition using deep learning. Peer— Peer Netw. Appl. 2021, 14, 1816–1828. [Google Scholar] [CrossRef]
- Li, S.-F.; Li, K.-Y.; Qiao, Y.; Zhang, L.-X. Cucumber Disease Detection Method Based on Visible Light Spectrum and Improved YOLOv5 in Natural Scenes. Spectrosc. Spectr. Anal. 2023, 43, 2596–2600. [Google Scholar]
- Ahmad, N.; Asif, H.M.S.; Saleem, G.; Younus, M.U.; Anwar, S.; Anjum, M.R. Leaf Image-Based Plant Disease Identification Using Color and Texture Features. Wirel. Pers. Commun. 2021, 121, 1139–1168. [Google Scholar] [CrossRef]
- Almadhor, A.; Rauf, H.T.; Lali, M.I.U.; Damasevicius, R.; Alouffi, B.; Alharbi, A. AI-Driven Framework for Recognition of Guava Plant Diseases through Machine Learning from DSLR Camera Sensor Based High Resolution Imagery. Sensors 2021, 21, 3830. [Google Scholar] [CrossRef] [PubMed]
- Kundu, N.; Rani, G.; Dhaka, V.S.; Gupta, K.; Nayak, S.C.; Verma, S.; Ijaz, M.F.; Wozniak, M. IoT and Interpretable Machine Learning Based Framework for Disease Prediction in Pearl Millet. Sensors 2021, 21, 5386. [Google Scholar] [CrossRef]
- Liu, Y.; Wang, Z.; Wang, R.; Chen, J.; Gao, H. Flooding-based MobileNet to identify cucumber diseases from leaf images in natural scenes. Comput. Electron. Agric. 2023, 213, 108166. [Google Scholar] [CrossRef]
- Guo, Y.; Zhang, J.; Yin, C.; Hu, X.; Zou, Y.; Xue, Z.; Wang, W. Plant Disease Identification Based on Deep Learning Algorithm in Smart Farming. Discret. Dyn. Nat. Soc. 2020, 2020, 1–11. [Google Scholar] [CrossRef]
- Zhang, C.; Zhang, S.; Yang, J.; Shi, Y.; Chen, J. Apple leaf disease identification using genetic algorithm and correlation based feature selection method. Int. J. Agric. Biol. Eng. 2017, 10, 74–83. [Google Scholar] [CrossRef]
- Yin, C.; Su, Y.; Pan, M.; Duan, J. Detection of the quality of famous green tea based on improved YOLOv5s. Trans. Chin. Soc. Agric. Eng. 2023, 39, 179–187. [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]
- Bari, B.S.; Islam, M.N.; Rashid, M.; Hasan, M.J.; Razman, M.A.M.; Musa, R.M.; Ab Nasir, A.F.; Majeed, A.P.P.A. A real-time approach of diagnosing rice leaf disease using deep learning-based faster R-CNN framework. Peerj Comput. Sci. 2021, 7, e432. [Google Scholar] [CrossRef] [PubMed]
- Xue, W.; Cheng, R.; Kang, Y.; Huang, X.; Xu, Y.; Dong, C. Pear Leaf Disease Spot Counting Method Based on GC-Cascade R-CNN. Trans. Chin. Soc. Agric. Mach. 2022, 53, 237–245. [Google Scholar]
- Roy, A.M.; Bose, R.; Bhaduri, J. A fast accurate fine-grain object detection model based on YOLOv4 deep neural network. Neural Comput. Appl. 2022, 34, 3895–3921. [Google Scholar] [CrossRef]
- Li, S.; Li, K.; Qiao, Y.; Zhang, L. A multi-scale cucumber disease detection method in natural scenes based on YOLOv5. Comput. Electron. Agric. 2022, 202, 107363. [Google Scholar] [CrossRef]
- Zou, Z.; Chen, K.; Shi, Z.; Guo, Y.; Ye, J. Object Detection in 20 Years: A Survey. Proc. IEEE 2023, 111, 257–276. [Google Scholar] [CrossRef]
- Zhou, T.; Yu, Z.; Cao, Y.; Bai, H.; Su, Y. Study on an infrared multi-target detection method based on the pseudo-two-stage model. Infrared Phys. Technol. 2021, 118, 103883. [Google Scholar] [CrossRef]
- Guirguis, K.; Abdelsamad, M.; Eskandar, G.; Hendawy, A.; Kayser, M.; Yang, B.; Beyerer, J. Towards Discriminative and Transferable One-Stage Few-Shot Object Detectors. In Proceedings of the 23rd IEEE/CVF Winter Conference on Applications of Computer Vision (WACV), Waikoloa, HI, USA, 3–7 January 2023; pp. 3749–3758. [Google Scholar]
- Ale, L.; Zhang, N.; Li, L. Road Damage Detection Using RetinaNet. In Proceedings of the IEEE International Conference on Big Data (Big Data), Seattle, WA, USA, 10–13 December 2018; pp. 5197–5200. [Google Scholar]
- Hamza, R.; Chtourou, M. Comparative Study on Deep Learning Methods for Apple Ripeness Estimation on Tree. In Proceedings of the 21st International Conference on Intelligent Systems Design and Applications (ISDA), World Wide Web, ELECTR NETWORK, 13–15 December 2021; pp. 1325–1340. [Google Scholar]
- Li, Z.; Tian, X.; Liu, X.; Liu, Y.; Shi, X. A Two-Stage Industrial Defect Detection Framework Based on Improved-YOLOv5 and Optimized-Inception-ResnetV2 Models. Appl. Sci. 2022, 12, 834. [Google Scholar] [CrossRef]
- Brauwers, G.; Frasincar, F. A General Survey on Attention Mechanisms in Deep Learning. IEEE Trans. Knowl. Data Eng. 2023, 35, 3279–3298. [Google Scholar] [CrossRef]
- Yao, M.; Min, Z. Summary of Fine-Grained Image Recognition Based on Attention Mechanism. In Proceedings of the 13th International Conference on Graphics and Image Processing (ICGIP), Yunnan University, Kunming, China, 18–20 August 2021. [Google Scholar]
- Qi, J.; Liu, X.; Liu, K.; Xu, F.; Guo, H.; Tian, X.; Li, M.; Bao, Z.; Li, Y. An improved YOLOv5 model based on visual attention mechanism: Application to recognition of tomato virus disease. Comput. Electron. Agric. 2022, 194, 106780. [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]
- Song, B.; Lee, J. Detection of Northern Corn Leaf Blight Disease in Real Environment Using Optimized YOLOv3. In Proceedings of the IEEE 12th Annual Computing and Communication Workshop and Conference (CCWC), Electr Network, Las Vegas, NV, USA, 26–29 January 2022; pp. 475–480. [Google Scholar]
- de Moraes, J.L.; Neto, J.d.O.; Badue, C.; Oliveira-Santos, T.; de Souza, A.F. Yolo-Papaya: A Papaya Fruit Disease Detector and Classifier Using CNNs and Convolutional Block Attention Modules. Electronics 2023, 12, 2202. [Google Scholar] [CrossRef]
- Yang, L.; Zhang, F.; Wang, P.S.-P.; Li, X.; Meng, Z. Multi-scale spatial-spectral fusion based on multi-input fusion calculation and coordinate attention for hyperspectral image classification. Pattern Recognit. 2022, 122, 108348. [Google Scholar] [CrossRef]
- 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 (CVPR), Electr Network, Virtual Conference, 19–25 June 2021; pp. 13708–13717. [Google Scholar]
- Wang, J.; Chen, K.; Xu, R.; Liu, Z.; Loy, C.C.; Lin, D. CARAFE: Content-Aware ReAssembly of FEatures. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), Seoul, Republic of Korea, 27 October–2 November 2019; pp. 3007–3016. [Google Scholar]
- Li, H.; Li, J.; Wei, H.; Liu, Z.; Zhan, Z.; Ren, Q. Slim-neck by GSConv: A better design paradigm of detector architectures for autonomous vehicles. arXiv 2022, arXiv:2206.02424. [Google Scholar] [CrossRef]
Leaf Disease Type | Original Dataset (Training Dataset/Test Dataset) | Enhanced Dataset (Training Dataset/Test Dataset) |
---|---|---|
Rust | 634 (511/123) | 2167 (2044/123) |
Anthrax | 679 (546/133) | 2317 (2184/133) |
Black rot | 543 (439/104) | 1860 (1756/104) |
Leaf spot | 675 (543/132) | 2604 (2172/132) |
Mosaic | 877 (704/173) | 2989 (2816/173) |
Total | 3408 (2743/665) | 11,637 (10,972/665) |
Model | Model Size (MB) | FLOPs (G) | [email protected] (%) |
---|---|---|---|
YOLOv6n | 8.27 | 11.8 | 87.6 |
YOLOv7-ting | 11.70 | 13.2 | 87.7 |
YOLOv8n | 5.94 | 8.1 | 88.1 |
YOLOv5n | 3.74 | 4.1 | 88.6 |
Parameter | Value | Parameter | Value |
---|---|---|---|
Batch size | 32 | Initial learning rate | 0.01 |
Epochs | 250 | Momentum | 0.937 |
Input size | 640 × 640 | Weight decay | 0.0005 |
Optimizer | SGD |
Attention Mechanism | Model Size (MB) | FLOPs (G) | [email protected] (%) |
---|---|---|---|
Base (YOLOv5n) | 3.74 | 4.1 | 88.6 |
C3CBAM | 3.63 | 3.8 | 89.1 |
C3ECA | 3.61 | 3.8 | 89.1 |
C3SE | 3.60 | 3.8 | 89.3 |
C3CA | 3.60 | 3.8 | 89.8 |
Model | C3CA | CAREFE | GSConv | Model Size (MB) | FLOPs (G) | [email protected] (%) |
---|---|---|---|---|---|---|
Base (YOLOv5n) | 3.74 | 4.1 | 88.6 | |||
YOLOv5n_1 | √ | 3.63 | 3.8 | 89.8 | ||
YOLOv5n_2 | √ | 3.85 | 4.2 | 89.7 | ||
YOLOv5n_3 | √ | 3.53 | 4.0 | 89.3 | ||
YOLOv5n_4 | √ | √ | 3.69 | 3.9 | 91.5 | |
YOLOv5n_5 | √ | √ | 3.43 | 3.7 | 90.0 | |
YOLOv5n_6 | √ | √ | 3.59 | 4.1 | 90.2 | |
CCG-YOLOv5n | √ | √ | √ | 3.49 | 3.8 | 92.4 |
Methods | Model Size (MB) | FLOPs (G) | [email protected] (%) | FPS |
---|---|---|---|---|
YOLOv3-ting | 33.16 | 13.0 | 82.7 | 122 |
YOLOv4-ting | 22.40 | 6.8 | 83.3 | 125 |
MTC-YOLOv5n [17] | 4.70 | 6.1 | 87.1 | 124 |
YOLOv5s | 13.70 | 15.8 | 89.0 | 120 |
GC-Cascade R-CNN [15] | 88.83 | 312.4 | 88.5 | 7 |
CCG-YOLOv5n | 3.49 | 3.8 | 92.4 | 129 |
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
Li, J.; Liu, Z.; Wang, D. A Lightweight Algorithm for Recognizing Pear Leaf Diseases in Natural Scenes Based on an Improved YOLOv5 Deep Learning Model. Agriculture 2024, 14, 273. https://doi.org/10.3390/agriculture14020273
Li J, Liu Z, Wang D. A Lightweight Algorithm for Recognizing Pear Leaf Diseases in Natural Scenes Based on an Improved YOLOv5 Deep Learning Model. Agriculture. 2024; 14(2):273. https://doi.org/10.3390/agriculture14020273
Chicago/Turabian StyleLi, Jianian, Zhengquan Liu, and Dejin Wang. 2024. "A Lightweight Algorithm for Recognizing Pear Leaf Diseases in Natural Scenes Based on an Improved YOLOv5 Deep Learning Model" Agriculture 14, no. 2: 273. https://doi.org/10.3390/agriculture14020273
APA StyleLi, J., Liu, Z., & Wang, D. (2024). A Lightweight Algorithm for Recognizing Pear Leaf Diseases in Natural Scenes Based on an Improved YOLOv5 Deep Learning Model. Agriculture, 14(2), 273. https://doi.org/10.3390/agriculture14020273