| Chinese sericulture industry enjoys a long history of more than 5,000 years,which had been an important pillar of Chinese economy and had occupied a vital position in the world.Since the 21st century,in order to promote the development of sericulture and silk industry,the government has guided sericulture industry for improvement of mechanization and intellectualization,resulting in enhancement of product quality and technological competitiveness.Paper cocoon mountage is widely used in China’s sericulture industry,so it is the key to improve filature quality and yield that cocoons are selectively and automatically picked from cocoon mountage.In this paper,Machine Vision and Convolutional Neural Network(CNN)were used for segmentation,location and classification of cocoons in mountage,which provided theoretical basis and technical support for the harvest and screening of cocoons.The main research works were shown as follows:(1)Study segmentation and location algorithm for mountage cocoons based on Fuzzy C-means(FCM).Mountage cocoon images were processed to segment cocoon images from complex background by using FCM,threshold segmentation,morphological processing and area threshold.At the same time,the adverse impact of frison on segmentation of mountage cocoons was overcomed.A visual measurement and location algorithm for mountage cocoon was proposed.Throuhg camera calibration and multi-point mean method,the picking machine could obtain precise position coordinates of cocoons centroid.Cocoon segmentation and positioning experiments were carried out by using automatic picking machine.The results showed that average recognition rate of cocoons was 96.88%,and maximum positioning error of cocoons position coordinate was 4 mm.Experiments results proved that the proposed algorithm satisfied precision requirement of picking machine for cocoon positioning and harvesting.(2)Characteristic analysis of cocoon image and algorithm for detecting macular cocoons based on HSV model were studied.The conversion rule of RGB color space to HSV color space was clarified.The differences of H component distribution between waste cocoon and reelable cocoon in the HSV color histogram were analyzed.Except macular cocoon,thin skin cocoon,shriveled cocoon,double palace cocoon,mouth cocoon,oil cocoon and mildew cocoon could not be effectively distinguished from reelable cocoon only according to color proportion in HSV space.Therefore,classification algorithm needs to extract diversity features,such as color proportion,color distribution,area threshold and edge characteristics of cocoons to effectively classify reelable cocoon and waste ones.As for marcular cocoon,the sum of pixel proportion of Hm-S2 component in H3,H4 and H5 was compared with the threshold value of the yellow spotted color for determining whether it is a marcular cocoon.The detection rate of marcular cocoon was 80.7%according to experiment data.(3)A CNN cocoon classification model based on transfer learning and visualization of shallow activation features was constructed.CNN could not only extract color feature and edge feature of different kinds of cocoons effectively through multi-layer convolution operation,but also obtain subtle differences of images.Therefore,it could realize the effective classification of reelable cocoon and other waste cocoons.AlexNet and VGG-19 were trained with transfer learning method by using cocoon sample set.Layer-by-layer reverse propagation algorithm,random gradient descent algorithm and L2 regularization were used during the training process.According to training results,the TPRs of reeble cocoon for AlexNet and VGG-19 were 98.3%,the recognition rate of VGG-19 for waste cocoon was 81.5%higher than that of AlexNetw with 69.1%;the MCC coefficients of AlexNet and VGG-19 were81.2%and 73.0%respectively.Furthermore,visual analysis of shallow convolution core activation features shown that many convolution cores in AlexNet shallow convolution layer were not activated.Meanwhile,all convolution cores in shallow convolution layers of VGG-19 were activated with image features to varying degrees,and its activated color and edge features shown more powerful expression.Visualization results shown that color and edge features extracted by convolution kernel with small size and small step length were more abundant,so VGG-19 was more suitable for cocoon classification than AlexNet.(4)According to the characteristics of cocoon image,classification performance of the CNN model was improved by using data enhancement and hyper-parameter optimization algorithm.Through analyzing test results of different cocoons images and different data enhancement methods,suitable data enhancement method was selected for reelable cocoon and each other waste cocoon.These methods could expand sample size and alleviate class imbalance.After data enhancement,there were 8421 samples of reelable cocoons and 2152samples of waste cocoons,and the ratio of majority to minority was reduced to 3.91:1.Three hyperparameters,i.e.the initial learning rateη,the momentum parameter v in the SGD algorithm and the L2 regularization coefficientα,were optimized.According to Bayesian principle,the error of validation set was chosen as the target function,Gaussian process distribution was adopted as the prior distribution of objective function,and EI function was adopted as the acquisition function.Updating the prior distribution with samples information iteratively,posterior distribution of objective function was obtained.And posterior distribution could help us find the optimal values of three hyperparameters.In order to avoid over-exploitation in the local minimum area of objective function,EI acquisition function was optimized with a criteria of standard deviation.Using data enhancement and Bayesian hyperparameter optimization algorithm for VGG-19 model training,the overall classification accuracy of verification set was 97.1%,the detection rate(TNR)for waste cocoon was 96.1%,and the classification accuracy rate(TPR)for reelable cocoon was 99.8%.In generalization test,the detection rate(TNR)for waste cocoon was 98%,and the classification accuracy(TPR)for reelable cocoon was 92.3%.Compared the model with original taining data set and the model with sub-optimal hyperparameters,training indicators of the optimized model were all improved.Therefore,data enhancement method and hyperparameter optimization algorithm used in this paper effectively improved the accuracy and generalization of CNN model for mountage cocoon classification. |