Han Wei, Jiang Fei, Zhu Zhiyuan
Chongqing Key Laboratory of Nonlinear Circuits and Intelligent Information Processing, College of Electronic and Information Engineering, Southwest University, Chongqing 400715, China.
The 28th Research Institute of China Electronics Technology Group Corporation, Nanjing 210007, China.
Foods. 2022 Apr 14;11(8):1127. doi: 10.3390/foods11081127.
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.
目前,市场上樱桃的质量参差不齐,因为人们依靠感官来辨别樱桃质量,这既耗费大量时间和精力,在准确性方面也未取得良好效果。若采用化学方法提取樱桃的内部质量指标,如pH值、糖酸比和维生素C含量等,检测速度会降低。随着人工智能(AI)的发展,利用AI算法进行图像处理受到广泛关注。YOLO系列中的YOLOv5模型具有检测精度高、速度快、体积小等诸多优点,已应用于人脸识别、图像识别等领域。然而,受季节天气、环境等因素影响,训练模型所用的数据集会降低图像识别的准确性。为提高准确性,必须使用大量数据进行模型训练,但这会降低模型训练速度。由于训练时不可能使用所有数据,检测过程中难免会出现识别错误。在本研究中,通过泛洪填充算法提取数据集中的樱桃图像。将提取的樱桃图像作为新的数据集用于训练和识别,并将结果与未提取图像的结果进行比较。使用泛洪填充算法生成的数据集进行模型训练。经过20个训练轮次后,准确率达到99.6%。未使用该算法提取图像时,经过300个训练轮次后准确率仅为78.6%。