Crop insect pest recognition method and system, electronic equipment and storage medium

By constructing a crop pest identification model, utilizing a backbone network, a multidimensional information reasoning module, a graph feature pyramid module, and a graph attention module, the problem of low identification accuracy of existing models in complex field environments is solved, achieving efficient and accurate pest identification.

CN121708346APending Publication Date: 2026-03-20JILIN AGRI SCI & TECH COLLEGE
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511618082.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-06
Publication Date
2026-03-20

AI Technical Summary

Technical Problem

Existing deep learning-based crop pest identification models have low accuracy in complex field environments and fail to meet the precise identification requirements in practical applications, especially in multi-camera monitoring scenarios, where they are difficult to adapt to the characteristics of rice crops.

Method used

A crop pest identification model is constructed, including a backbone network, a multidimensional information reasoning module, a graph feature pyramid module, and a graph attention module. By extracting multi-scale features, representing local features, enhancing graph features, and performing attention processing, the model's pest identification performance in complex environments is improved.

Benefits of technology

It improves the accuracy and robustness of pest identification, can adapt to the changing perspectives of multi-camera joint monitoring, and achieves efficient and accurate pest identification in complex field environments, providing reliable technical support for rice pest control.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121708346A_ABST
    Figure CN121708346A_ABST
Patent Text Reader

Abstract

The invention discloses a crop insect pest recognition method and system, electronic equipment and a storage medium, and relates to the technical field of crop insect pest recognition, and the method comprises the steps: constructing a crop insect pest recognition model; training the crop pest recognition model to obtain a trained crop pest recognition model; and performing pest recognition on a to-be-recognized crop image shot by a camera by using the trained crop pest recognition model, and outputting a pest detection result of the to-be-recognized crop image. According to the method, a backbone network extracts multi-scale features; the multi-dimensional information reasoning module enhances insect pest detail capture and reduces background interference; the graph feature pyramid module realizes multi-scale feature interaction and improves the detection performance; the image attention module highlights insect pest characteristics and inhibits noise; the head is detected to ensure accurate positioning and classification. The trained model adapts to a multi-camera visual angle, and accurate insect pest recognition is realized in a complex environment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of crop pest identification, and particularly to a crop pest identification method, system, electronic device, and storage medium. Background Art

[0002] Pest infestation is one of the main factors leading to reduced rice yield and deteriorated quality. Its occurrence not only directly damages key tissues such as leaves and stems, but also triggers secondary diseases, thus posing a serious threat to the entire growth cycle of rice. In the field environment with large-scale planting, pest infestations often have characteristics such as fast transmission speed and wide damage range. Once the prevention and control are not timely, it may cause a significant reduction in yield or even crop failure. Therefore, how to achieve timely detection and accurate identification of rice pests has become a key issue in ensuring the healthy growth and stable high yield of rice. Effective pest monitoring and identification not only help to guide scientific prevention and control, reduce the overuse of pesticides, but also improve product quality while increasing grain yield, which is of great significance for realizing green agriculture and sustainable development.

[0003] With the rapid development of artificial intelligence technology, agriculture is accelerating its transformation towards wisdom and precision. Multi-camera collaborative monitoring has become an important means of crop pest monitoring due to its remote high efficiency and large-scale coverage ability. Combining with object detection methods based on deep learning can automate the detection and identification of pests in farmland, so as to achieve real-time and accurate grasp of the occurrence of pests. Currently, the crop pest identification methods based on deep learning can be mainly divided into two categories: one is the two-stage detection model represented by Fast R-CNN, whose core idea is to first generate candidate regions and then classify and perform bounding box regression on the candidate regions; the other is the one-stage detection model represented by SSD, which directly performs regression and classification on feature maps of different scales to achieve end-to-end fast detection. Around these frameworks, researchers have proposed various improvement strategies, including optimizing the loss function to enhance the sensitivity to small-scale pest targets, constructing a more targeted feature extraction network to enhance the expression ability of pest features, or introducing an attention mechanism to alleviate noise interference in complex environments.

[0004] Although the existing crop pest identification models based on deep learning have certain performance improvements, these methods have problems such as not adapting to the perspectives of multi-camera collaborative monitoring and not being specifically optimized for the characteristics of rice crops. When directly applied to the camera monitoring scenario, due to factors such as complex background information in the field environment, large changes in the scale of pest targets, and fuzzy detailed features of pests, the model identification accuracy will decrease, making it difficult to meet the requirements of accurate pest identification in practical applications.

[0005] To overcome the shortcomings of existing technologies, it is necessary to design a deep learning model specifically for rice pest identification tasks from a camera perspective. By improving the network structure and feature processing methods, the performance of pest identification in complex field environments can be enhanced. Summary of the Invention

[0006] The technical problem to be solved by this invention is to address the shortcomings of existing technologies, and specifically provides a method, system, electronic device, and storage medium for identifying crop pests, as detailed below: 1) In a first aspect, the present invention provides a method for identifying crop pests, the specific technical solution of which is as follows: A crop pest identification model is constructed, comprising a backbone network, a multi-dimensional information reasoning module, a graph feature pyramid module, a graph attention module, and a detection head; the backbone network is used to extract multi-scale features from sample crop images; the multi-dimensional information reasoning module is used to perform local feature representation on the multi-scale features, construct feature sub-graphs, and perform feature information reasoning on the feature sub-graphs, outputting the reasoned features; the graph feature pyramid module is used to perform graph feature enhancement operations on the reasoned features, outputting the enhanced features; the graph attention module is used to perform graph convolution processing on the enhanced features, outputting the attention-enhanced features; the detection head is used to generate pest detection results corresponding to the sample crop images based on the attention-enhanced features; the crop pest identification model is trained to obtain a trained crop pest identification model; the trained crop pest identification model is used to identify pests in crop images captured by a camera, outputting the pest detection results of the crop images to be identified.

[0007] The beneficial effects of the crop pest identification method provided by this invention are as follows: The backbone network extracts multi-scale features from sample crop images, providing rich multi-level feature representations for subsequent processing. The multi-dimensional information inference module enhances the model's ability to capture detailed pest features and reduces interference from complex background information by performing local feature representation, constructing feature subgraphs, and inferring feature information from multi-scale features. The graph feature pyramid module achieves adaptive interaction of multi-scale features by performing graph feature enhancement operations on the inferred features, improving the model's detection performance for pest targets at different scales. The graph attention module further highlights pest target features, suppresses background noise, and improves identification accuracy by performing graph convolution processing on the enhanced features. The detection head generates pest detection results based on the attention-enhanced features, ensuring accurate location of pests and correct classification of pest categories. After training, the model can adapt to the changing perspectives of multi-camera joint monitoring, achieving efficient and accurate pest identification in complex field environments, providing reliable technical support for rice pest control.

[0008] 2) In a second aspect, the present invention also provides a crop pest identification system, the specific technical solution of which includes a model building module, a model training module, and a model application module; the model building module is used to: construct a crop pest identification model, the crop pest identification model including a backbone network, a multi-dimensional information reasoning module, a graph feature pyramid module, a graph attention module, and a detection head; the backbone network is used to: extract multi-scale features from sample crop images; the multi-dimensional information reasoning module is used to: perform local feature representation on the multi-scale features, construct feature sub-graphs, and perform feature information reasoning on the feature sub-graphs, outputting the reasoned features; the graph feature pyramid... The module is used to: perform graph feature enhancement on the inferred features and output the enhanced features; the graph attention module is used to: perform graph convolution on the enhanced features and output the attention-enhanced features; the detection head is used to: generate pest detection results corresponding to sample crop images based on the attention-enhanced features; the model training module is used to: train the crop pest recognition model and obtain the trained crop pest recognition model; the model application module is used to: use the trained crop pest recognition model to perform pest recognition on the crop images to be identified captured by the camera and output the pest detection results of the crop images to be identified.

[0009] 3) In a third aspect, the present invention also provides an electronic device, the electronic device including a processor coupled to a memory, the memory storing at least one computer program, the at least one computer program being loaded and executed by the processor, so as to enable the electronic device to implement any of the above-mentioned methods for identifying crop pests.

[0010] 4) In a fourth aspect, the present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements any of the above-described methods for identifying crop pests.

[0011] It should be noted that the beneficial effects of the technical solutions of the second to fourth aspects of the present invention and their corresponding possible implementations can be found in the above description of the technical effects of the first aspect and its corresponding possible implementations, and will not be repeated here. Attached Figure Description

[0012] Figure 1 This is a flowchart illustrating a method for identifying crop pests according to an embodiment of the present invention. Figure 2 A schematic diagram of the structure of a crop pest identification model; Figure 3 This is a structural diagram of the multidimensional information reasoning module; Figure 4 A schematic diagram of the subgraph construction; Figure 5 A schematic diagram of the spatially weighted structure; Figure 6 A schematic diagram of the channel weighting structure; Figure 7 This is a schematic diagram of the structure of the graph feature pyramid module; Figure 8 This is a schematic diagram of the attention module structure; Figure 9 This is a schematic diagram illustrating the distribution of the dataset; Figure 10 These are the experimental results; Figure 11 A schematic diagram for visualizing features; Figure 12 This is a flowchart illustrating a crop pest identification system according to an embodiment of the present invention. Detailed Implementation

