| With the increasing cost of labor,automatic fruit grading has attracted much attention.The automatic grading of apples is difficult to popularize because of the difficulty of research.From the perspective of grading technology,nowadays,the difficulty of apple appearance quality grading mainly lies in size grading and defect grading.The former is affected by the change of apple shape and it is difficult to achieve an accurate correspondence between the image size and the actual diameter.The latter is affected by the variable appearance of the defects and the defects were difficult to confuse with the fruit stalk calyx.From the perspective of grading system,the current apple grading is mostly limited to mechanical grading,which has the problems of poor integration with software,few detection indicators and low grading accuracy.In response to the above problems,this article has completed the following related work after introducing the grading-related theories:Firstly,aiming at the problem of inaccurate mapping between apple image and actual diameter,a linear fitting model was designed to predict the actual diameter of apples.In this method,the minimum circumscribed circle of apple contour was calculated by using the outermost point of apple contour,and the minimum circumscribed circle diameter was taken as the maximum diameter of apple image.Then,a linear model was established between the maximum diameter of apple image and the actual measured diameter to predict the actual diameter of apples.The experimental results showed that the model could achieve 92%grading accuracy and 0.56mm average calculation error.Secondly,according to the difficulty of defect identification in apple image,a method of defect grading based on MobileNet model was designed.In this method,firstly,suspected defect areas were segmented from apple image by HSV color feature,and the area of these areas was calculated and labeled by seed filling method.Then,the expanded data was used to build a lightweight MobileNet model to classify the suspected defect areas and determined the defect degree of apples.The experiment results showed that the grading accuracy of apple defects was 95%,which is higher than both image processing method and classic machine learning method.Compared with the classical machine learning method,MobileNet model still has obvious grading advantages while it reduced the scale of convolutional neural network.Finally,an apple appearance quality grading system was designed and implemented based on the above work.In this system,the linear fitting model was used in the size calculation module,the MobileNet model was used in the defect number and area calculation module,and the red proportion of apple image in HSV color space was used in the color rate calculation module.In the end,apples were graded according to the corresponding national standards and the output data of each module.Tests showed that the system has an accuracy rate of 88.3%and has a kind classification speed.The relevant experiments showed that the grading system designed in this paper has practical application value. |