| With the continuous improvement of the national economic level,the people’s requirements for food quality are also getting higher and higher.Rice is one of the important food crops for our people.Scientific sorting is an important way to improve the quality of rice.However,at present,domestic color sorters still have room for further improvement in the distinction of subtle colors and shapes.Therefore,this paper studies the rice color sorting algorithm based on machine learning,in order to enable the color sorter to obtain better image recognition results.In this paper,a rice image acquisition platform is firstly built,and the self-built rice image dataset is preprocessed,including image grayscale,noise reduction,threshold background segmentation and contour extraction.Through the comparison and analysis of simulation,the preprocessing algorithm suitable for this topic is selected,and the unqualified images are eliminated.Then a machine learning algorithm based on BP neural network was constructed,extracting a total of 12 rice color and shape feature parameters.The quality grading of polished rice,black rice,broken rice,chalky rice,and yellow rice was achieved,with an average recognition accuracy of 90.77%.Further,an in-depth learning rice grading algorithm based on Inception-v3 was constructed,and the self built dataset was expanded by using image enhancement algorithm.After the Image Net dataset was pre trained,the network pruning optimization model was completed by using parameter transfer learning and L1 and L2 norms,and the comprehensive recognition accuracy of rice species was kept above 95% under the appropriate parameter adjustment strategy.Finally,using Qt to achieve visual design of the detection system,the best trained model is loaded,and after internal packaging,rice image detection can be achieved.The detection interface is simple and clear,and the recognition process is fast and accurate.This project has completed the research and design implementation of a rice color sorting algorithm based on machine learning,and improved the convolutional network model.The effectiveness of image feature extraction and the feasibility of the algorithm model have been verified through experiments,and the universality of different datasets has also been verified.The experimental results indicate that the two convolutional neural networks constructed in this project have achieved the expected goals of rice color selection,and can provide practical significance for improving color sorting indicators. |