[0013] like Figure 1 As shown, an embodiment of the present invention provides a method for identifying crop pests, comprising the following steps: S1. Construct a crop pest identification model. The crop pest identification model includes a backbone network, a multi-dimensional information reasoning module, a graph feature pyramid module, a graph attention module, and a detection head. Specifically: 1) The backbone network is used to extract multi-scale features from sample crop images. The backbone network adopts a convolutional neural network architecture, consisting of multiple sequentially connected convolutional modules. Each convolutional module contains a convolutional layer, a batch normalization layer, and a LeakyReLU activation function. The network structure achieves hierarchical feature extraction by progressively increasing the number of convolutional kernels and decreasing the feature map size. Specifically, the backbone network includes an initial convolutional layer, multiple downsampling stages, and a feature output layer. The initial convolutional layer uses a large convolutional kernel and stride to quickly reduce the input image resolution; the downsampling stages progressively reduce the feature map size through convolutional operations with a stride of two, while simultaneously doubling the number of channels to capture diverse features from low-level details to high-level semantics; the feature output layer extracts multi-scale feature maps from different downsampling stages. These feature maps have different spatial resolutions and channel depths, providing rich feature representations for subsequent modules. The specific implementation process for extracting multi-scale features is as follows: The input sample crop image has dimensions H (height), W (width), and C (number of channels), typically set to 640 pixels × 640 pixels × 3 channels (i.e., RGB image). The image is first processed by an initial convolutional layer with a kernel size K of 7×7, a stride S of 2, and padding P of 3. The output feature map has dimensions H / 2×W / 2×D, where D is the initial number of channels (e.g., 64). The convolution operation can be represented as: ,in, This represents the input sample crop image. This represents the weight parameters of the initial convolutional layer. This represents the convolution operation. This represents the initial output feature map. The initial feature map is then subjected to a non-linear transformation through a batch normalization layer and the LeakyReLU activation function. Batch normalization standardizes the feature map to accelerate training, while the LeakyReLU activation function introduces a non-linear relationship to enhance feature representation. This process can be represented as: , ,in, This represents the feature map after batch normalization. This represents the activated feature map. The feature map then enters multiple downsampling stages. Each downsampling stage consists of multiple convolutional modules, each including a convolutional layer, a batch normalization layer, and a LeakyReLU activation function. The downsampling stages use convolutional operations with a stride of two to reduce the feature map resolution while increasing the number of channels. For example, the first downsampling stage transforms the input feature map size from H / 2×W / 2×D to H / 4×W / 4×2D, the second downsampling stage further transforms it to H / 8×W / 8×4D, and so on. The convolutional operation in each downsampling stage can be represented as: ,in, This represents the output feature map of the i-th downsampling stage. This represents the convolution operation in the i-th downsampling stage, including the convolutional layer, batch normalization layer, and LeakyReLU activation function. This represents the activation output feature map of the previous stage. In the feature output layer, the backbone network extracts multi-scale feature maps from different downsampling stages. For example, a high-resolution feature map (size H / 8×W / 8×C1) is output from the early downsampling stage, a medium-resolution feature map (size H / 16×W / 16×C2) is output from the mid-stage, and a low-resolution feature map (size H / 32×W / 32×C3) is output from the late stage, where C1, C2, and C3 are the number of channels in the corresponding stages. These multi-scale feature maps capture low-level edge texture information, mid-level structural information, and high-level abstract semantic information, respectively, and together constitute the multi-scale feature output. The entire extraction process can be summarized as follows: ,in, Represents a multi-scale feature set. Represents high-resolution feature maps, Represents a medium-resolution feature map. This represents a low-resolution feature map. The entire process ensures the hierarchy and diversity of feature extraction, supporting the model's robust identification of pest targets in complex environments.

[0014] 2) The multi-dimensional information reasoning module is used to: represent multi-scale features locally, construct feature subgraphs, reason about feature information from the feature subgraphs, and output the reasoned features. Specifically: Multi-scale features are divided into channel-dimensional features and spatial-dimensional features. The channel-dimensional features are averaged along the channel to obtain the channel mean vector, and the spatial-dimensional features are averaged along the space to obtain the spatial mean matrix. The channel mean vector and the spatial mean matrix are reshaped to a uniform shape, and a similarity adjacency matrix is ​​calculated using the inner product. Based on the similarity adjacency matrix, a connection relationship is established between the channel feature regions and the spatial feature regions. The channel feature regions and the spatial feature regions are then concatenated according to this connection relationship to obtain a set of subgraphs. The channel feature regions are obtained by dividing the feature maps in the multi-scale features along the channel dimension, and the spatial feature regions are obtained by dividing the feature maps in the multi-scale features along the spatial dimension. The subgraph set is used for feature information inference to obtain the inferred features.

[0015] The multi-dimensional information inference module comprises three sequentially connected components: a local feature representation component, a subgraph construction component, and a feature information inference component. The local feature representation component decomposes the input multi-scale features into channel-dimensional and spatial-dimensional features and calculates their mean representations. The subgraph construction component uses these mean representations to generate a similarity adjacency matrix and establishes connections between channel feature regions and spatial feature regions based on this matrix, forming a subgraph set through concatenation. The feature information inference component uses the subgraph set for feature aggregation and inference, including normalization of the adjacency matrix and spatial and channel-weighted inference, ultimately outputting the inferred features. The entire network structure employs graph convolution principles to achieve cross-dimensional feature interaction, enhancing the model's ability to capture long-distance dependencies in pests. The specific process for obtaining the inferred features is as follows: Multi-scale features originate from the backbone network and are represented as a set of feature maps, each with height H, width W, and number of channels C. The module first processes the local feature representations, dividing the multi-scale features into channel-dimensional features and spatial-dimensional features. Channel-dimensional features refer to the representation of the feature map along the channel direction, while spatial-dimensional features refer to the representation of the feature map along the spatial direction.

[0016] The channel mean vector is obtained by averaging the features along the channel dimension. Specifically, each feature map is divided into N non-overlapping feature regions in the spatial dimension, each region having a size of H'×W', where H' equals H divided by the square root of N, and W' equals W divided by the square root of N, ensuring coverage of the entire feature map. For each feature region, the average value is calculated along the channel dimension to generate the channel mean vector. The calculation process is expressed by the formula: ,in, This represents the element of the channel mean vector of the i-th feature region. H' represents the value of the feature map at spatial location (h, w) and channel i, where H' represents the height of the feature region, W' represents the width of the feature region, i ranges from 1 to N, and N represents the total number of feature regions.

[0017] The spatial mean matrix is ​​obtained by averaging the features along the entire spatial dimension. For each channel, the average value is calculated across the entire spatial dimension to generate the spatial mean matrix. The calculation process is expressed by the formula: , This represents an element of the spatial mean matrix for the j-th channel. Let H represent the value of the feature map at spatial location (h, w) and channel j, where H represents the original height of the feature map, W represents the original width of the feature map, j ranges from 1 to C, and C represents the total number of channels. Then, the channel mean vector and the spatial mean matrix are reshaped to a uniform shape. Specifically, the channel mean vector... Originally, the spatial mean matrix had a dimension of N×1. Originally 1×C, the channel mean vector is transformed into an N×1 matrix, and the spatial mean matrix is ​​transformed into a 1×C matrix through a reshaping operation, ensuring that matrix operations can be performed between them. A similarity adjacency matrix is ​​calculated by performing an inner product operation on the reshaped channel mean vector and the spatial mean matrix. This matrix represents the correlation strength between channel feature regions and spatial feature regions. The calculation process is expressed by the following formula: ,in, This represents a similarity adjacency matrix with dimensions N×C. This represents the reshaped channel mean vector. This represents the transpose of the reshaped spatial mean matrix.

[0018] Based on a similarity adjacency matrix, a connection relationship is established between channel feature regions and spatial feature regions. Specifically, channel feature regions are feature regions obtained by partitioning the feature maps in multi-scale features along the channel dimension, with each channel feature region corresponding to a channel index. Spatial feature regions are feature regions obtained by partitioning the feature maps in multi-scale features along the spatial dimension, with each spatial feature region corresponding to a spatial block index. A similarity adjacency matrix is ​​used. For each channel feature region, the top k most relevant spatial feature regions are selected to form connection pairs. The connection relationship is defined as follows: ,in, Let represent the set of connection relationships, where 'i' represents the channel feature region index, 'j' represents the spatial feature region index, and 'k' represents the preset number of nearest neighbors to control connection sparsity. The channel and spatial feature regions are concatenated according to the connection relationships to obtain a subgraph set. For each connection pair (i,j), the corresponding channel and spatial feature regions are extracted from the original multi-scale features. The channel feature region consists of all spatial values ​​of the feature map in channel i, and the spatial feature region consists of all channel values ​​of the feature map in spatial block j. These two regions are concatenated along the feature dimension using a concatenation function to form a subgraph. The calculation process is expressed by the formula: ,in, To represent a subgraph, This represents the feature region of the i-th channel. Let represent the j-th spatial feature region, and Concat denotes the concatenation operation. All subgraphs constitute the subgraph set. .

[0019] Feature information reasoning is performed using subgraph sets to obtain the reasoned features. Feature information reasoning includes normalizing the adjacency matrix and applying spatial weighting and channel weighting reasoning. First, the similarity adjacency matrix... Symmetric normalization is performed to prevent excessively high node degrees from affecting the aggregation weights. The normalization process is expressed by the formula: ,in, This represents the normalized adjacency matrix. The degree matrix is ​​represented by the following diagonal elements: The lines and, Represents the identity matrix.

[0020] Spatial weighted feature inference is performed, using a normalized adjacency matrix to weight and aggregate spatial features. The calculation process is expressed by the following formula: ,in, The features represent those obtained after spatial weighted reasoning. This represents the set of all spatial feature regions. Channel-weighted feature inference is performed, using a normalized adjacency matrix to weight and aggregate channel features. The calculation process is expressed by the formula: ,in, This represents the features after channel-weighted inference. This represents the set of all channel feature regions. Finally, the spatially weighted inference features and the channel-weighted inference features are fused with the original multi-scale features. The feature dimensions are compressed through convolutional layers to output the inferred features. The fusion process is expressed by the formula: ,in, Represents the features after inference; Conv represents the convolution operation, used to reduce the number of channels and integrate features; Concat represents the concatenation operation. This represents the original multi-scale features. Through the above steps, the multi-dimensional information inference module completes the transformation from multi-scale features to inferred features, enhancing the model's ability to model the global context of pest features. The entire process ensures the robustness and effectiveness of feature interactions, providing optimized feature representations for subsequent modules.

