Zhang Siyu, Zhang Qiuju, Li Ke. Detection of peanut kernel quality based on machine vision and adaptive convolution neural network[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2020, 36(4): 269-277. DOI: 10.11975/j.issn.1002-6819.2020.04.032
    Citation: Zhang Siyu, Zhang Qiuju, Li Ke. Detection of peanut kernel quality based on machine vision and adaptive convolution neural network[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2020, 36(4): 269-277. DOI: 10.11975/j.issn.1002-6819.2020.04.032

    Detection of peanut kernel quality based on machine vision and adaptive convolution neural network

    • Abstract: Aiming at the shortcomings of the traditional image recognition, including low accuracy and relying on experienced staff, a peanut kernel quality detection method based on machine vision and adaptive convolutional neural network (DAL-ACNN) is proposed in this paper. An image acquisition system was built to obtain the color images of peanuts which included normal peanuts, broken peanuts, shriveled peanuts and mildew peanuts, and a black background was selected in the system. Then, a convolutional neural network (CNN) based on Alexnet was selected to automatically extract and detect the peanut defects. To improve the accuracy and generalization of detection, it is necessary to optimize the existed network. Firstly, the key of the stochastic gradient descent is the choice of the learning rate, which directly influences the convergence speed and testing accuracy of the network. In this paper, an adaptive learning rate based on the changes in the loss and the weight was proposed, respectively. A larger learning rate was obtained to accelerate convergence in the initial training stage, and a smaller learning rate produced due to a higher accuracy in the later of network, which can avoid the oscillation. In the process of parameters update, a quadratic function was introduced to the loss to combine with the adaptive learning rate based on loss change for parameters update, and a normal distribution model was introduced to combine with the adaptive learning rate based on weight change to further update parameters. Secondly, to improve the generalization performance of the model, the domain adaption learning (DAL) for transfer learning was joined to the network. A domain classifier was introduced behind the feature layer, which can measure the difference of feature distribution between domains by the domain classification loss, and minimize difference of feature distribution by the marginal distribution adaption loss. A conditional distribution adaptation was introduced behind the Softmax layer, which can measure and adjust the category distribution difference by the conditional distribution adaption loss. These losses for domain adaption learning were optimized by backpropagation, which can locally and globally adjust the distribution to minimize the difference between domains, then the source domain information was migrated to the target domain, so the network trained on source data can also perform well on target data. The loss of marginal distribution adaption and conditional distribution adaption were combined with the classification loss to form the loss of the proposed model. The loss of conditional distribution adaption and classification were used to update the parameters by the adaptive learning rate based on loss change, and the marginal distribution adaption loss was used to further update the feature parameters by the adaptive learning rate based on weight change. The additional domain classifier parameter was updated by the adaptive learning rate based on domain classification loss variation. Finally, to verify the proposed method, the background above was seen as source domain, and a white background was selected as target domain. The parameters trained on source domain were used to initialize the proposed model, the source data and target data were taken as input to train the model. The result showed that the average accuracy for peanut detection in the target domain was 99.7%. And a higher convergence and accuracy generated by comparing with the traditional CNN at different learning rates and training sample sizes. To further prove the performance of the proposed approach, it was compared with the classic VGGNet、GoogLeNet、ResNet and DenseNet, which produced a satisfactory result.
    • loading

    Catalog

      /

      DownLoad:  Full-Size Img  PowerPoint
      Return
      Return