Research on the Real-Time Detection of Red Fruit Based on the You Only Look Once Algorithm
Abstract
:1. Introduction
- (1)
- Pedestrian detection, especially small-scale pedestrian detection, is one of the challenges faced by object detection algorithms [3];
- (2)
- Face detection, occlusion, and multi-scale object detection are also difficult challenges [4];
- (3)
- Text detection and object detection for distorted, blurry, and low-quality images is one of the difficult problems that need to be solved [5];
- (4)
- Fruit and vegetable testing [6,7]. Recently, many researchers have begun to explore new and more efficient techniques for detecting and identifying fruits and vegetables [8]. However, because traditional technologies cannot quickly and accurately collect and analyze massive images, their robustness and accuracy still have certain shortcomings [9]. With the development of science and technology, new fruit and vegetable detection technology has been widely used in various scenarios. They can more accurately capture the appearance, structure, and properties of fruit, and can quickly and accurately identify the growth cycle of each fruit and the quality of the product. The application of these technologies has greatly improved the efficiency and accuracy of fruit and vegetable harvesting, bringing greater efficiency and faster harvest to agricultural production.
1.1. Review of Related Technologies for Red Fruit Detection
1.2. Overview of Object Detection Based on Neural Networks
2. Overall Design of Red Fruit Target Detection Scheme Based on Deep Learning
2.1. Algorithm Flow Based on Convolutional Neural Network
- (1)
- Sigmoid activation function:
- (2)
- Tanh activation function:
- (3)
- Leaky ReLU activation function:
2.2. Red Fruit Target Detection Scheme
3. Algorithm Flow Based on YOLOv4-Tiny Architecture
3.1. Backbone Feature Extraction Network
3.2. YOLOv4-Tiny Algorithm Flow
4. Detailed Design
4.1. Experimental Environment
4.2. Make Datasets
4.2.1. Dataset Format
4.2.2. Image Collection
4.2.3. Dataset Enrichment
- Image enlargement or reduction. Enlarging or reducing an image relative to the original image and changing its size can also augment the image.
- Random cropping: randomly select a part from the image, crop this part, and adjust it to the size of the original image.
4.3. Image preprocessing
5. Discussion of Results
5.1. Train the Model
5.2. Evaluation Indicators
- (1)
- TP (true positive): The positive samples are predicted as positive by the model. The evaluation criterion in YOlOv4-tiny is the number of detection boxes where the IoU of the prediction box and the real target frame is greater than or equal to a certain threshold, and the same real target frame is calculated only once;
- (2)
- TN (true negative): the negative samples are predicted by the model as negative, that is, the number of background classes;
- (3)
- FP (false positive): The negative samples are predicted by the model as positive, also known as false positive. It is evaluated in YOLOv5 as the number of detection boxes whose IoU is less than a certain threshold between the prediction box and the real target box;
- (4)
- FN (false negative): a positive sample is predicted by the model as negative, also known as a false negative, that is, the number of real target boxes that are not detected.
5.3. Analysis of Experimental Results
5.3.1. Loss Analysis
5.3.2. Precision and Recall Index Analysis
5.3.3. F1Score Indicator Analysis
5.3.4. mAP Analysis
5.3.5. Comparison Experiments
- (1)
- According Table 2, this study method’s accuracy rate is up to 96%, while that of other methods is generally below 70%. The recall rate is 95%, showing a strong advantage compared with YOLOv4-Lite, YOLOv5-x, and Faster R-CNN. This situation is the same when applied to the F1Score and the mAP.
- (2)
- The processing time (no more than 5 ms in this method) shows the greatest improvement when compared with the other methods (second level). Although the accuracy rate, the recall rate, the F1Score, and the mAP are related to many factors, such as the availability and effectiveness of the training picture, the complexity of the algorithm, etc., the compared algorithm factors will fluctuate with the factors mentioned above. So, the indicators (the accuracy rate, the recall rate, the F1Score, and the mAP) may not be the best representation of the efficiency of an algorithm, but the processing time is, because time is an absolute value. From the perspective of real-time performance, the method adopted in this study has incomparable advantages. The processing time is no more than 5 ms. Compared to 800+ ms, there is a huge improvement.
- (3)
- Another result that needs to be analyzed is the size of the sample set; 2000 red fruit samples are used in this study, while more than 5000 are used in the comparison experiment. So, the algorithm in this study shows a certain overlearning phenomenon, and the too-high index value (more than 95%) is one of its manifestations. Therefore, the next step of this study is to continue to collect red fruit photos to form a larger sample set and avoid slight overlearning.
6. Conclusions
Supplementary Materials
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
References
- Fu, H.; Zhao, X.; Zhai, Y.; Zheng, K.; Zheng, S.; Wang, X. Research progress of weed identification method based on deep learning. J. Chin. Agric. Mech. 2023, 44, 198–207. [Google Scholar] [CrossRef]
- Xiao, Z.; Luo, L.; Chen, M.; Wang, J.; Lu, Q.; Luo, S. Detection of grapes in orchard environment based on improved YOLO-V4. J. Intel. Agri. Mech. 2023, 4, 35–43. [Google Scholar] [CrossRef]
- Cao, H.; Deng, X.; Zhang, M.; Zhang, J.; He, X.; Zhu, J. Improved pedestrian detection algorithm of YoloV5. Comput. Aided Eng. 2023, 32, 53–59. [Google Scholar]
- Song, M. Research on multi-scale face detection network based on improved Faster RCNN. Autom. Instrum. 2022, 43, 39–43+48. [Google Scholar]
- Lu, F. Research on error text detection system of English translation robot based on deep learning. Autom. Instrum. 2023, 3, 284–290. [Google Scholar] [CrossRef]
- Chen, B.; Chen, G. Review of fruit classification identification and ripeness detection technology. Comput. Age 2022, 7, 62–65. [Google Scholar] [CrossRef]
- Xu, Y.; Jiang, M.; Li, Y.; Wu, Y.; Lu, G. Fruit target detection based on improved YOLO and NMS. J. Electron. Meas. Instrum. 2022, 36, 114–123. [Google Scholar]
- Kong, P. Research and Application of Fruit Target Detection Based on Deep Learning. Master’s Thesis, Beijing University of Posts and Telecommunications, Beijing, China, 2021. [Google Scholar]
- Wang, H.; Mou, Q.; Yue, Y.; Zhao, H. Research on general detection model of fruit picking based on YOLOv3. China Sci. Technol. Pap. 2021, 16, 336–342. [Google Scholar]
- Bargoti, S.; Underwood, J.P. Image Segmentation for Fruit Detection and Yield Estimation in Apple Orchards. J. Field Robot. 2017, 34, 1039–1060. [Google Scholar] [CrossRef]
- Peng, H.X.; Huang, B.; Shao, Y.Y.; Li, Z.S.; Zhang, C.W.; Xiong, J.T. General improved SSD model for picking object recognition of multiple fruits in natural environment. Trans. Chin. Soc. Agric. Eng. 2018, 34, 155–162. [Google Scholar]
- Li, X. A Recognition and Grading Method for Machine Picking of Elevated Strawberries. Master’s Thesis, Southeast University, Nanjing, China, 2018. [Google Scholar]
- Bi, S.; Gao, F.; Chen, J.W.; Zhang, L. Detection Method of Citrus Based on Deep Convolution Neural Network. Trans. Chin. Soc. Agric. Mach. 2019, 50, 181–186. [Google Scholar]
- Zeng, P.P. Research on Fruit Image Target Detection Based on Convolutional Neural Network. Master’s Thesis, University of South China, Hengyang, China, 2019. [Google Scholar]
- Cheng, H.F.; Zhang, C.Y. Research on apple image recognition technology based on improved LeNet convolution neural network in natural scene. Food Mach. 2019, 35, 155–158. [Google Scholar]
- Huang, H.J. Research on Fruit Detection Technology Based on Deep Learning. Master’s Thesis, Jiangsu University of Science and Technology, Zhenjiang, China, 2020. [Google Scholar]
- Zhang, E.Y.; Cheng, Y.L.; Hu, G.R.; Bu, L.X.; Zhao, J.; Chen, J. Recognition of green apple in natural scenes based on SSD algorithm. China Sci. 2020, 15, 274–281. [Google Scholar]
- Gao, F.F.; Fu, L.S.; Zhang, X.; Majeed, Y.; Li, R.; Karkee, M.; Zhang, Q. Multi-class fruit-on-plant detection for apple in SNAP system using Faster R-CNN. Comput. Electron. Agric. 2020, 176, 105634. [Google Scholar] [CrossRef]
- Shi, T.; Shang, J.; Wu, Z. Research on image classification improvement method based on convolutional neural network. Mod. Inf. Technol. 2023, 7, 109–112. [Google Scholar] [CrossRef]
- Wang, X. Research on Visualization of Convolutional Neural Network Based on Gradient Analysis. Master’s Thesis, Dalian Ocean University, Dalian, China, 2023. [Google Scholar]
- Zhang, S. Review of image recognition based on convolutional neural network. J. Xi’an Aeronaut. Univ. 2023, 41, 74–81. [Google Scholar]
- He, K.; Zhang, X.; Ren, S.; Sun, J. Spatial pyramid pooling in deep convolutional networks for visual recognition. IEEE Trans. Pattern Anal. Mach. Intell. 2015, 37, 1904–1916. [Google Scholar] [CrossRef]
- Ren, S.; He, K.; Girshick, R.; Sun, J. Faster r-cnn: Towards real-time object detection with region proposal networks. Adv. Neural Inf. Process. Syst. 2015, 28. [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]
- Zhu, H.; Zhou, S.; Liu, X.; Zeng, Y.; Li, S. Review of single-stage object detection algorithm based on deep learning. Ind. Control. Comput. 2023, 36, 101–103. [Google Scholar]
- Gulzar, Y.; Ünal, Z.; Aktaş, H.; Mir, M.S. Harnessing the Power of Transfer Learning in Sunflower Disease Detection: A Comparative Study. Agriculture 2023, 13, 1479. [Google Scholar] [CrossRef]
- Gulzar, Y. Fruit Image Classification Model Based on MobileNetV2 with Deep Transfer Learning Technique. Sustainability 2023, 15, 1906. [Google Scholar] [CrossRef]
- Dhiman, P.; Kaur, A.; Balasaraswathi, V.R.; Gulzar, Y.; Alwan, A.A.; Hamid, Y. Image Acquisition, Preprocessing and Classification of Citrus Fruit Diseases: A Systematic Literature Review. Sustainability 2023, 15, 9643. [Google Scholar] [CrossRef]
- Mamat, N.; Othman, M.F.; Abdulghafor, R.; Alwan, A.A.; Gulzar, Y. Enhancing Image Annotation Technique of Fruit Classification Using a Deep Learning Approach. Sustainability 2023, 15, 901. [Google Scholar] [CrossRef]
- Liu, J.; Nie, K. Single-stage object detection algorithm based on improved YOLOv3. Electro-Opt. Control. 2021, 28, 30–33+69. [Google Scholar]
- Tao, J.; Lin, W.; Zeng, L.; Zhang, J.; Zhao, Z.; Xu, Z.; Zhang, C. Pointer Meter Reading Recognition Based on YOLOv4-tiny and Hourglass. J. Electron. Meas. Instru-Mentation 2023, 35, 1–10. [Google Scholar]
- He, X.; Song, X. Improved lightweight object detection algorithm for YOLOv4-Tiny. Comput. Sci. Explor. 2023, 1–17. Available online: http://kns.cnki.net/kcms/detail/11.5602.TP.20230310.0947.004.html (accessed on 20 September 2023).
- Yin, M.; Jia, X.; Zhang, X.; Feng, J.; Fan, X. Improved YOLOv4-Tiny’s Behavioral Human Detection for Locker Damage. Comput. Eng. Appl. 2023, 1–10. Available online: http://kns.cnki.net/kcms/detail/11.2127.TP.20230228.1059.012.html (accessed on 20 September 2023).
- Zou, W.; Ji, C. A real-time detection method for strip surface defects with improved YOLOv4-tiny. Mech. Sci. Technol. 2023, 42, 883–889. [Google Scholar] [CrossRef]
- Zhou, G.; Ma, S.; Liang, F. Recognition of the apple in panoramic images based on improved YOLOv4 model. Trans. Chin. Soc. Agric. Eng. 2022, 38, 159–168. [Google Scholar]
Name | Information |
---|---|
Memory | 16 GB |
CPU | Inter(R)Core (TM)i7-9750HFCPU@2.60 GHz |
GPU | NVIDIAGeforceGTX1650 |
Operating system platform | Windows1064-bit |
Deep learning computing framework | Pytorch1.13.1 |
Development language | Python3.6 |
Accuracy Rate | Recall Rate | F1Score | mAP | Processing Time (s) | |
---|---|---|---|---|---|
This study | 96.21% | 95.47% | 0.92 | 95.5% | 0.005 |
Improved YOLO v4 [35] | 64.94% | 52% | 0.58 | 49.45% | 0.797 |
YOLOv4 [35] | 64.21% | 43.51% | 0.52 | 44.1% | 0.848 |
YOLOv4-Lite [35] | 35.33% | 27.39% | 0.31 | 18.57% | 0.88 |
YOLOv5-l [35] | 51.5% | 32.75% | 0.4 | 27.06% | 0.879 |
YOLOv5-x [35] | 53.33% | 34.65% | 0.42 | 30.17% | 0.871 |
Faster R-CNN [35] | 51.61% | 16.48% | 0.25 | 10.81% | 0.955 |
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. |
© 2023 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
Mei, S.; Ding, W.; Wang, J. Research on the Real-Time Detection of Red Fruit Based on the You Only Look Once Algorithm. Processes 2024, 12, 15. https://doi.org/10.3390/pr12010015
Mei S, Ding W, Wang J. Research on the Real-Time Detection of Red Fruit Based on the You Only Look Once Algorithm. Processes. 2024; 12(1):15. https://doi.org/10.3390/pr12010015
Chicago/Turabian StyleMei, Song, Wenqin Ding, and Jinpeng Wang. 2024. "Research on the Real-Time Detection of Red Fruit Based on the You Only Look Once Algorithm" Processes 12, no. 1: 15. https://doi.org/10.3390/pr12010015
APA StyleMei, S., Ding, W., & Wang, J. (2024). Research on the Real-Time Detection of Red Fruit Based on the You Only Look Once Algorithm. Processes, 12(1), 15. https://doi.org/10.3390/pr12010015