[0021] 3) The graph feature pyramid module is used to perform graph feature enhancement operations on the inferred features and output the enhanced features. The specific implementation process is as follows: The inferred features are mapped to a linear feature latent space to obtain a latent feature representation. A graph structure is constructed on the latent feature representation, where the nodes of the graph structure correspond to feature units, and the edges in the graph structure are constructed based on the similarity between the node features. The features of each node and its corresponding neighboring nodes are aggregated through a graph convolutional layer to obtain the fused features. The fused features are mapped back to the original feature space through a linear transformation to obtain the enhanced features.

[0022] The network structure of the graph feature pyramid module comprises four sequentially connected components: a linear mapping component, a graph construction component, a graph convolution component, and a linear inverse mapping component. The linear mapping component transforms the input inference features into a linear feature latent space using a learnable weight matrix. The graph construction component defines a graph structure on the latent feature representation, where nodes correspond to feature units, and edges are dynamically constructed based on the similarity between node features. The graph convolution component achieves feature fusion by aggregating the features of each node with its neighboring nodes. The linear inverse mapping component uses another learnable weight matrix to transform the fused features back into the original feature space, outputting the enhanced features. The entire network structure utilizes graph convolution operations to achieve cross-layer feature interaction, enhancing the model's ability to perceive multi-scale pest features. The process of obtaining the enhanced features is as follows: ① The inferred features are represented as a 3D tensor with height H, width W, and number of channels C. The module first performs a linear mapping, mapping the inferred features to a linear feature latent space. The linear feature latent space is a low-dimensional vector space. The original features are projected into this space through a linear transformation to simplify subsequent graph operations and retain key information. The mapping process is implemented using a learnable weight matrix, and the calculation process is expressed by the formula: ,in, This represents the latent feature representation, with dimensions H×W×D, where D is the dimension of the latent space; This represents the learnable weight matrix, with dimensions C×D; This represents the features after input inference, with dimensions H×W×C; the dot sign indicates a matrix multiplication operation.

[0023] The linear feature latent space refers to projecting high-dimensional features into a low-dimensional vector space through linear transformations. This space preserves the main semantic information of the original features while reducing computational complexity. In this space, feature representations are more compact, facilitating graph structure construction and feature aggregation. Linear mapping is achieved through learnable parameters, enabling the model to adaptively learn the feature representation best suited for the task.

[0024] ② Construct a graph structure on the latent feature representation. The graph structure consists of a set of nodes and a set of edges. Nodes correspond to feature units, and each node represents a basic element in the latent feature representation. A feature unit is each spatial location or feature vector in the latent feature representation, corresponding to a specific region or channel slice of the input feature map. In the graph structure, each node carries a feature vector used to represent local or global semantic information. Here, a feature unit refers to the smallest processable element in the latent feature representation, usually corresponding to a spatial location or a feature dimension of the feature map. Each feature unit contains a feature vector used to encode local texture, shape, or semantic attributes. In graph construction, feature units serve as the foundation of graph nodes, forming a topological structure through connections. Node features refer to the feature vector associated with each node, originating from the corresponding position in the latent feature representation. Node features are used to calculate similarity and construct edge relationships, and are the core input for graph convolution operations. Node features are usually represented in vector form, with dimensions consistent with the dimensions of the latent space.

[0025] When constructing the graph structure, edges are built based on the similarity between node features. Specifically, latent features are represented... Reshape into a two-dimensional matrix of dimension N×D, where N equals H×W, representing the total number of nodes. For each node i, its node characteristics are denoted as... The dimension is D. Calculate the similarity between all node pairs using methods such as cosine similarity or inner product. The similarity calculation process is expressed by the formula: ,in, This represents the similarity score between node i and node j; Represents the feature vector of node i; Let represent the feature vector of node j; the dot sign represents the vector inner product; and the double vertical line represents the vector norm. Based on similarity scores, the k most similar nodes are selected as neighbors for each node, forming edge connections. Neighbor nodes are nodes directly connected to the current node in the graph structure, selected based on feature similarity. The set of neighbor nodes defines the local context of each node, used for feature aggregation in graph convolution. Neighbor node selection is achieved through similarity ranking, ensuring that only the most relevant nodes participate in the aggregation operation.

[0026] ③ The features of each node and its corresponding neighboring nodes are aggregated through a graph convolutional layer to obtain the fused features. The graph convolutional layer uses an adjacency matrix to define the connection relationships between nodes and aggregates neighbor features through weighted summation. First, the adjacency matrix is ​​constructed. The dimension is N×N, where the elements are... This represents the connection strength between node i and node j. If node j is a neighbor of node i, then... The value is set based on the similarity score; otherwise, it is zero. The graph convolution operation can be represented as: ,in, This represents the fused features, with dimensions N×D', where D' is the output dimension of the graph convolution. Represents the adjacency matrix; Represents latent features; Let represent the learnable weight matrix of the graph convolutional layer, with dimensions D×D'; This represents the activation function, such as ReLU. Specifically, for each node, the feature aggregation process is expressed by the formula: ,in, This represents the fused features of node i; Represents the set of neighboring nodes of node i; This represents the edge weight, which is usually normalized.

[0027] ④ The fused features are mapped back to the original feature space through a linear transformation to obtain the enhanced features. The linear transformation uses a learnable weight matrix to project the features from the graph convolution output dimension back to the original number of channels, and reshapes them into a three-dimensional tensor form. The calculation process is expressed by the formula: ,in, This represents the enhanced features, with dimensions H×W×C; This represents the learnable weight matrix, with dimensions D'×C; The fused features are reshaped into an N×D' shape for later use. The enhanced features retain multi-scale contextual information and highlight pest-related features. The original feature space refers to the high-dimensional space containing the inferred features, possessing the original number of channels and spatial resolution. Mapping back to the original feature space ensures compatibility of the output with subsequent modules, while integrating the enhancement information learned from graph convolution through linear transformation.

[0028] 4) The graph attention module is used to perform graph convolution processing on the enhanced features and output the attention-enhanced features. The specific implementation process is as follows: The enhanced features are processed through two independent graph convolution operations, generating a first graph convolution feature matrix and a second graph convolution feature matrix, respectively. The first graph convolution feature matrix is ​​then convolutionally normalized, and an activation matrix is ​​generated using an activation function. The first graph convolution feature matrix, the second graph convolution feature matrix, and the activation matrix are multiplied together to obtain an intermediate feature matrix. The second graph convolution feature matrix is ​​then multiplied element-wise with the enhanced features to obtain a weighted feature matrix. Finally, the intermediate feature matrix, the weighted feature matrix, and the enhanced features are added together to output the attention-enhanced features.

[0029] The graph attention module comprises several sequentially connected components: two independent graph convolutional layers, a convolutional normalization layer, an activation function layer, a matrix multiplication component, an element-wise multiplication component, and an addition component. The two independent graph convolutional layers process the enhanced input features in parallel, outputting a first graph convolutional feature matrix and a second graph convolutional feature matrix, respectively. The convolutional normalization layer and the activation function layer process the first graph convolutional feature matrix to generate an activation matrix. The matrix multiplication component multiplies the first graph convolutional feature matrix, the second graph convolutional feature matrix, and the activation matrix, outputting an intermediate feature matrix. The element-wise multiplication component multiplies the second graph convolutional feature matrix with the enhanced input features element-wise, outputting a weighted feature matrix. The addition component adds the intermediate feature matrix, the weighted feature matrix, and the enhanced input features, finally outputting the attention-enhanced features. The entire network structure achieves feature importance learning through graph convolution and matrix operations, enhancing the pest target features while suppressing background information. The specific process for obtaining the attention-enhanced features is as follows: ① The enhanced features are represented as a 3D tensor with height H, width W, and number of channels C. The module first processes the enhanced features through two independent graph convolution operations. Each graph convolution operation uses different learnable parameters to extract diverse feature representations. The graph convolution operations are based on a graph structure, where nodes correspond to feature units, and edges are dynamically constructed based on feature similarity. The first graph convolution operation generates the first graph convolution feature matrix, and the second graph convolution operation generates the second graph convolution feature matrix. The calculation process is expressed by the following formula: , ,in, This represents the convolutional feature matrix of the first image, with dimensions H×W×D; This represents the convolutional feature matrix of the second graph, with dimensions H×W×D; This indicates the first graph convolution operation, which includes graph structure construction and feature aggregation; This indicates that the second graph convolution operation is independent of the parameters of the first operation; The input features are augmented, with dimensions H×W×C; D represents the number of output channels of the graph convolution.

[0030] ② The convolutional feature matrix of the first image is subjected to convolutional normalization, and an activation matrix is ​​generated using an activation function. Convolutional normalization uses a 1x1 convolutional layer to linearly transform the convolutional feature matrix of the first image, followed by batch normalization to stabilize the training process. The activation function used is the Sigmoid function, which compresses the output values ​​to between zero and one, representing the feature importance weights. The calculation process is expressed by the formula: , ,in, This represents the matrix after convolution normalization, with dimensions H×W×D; This represents a one-to-one convolution operation, using a learnable weight matrix; This indicates a batch normalization operation; This represents the activation matrix, with dimensions H×W×D; This represents the Sigmoid activation function.

