Abstract:Abstract: Carrot has widely been served in the human diet, due to its rich in nutrients, particularly on carotene and dietary fiber. However, the brown and black spot disease can ruin the appearance and nutritional quality of carrot during the planting. Therefore, the classification of carrot grades has become an essential part, to improve the competitiveness of carrots in the market. Specifically, the detailed grading can greatly contribute to the commercial value of carrots. Traditionally, a feature extraction with classifier mode was generally adopted to detect the carrot appearance, where the manual definition of features was required, leading to time consuming, less accuracy, and erroneous judgement. In this study, a novel network was proposed to solve the problem, based on a lightweight front-end deployment method, the knowledge distillation technique. Teacher and student models were selected, where a teacher model was introduced to guide the training of student model. The model in this network can be used to reduce the number of parameters and running time, while achieve high accuracy. 3 266 high-resolution images of carrot were collected from the sorting machine as the experimental data sets. Four grades were divided, including the normal, curved, black spot and fibrous root, according to the carrot grading standards of Ministry of Agriculture of the People's Republic of China NY/T 1983-2011. 70% of the dataset was randomly divided into the training sets, whereas, the remaining 30% into test sets. The dataset of carrot was first imported into the network model for training. A teacher model was then introduced, when training to induce a student model, where the teacher model was a large-scale and complex network with many participants, whereas, the student model was a small-scale and streamlined network with a small number of parameters. By inducing training, small models can finally achieve high accuracy. Three teacher models were used, including Resnet34, Resnet50, and Resnet101, in order to guide the training of student model of Resnet18. Correspondingly, the average accuracy of distillation model increased from 94.3% to 94.8%, 95.2%, and 95.8%, respectively. The recognition rate of normal carrot was improved to 100%, where the Resnet18 student model was guided by the Resnet101 teacher model. The recognition rate of normal, black spot and fibrous root increased by about 2%, while, the training time of the model was 11.3 h. In addition, the recognition accuracies of Resnet50 and Resnet101 teacher model were 96.3% and 96.9% respectively, whereas, the training time of models can be 19.3 h and 31.3 h, respectively. The experimental results showed that the recognition rate of distillation model was much higher than that of the traditional model based on feature extraction with classifier. The recognition rate of model can further improved as the increase in the depth of teacher model. Knowledge distillation can perform well from the perspective of training time and arrangement in the model. The training time and deployment of model can be greatly shortened with a tradeoff of accuracy. Consequently, the knowledge distillation model can be used to provide a promising significant support to improve the performance of automatic detection device for the appearance quality of carrots.