Abstract:Few shot crop disease and pest identification is of great significance for the intelligent and sustainable development of agriculture. This article proposes a small sample crop disease and pest identification method based on an improved deep nearest neighbor neural network(MDN4).In feature extraction stage,a multi-scale fusion structure is adopted to extract image details and semantic features,a convolutional block attention module(CBAM) is introduced to extract category-related attention maps.A dynamic weighted k-nearest neighbor method(KNN) is proposed to measure the category of query samples in order to improve the matching accuracy.In classification stage, by introducing central loss to increase intra-class compactness,aggregating similar samples and separating dissimilar samples, the accuracy of crop pest and disease identification can be improved. The improved model MDN4 achieved recognition accuracies of 69.06% and 82.81% in the 5-way 1-shot and 5-way 5-shot scenarios, respectively. Compared with the DN4 method, it increased by 8.97% and 5.28%, respectively. Improved the efficiency of pest control and reduced identification costs.