[0031] ③ Multiply the convolutional feature matrices of the first and second images with the activation matrix to obtain the intermediate feature matrix. The matrix multiplication operation first reshapes the convolutional feature matrices of the first and second images into two-dimensional matrices of dimension N×D, where N equals H×W. The activation matrix is ​​also reshaped to the same dimension. The matrix multiplication is then performed by multiplying the product of the first image's convolutional feature matrix and the activation matrix, and then multiplying it by the second image's convolutional feature matrix to finally output the intermediate feature matrix. The calculation process is expressed by the formula: , , , ,in, This represents the convolutional feature matrix of the first image after reshaping, with dimensions N×D; This represents the convolutional feature matrix of the reshaped second image, with dimensions N×D; This represents the reshaped activation matrix, with dimensions N×D; This represents the intermediate feature matrix, with dimensions N×D; the dot sign indicates matrix multiplication; T indicates matrix transpose. This indicates a reshaping operation, which converts a three-dimensional tensor into a two-dimensional matrix.

[0032] ④ Multiply the convolutional feature matrix of the second image element-wise with the enhanced features to obtain a weighted feature matrix. The element-wise multiplication operation multiplies each element of the convolutional feature matrix of the second image with the corresponding element of the enhanced features, emphasizing important features and suppressing irrelevant information. The calculation process is expressed by the formula: ,in, This represents the weighted feature matrix, with dimensions H×W×D; This represents an element-wise multiplication operation; This represents the convolutional feature matrix of the second graph; This represents the enhanced features of the input.

[0033] ⑤ Add the intermediate feature matrix, the weighted feature matrix, and the enhanced features to output the attention-enhanced features. The addition operation first reshapes the intermediate feature matrix and the weighted feature matrix to the same dimensions as the enhanced features, and then performs element-wise addition. The calculation process is expressed by the formula: ,in, The feature represents the attention-enhanced feature, with dimensions H×W×C; The symbol indicates a reshaping operation, which transforms the intermediate feature matrix from two dimensions back to three dimensions; the plus sign indicates element-wise addition.

[0034] 5) The detection head is used to generate pest detection results corresponding to sample crop images based on the attention-enhanced features.

[0035] The detection head comprises a feature transformation component, a multi-scale detection component, and a result generation component. The feature transformation component uses convolutional layers to transform the attention-enhanced input features into a feature representation suitable for the detection task. The multi-scale detection component includes classification and regression branches, handling category prediction and bounding box localization for feature maps at different scales, respectively. The result generation component integrates the multi-scale outputs and applies post-processing operations to generate the final detection result. The entire network structure employs a multi-scale detection mechanism based on anchor boxes to ensure the ability to identify pest targets of different sizes. The specific implementation process for generating pest detection results corresponding to sample crop images is as follows: ① The attention-enhanced features are represented as a three-dimensional tensor with height H, width W, and number of channels C. The detection head first performs feature transformation on the attention-enhanced features, mapping them to a space suitable for the detection task through a series of convolutional layers and activation functions. The feature transformation process uses multiple 3x3 convolutional layers, each followed by a batch normalization layer and a LeakyReLU activation function to enhance feature representation and maintain gradient stability. The calculation process is expressed by the formula: ,in, This represents the transformed features, with dimensions H×W×C'; This represents the feature after input attention enhancement, with dimensions H×W×C; This represents a 3x3 convolution operation; This indicates a batch normalization operation; C' represents the LeakyReLU activation function; C' represents the number of channels after transformation.

[0036] ② The transformed features are fed into a multi-scale detection component, which handles both classification and regression tasks. The classification branch predicts the probability of a pest target's class at each spatial location, while the regression branch predicts the precise bounding box location of the pest target. The classification branch maps the features to a dimension equal to the number of classes plus one, where one represents the background class, using a 1x1 convolutional layer. The regression branch maps the features to a dimension equal to four times the number of anchor boxes, where each bounding box requires four parameters to represent its position. The calculation process is expressed by the formula: , ,in, This represents the classification prediction output, with dimensions H×W×(K+1), where K represents the total number of pest categories; This represents the regression prediction output, with dimensions H×W×(4×A), where A represents the number of predefined anchor boxes at each location; A one-to-one convolutional layer representing a classification branch; This represents a one-to-one convolutional layer representing the regression branch.

[0037] ③ In the results generation component, the bounding box parameters output by the regression prediction are converted into actual coordinates. For each spatial location (i,j) and each anchor box a on the feature map, the regression prediction outputs four values ​​(t_x,t_y,t_w,t_h), representing the bounding box center offset and size scaling, respectively. The actual bounding box coordinate calculation process is expressed by the formula: , , , ,in, This indicates the center coordinates and width and height of the predicted bounding box; This represents the Sigmoid function, which constrains the offset to between zero and one. Indicates the coordinates of the top-left corner of the grid; This indicates the width and height of the preset anchor point frame.

[0038] Meanwhile, the classification prediction output is converted into class probabilities using the Sigmoid function, and the calculation process is expressed by the formula: ,in, This represents the probability score for each position and each category, with dimensions H×W×(K+1).

[0039] ④ The head detection also employs a multi-scale feature fusion strategy to extract detection results from feature maps at different levels. For each scale feature map, the above feature transformation and multi-scale detection process is repeated to ensure that the model can capture various pest targets from small to large. The sizes of the multi-scale feature maps are 1 / 32, 1 / 16, and 1 / 8 of the original input image, corresponding to the detection of small, medium, and large pest targets.

[0040] ⑤ The results generation component applies non-maximum suppression (NMS) to merge overlapping detection boxes and filter low-confidence predictions. NMS filters based on the class probability and cross-union ratio (CUP) of the bounding boxes, ensuring that only the most accurate detection box is retained for each pest target. The filtering process is based on preset confidence and CUP thresholds, and the calculation process is expressed by the following formula: Output represents the final pest detection result, which includes bounding box coordinates and category labels; This represents the set of all predicted bounding boxes; This represents the class probability of the corresponding bounding box; The cross-union ratio threshold represents the non-maximum suppression threshold; This represents the confidence level filtering threshold; NMS represents the non-maximum suppression algorithm.

[0041] S2. Train the crop pest identification model to obtain the trained crop pest identification model. The specific implementation process is as follows: The training set consisted of 3200 sample crop images, each accompanied by a labeled file containing pest categories and bounding box coordinates. The images were first resized to a uniform height and width of 640 pixels to meet model input requirements. Data augmentation techniques were applied to the training set, including random horizontal flipping, random rotation, and color jittering, to increase data diversity and improve model generalization ability. Pixel values ​​were normalized to between zero and one; the calculation process is expressed by the formula: ,in, This represents the normalized image, with dimensions of 640×640×3; This represents the original input image, with dimensions of 640×640×3. The model initialization component sets the parameters of the crop pest recognition model. The weights of the backbone network, multidimensional information inference module, graph feature pyramid module, graph attention module, and detection head use the Xavier initialization method, with biases initialized to zero. If pre-trained weights, such as those from YOLOv11s, are used, these weights are loaded to accelerate convergence. The total number of model parameters is approximately 8.31 million, and all modules are placed in training mode with gradient calculation enabled.

[0042] The loss function calculation component defines multi-task loss functions, including classification loss, regression loss, and confidence loss. Classification loss measures the accuracy of pest category prediction using binary cross-entropy loss; regression loss measures the accuracy of bounding box location prediction using intersection-over-union (IoU) loss; and confidence loss measures the accuracy of target existence prediction using binary cross-entropy loss. The total loss function is a weighted sum of these losses, calculated using the following formula: ,in, Indicates the total loss; Indicates classification loss; Indicates regression loss; Indicates confidence loss; This represents the classification loss weight, set to 1.0; This represents the regression loss weight, set to 1.0; This represents the confidence loss weight, set to 1.0. The classification loss calculation process is expressed by the formula: ,in, Indicates the number of samples; This represents the actual category label, with a value of 0 or 1. This represents the predicted category probability. The regression loss calculation process is expressed by the formula: ,in, Represents the intersection-union ratio function; Indicates the coordinates of the predicted bounding box; This represents the coordinates of the true bounding box. The confidence loss calculation process is expressed by the formula: ,in, Indicates the true confidence level label; This indicates the prediction confidence level.

[0043] The optimizer settings are set to Adam, with an initial learning rate of 0.001 and a weight decay factor of 0.0005. Cosine annealing is used for learning rate scheduling, adjusting the learning rate after each epoch to promote convergence. Optimizer parameters include all learnable weights and biases of the model. The training loop executes for 600 epochs, iterating through all batches of the training set in each epoch, with a batch size of 16. For each batch, 16 preprocessed sample crop images with dimensions of 16×640×640×3 are input. The model performs forward propagation, sequentially passing through the backbone network, multidimensional information inference module, graph feature pyramid module, graph attention module, and detection head, outputting pest detection results. Forward propagation calculates the predicted bounding box coordinates and class probabilities. The loss function calculation component calculates the total loss based on the prediction results and ground truth labels. The backpropagation component uses automatic differentiation to calculate the gradient of the loss function with respect to the model parameters. The parameter update component applies the Adam optimizer to update the parameters, adjusting the model weights to minimize the loss. During training, model performance is evaluated on the validation set every 10 epochs, calculating metrics such as accuracy, recall, and mean precision, and saving the weights of the model with the lowest validation loss. After training, a trained crop pest identification model is obtained, with its parameters fixed, for subsequent pest identification of images of crops captured by a camera. The entire training process ensures that the model learns effective representations of pest features from the data, achieving high-precision pest detection capabilities.

