| Literature DB >> 35062541 |
Shilei Lyu1,2,3,4, Ruiyao Li1,3, Yawen Zhao1,3, Zhen Li1,2,3,4, Renjie Fan1,3, Siying Liu1.
Abstract
Green citrus detection in citrus orchards provides reliable support for production management chains, such as fruit thinning, sunburn prevention and yield estimation. In this paper, we proposed a lightweight object detection YOLOv5-CS (Citrus Sort) model to realize object detection and the accurate counting of green citrus in the natural environment. First, we employ image rotation codes to improve the generalization ability of the model. Second, in the backbone, a convolutional layer is replaced by a convolutional block attention module, and a detection layer is embedded to improve the detection accuracy of the little citrus. Third, both the loss function CIoU (Complete Intersection over Union) and cosine annealing algorithm are used to get the better training effect of the model. Finally, our model is migrated and deployed to the AI (Artificial Intelligence) edge system. Furthermore, we apply the scene segmentation method using the "virtual region" to achieve accurate counting of the green citrus, thereby forming an embedded system of green citrus counting by edge computing. The results show that the mAP@.5 of the YOLOv5-CS model for green citrus was 98.23%, and the recall is 97.66%. The inference speed of YOLOv5-CS detecting a picture on the server is 0.017 s, and the inference speed on Nvidia Jetson Xavier NX is 0.037 s. The detection and counting frame rate of the AI edge system-side counting system is 28 FPS, which meets the counting requirements of green citrus.Entities:
Keywords: AI edge system; YOLOv5-CS; green citrus; object detection; virtual region
Mesh:
Year: 2022 PMID: 35062541 PMCID: PMC8778674 DOI: 10.3390/s22020576
Source DB: PubMed Journal: Sensors (Basel) ISSN: 1424-8220 Impact factor: 3.576
Figure 1YOLO object detection.
Figure 2YOLOv5 Architecture.
Figure 3Slicing operation for subimage 1–4.
Figure 4Neck module.
Figure 5Green citrus counting.
Figure 6Virtual line for counting.
Figure 7Data augmentation methods. (a) origin, (b) blur, (c) horizontal mirroring, (d) move, (e) rotate 270°, (f) noise, (g) vertical mirroring.
Green citrus dataset.
| Dataset | Label | Training Set | Test Set | Total |
|---|---|---|---|---|
| green citrus | unripe citrus | 2211 | 620 | 2831 |
Figure 8Data labeling.
Figure 9YOLOv5-CS Architecture.
Figure 10Image rotation.
YOLOv5-CS network structure.
| Serial Number | From | Params | Module | Arguments |
|---|---|---|---|---|
| 0 | −1 | 3520 | Focus | [3, 32, 3] |
|
|
|
|
|
|
| 2 | −1 | 19,904 | BottleneckCSP | [64, 64, 1] |
| 3 | −1 | 73,984 | Conv | [64, 128, 3, 2] |
| 4 | −1 | 161,152 | BottleneckCSP | [128, 128, 3] |
| 5 | −1 | 295,424 | Conv | [128, 256, 3, 2] |
| 6 | −1 | 641,792 | BottleneckCSP | [256, 256, 3] |
| 7 | −1 | 1,180,672 | Conv | [256, 512, 3, 2] |
| 8 | −1 | 656,896 | SPP | [512, 512, [5, 9, 13]] |
| 9 | −1 | 1,248,768 | BottleneckCSP | [512, 512, 1, False] |
| 10 | −1 | 131,584 | Conv | [512, 256, 1, 1] |
| 11 | −1 | 0 | Upsample | [None, 2, ‘nearest’] |
| 12 | [−1, 6] | 0 | Concat | [1] |
| 13 | −1 | 378,624 | BottleneckCSP | [512,256, 1, False] |
| 14 | −1 | 66,048 | Conv | [256, 128, 1, 1] |
| 15 | −1 | 0 | Upsample | [None, 2, ‘nearest’] |
| 16 | [−1, 4] | 0 | Concat | [1] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 | −1 | 95,104 | BottleneckCSP | [256, 128, 1, False] |
| 25 | −1 | 147,712 | Conv | [128, 128, 3, 2] |
| 26 | [−1, 14] | 0 | Concat | [1] |
| 27 | −1 | 313,088 | BottleneckCSP | [256,256, 1, False] |
| 28 | −1 | 590,336 | Conv | [256, 256, 3, 2] |
| 29 | [−1, 10] | 0 | Concat | [1] |
| 30 | −1 | 1,248,768 | BottleneckCSP | [512,512, 1, False] |
Figure 11Edge-computing system platform.
Figure 12Green citrus counting.
Model ablation experiment.
| Data Augmentation | Small Object Detection Layer | CBAM | mAP@.5 | Recall | Epochs |
|---|---|---|---|---|---|
| 96.66% | 92.74% | 100 | |||
| √ | 97.51% | 96.16% | |||
| √ | √ | 97.59% | 96.09% | ||
| √ | √ | √ | 98.05% | 97.38% |
Figure 13Loss curve.
Figure 14Leakage detection of citrus.
Figure 15mAP@.5 curve.
Training result.
| Neural Network | Epochs | mAP@.5 | Image-Size | Precision | Recall |
|---|---|---|---|---|---|
| First training | |||||
| YOLOv5 | 100 | 97.51% | 416 | 89.81% | 96.16% |
| YOLOv5-CS | 100 | 98.05% | 416 | 84.49% | 97.38% |
| Retraining | |||||
| YOLOv5 | 50 | 97.79% | 416 | 93.03% | 95.27% |
| YOLOv5-CS | 50 | 98.23% | 416 | 86.97% | 97.66% |
Figure 16Counting the number of citrus in the orchard.
Counting results of simulated citrus tree.
| Number of Experiments | Actual Number | Number of Tests | Relative Error | Average Relative Error of Ten Times | FPS |
|---|---|---|---|---|---|
| 1 | 40 | 40 | 0% | 4.25% | 28 |
| 2 | 37 | 7.5% | |||
| 3 | 36 | 10% | |||
| 4 | 38 | 5% | |||
| 5 | 38 | 5% | |||
| 6 | 39 | 2.5% | |||
| 7 | 37 | 7.5% | |||
| 8 | 39 | 2.5% | |||
| 9 | 40 | 0% | |||
| 10 | 39 | 2.5% |
Counting results of real citrus tree.
| Number of Experiments | Actual Number | Number of Tests | Relative Error | Average Relative Error of Ten Times | FPS |
|---|---|---|---|---|---|
| 1 | 24 | 22 | 8.33% | 8.75% | 28 |
| 2 | 21 | 12.5% | |||
| 3 | 23 | 4.17% | |||
| 4 | 25 | 4.17% | |||
| 5 | 21 | 12.5% | |||
| 6 | 20 | 16.67% | |||
| 7 | 26 | 8.33% | |||
| 8 | 22 | 8.33% | |||
| 9 | 23 | 4.17% | |||
| 10 | 22 | 8.33% |