Abstract:Aiming at the problems of low efficiency and poor accuracy in the classification and recognition of blueberry fruit fly pests, a deep learning method was proposed to process and analyze the collected blueberry hyperspectral images, so as to realize the nondestructive detection of blueberry fruit fly pests. Firstly, the dimension of blueberry hyperspectral image was reduced by PCA. And the better data set PC2 and PC3 was selected. The best data set PC23 was obtained by splicing PC2 and PC3. The seven enhancement operations were performed on the images in the dataset, including 90° rotation, 180° rotation, blur, brightness adjustment, mirror image and Gaussian noise, so as to expand the capacity of each data set to 18 times of the original capacity. Then the three deep learning models of VGG16, InceptionV3 and ResNet50 were used to recognize and detect blueberry fruit fly pest images, and high recognition accuracy was achieved. Among them, ResNet50 model had the highest efficiency, and the accuracy of ResNet50 model was the highest, reaching 92.92%, and the loss rate was the lowest, only 3.08%. Therefore, ResNet50 model had the best overall recognition effect on the nondestructive detection of blueberry fruit fly pests. Finally, an improved im-ResNet50 model was constructed based on ResNet50 model from three aspects: ECA attention module, Focal Loss loss function and Mish activation function. The recognition accuracy of im-ResNet50 model was 95.69%, and the loss rate was reduced to 1.52%. The results showed that im-ResNet50 model effectively improved the pest identification ability of blueberry fruit fly. The interpretability of im-ResNet50 model was also analyzed by Grad-CAM. The research results can quickly and accurately detect the blueberry fruit fly pests, and it can provide theoretical support for the intelligent detection and online sorting of small berry quality.