[0044] S3. Using the trained crop pest identification model, identify pests in the images of crops captured by the camera, and output the pest detection results for the crop images. Specifically: A camera sensor is installed in the field environment to capture images of the crops to be identified at fixed time intervals or triggered by a specific method. Image acquisition parameters are set to a resolution of 1920×1080 pixels, RGB color space, and JPEG storage format. The camera sensor transmits the captured crop images to the edge computing device via an IoT interface, using Base64 encoding to ensure image data integrity during transmission. The image preprocessing component receives the crop images from the camera and performs a series of standardization operations. First, the image size is adjusted to 640×640 pixels, maintaining the original aspect ratio while filling the edges with gray pixels. Then, the pixel values ​​are normalized from an integer range of 0-255 to a floating-point range of 0-1. The calculation process is expressed by the formula: ,in, This represents the preprocessed image, with dimensions of 640×640×3; This refers to an image of the crop to be identified captured by a camera; its dimensions are variable. This indicates an image resizing operation. The preprocessed image is converted to PyTorch tensor format, and batch dimensions are added to form an input tensor with dimensions of 1×640×640×3.

[0045] The model inference component loads the trained crop pest identification model, including the backbone network, multi-dimensional information inference module, graph feature pyramid module, graph attention module, and all training parameters of the detection head. The model is set to evaluation mode, and the training-time features of Dropout and batch normalization layers are disabled. The preprocessed image tensor is input into the model and forward propagation is performed sequentially through each module. The backbone network extracts multi-scale features from the input image; the multi-dimensional information inference module performs local feature representation and feature information inference on the multi-scale features; the graph feature pyramid module performs graph feature enhancement on the inferred features; the graph attention module performs attention enhancement processing on the enhanced features; and the detection head generates a preliminary detection output based on the attention-enhanced features. The forward propagation calculation process is expressed by the formula: , , , , ,in, This represents the multi-scale features output by the backbone network; This represents the inferred features output by the multidimensional information reasoning module. This represents the enhanced features output by the graph feature pyramid module; This represents the attention-enhanced features output by the graph attention module. This indicates the raw detection result output by the detection head.

[0046] The output component performs post-processing on the raw detection results output by the model inference component. First, a confidence threshold filter is applied to remove detection boxes with a confidence level below 0.5. Then, non-maximum suppression is performed to remove redundant detection boxes with high overlap, and the intersection-overlap ratio (IoU) threshold is set to 0.45. The processed detection box coordinates are mapped back from a 640×640 scale to the original image scale. The calculation process is expressed by the formula: , , , ,in, Represents the bounding box coordinates mapped to the original image scale; Represents the bounding box coordinates output by the model; This represents the width and height of the original image of the crop to be identified.

[0047] The final output shows the pest detection results for the crop image to be identified, including the bounding box coordinates, category label, and confidence score for each detected pest target. The output format uses a JSON data structure, containing the image ID, detection timestamp, and a list of pest detection results. The entire recognition process is completed on an edge computing device, with an average processing time of less than 200 milliseconds, meeting the application requirements for real-time pest monitoring.

[0048] The pest detection results include the precise location information, category classification, and detection confidence score for each detected pest target. Location information is represented by bounding box coordinates, including the horizontal and vertical coordinates of the top-left corner and the width and height of the box; category classification specifies the specific pest type, corresponding to the 11 rice pest categories defined in the dataset; the detection confidence score is a probabilistic estimate of the model's accuracy in this detection, ranging from 0 to 1. The pest detection results are organized in a structured data format, facilitating subsequent pest statistical analysis, control decisions, and early warning dissemination.

[0049] The technical solution of the present invention will be further described through the following embodiments, as follows: A crop pest identification model (also known as a rice pest identification model) based on a camera perspective, integrating multi-dimensional information collaboration and graph attention mechanisms. The overall structure of the rice pest identification model is as follows: Figure 2As shown, the overall model structure follows the YOLO object detection basic structure, mainly consisting of three components: the backbone, the neck, and the head. The backbone is responsible for extracting multi-scale features from the input image, the neck enhances feature representation through multi-module collaboration, and the head generates the final pest detection result. The backbone consists of multiple convolutional layers and feature extraction modules, specifically including Conv convolutional layers, C3k2 modules, SPPF spatial pyramid pooling fast module, and C2PSA modules. The input image first undergoes preliminary feature extraction through the Conv convolutional layers, and then the C3k2 module enhances the feature representation capability. The C3k2 module uses multiple convolutions and residual connections to capture local and global features. Subsequently, the SPPF (Spatial Pyramid Pooling Fast Module) aggregates contextual information through multi-scale pooling operations, enhancing the model's ability to perceive pests at different scales. The C2PSA module further optimizes feature representation, combining channel and spatial attention mechanisms to highlight important features. The backbone network outputs multi-scale feature maps containing low-level edge texture information and high-level abstract semantic features, providing a multi-level representation foundation for subsequent processing. The neck network receives the multi-scale features output by the backbone network and introduces multiple modules for feature fusion and enhancement. The neck network includes a Multidimensional Information Inference Module (MIIM), a graph feature pyramid module, and a graph attention module, as well as related connection and sampling operations. The Multidimensional Information Inference Module (MIIM), denoted as MIIM, performs local feature representation and feature information inference on the input multi-scale features. The MIIM first divides the multi-scale features into channel-dimensional and spatial-dimensional features. It averages the channel-dimensional features along the channels to obtain the channel mean vector, and averages the spatial-dimensional features along the space to obtain the spatial mean matrix. The channel mean vector and spatial mean matrix are reshaped to a uniform shape, and a similarity adjacency matrix is ​​calculated using inner product. Based on the similarity adjacency matrix, connections are established between channel feature regions and spatial feature regions. These regions are then concatenated according to these connections to obtain a subgraph set. Feature information inference is performed using this subgraph set, and the inferred features are output. This process enables cross-dimensional feature interaction, allowing the model to retain the fine structure of local regions while enhancing the expression of global semantic patterns, thus obtaining a more complete and robust feature representation. The graph feature pyramid module organizes feature mappings at different scales in the neck network through graph topological relationships, better modeling the contextual dependencies between hierarchical features.The graph feature pyramid module includes the Graph Feature Enhancement (FE) operation, the Concat operation, and the TIpsample upsampling or downsampling operation. After inference, the features are first enhanced by the FE operation, mapping them to a linear latent feature space to obtain a latent feature representation. A graph structure is then constructed on this latent feature representation, where nodes correspond to feature units, and edges are constructed based on the similarity between node features. Features from each node and its corresponding neighbors are aggregated through a graph convolutional layer to obtain fused features. The fused features are then mapped back to the original feature space through a linear transformation to obtain enhanced features. The Concat operation merges feature maps from different levels, and the TIpsample operation adjusts the feature map size to align scales. This design highlights foreground instance features of rice pests against complex backgrounds, enabling simultaneous modeling of small-scale pest targets and large-scale plant background. The graph attention module, labeled GCN Attn, performs weighted modeling of the correlation between feature nodes, effectively improving the discriminability between foreground pests and background interference. The Graph Attention Module (GCN Attn) processes the enhanced features through two independent graph convolution operations, generating a first graph convolutional feature matrix and a second graph convolutional feature matrix. The first graph convolutional feature matrix is ​​convolutionally normalized and then an activation matrix is ​​generated using an activation function. The first and second graph convolutional feature matrices are multiplied with the activation matrix to obtain an intermediate feature matrix. The second graph convolutional feature matrix is ​​then multiplied element-wise with the enhanced features to obtain a weighted feature matrix. The intermediate feature matrix, the weighted feature matrix, and the enhanced features are then added together to output the attention-enhanced features. This mechanism suppresses the adverse effects of background and noise on feature learning, thus addressing the problem of pest targets being easily obscured in low-contrast scenes, further improving the model's detection accuracy and stability. The detection head receives the attention-enhanced features output from the neck network and generates the final pest detection result. The detection head includes multiple Detect modules, each of which converts features into bounding box coordinates and class probabilities through convolutional layers and activation functions. The head detection layer applies non-maximum suppression to filter overlapping detection boxes and outputs the bounding box location, class label, and confidence score for each pest target. The entire model structure, through the collaborative work of the backbone, neck, and head detection layers, achieves high-precision identification of rice pest images captured by a camera.

