| There are many kinds of plant diseases.Accurate identification of plant diseases is of great significance for timely protection and control of plants.In recent years,with the continuous progress of artificial intelligence technology,various advanced AI technologies have emerged in an endless stream.Deep learning,as one of the hottest ones,has also made great progress.Convolutional neural network has become one of the main means to solve image processing and analysis tasks.It also has high application value in plant disease recognition.However,most of the current convolutional neural network models have many parameters,and it is difficult to deploy and apply on edge devices such as smart phones and embedded sensor nodes with limited computing resources and storage space.In order to solve these problems,this paper proposes a lightweight plant disease recognition model based on knowledge distillation and channel pruning,and transplants it to Android and deploys it.The specific research work is as follows:Firstly,the network structure of Res Net model is adjusted according to the demand.By introducing one or more teaching assistant networks in knowledge distillation,the training effect of the model is better.After sparse training of the final teaching assistant network model,the lightweight student network model is obtained by channel pruning,and the student network model is fine-tuned to restore the model performance.The experimental results show that on the data set of 38 categories of 14 plants,after pruning the model by 50%,the accuracy of the model is 95.76%,which is 4.22% higher than the original model.On the data set of five categories of apple leaves,after pruning the model by 70%,the accuracy of the model was88.97%,which was 1.88% higher than the original model.Secondly,aiming at the problem that the recovery accuracy of the retraining model is not as good as expected after removing part of the network in channel pruning,this paper uses the idea of knowledge distillation and learning rate inversion instead of fine-tuning for retraining.The student network is guided by the teaching assistant network,and the retraining is combined with the learning rate inversion to make the model performance better.The experimental results show that on the data set of 38 categories of 14 plants,after pruning the model by 90 %,the accuracy of the model is 97.78 %,which is 1.49 % higher than the original model.On the data set of five categories of apple leaves,after pruning the model by 70 %,the accuracy of the model was 91.94 %,which was 4.85 % higher than the original model.Finally,this paper converts the obtained lightweight model to a model that can be deployed on the Android side and develops the Android application.The experimental results show that on the data set of 38 categories of 14 plants,the accuracy of the tflite model converted by this method is as high as 99.03%,which is 1.25% higher than that before conversion,and the model size is reduced by more than half.On the data set of five categories of apple leaves,the accuracy of the tflite model converted by this method is as high as 95.25%,which is 3.31% higher than that before conversion,and the model size is also reduced by more than half.In summary,this paper optimizes the two aspects of reducing the model size and restoring the model accuracy,and effectively guarantees the performance of the model while reducing the model size.The converted model is successfully deployed in the Android terminal,which provides a new solution for edge devices such as smart phones and embedded sensor nodes to accurately identify plant diseases. |