Detection of Orchard Apples Using Improved YOLOv5s-GBR Model
Abstract
:1. Introduction
- (1)
- Using the lightweight GhostNetV2 instead of the C3 module in the backbone network reduces the redundancy of the network layer, lowers the number of parameters in the model, and improves the detection accuracy and speed while reducing the computational burden.
- (2)
- In this study, we uniquely utilize the adaptive sparse sampling of bi-level routing attention (BRA) to focus attention on a few key labels and also use the spatial attention (SA) module to enhance the local key information of the sparsely sampled features and propose a novel bi-level routing spatial attention module (BRSAM). This design both extracts the key features and reduces the influence of irrelevant features, which improves the computational efficiency and detection performance, as well as the generalization ability and robustness of the model.
- (3)
- This research used the repulsive loss function instead of the original bounding box loss function to enhance the detection of occluded, overlapping targets.
2. Materials and Methods
2.1. Image Acquisition and Data Enhancement
2.2. Model Selection and Improvement
2.2.1. Target Detection Network Model Selection
2.2.2. YOLOv5s Network Architecture
2.2.3. Model Backbone Module Improvement
2.2.4. Bi-Level Routing Spatial Attention Module
2.2.5. Repulsion Loss
2.2.6. Improved YOLOv5s Network Model
3. Results
3.1. Model Training
3.1.1. Training Platform
3.1.2. Evaluation Indicators
3.2. Training Results
4. Discussion
4.1. Ablation Experiments
4.2. Verification of the Network Model
5. Conclusions
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
References
- Wu, Z.C.; Chen, P. State Analysis of Apple Industry in China. IOP Conf. Ser. Earth Environ. Sci. 2021, 831, 012067. [Google Scholar] [CrossRef]
- Sun, Y.; Lu, Y.H.; Wang, Z.C.; Li, M.Y. Production efficiency and change characteristics of China’s apple industry in terms of planting scale. PLoS ONE 2021, 16, e0254820. [Google Scholar] [CrossRef]
- Song, L.Q.; Dimitar, S.; Wang, X.F.; Stanislava, D.; Liu, M.Y.; Liu, X.Q.; Jiang, Z.W.; Zhao, L.L. Cultivation and evaluation of series yellow and green apple varieties in Yantai, China. Rastenievdni Nauk. 2020, 57, 21–25. [Google Scholar]
- Dorward, A. Agricultural labour productivity, food prices and sustainable development impacts and indicators. Food Policy 2013, 39, 40–50. [Google Scholar] [CrossRef]
- Jiang, S.; Zhang, H.Y.; Cong, W.F.; Liang, Z.Y.; Ren, Q.R.; Wang, C.; Zhang, F.S.; Jiao, X.Q. Multi-objective optimization of smallholder apple production: Lessons from the bohai bay region. Sustainability 2020, 12, 6496. [Google Scholar] [CrossRef]
- Mahesh, B. Machine learning algorithms—A review. Int. J. Sci. Res. 2020, 9, 381–386. [Google Scholar]
- Pandey, R.; Naik, S.; Marfatia, R. Image processing and machine learning for automated fruit grading system: A technical review. Int. J. Comput. Appl. 2013, 81, 29–39. [Google Scholar] [CrossRef]
- Chu, P.Y.; Li, Z.J.; Lammers, K.; Lu, R.F.; Liu, X.M. Deep Learning-based Apple Detection using a Suppression Mask R-CNN. Pattern Recognit. Lett. 2021, 147, 206–211. [Google Scholar] [CrossRef]
- Xuan, G.T.; Gao, C.; Shao, Y.Y.; Zhang, M.; Wang, Y.X.; Zhong, J.R.; Li, Q.G.; Peng, H.X. Apple detection in natural environment using deep learning algorithms. IEEE Access 2020, 8, 216772–216780. [Google Scholar] [CrossRef]
- Kang, H.W.; Chen, C. Fast implementation of real-time fruit detection in apple orchards using deep learning. Comput. Electron. Agric. 2020, 168, 105108. [Google Scholar] [CrossRef]
- Linker, R.; Cohen, O.; Naor, A. Determination of the number of green apples in RGB images recorded in orchards. Comput. Electron. Agric. 2012, 81, 45–57. [Google Scholar] [CrossRef]
- Jiang, M.; Song, L.; Wang, Y.F.; Li, Z.Y.; Song, H.B. Fusion of the YOLOv4 network model and visual attention mechanism to detect low-quality young apples in a complex environment. Precis. Agric. 2022, 23, 559–577. [Google Scholar] [CrossRef]
- Lu, S.L.; Chen, W.K.; Zhang, X.; Karkee, M. Canopy-attention-YOLOv4-based immature/mature apple fruit detection on dense-foliage tree architectures for early crop load estimation. Comput. Electron. Agric. 2022, 193, 106696. [Google Scholar] [CrossRef]
- Wang, Z.P.; Jin, L.Y.; Wang, S.; Xu, H.R. Apple stem/calyx real-time recognition using YOLO-v5 algorithm for fruit automatic loading system. Postharvest Biol. Technol. 2022, 185, 111808. [Google Scholar] [CrossRef]
- Wang, J.X.; Su, Y.H.; Yao, J.H.; Liu, M.; Du, Y.R.; Wu, X.; Huang, L.; Zhao, M.H. Apple rapid recognition and processing method based on an improved version of YOLOv5. Ecol. Inform. 2023, 77, 102196. [Google Scholar] [CrossRef]
- Solimani, F.; Cardellicchio, A.; Dimauro, G.; Petrozza, A.; Summerer, S.; Cellini, F.; Renò, V. Optimizing tomato plant phenotyping detection: Boosting YOLOv8 architecture to tackle data complexity. Comput. Electron. Agric. 2024, 218, 108728. [Google Scholar] [CrossRef]
- Ma, B.L.; Hua, Z.X.; Wen, Y.C.; Deng, H.X.; Zhao, Y.J.; Pu, L.R.; Song, H.B. Using an improved lightweight YOLOv8 model for real-time detection of multi-stage apple fruit in complex orchard environments. Artif. Intell. Agric. 2024, 11, 70–82. [Google Scholar] [CrossRef]
- Jiang, W.; Quan, L.Z.; Wei, G.Y.; Chang, C.; Geng, T.Y. A conceptual evaluation of a weed control method with post-damage application of herbicides: A composite intelligent intra-row weeding robot. Soil Tillage Res. 2023, 234, 105837. [Google Scholar] [CrossRef]
- Liu, S.; Qi, L.; Qin, H.F.; Shi, J.P.; Jia, J.Y. Path aggregation network for instance segmentation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Salt Lake City, UT, USA, 18–23 June 2018; pp. 8759–8768. [Google Scholar] [CrossRef]
- Zheng, Z.H.; Wang, P.; Ren, D.W.; Liu, W.; Ye, R.G.; Hu, Q.H.; Zuo, W.M. Enhancing geometric factors in model learning and inference for object detection and instance segmentation. IEEE Trans. Cybern. 2021, 52, 8574–8586. [Google Scholar] [CrossRef]
- Tang, Y.H.; Han, K.; Guo, J.Y.; Xu, C.; Xu, C.; Wang, Y.H. GhostNetv2: Enhance cheap operation with long-range attention. Adv. Neural Inf. Process. Syst. 2022, 35, 9969–9982. [Google Scholar]
- Zhu, L.; Wang, X.j.; Ke, Z.H.; Zhang, W.; Lau, R. BiFormer: Vision transformer with Bi-Level Routing Attention. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Vancouver, BC, Canada, 17–24 June 2023; pp. 10323–10333. [Google Scholar] [CrossRef]
- Ren, S.C.; Zhou, D.Q.; He, S.F.; Feng, J.S.; Wang, X.C. Shunted self-attention via multi-scale token aggregation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, New Orleans, LA, USA, 18–24 June 2022; pp. 10853–10862. [Google Scholar] [CrossRef]
- Woo, S.; Park, J.; Lee, J.Y.; Kweon, I.S. Cbam: Convolutional block attention module. In Proceedings of the European Conference on Computer Vision (ECCV), Munich, Germany, 8–14 September 2018; pp. 3–19. [Google Scholar] [CrossRef]
- Wang, X.L.; Xiao, T.T.; Jiang, Y.N.; Shao, S.; Sun, J.; Shen, C.H. Repulsion loss: Detecting pedestrians in a crowd. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Salt Lake City, UT, USA, 18–23 June 2018; pp. 7774–7783. [Google Scholar] [CrossRef]
Algorithm | Module 1 | Module 2 |
---|---|---|
YOLOv5s-G | YOLOv5s | GhostNetV2 |
YOLOv5s-B | YOLOv5s | BRSAM |
YOLOv5s-R | YOLOv5s | Repulsion Loss |
ID | GhostNetV2 | BRSAM | Repulsion Loss | Params/M | mAP |
---|---|---|---|---|---|
1 | × | × | × | 7.9 | 94.3 |
2 | √ | × | × | 5.8 | 93.5 |
3 | √ | √ | × | 6.2 | 96.7 |
4 | √ | × | √ | 6.0 | 96.9 |
5 | √ | √ | √ | 6.3 | 98.2 |
Models | P (%) | R (%) | mAP_0.5(%) | Size/MB |
---|---|---|---|---|
YOLOv5-lite-s | 85.6 | 83.6 | 87.2 | 3.2 |
YOLOv5-lite-e | 86.5 | 84.7 | 88.8 | 1.7 |
YOLOv4-tiny | 91.7 | 89.2 | 92.8 | 6.9 |
YOLOv5s | 89.8 | 91.7 | 94.3 | 14.1 |
YOLOv5m | 91.2 | 92.8 | 95.6 | 40.8 |
YOLOv5l | 91.9 | 93.5 | 96.4 | 89.2 |
YOLOv8s | 92.6 | 94.3 | 97.5 | 21.8 |
Faster R-CNN | 85.8 | 89.7 | 95.7 | 108 |
SSD | 90.7 | 87.5 | 93.3 | 100 |
YOLOv5s-GBR | 93.5 | 95.4 | 98.2 | 14.3 |
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
Sun, X.; Zheng, Y.; Wu, D.; Sui, Y. Detection of Orchard Apples Using Improved YOLOv5s-GBR Model. Agronomy 2024, 14, 682. https://doi.org/10.3390/agronomy14040682
Sun X, Zheng Y, Wu D, Sui Y. Detection of Orchard Apples Using Improved YOLOv5s-GBR Model. Agronomy. 2024; 14(4):682. https://doi.org/10.3390/agronomy14040682
Chicago/Turabian StyleSun, Xingdong, Yukai Zheng, Delin Wu, and Yuhang Sui. 2024. "Detection of Orchard Apples Using Improved YOLOv5s-GBR Model" Agronomy 14, no. 4: 682. https://doi.org/10.3390/agronomy14040682
APA StyleSun, X., Zheng, Y., Wu, D., & Sui, Y. (2024). Detection of Orchard Apples Using Improved YOLOv5s-GBR Model. Agronomy, 14(4), 682. https://doi.org/10.3390/agronomy14040682