| Candy is a kind of pastry whose main components are made up of sugar.For the past few years,people’s demand for snacks continuous growing,while the development of the candy industry is also growing vigorously.The varieties of candy is becoming much more diversity.To further meet the needs of the people,more and more domestic candy producers are beginning to adopt automated production to improve the efficiency of the production capacity.However,due to the lack of loading material and cooling process,the candy produces different types of defects,including the surface hole,dimensional changes,substandard weight and so on.Previously,due to the limits of technical level,the recognition and sorting work rely mainly on the quality inspectors who use eys and hands,which includes the problems of low sorting efficiency,high labor intensity and employment costs.Therefore,finding a way to improve the efficiency of recognition and sorting of the defective candy which can help breakthrough the development difficulties and promote industrial transformation has already become the top priority of producers.The main research of this paper is based on the deep learning methods coming from the machine vision,which can accurately realize the nondestructive testing and elimination.Finally,the competitiveness and influence of candy producers will be greatly improved.The main research and test results are as followed:(1)Aiming at the candy formed by cooling and solidification in industrial production,we designed a set of image acquisition system.Firstly,the hardware structure used by the sorting system is briefly introduced,which includes the industrial camera,the planiform light source,the programmable logic controller(PLC)and the pneumatic spray valve.Secondly,the classification principle and operation process of the system are briefly introduced.Thirdly,the several commonly defective candy types produced by the cooperative company are briefly introduced.(2)Aiming at the defective candy,we proposed a candy classification algorithm based on deep learning methods.Firstly,the construction process of defective candy dataset is briefly introduced,and some releated operations of the image processing including the median filtering,the gray processing,the threshold segmentation,the connected domain processing,the adhesion segmentation and so on.Secondly,the structures of the convolutional neural networks(CNN)are intoduced which include the convolutional layer,the pooling layer,the activation function,the fully connected layer and so on.Thirdly,the several deep learning models used in this paper are introduced which include the Alex Net,the Google Net,the VGG16,the Res Net50,the Mobile Netv2,the Mnas Net and so on.Fourthly,we compared the classification results with the traditional machine learning models,including the CDNN,the Enhanced K-NN,the SVM and the Random Forest.Lastly,we used the confusion matrix to evaluate the classification performance of the experimental model and the result shows that the accuracy of the Res Net50 model has been over 97%,which can meet the actual production needs.(3)Aiming at the defective candy,we proposed a candy classification algorithm based on the object detection algorithm.Firstly,the basic structures of the YOLOv5 model used in this paper are introduced including the Backbone,the Neck and the Detect.Secondly,the error loss function of the YOLOv5 is introduced including the regression loss of Bonding Box,the loss of objection and the loss of classification.Thirdly,the classification standard and collection and labeling process of the dataset are introduced.Lastly,we presented the performance of the YLOLOv5 model’s classification and training and the result shows that the model recalling is over 95% which can also meet the actual production needs.(4)We designed a set of candy sorting system based on the classification results which can be applied to the industrial actual production.Firstly,the basic structures of the system are introduced including the composition of the hardware device and the design scheme of extended circuit module including the initial interface,the sorting interface and the parameter setting interface.Lastly,the actual production test effect of the system is demonstrated and the result shows that the rate of recalling is over 95% and the take-out rate is about 1.8%,which can meet the actual production needs. |