| Literature DB >> 35968138 |
Chaojun Hou1, Xiaodi Zhang1, Yu Tang2, Jiajun Zhuang1, Zhiping Tan2, Huasheng Huang2, Weilin Chen3, Sheng Wei4, Yong He5, Shaoming Luo3.
Abstract
Intelligent detection and localization of mature citrus fruits is a critical challenge in developing an automatic harvesting robot. Variable illumination conditions and different occlusion states are some of the essential issues that must be addressed for the accurate detection and localization of citrus in the orchard environment. In this paper, a novel method for the detection and localization of mature citrus using improved You Only Look Once (YOLO) v5s with binocular vision is proposed. First, a new loss function (polarity binary cross-entropy with logit loss) for YOLO v5s is designed to calculate the loss value of class probability and objectness score, so that a large penalty for false and missing detection is applied during the training process. Second, to recover the missing depth information caused by randomly overlapping background participants, Cr-Cb chromatic mapping, the Otsu thresholding algorithm, and morphological processing are successively used to extract the complete shape of the citrus, and the kriging method is applied to obtain the best linear unbiased estimator for the missing depth value. Finally, the citrus spatial position and posture information are obtained according to the camera imaging model and the geometric features of the citrus. The experimental results show that the recall rates of citrus detection under non-uniform illumination conditions, weak illumination, and well illumination are 99.55%, 98.47%, and 98.48%, respectively, approximately 2-9% higher than those of the original YOLO v5s network. The average error of the distance between the citrus fruit and the camera is 3.98 mm, and the average errors of the citrus diameters in the 3D direction are less than 2.75 mm. The average detection time per frame is 78.96 ms. The results indicate that our method can detect and localize citrus fruits in the complex environment of orchards with high accuracy and speed. Our dataset and codes are available at https://github.com/AshesBen/citrus-detection-localization.Entities:
Keywords: YOLO v5s; binocular vision; citrus detection; citrus localization; loss function
Year: 2022 PMID: 35968138 PMCID: PMC9372459 DOI: 10.3389/fpls.2022.972445
Source DB: PubMed Journal: Front Plant Sci ISSN: 1664-462X Impact factor: 6.627
Dataset distribution.
| Non | Weak | Well | Total | |||||
| Images | Samples | Images | Samples | Images | Samples | Images | Samples | |
| Train | 923 | 4569 | 814 | 2503 | 1176 | 4016 | 2913 | 11088 |
| Validation | 333 | 1636 | 255 | 809 | 383 | 1435 | 971 | 3880 |
| Test | 307 | 892 | 269 | 655 | 395 | 1052 | 971 | 2599 |
FIGURE 1Examples of citrus images captured in three illumination conditions: (A) non, (B) weak, (C) well, (D) depth map of (A), (E) depth map of (B), and (F) depth map of (C).
FIGURE 2Flow diagram of our proposed method.
FIGURE 3Citrus detection model based on You Only Look Once (YOLO) v5s: (A) network structure of improved YOLO v5s and (B) function graph of penalty function f.
FIGURE 4Examples of color curves of the citrus and background in different color spaces: (A) original RGB image, (B) color intensity on the line on R, G, and B elements in RGB color space, and (C) color intensity on the line on Cb and Cr elements in YCrCb color space.
FIGURE 5Examples of the citrus image after Cr-Cb chromatic mapping and its gray histogram under variable illumination: (A) non, (B) weak, and (C) well.
FIGURE 6Coordinate system transformation diagram.
FIGURE 7Example of 2D and 3D location information of citrus fruit: (A) 2D information of citrus fruit with four endpoints (green points) and center points Q (red points) in O. (B) Citrus 3D bounding box in O with eight vertices.
Algorithm 1 - Calculation of 3D localization for a citrus fruit.
Detection results of You Only Look Once (YOLO) v5s using different loss functions in the test dataset.
| Loss function | Illumination |
|
|
|
| |||
| Our Loss | Non | 95.79 |
| 0.98 | 79.31 | 888 | 39 | 4 |
| Weak | 96.13 | 98.47 | 0.97 |
| 645 | 26 | 10 | |
| Well |
| 98.48 | 0.98 | 81.04 | 1036 | 36 | 16 | |
| Total | 96.22 | 98.85 |
| 78.96 | 2569 | 101 | 30 | |
|
| Non | 95.50 | 90.47 | 0.93 | 81.34 | 807 | 38 | 85 |
| Weak | 94.80 | 91.91 | 0.93 | 78.63 | 602 | 33 | 53 | |
| Well | 96.07 | 93.06 | 0.95 | 83.16 | 979 | 40 | 73 | |
| Total | 95.56 | 91.88 | 0.94 | 81.33 | 2388 | 111 | 211 | |
|
| Non | 95.93 | 92.38 | 0.94 | 79.91 | 824 | 35 | 68 |
| Weak | 95.09 | 91.76 | 0.93 | 75.38 | 601 | 31 | 54 | |
| Well | 96.25 | 92.78 | 0.94 | 82.59 | 976 | 38 | 76 | |
| Total | 95.85 | 92.38 | 0.94 | 79.75 | 2401 | 104 | 198 | |
|
| Non | 95.67 | 94.17 | 0.95 | 79.33 | 840 | 38 | 52 |
| Weak | 95.09 | 94.66 | 0.95 | 75.53 | 620 | 32 | 35 | |
| Well | 96.06 | 95.06 | 0.96 | 81.73 | 1000 | 41 | 52 | |
| Total | 95.68 | 94.65 | 0.95 | 79.25 | 2460 | 111 | 139 |
The bold values means the best result on each metrics.
FIGURE 8The missed detection of citrus samples of You Only Look Once (YOLO) v5s but detected by our proposed loss in different illumination on test data: (A) non, (B) weak, and (C) well.
FIGURE 9Comparison of detection results using different loss functions: (A) Our loss, (B) Loss, (C) Loss, and (D) Loss.
FIGURE 10Results of samples under different illumination conditions: (A) RGB image, (B) Cr-Cb chromatic mapping, (C) Otsu segmentation, (D) morphological operations, where the red point is the center point and the green point is the maximum and minimum point of the citrus fruit, (E) color map of the original depth map, and (F) color map on depth map restored by the kriging method.
FIGURE 11Experiment results using the Kriging method: (A) color map of depth values, (B) RGB image of a citrus fruit, (C) color map by setting depth values zero at random pixels, and (D) color map of restoration by kriging.
FIGURE 12Examples of 3D bounding boxes for citrus fruits.
FIGURE 13Comparison between the measured values and predicted values: (A) d, (B) d, (C) d, and (D) d.