[0050] In rice pest identification tasks using camera perspectives, multi-scale features play a crucial role. Pests often exhibit significant differences across different growth stages, feeding methods, and morphological manifestations, with features ranging from minute spots on leaves to extensive tissue damage. Single-scale features struggle to simultaneously capture local texture details and overall structural changes, while multi-scale feature fusion can preserve fine texture information at a low level and integrate global semantic and shape features at a high level, thus achieving comprehensive modeling of pest type and severity. This collaborative representation of multi-scale information not only enhances the model's ability to perceive complex pest patterns but also strengthens its robustness to changes in lighting, background interference, and varying shooting distances, making it irreplaceable in intelligent rice pest identification. Furthermore, spatially adjacent features often convey different information. Pest occurrences are usually accompanied by leaf tissue damage, and the insect body and the lesioned leaf area are closely adjacent in the image. This semantic association provides the model with stronger discriminative basis. It is worth noting that insects are often small and camouflaged, making it easy to miss detections by relying solely on insect features. However, combining the characteristics of local lesions on leaves can significantly improve the accuracy and stability of detection through contextual information. Furthermore, when an insect is connected to a leaf, its edges, textures, and colors are more likely to align and complement each other during feature extraction, further enhancing the robustness of feature representation. Therefore, a Multidimensional Information Inference Module (MIIM) is proposed, with the following module structure: Figure 3 As shown, the module comprises three parts: local feature representation, feature subgraph construction, and information inference. Local feature representation is performed on the input feature X, which is divided into channel-dimensional features and spatial-dimensional features. The channel-dimensional features are averaged along the channels to obtain the channel mean vector, and the spatial-dimensional features are averaged along the space to obtain the spatial mean matrix. This mean averaging operation is a key step in local feature representation. Subsequently, the channel mean vector and spatial mean matrix are reshaped to a uniform shape, and a similarity adjacency matrix is ​​calculated using the inner product. Based on the similarity adjacency matrix, connections between channel feature regions and spatial feature regions are established. These connections are then concatenated to obtain a subgraph set, corresponding to the graph construction operation in the diagram. Finally, the subgraph set is used for feature information inference, including normalizing the adjacency matrix and applying spatial and channel weighted inference. The inferred features are then output, corresponding to the information operation in the diagram. Inference information reasoning operation; the entire data flow starts from the input feature X, and through the steps of mean processing, graph construction and information reasoning, it gradually realizes cross-dimensional feature interaction, enhancing the model's ability to model the global context of pest features. Specifically: (1) Local Feature Representation: In rice pest identification, traditional convolution relies on a fixed receptive field, making it difficult to comprehensively model the complex relationships between pest spots, leaf texture, and overall damaged areas. In contrast, graph convolution establishes inter-regional connections through adjacency matrices, enabling flexible aggregation of non-local information from cross-scale feature maps, thereby capturing the long-range dependencies of pests in different parts. Based on this idea, a topological graph is constructed between different regions of the rice leaf pest feature map to obtain local representations of the features. Especially for high-resolution feature maps, it can effectively characterize local details such as pest spots and holes, providing more accurate support for semantic information in subsequent low-resolution features, thus achieving joint modeling of pest local and overall features. First, the input features are divided into two dimensions: channel dimension and spatial dimension. The mean is calculated for each dimension. The channel dimension features are averaged along the channel, requiring the feature map to be divided into For each of the three non-overlapping feature regions, the mean value along the channel is calculated, resulting in a local representation vector with a length of [length missing]. The process of calculating the channel mean is as follows: Then, perform a spatial mean calculation. The formula for calculating the spatial mean is as follows: Finally, the two mean matrices are reshaped to a uniform shape, then their inner product is performed to extract the similarity adjacency matrix, and the channel correlation coefficient and spatial correlation coefficient of each region to the original feature map are calculated: .

[0051] (2) Subgraph construction: An index between regions in a feature can be constructed using the representation vector, and the data variance can be utilized. This allows control over the sparsity of the correlation matrix A. The correlation matrix can be used to find the regional connections between adjacent features, which can be represented as: ,in, Let f represent the k most relevant indices in matrix A, and let f be a function of the return characteristics based on the indices. Then, the obtained information is concatenated to obtain the subgraph. The calculation process is as follows: ,in, This indicates a feature concatenation operation. This forms the final set of subgraphs. The entire subgraph construction structure is as follows: Figure 4As shown, the input features are first divided into multiple channel feature regions and spatial feature regions. The channel mean vector is obtained by calculating the average value of the channel feature regions along the channel dimension, and the spatial mean matrix is ​​obtained by calculating the average value of the spatial feature regions along the spatial dimension. Then, the channel mean vector and the spatial mean matrix are reshaped into a uniform shape and their inner product is calculated to obtain the similarity adjacency matrix. Based on the similarity adjacency matrix, the top k most relevant spatial feature regions for each channel feature region are selected to establish a connection relationship. Then, according to these connection relationships, the corresponding channel feature regions and spatial feature regions are spliced ​​to form multiple subgraphs. Finally, all these subgraphs constitute a complete set of subgraphs for subsequent feature information inference. The whole process realizes the transformation from raw features to structured graph representation.

[0052] (3) Feature information reasoning: Reasoning from local information to global information requires normalization of the adjacency matrix. Symmetric normalization is used to avoid excessive weighting of nodes with high degree during aggregation. The calculation process is as follows: , where the matrix Let I be the original adjacency matrix, D be the identity matrix, and D be the degree matrix. For spatial features, a weighted approach based on local spatial features is used to achieve information reasoning from local to global features. The specific structure is as follows: Figure 5 As shown, Figure 5 In this process, the Representation Vector constructs an adjacency matrix. First, the adjacency matrix is ​​symmetrically normalized to avoid excessively high node degrees affecting the aggregation weights. Then, the normalized adjacency matrix is ​​used to perform weighted aggregation operations on spatial feature regions. Specifically, matrix multiplication is used to achieve information reasoning from local spatial features to global features. Then, high-resolution features are used as residuals and concatenated with the weighted features using a Cont operation. Finally, convolutional layers compress the feature dimensions and fuse all features, completing the full transformation process from local feature representation to global feature reasoning.

[0053] Spatial weighted feature reasoning can be expressed as: ,in, This represents the original feature region found through matrix A. High-resolution features are concatenated with it as residuals, then features are compressed through convolution, and finally all compressed features are fused. The entire process can be represented as: , , ,in, The operation is used to change the shape of the feature, and X is the final output of spatial feature information inference.

[0054] In rice pest identification, local channel features can be abstracted into semantic vectors to characterize the semantic attributes of pest spots, leaf lesions, and texture details at different scales. To depict the intrinsic relationships between these features, a routing index matrix between channels is constructed, and based on semantic dependencies, the semantic vector of each channel is treated as a graph node, thus forming a local topological sub-graphet. By applying graph convolutional networks to these sub-graphets for semantic reasoning, node-level regional channel weights can be generated, thereby highlighting pest-related features. Finally, by weighting the regional attention of the sub-graphets and combining linear transformation operations to integrate the features, cross-scale fusion output features are obtained, achieving efficient aggregation of multi-scale semantic information of rice pests, such as... Figure 6 As shown, Figure 6 In this process, a set of channel feature subgraphs is constructed using Representation Vectors. The semantic vector of each channel serves as a graph node to form a local topological subgraph set. Then, the subgraph representation vectors are multiplied by the learnable Weights Vectors and added together to obtain a weighted feature representation. Next, the weighted features are integrated and their dimensions are adjusted through a Linear transformation operation. Finally, the cross-scale fusion feature result is output. The entire process realizes semantic information reasoning and feature enhancement in the channel dimension.

[0055] Channel-weighted feature inference can be expressed as: ,in, This represents the original feature region found through matrix A. The subgraph representation vector is dot-producted with the learnable weight matrix and then added. The resulting vector combination forms a matrix, which, after a linear transformation, yields the channel inference result. The entire process can be represented as: , , , It represents a linear transformation.

[0056] To address the issues of severe noise interference and blurred pest details in images captured by camera sensors in complex field environments, a Graph Feature Pyramid Network (FPN) is proposed. The FPN effectively alleviates the multi-scale problem in pest detection by fusing multiple layers of features to detect targets at different scales. Most existing FPNs use element-wise summation to fuse adjacent feature layers, which struggles to capture long-distance dependencies and fails to fully utilize the potential information contained in non-adjacent layers. For pest detection tasks in complex field environments where pest features are not readily apparent, this additional information often plays a crucial role in the final result. Therefore, a Graph Feature Enhancement (FE) module is introduced into the feature pyramid. Through concise graph convolution operations, adaptive feature interaction between pyramid layers is achieved, fully integrating useful information from different levels of feature maps, enhancing the semantic representation of pests while preserving rich spatial structure. The structure of the Graph Feature Pyramid module is as follows: Figure 7 As shown, the input features are mapped to the latent feature space through a linear transformation to obtain the latent feature representation. Then, a graph structure is constructed on the latent feature representation and the similarity between nodes is dynamically calculated to determine the edge connection relationship. Then, the features of each node and its neighboring nodes are aggregated through a graph convolutional layer to achieve feature fusion. Finally, the fused features are mapped back to the original feature space through a linear transformation to obtain the enhanced feature output. The entire process realizes cross-level feature interaction and multi-scale information integration through the graph structure.

[0057] Assuming the input features are , Features The number of layers. The graph feature enhancement module first needs to... The feature space is mapped to a linear latent feature space, and feature fusion is achieved through graph convolution. Finally, the feature space is transformed back to the original feature space. The computation process can be represented as follows: ,in, The feature map output by the graph feature enhancement module. To center a learnable weight, Represents the ReLU activation function. This is a graph convolutional layer. A graph convolutional layer first defines nodes and edges. Assume the feature map after linear transformation is... You can pass To construct the nodes and edges of the graph .picture The nodes correspond to feature units within the features. To better extract detailed information from the features, the graph... The edges between nodes are dynamically constructed. Construct a neighbor set, i.e. Represents a node The set of all neighboring nodes; for any node For example, the feature representation of this node is as follows: Calculate the distance between the vertex and other nodes in the graph to obtain a similarity matrix, and select the most similar vertices as... The neighboring nodes, and added to The calculation process is as follows: Subsequently, graph convolution is used to aggregate the features of a node and its neighboring nodes, thereby exchanging feature information between nodes and capturing long-range dependencies in the multi-scale fused pyramid, thus achieving feature aggregation. The specific calculation process is as follows: Finally, a linear transformation is used to... Mapping to the original feature size yields the final output of the graph feature enhancement module. The feature pyramid introduced with the graph feature enhancement module can perceive not only multi-scale contextual information but also inter-layer feature information within the pyramid, thus enhancing the semantic expression of pests.

[0058] From a camera's perspective, insect pest targets in images may be obscured by a large amount of background, making it very difficult to extract clear and effective target features. To address this, a graph attention module for rice pest identification is proposed, with the following structure: Figure 8 As shown, the input feature X is processed through a first graph convolution operation (gConv) to generate a first graph convolutional feature matrix, and simultaneously through a second graph convolution operation (gConv) to generate a second graph convolutional feature matrix. Next, the first graph convolutional feature matrix is ​​normalized using a convolution operation (Conv) and then an activation matrix is ​​generated using an activation function. The first and second graph convolutional feature matrices are then multiplied with the activation matrix to obtain an intermediate feature matrix. Simultaneously, the second graph convolutional feature matrix is ​​multiplied element-wise with the original input feature X to obtain a weighted feature matrix. Finally, the intermediate feature matrix, the weighted feature matrix, and the original input feature X are added to obtain the attention-enhanced feature output. The core idea of ​​the graph attention module is to enhance the original feature representation by learning important information from the features, thereby suppressing background target information, highlighting pest target features, and improving the performance of the pest identification model.

