| Literature DB >> 35454714 |
Wei Han1, Fei Jiang2, Zhiyuan Zhu1.
Abstract
Presently, the quality of cherries in the market is uneven, because human senses are used to distinguish cherry quality, which consumes a lot of time and energy and does not achieve good results in terms of accuracy. If the internal quality indices, such as the PH value, sugar-acid ratio, and vitamin C content, of cherries are extracted using chemical methods, the detection speed will decrease. With the development of artificial intelligence (AI), image processing by AI algorithms has attracted broad attention. The YOLOv5 model in the YOLO series has many advantages, such as high detection accuracy, fast speed, small size, and so on, and has been used in face recognition, image recognition and other fields. However, owing to the influence of seasonal weather, the environment and other factors, the dataset used in the training model decreases the accuracy of image recognition. To improve the accuracy, a large amount of data must be used for model training, but this will decrease the model training speed. Because it is impossible to use all data in training, there will inevitably be recognition errors in the detection process. In this study, the cherry images in a dataset were extracted by the flooding filling algorithm. The extracted cherry images were used as a new dataset for training and recognition, and the results were compared to those obtained with non-extracted images. The dataset generated by the flooding filling algorithm was used for model training. After 20 training epochs, the accuracy rate reached 99.6%. Without using the algorithm to extract images, the accuracy rate was only 78.6% after 300 training epochs.Entities:
Keywords: YOLOv5s; cherry; deep learning; flood filling algorithm; image processing
Year: 2022 PMID: 35454714 PMCID: PMC9025714 DOI: 10.3390/foods11081127
Source DB: PubMed Journal: Foods ISSN: 2304-8158
Figure 1Basic structure of CNN.
Figure 2Network structure diagram of YOLOv5s target detection algorithm.
Figure 3Sample images: (a) original sample images; (b) images extracted by flooding filling algorithm [20].
Experimental Configuration and Parameters.
| Configuration | Parameters | |
|---|---|---|
| Software | System | Windows 10 |
| IDEL | Pycharm | |
| Python | Python 3.8 | |
| Hardware | CPU | Intel(R) Core(TM) i7-8750H CPU @ 2.20 GHz |
| Graphics card | NVIDIA GeForce GTX 1050 Ti | |
| Training parameters | Pre-training weight | YOLOv5s.PT |
| Epochs | 50 | |
| Sample size | 2000 | |
Figure 4Training results obtained with original image.
Figure 5Training results obtained with image dataset extracted by flooding filling algorithm.
Comparison of Training Results Obtained with Different Datasets.
| Dataset | Precision | Recall | Average Precision (IoU Threshold: 0.5) | Average Precision (IoU Threshold: 0.5–0.95) |
|---|---|---|---|---|
| Original images | 99.6% | 99.4% | 96.7% | 95.4% |
| Images extracted by flooding filling algorithm | 78.6% | 58.7% | 41.5% | 17.8% |
Figure 6Detection effect: (a) detection effect with original image; (b) detection effect with image extraction using flood filling algorithm [20].