| China produces a huge amount of rice every year.With the rapid development of computer science and technology over time,the common applications of machine learning and artificial intelligence in various aspects of rice inspection have become increasingly widespread.Compared with traditional and artificial non-destructive testing techniques,machine learning has objective standards and scientific nature,which is an inevitable trend in the development of automatic classification.This article describes the current research status of machine vision detection technology and equipment at home and abroad,focusing on the relevant theories and algorithms involved in rice appearance quality detection based on convolutional neural networks.This paper studies the detection of rice appearance quality using convolutional neural networks.The research contents are as follows:(1)Build a rice image test platform,and study the parameter selection and principle of each component of the test platform,including vibration feeder,conveyor belt,speed controller,camera,lighting system,etc.The Xinghua similar rice in Jiangsu was classified and explained,and the rice was divided into normal rice with good appearance quality,white opaque and defective chalky rice and broken rice.At the same time,the rice image was taken by the rice online device to complete the construction of the rice data set.(2)Different convolutional neural networks are used to recognize the rice images obtained.From the traditional ResNet classification network to the target detection network.Aiming at the traditional ResNet classification network,after a series of preprocessing operations on the acquired images,the segmentation of cohesive rice grains is completed,and the single rice image is obtained.After training,the recognition accuracy is 80%.Later,rice was recognized by Center Net without aiming frame,Faster R-CNN in the second stage and YOLOv5 in the first stage of the target detection network,and the mean average precision of recognition was 82.2%,55.6% and 92.2% respectively.ResNet has an accuracy rate of 85% for rice recognition,while YOLOv5 has an mean average precision rate of 89.2% for rice recognition.Through identification comparison between networks,YOLOv5 network with high recognition rate and fast recognition speed is selected.At the same time,when the appearance quality of rice is detected online,the phenomenon of rice missing inspection may occur,and thus the quality of rice cannot be graded.Therefore,in order to better meet the quality inspection requirements of rice,YOLOv5 network is improved.(3)The YOLOv5 network is improved to meet the requirements of rice small target recognition,prevent missing detection and ensure real-time identification.In order to improve the accuracy of rice recognition,a small target detection scale is added to the original three detection scales,and a feature map of 160×160 is used to detect small targets.Adding a detection scale will increase the number of parameters,which is difficult to deploy to embedded devices for real-time detection.In this paper,Ghost module is used to replace CSPDarknet-53 for feature extraction,which makes the network lightweight.At the same time,normal rice and chalky rice can be distinguished by color.CBAM module is used to enhance the extraction of color features.The improved network recognition accuracy is 96.5%,4.3 percentage points higher than YOLOv5,which can complete the appearance quality detection of rice.(4)Through the construction and debugging of the rice online detection device,the camera parameters are set.In order to make rice online detection more effective,set the speed of the conveyor belt and the vibrating feeder.After testing,the average accuracy rate of rice recognition is 88.4% when the light is dark,and 90.6% when the light is strong.This study provides a new non-destructive and fast sorting method and device development idea for rice appearance quality detection.The research results have a promoting effect on the application of rice appearance quality detection technology,and provide important theoretical basis and practical reference for improving the detection level of rice appearance quality in China. |