[0059] The graph attention module first obtains the input features through two graph convolutions. The important information in the graph is constructed using the same subgraph construction method as the Multidimensional Information Inference Module (MIIM), resulting in two graph convolution feature matrices. and Then, through a Convolution normalizes some features and activates them using an activation function to obtain a matrix. ; through matrix multiplication , , Multiply the matrices and transform their size to the initial shape to obtain the characteristic matrix. Subsequently, the graph convolution matrix... Compared with the original input features Element-wise multiplication yields the characteristic matrix. This allows for the extraction of spatial information contained in the feature channels, namely, modeling the target portion of the feature channels to enrich the feature information, while also suppressing other background and noise features to highlight the pest target; finally, , Compared with the original input features The summation weakens non-target regions and strengthens the attention-enhanced feature map of the target region, mitigating the impact of background and noise on model performance. The calculation process can be formally represented as: , , , .

[0060] The technical effects of the present invention are illustrated by the following experiments: 1. Dataset and Evaluation Metrics: (1) Dataset: Images of rice pests captured by real cameras were used as the experimental dataset, containing 11 common rice pests. The distribution of each rice pest is as follows: Figure 9 As shown in the image, the dataset is divided into three parts: a training set of 3200 images, a validation set of 1000 images, and a test set of 500 images. The experimental dataset is constructed using rice pest images captured by real cameras. All images were collected from natural field environments, exhibiting typical characteristics such as large variations in lighting, complex backgrounds, and uneven pest distribution, thus more closely resembling real-world application scenarios. The dataset contains 11 common rice pest categories, covering various typical pest images, and their distribution is shown in the image. Figure 8 As shown in the diagram. To ensure the scientific rigor of model training and evaluation, the dataset was divided into a 64%:20%:16% ratio. The training set consisted of 3200 images, used for learning model parameters; the validation set of 1000 images, used for model tuning and preventing overfitting during training; and the test set of 500 images, used for independently evaluating the generalization performance of the final model. This division not only ensured sufficient data utilization but also provided a reliable basis for the objective comparison and performance analysis of rice pest detection methods.

