Strawberry Maturity Recognition Based on Improved YOLOv5
Abstract
:1. Introduction
2. Materials and Methods
2.1. Data Acquisition
2.2. YOLOv5s Network Structure
Parameter Optimization of Anchor Frame
2.3. Improved YOLOv5s Network
2.3.1. Biformed Attention Mechanism
2.3.2. Improvement of Upsampling Algorithm
2.3.3. BIFPN Feature Fusion Network
2.3.4. Improvement of Loss Function
2.3.5. Target Tracking Algorithm
3. Results
3.1. Training of Models
3.2. Model Evaluation
4. Discussion
4.1. Evaluation of the Model’s Performance Pre- and Post-Improvement
4.2. Comparison of Performance between This Algorithm and Several Target Detection Algorithms
4.2.1. Comparison between the Improved Algorithm and Other Algorithms
4.2.2. Comparison of Actual Recognition Effects of Test Sets
4.2.3. Ablation Experiment
4.3. Android Deployment Testing
4.4. Combination Experiment with Detection Robots
5. Conclusions
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
References
- Fait, A.; Hanhineva, K.; Beleggia, R.; Dai, N.; Rogachev, I.; Nikiforova, V.J.; Fernie, A.R.; Aharoni, A. Reconfiguration of the achene and receptacle metabolic networks during strawberry fruit development. Plant Physiol. 2008, 148, 730–750. [Google Scholar] [CrossRef] [PubMed]
- Nunes, M.C.N.; Brecht, J.K.; Morais, A.; Sargent, S.A. Physicochemical changes during strawberry development in the field compared to those that occur in harvested fruit during storage. J. Sci. Food Agric. 2006, 86, 180–190. [Google Scholar] [CrossRef]
- Sturm, K.; Koron, D.; Stampar, F. The composition of fruit of different strawberry varieties depending on maturity stage. Food Chem. 2003, 83, 417–422. [Google Scholar] [CrossRef]
- Zhou, C.; Hu, J.; Xu, Z.; Yue, J.; Ye, H.; Yang, G. A novel greenhouse-based system for the detection and plumpness assessment of strawberry using an improved deep learning technique. Front. Plant Sci. 2020, 11, 559. [Google Scholar] [CrossRef] [PubMed]
- Hayashi, S.; Yamamoto, S.; Saito, S.; Ochiai, Y.; Kamata, J.; Kurita, M.; Yamamoto, K. Field operation of a movable strawberry-harvesting robot using a travel platform. Jpn. Agric. Res. Q. JARQ 2014, 48, 307–316. [Google Scholar] [CrossRef]
- Xiong, Y.; Ge, Y.; Grimstad, L.; From, P.J. An autonomous strawberry-harvesting robot: Design, development, integration, and field evaluation. J. Field Robot. 2020, 37, 202–224. [Google Scholar] [CrossRef]
- Xiong, Y.; Peng, C.; Grimstad, L.; From, P.J.; Isler, V. Development and field evaluation of a strawberry harvesting robot with a cable-driven gripper. Comput. Electron. Agric. 2019, 157, 392–402. [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. In Proceedings of the IEEE International Conference on Computer Vision, Venice, Italy, 22–29 October 2017; pp. 2961–2969. [Google Scholar]
- Cai, Z.; Vasconcelos, N. Cascade r-cnn: Delving into high quality object detection. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Salt Lake City, UT, USA, 18–23 June 2018; pp. 6154–6162. [Google Scholar]
- Wang, M.; Fu, B.; Fan, J.; Wang, Y.; Zhang, L.; Xia, C. Sweet potato leaf detection in a natural scene based on faster R-CNN with a visual attention mechanism and DIoU-NMS. Ecol. Inform. 2023, 73, 101931. [Google Scholar] [CrossRef]
- Mu, X.; He, L.; Heinemann, P.; Schupp, J.; Karkee, M. Mask R-CNN based apple flower detection and king flower identification for precision pollination. Smart Agric. Technol. 2023, 4, 100151. [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]
- Liu, W.; Anguelov, D.; Erhan, D.; Szegedy, C.; Reed, S.E.; Fu, C.-Y.; Berg, A.C. SSD: Single Shot MultiBox Detector. arXiv 2015, arXiv:1512.02325. [Google Scholar]
- Li, R.; Ji, Z.; Hu, S.; Huang, X.; Yang, J.; Li, W. Tomato Maturity Recognition Model Based on Improved YOLOv5 in Greenhouse. Agronomy 2023, 13, 603. [Google Scholar] [CrossRef]
- Li, T.; Sun, M.; He, Q.; Zhang, G.; Shi, G.; Ding, X.; Lin, S. Tomato recognition and location algorithm based on improved YOLOv5. Comput. Electron. Agric. 2023, 208, 107759. [Google Scholar] [CrossRef]
- Fan, Y.; Zhang, S.; Feng, K.; Qian, K.; Wang, Y.; Qin, S. Strawberry Maturity Recognition Algorithm Combining Dark Channel Enhancement and YOLOv5. Sensors 2022, 22, 419. [Google Scholar] [CrossRef] [PubMed]
- Sekharamantry, P.K.; Melgani, F.; Malacarne, J. Deep Learning-Based Apple Detection with Attention Module and Improved Loss Function in YOLO. Remote Sens. 2023, 15, 1516. [Google Scholar] [CrossRef]
- Wang, Y.; Xing, Z.; Ma, L.; Qu, A.; Xue, J. Object Detection Algorithm for Lingwu Long Jujubes Based on the Improved SSD. Agriculture 2022, 12, 1456. [Google Scholar] [CrossRef]
- Jie, H.; Li, S.; Samuel, A.; Gang, S.; Enhua, W. Squeeze-and-Excitation Networks. IEEE Trans. Pattern Anal. Mach. Intell. 2019, 42. [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]
- 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, Nashville, TN, USA, 20–25 June 2021; pp. 13713–13722. [Google Scholar]
- Zhu, L.; Wang, X.; Ke, Z.; Zhang, W.; Lau, R.W. BiFormer: Vision Transformer with Bi-Level Routing Attention. In Proceedings of the Computer Vision and Pattern Recognition, Vancouver, BC, Canada, 17–24 June 2023. [Google Scholar] [CrossRef]
- 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, Seoul, Republic of Korea, 27 October–2 November 2019; pp. 3007–3016. [Google Scholar]
- Wang, K.; Liew, J.H.; Zou, Y.; Zhou, D.; Feng, J. Panet: Few-shot image semantic segmentation with prototype alignment. In Proceedings of the IEEE/CVF International Conference on Computer Vision, Seoul, Republic of Korea, 27 October–2 November 2019; pp. 9197–9206. [Google Scholar]
- Tan, M.; Pang, R.; Le, Q.V. EfficientDet: Scalable and efficient object detection. In Proceedings of the IEEE Computer Society Conference on Computer Vision and Pattern Recognition, Seattle, WA, USA, 13–19 June 2020. [Google Scholar]
- Zhang, Y.-F.; Ren, W.; Zhang, Z.; Jia, Z.; Wang, L.; Tan, T. Focal and efficient IOU loss for accurate bounding box regression. Neurocomputing 2022, 506, 146–157. [Google Scholar] [CrossRef]
Feature Scale | Anchor Box1/px | Anchor Box2/px | Anchor Box3/px |
---|---|---|---|
Small scale | 40 × 40 | 60 × 51 | 53 × 71 |
Medium scale | 66 × 88 | 92 × 71 | 80 × 108 |
Large scale | 95 × 127 | 134 × 108 | 115 × 155 |
Algorithm | P/% | R/% | mAP_0.5/% | mAP_0.5:0.95/% | Size/MB |
---|---|---|---|---|---|
YOLOv4-tiny | 91.2 | 88.2 | 91.5 | 79.5 | 6.7 |
YOLOv5-lite-e | 89.8 | 81.4 | 87.5 | 71.4 | 1.6 |
YOLOv5-lite-s | 90.3 | 85.7 | 90.3 | 77.5 | 3.2 |
YOLOv7 | 93 | 90.7 | 93.9 | 88.7 | 74.5 |
Faster RCNN | 92.3 | 89.6 | 91.8 | 83.3 | 107.57 |
YOLOv5s-BiCE | 94.5 | 93.4 | 96.1 | 92.9 | 15.3 |
Algorithm | Number of Immature | Number of Medium | Number of Medium Well | Number of Mature | Number of Malformed | Recognition Accuracy Rate/% | Detection Time/s |
---|---|---|---|---|---|---|---|
YOLOv5s | 426 | 164 | 262 | 158 | 74 | 89.7 | 2.6 |
YOLOv5s-B | 435 | 153 | 189 | 178 | 79 | 92.4 | 2.7 |
YOLOv5s-Bi | 440 | 151 | 187 | 176 | 92 | 92.7 | 2.6 |
YOLOv5s-C | 445 | 123 | 185 | 169 | 78 | 92.5 | 2.6 |
YOLOv5s-E | 430 | 125 | 178 | 188 | 90 | 90.6 | 2.6 |
YOLOv5s-BiCE | 453 | 129 | 193 | 164 | 83 | 94.5 | 2.6 |
YOLOv4-tiny | 434 | 127 | 183 | 183 | 86 | 91.5 | 1.17 |
YOLOv5-lite-e | 428 | 124 | 184 | 160 | 88 | 90.3 | 3.01 |
YOLOv5-lite-s | 431 | 125 | 184 | 179 | 74 | 90.8 | 3.27 |
YOLOv7 | 443 | 126 | 187 | 181 | 80 | 93.4 | 3.92 |
Faster RCNN | 441 | 125 | 224 | 163 | 88 | 92.8 | 57.7 |
Algorithm 1 | Algorithm 2 | Algorithm 3 |
---|---|---|
YOLOv5s | BiFormer | YOLOv5s-B |
YOLOv5s | BiFPN | YOLOv5s-Bi |
YOLOv5s | CARAFE | YOLOv5s-C |
YOLOv5s | Focal_EIOU | YOLOv5s-E |
Algorithm | P/% | R/% | mAP_0.5/% | mAP_0.5:0.95/% | Size/MB |
---|---|---|---|---|---|
YOLOv5s | 88.2 | 90.9 | 93.3 | 85.5 | 14.4 |
YOLOv5s-B | 92.8 | 90.1 | 95 | 87.7 | 14.9 |
YOLOv5s-Bi | 92.3 | 91 | 94.6 | 87.1 | 14.5 |
YOLOv5s-C | 92.1 | 90.6 | 94.7 | 87.3 | 14.7 |
YOLOv5s-E | 89.9 | 89.8 | 94.8 | 86.5 | 14.4 |
YOLOv5s-BiCE | 94.5 | 93.4 | 96.1 | 92.9 | 15.3 |
Algorithm | MOTA/% | MOTP/% | FPS |
---|---|---|---|
YOLOv5s-DeepSort | 84.4 | 82.6 | 25 |
YOLOv5s-BiCE-DeepSort | 91.3 | 90.1 | 51 |
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
Tao, Z.; Li, K.; Rao, Y.; Li, W.; Zhu, J. Strawberry Maturity Recognition Based on Improved YOLOv5. Agronomy 2024, 14, 460. https://doi.org/10.3390/agronomy14030460
Tao Z, Li K, Rao Y, Li W, Zhu J. Strawberry Maturity Recognition Based on Improved YOLOv5. Agronomy. 2024; 14(3):460. https://doi.org/10.3390/agronomy14030460
Chicago/Turabian StyleTao, Zhiqing, Ke Li, Yuan Rao, Wei Li, and Jun Zhu. 2024. "Strawberry Maturity Recognition Based on Improved YOLOv5" Agronomy 14, no. 3: 460. https://doi.org/10.3390/agronomy14030460
APA StyleTao, Z., Li, K., Rao, Y., Li, W., & Zhu, J. (2024). Strawberry Maturity Recognition Based on Improved YOLOv5. Agronomy, 14(3), 460. https://doi.org/10.3390/agronomy14030460