| China has more than 2,000 years of apple cultivation history,the output of apples accounts for more than 40% of the world’s total output.At present,apple grading is primarily done manually,relying on the human vision to distinguish features such as the color,shape,size and defects in apples.This manual sorting is subjective,non-repeatable,and slow.This together with other human factors such as physical fatigue of this labor intensive practice makes the grading accuracy rather poor.It follows that automated,high speed,and efficient apple grading technology is favored by fruit farmers.Clearly,such automated sorting technology can overcome the problem of the traditional,manual grading of apples.The automated sorting technology can maintain continuity,repeatability,accuracy,and uniformity in apple grading.In view of the practicality of automated sorting technologies,more and more practical engineering projects are devoted to building an intelligent,reliable,fast,and efficient apple grading system.The hardware system of this subject is mainly based on STM32 microprocessor for control,CCD industrial camera for image acquisition,gas compressor,nozzle,solenoid valve as apple classification execution device and encoder to detect the speed of the conveyor belt.The CCD industrial camera collects apple photos,and performs operations such as cropping,data enhancement and normalization preprocessing on the collected original apple images to obtain an apple data set.The preprocessed data set is extracted by traditional methods to analyze the characteristics of apples.It is found that the fusion feature has a higher accuracy rate than the single feature.In the single feature,the color feature has a greater impact on the accuracy of apple grading.A single feature often reflects only part of the feature information of an apple and the classification accuracy is not high.In view of the above experience,then introduced the algorithm principles of convolutional neural network(CNN)and support vector machine(SVM),and proposed using CNN to extract the apple’s features,and send the feature information to the classifier SVM.This CNN+SVM(CNN_SVM)model combination is used in this experiment.Programs are written in python language,and Keras deep learning library is used to build 6-layer CNN feature extraction layer,including convolution layer,batch normalization layer,Max Pooling layer,and fully connected layer.Finally,the features extracted from the fully connected layer are input into the SVM classifier to classify apples.The apple grading method in this paper is to extract the color,texture,shape,roundness and other characteristics of apples in an automatic sorting device using convolutional neural networks.In the machine learning algorithm,this article uses 4different methods: k-nearest neighbor(KNN),SVM,CNN,CNN_SVM to classify Yantai apple.When apple is grading,the fusion model using CNN and SVM classifiers is much more accurate than the simple KNN,SVM and CNN models,which improves the learning ability and generalization ability of the model.In this paper,an automatic grading machine learning model CNN_SVM is developed,and the experiment is verified in the environment of conveyor belt.The results show that the CNN_SVM model is used to grade apples quickly and accurately,reducing the labor cost of manual grading,and has important commercial prospects. |