[0061] (2) Evaluation indicators: Accuracy rate (%) ), recall rate ( ), average accuracy ( ) and average category accuracy ( (These are some of the metrics used to evaluate the performance of anomaly detection models, and their calculation formulas are shown below.) This indicates that the correct sample was identified as correct; This indicates that incorrect samples were identified as correct. This indicates that incorrect samples are identified as incorrect; Indicates the total number of samples; Number of all samples belonging to each category , , , , It is a commonly used metric for evaluating object detection algorithms. The calculation method is to first set the IoU to 0.5, and then calculate the IoU for all categories of images. Finally, all categories are obtained. The average value is calculated. This solves the problem that simple metrics such as precision, recall, and accuracy used in classification problems are no longer sufficient to reflect the accuracy of object detection results, since object detection tasks require both class and object location labeling.

[0062] 2. Experimental Results: Based on the proposed rice pest detection method, a systematic experiment was conducted on the constructed dataset. By comparing the performance of different methods in terms of detection accuracy, recall, and overall performance indicators, the effectiveness and advantages of the proposed model can be fully demonstrated, laying the foundation for subsequent experimental results and analysis. The server used in the experiment had an Intel(R) Xeon(R) Gold 6133 CPU and an RTX 4090 24GB GPU. The toolkits used were PyTorch 2.7 and CUDA 12.9. The relevant parameter settings are shown in Table 1, and the experimental results are as follows. Figure 10 As shown.

[0063] Table 1: Figure 10This paper demonstrates the training process of the model in a rice pest detection task, including the trends of various loss functions during the training and validation phases, as well as the convergence of detection performance metrics (Precision, Recall, mAP). From the perspective of the loss function curves, the various training losses decrease rapidly in the early stages of iteration and stabilize after 200 to 300 epochs. The loss curves on the validation set are consistent with those on the training set, without significant oscillations or overfitting. This indicates that the model possesses good convergence and generalization capabilities during feature learning. From the perspective of performance metrics (Precision, Recall, mAP@0.5 and mAP@0.5:0.95), each metric shows a steady upward trend with training iterations and tends to saturate after approximately 300 epochs. The overall precision and recall both reached around 0.8, indicating that the model can achieve a balance between high precision and high recall in pest detection tasks. The convergence performance of mAP@0.5 and mAP@0.5:0.95 further proves that the model has strong detection capabilities under different IoU thresholds. The rapid improvement and stable convergence of mAP@0.5 indicate that the model performs well in capturing the location and category of pest targets, while the continuous improvement of mAP@0.5:0.95 reflects its effectiveness in multi-scale and fine-grained localization. In summary, Figure 10 This demonstrates that the proposed detection model exhibits good convergence, robustness, and detection accuracy in rice pest detection tasks under complex field environments. It can simultaneously meet the requirements of accurate positioning of pest targets and multi-scale recognition, providing a theoretical basis at the model level for identifying rice pests from the perspective of a camera.

[0064] 3. Comparative Experiments: To comprehensively verify the effectiveness of the proposed method, several representative object detection models were selected as controls, including: the two-stage methods Faster R-CNN and Cascade R-CNN, the single-stage method SSD, and the Transformer-based detectors DETR and Deformable DETR. In addition, the lightweight detection model MobileNet was introduced as a supplement. All methods were tested under the same data partitioning and training strategy to ensure the fairness of the comparison results. The results of the comparative experiments are shown in Table 2.

[0065] Table 2: Table 2 shows that the Deformable DETR model achieved the highest recall rate (84.14%), indicating that its introduced variable attention mechanism and multi-scale feature fusion mechanism can capture target features at appropriate scales, thereby improving the recall rate. In terms of accuracy, the proposed method achieved a good level, exceeding the Deformable DETR model by 3.05%, demonstrating that in rice pest identification, the proposed method, which integrates multi-dimensional information and graph attention mechanisms, can effectively capture pest features and achieve accurate rice pest identification. Although the number of parameters is slightly higher than the SSD model with MobileNet as the backbone network, the overall number of parameters is not large. In practical applications, it can be deployed on camera sensors to achieve on-device model recognition.

[0066] 4. Visualization Experiment: By observing the feature map output of the last layer of the model, the detection capability of the proposed method can be further demonstrated intuitively. Figure 11 The feature map of the last layer of the model was visualized, and the insect pest target was magnified for clearer observation. It is evident that the initial model's perception area is relatively scattered, lacking focused attention on the target. The proposed method can form a clear high-response region in the target area, significantly enhancing the target's localization and discrimination capabilities. This indicates that the proposed method is more discriminative in feature representation, able to more accurately capture the salient regions of the target, thereby improving detection performance.

[0067] 5. Ablation Experiment: To verify the contribution of each key module to the overall detection performance, further ablation experiments were conducted. Specifically, while maintaining consistency between the backbone network and training settings, the proposed modules were gradually removed or replaced, and the detection results under different configurations were recorded. By comparing the performance differences between the complete model and different ablation configurations, the role of each module in the rice pest detection task can be quantitatively evaluated, thus demonstrating the effectiveness and necessity of the proposed method in multi-scale feature aggregation, noise suppression, and fine-grained pest identification. The ablation experiment results are shown in Table 3.

[0068] Table 3: Table 3 shows the detection performance under different module combinations. Looking at the performance of a single module, adding the MIIM module alone achieved a precision of 88.05%, a significant improvement over the base model. This indicates that the MIIM module can enhance the modeling ability of the global context through multi-dimensional information reasoning, thereby reducing model errors and improving performance. In contrast, adding the GraphFPN module alone resulted in better performance in recall and rigorous metrics, with an mAP50-90 of 67.56%, demonstrating that graph feature pyramids effectively improve the robustness of the model under complex targets and scale variations. However, introducing GraphAttn alone had limited effect, with an mAP of only 73.76% and a mAP50-90 drop to 47.68%, indicating that the attention mechanism struggles to perform well in the absence of multi-scale and global information support. When all three modules work synergistically, the model achieves the best performance across all metrics: precision reaches 89.14%, and recall increases to 79.85%, fully demonstrating the complementarity between the modules. MIIM enhances global inference capabilities, GraphFPN provides intra-scale representation support, and GraphAttn further optimizes feature selection and information allocation, thus achieving synergistic performance gains. In summary, experimental results show that each module exhibits different performance improvements, and the final multi-module collaborative strategy achieves optimal results across all four metrics, validating the effectiveness of the proposed method for rice pest identification from a camera perspective.

[0069] To address the challenges of complex backgrounds and blurred details in rice pest identification from a camera perspective, a novel identification model integrating multidimensional information collaboration and graph attention mechanisms is proposed. The multidimensional information reasoning module aggregates non-local information across scales, effectively capturing long-distance dependencies between different parts of the pest. The graph feature pyramid and graph feature enhancement modules enable adaptive interaction between features at each level, fully integrating multi-layered information. Finally, the graph attention mechanism highlights the target features of the pest while suppressing interfering background information.

[0070] In the above embodiments, although the steps are numbered S1, S2, etc., they are only specific embodiments given by the present invention. Those skilled in the art can adjust the execution order of S1, S2, etc. according to the actual situation, and the scheme after adjusting the order is also within the protection scope of the present invention.

[0071] like Figure 12As shown, an embodiment of the present invention provides a crop pest identification system 200, comprising: a model building module 201, a model training module 202, and a model application module 203. The model building module 201 is used to: build a crop pest identification model, which includes a backbone network, a multi-dimensional information reasoning module, a graph feature pyramid module, a graph attention module, and a detection head. The backbone network is used to: extract multi-scale features from sample crop images. The multi-dimensional information reasoning module is used to: perform local feature representation on the multi-scale features, construct feature subgraphs, perform feature information reasoning on the feature subgraphs, and output the reasoned features. The graph feature pyramid module... The module is used to: perform graph feature enhancement on the inferred features and output the enhanced features; the graph attention module is used to: perform graph convolution on the enhanced features and output the attention-enhanced features; the detection head is used to: generate pest detection results corresponding to the sample crop images based on the attention-enhanced features; the model training module 202 is used to: train the crop pest recognition model and obtain the trained crop pest recognition model; the model application module 203 is used to: use the trained crop pest recognition model to perform pest recognition on the crop images to be identified captured by the camera and output the pest detection results of the crop images to be identified.

[0072] Optionally, in the above technical solution, the multi-dimensional information reasoning module is specifically used for: dividing multi-scale features into channel-dimensional features and spatial-dimensional features; averaging the channel-dimensional features along the channel to obtain the channel mean vector, and averaging the spatial-dimensional features along the space to obtain the spatial mean matrix; reshaping the channel mean vector and the spatial mean matrix into a unified shape, and calculating the similarity adjacency matrix through the inner product; establishing the connection relationship between the channel feature regions and the spatial feature regions based on the similarity adjacency matrix, and splicing the channel feature regions and the spatial feature regions according to the connection relationship to obtain a subgraph set; wherein, the channel feature region is the feature region obtained by dividing the feature map in the multi-scale features along the channel dimension, and the spatial feature region is the feature region obtained by dividing the feature map in the multi-scale features along the spatial dimension; using the subgraph set to perform feature information reasoning to obtain the reasoned features.

[0073] Optionally, in the above technical solution, the graph feature pyramid module is specifically used for: mapping the inferred features to a linear feature latent space to obtain a latent feature representation; constructing a graph structure on the latent feature representation, wherein the nodes of the graph structure correspond to feature units, and the edges in the graph structure are constructed based on the similarity between the node features; aggregating the features of each node and its corresponding neighboring nodes through a graph convolutional layer to obtain fused features; and mapping the fused features back to the original feature space through a linear transformation to obtain enhanced features.

[0074] Optionally, in the above technical solution, the graph attention module is specifically used to: process the enhanced features through two independent graph convolution operations to generate a first graph convolution feature matrix and a second graph convolution feature matrix, respectively; perform convolution normalization on the first graph convolution feature matrix and generate an activation matrix through an activation function; perform matrix multiplication of the first graph convolution feature matrix, the second graph convolution feature matrix, and the activation matrix to obtain an intermediate feature matrix; perform element-wise multiplication of the second graph convolution feature matrix with the enhanced features to obtain a weighted feature matrix; and add the intermediate feature matrix, the weighted feature matrix, and the enhanced features to output the attention-enhanced features.

[0075] It should be noted that the specific implementation process of the crop pest identification system 200 provided in the above embodiments is detailed in the method embodiments, and will not be repeated here.

[0076] An electronic device according to an embodiment of the present invention includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements any of the above-described methods for identifying crop pests. A computer-readable storage medium according to an embodiment of the present invention stores a computer program, which, when executed by a processor, implements any of the above-described methods for identifying crop pests.

[0077] Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of the present invention.

Claims

1. A method for identifying crop pests, characterized in that, include: A crop pest identification model is constructed, comprising a backbone network, a multi-dimensional information inference module, a graph feature pyramid module, a graph attention module, and a detection head. The backbone network is used to extract multi-scale features from sample crop images. The multi-dimensional information inference module is used to represent the multi-scale features locally, construct feature sub-graphs, and perform feature information inference on the feature sub-graphs, outputting the inferred features. The graph feature pyramid module is used to perform graph feature enhancement operations on the inferred features, outputting the enhanced features. The graph attention module is used to perform graph convolution processing on the enhanced features, outputting attention-enhanced features. The detection head is used to generate pest detection results corresponding to the sample crop images based on the attention-enhanced features. The crop pest identification model is trained to obtain a trained crop pest identification model. The trained crop pest identification model is used to identify pests in images of crops captured by a camera, and the pest detection results of the crop images are output.

2. The method for identifying crop pests according to claim 1, characterized in that, The multidimensional information reasoning module is specifically used for: The multi-scale features are divided into channel-dimensional features and spatial-dimensional features; The channel mean vector is obtained by averaging the features along the channel dimension, and the spatial mean matrix is ​​obtained by averaging the features along the space dimension. The channel mean vector and spatial mean matrix are reshaped to a uniform shape, and the similarity adjacency matrix is ​​calculated by inner product; Based on the similarity adjacency matrix, a connection relationship is established between the channel feature region and the spatial feature region. The channel feature region and the spatial feature region are then spliced ​​together according to the connection relationship to obtain a set of subgraphs. The channel feature region is a feature region obtained by dividing the feature map in the multi-scale feature along the channel dimension, and the spatial feature region is a feature region obtained by dividing the feature map in the multi-scale feature along the spatial dimension. The feature information is inferred using the subgraph set to obtain the inferred features.

3. The method for identifying crop pests according to claim 2, characterized in that, The graph feature pyramid module is specifically used for: The inferred features are mapped to the linear feature latent space to obtain the latent feature representation; A graph structure is constructed on the latent feature representation, wherein the nodes of the graph structure correspond to feature units, and the edges in the graph structure are constructed based on the similarity between node features; The features of each node and its corresponding neighboring nodes are aggregated by graph convolutional layers to obtain the fused features; The fused features are mapped back to the original feature space through a linear transformation to obtain the enhanced features.

4. The method for identifying crop pests according to claim 3, characterized in that, The graph attention module is specifically used for: The enhanced features are processed by two independent graph convolution operations to generate a first graph convolution feature matrix and a second graph convolution feature matrix, respectively. The convolutional feature matrix of the first image is subjected to convolutional normalization, and an activation matrix is ​​generated by an activation function. The convolutional feature matrix of the first image, the convolutional feature matrix of the second image, and the activation matrix are multiplied together to obtain the intermediate feature matrix; The second convolutional feature matrix is ​​multiplied element-wise with the enhanced features to obtain a weighted feature matrix; The intermediate feature matrix, the weighted feature matrix, and the enhanced features are added together to output the attention-enhanced features.

5. A crop pest identification system, characterized in that, include: Model building module, model training module, and model application module; The model building module is used to: construct a crop pest identification model, which includes a backbone network, a multi-dimensional information inference module, a graph feature pyramid module, a graph attention module, and a detection head; the backbone network is used to: extract multi-scale features from sample crop images; the multi-dimensional information inference module is used to: perform local feature representation on the multi-scale features, construct feature sub-graphs, and perform feature information inference on the feature sub-graphs to output the inferred features; the graph feature pyramid module is used to: perform graph feature enhancement operations on the inferred features to output the enhanced features; the graph attention module is used to: perform graph convolution processing on the enhanced features to output attention-enhanced features; and the detection head is used to: generate pest detection results corresponding to the sample crop images based on the attention-enhanced features. The model training module is used to: train the crop pest identification model to obtain a trained crop pest identification model. The model application module is used to: use the trained crop pest identification model to identify pests in images of crops to be identified captured by a camera, and output the pest detection results of the crop images to be identified.

6. The crop pest identification system according to claim 5, characterized in that, The multidimensional information reasoning module is specifically used for: The multi-scale features are divided into channel-dimensional features and spatial-dimensional features; The channel mean vector is obtained by averaging the features along the channel dimension, and the spatial mean matrix is ​​obtained by averaging the features along the space dimension. The channel mean vector and spatial mean matrix are reshaped to a uniform shape, and the similarity adjacency matrix is ​​calculated by inner product; Based on the similarity adjacency matrix, a connection relationship is established between the channel feature region and the spatial feature region. The channel feature region and the spatial feature region are then spliced ​​together according to the connection relationship to obtain a set of subgraphs. The channel feature region is a feature region obtained by dividing the feature map in the multi-scale feature along the channel dimension, and the spatial feature region is a feature region obtained by dividing the feature map in the multi-scale feature along the spatial dimension. The feature information is inferred using the subgraph set to obtain the inferred features.

7. A crop pest identification system according to claim 6, characterized in that, The graph feature pyramid module is specifically used for: The inferred features are mapped to the linear feature latent space to obtain the latent feature representation; A graph structure is constructed on the latent feature representation, wherein the nodes of the graph structure correspond to feature units, and the edges in the graph structure are constructed based on the similarity between node features; The features of each node and its corresponding neighboring nodes are aggregated by graph convolutional layers to obtain the fused features; The fused features are mapped back to the original feature space through a linear transformation to obtain the enhanced features.

8. A crop pest identification system according to claim 7, characterized in that, The graph attention module is specifically used for: The enhanced features are processed by two independent graph convolution operations to generate a first graph convolution feature matrix and a second graph convolution feature matrix, respectively. The convolutional feature matrix of the first image is subjected to convolutional normalization, and an activation matrix is ​​generated by an activation function. The convolutional feature matrix of the first image, the convolutional feature matrix of the second image, and the activation matrix are multiplied together to obtain the intermediate feature matrix; The second convolutional feature matrix is ​​multiplied element-wise with the enhanced features to obtain a weighted feature matrix; The intermediate feature matrix, the weighted feature matrix, and the enhanced features are added together to output the attention-enhanced features.

9. An electronic device, characterized in that, The method includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the crop pest identification method according to any one of claims 1 to 4.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, which, when executed by a processor, implements a method for identifying crop pests as described in any one of claims 1 to 4.