The invention relates to the field of
agriculture, in particular to a
crop disease and pest recognition method and
system, and the method comprises the steps: obtaining an image of a
crop, carrying out the preprocessing of the image, extracting features, obtaining a multi-scale feature map, and enabling the multi-scale feature map to serve as the input of an
encoder; determining the position of a reference point in each feature graph input by each layer of the
encoder, for each deformable attention head, inputting the feature of the reference point into a
linear layer to obtain the offset of a sampling point, taking the sampling point and the reference point as the nodes of the graph, determining the weight of an
edge based on the offset of the sampling point and the reference point, carrying out one-time graph
convolution on the graph, and carrying out one-time graph
convolution; obtaining a reference point feature corresponding to the deformable attention head based on a result of the graph
convolution; and inputting the characteristic pattern output by the
encoder into a decoder, and obtaining a
crop disease and
insect pest identification result by using a query vector of the decoder.