A crop disease detection method and system based on enhanced dynamic graph construction and multi-scale feature perception
Patent Information
- Application Number
- CN202611108649.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-23
- Publication Date
- 2026-10-13
AI Technical Summary
[0006]有鉴于此,本发明提供了一种基于增强动态图构建与多尺度特征感知的农作物病害检测方法及系统,旨在解决上述背景技术中现有技术存在的田间农作物图像叶片遮挡严重、病斑尺度差异明显、病害区域分布离散、细粒度病斑信息易丢失以及全局空间关系建模不足等问题
(1)基于图节点间特征距离统计关系动态构建增强动态轴图,使水稻叶片区域、病斑区域和田间背景区域之间能够形成自适应图连接,有效增强模型对复杂田间图像中空间拓扑关系的表达能力;
Smart Images

Figure CN122906450A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of smart agricultural disease diagnosis technology, and more specifically to a method and system for detecting crop diseases based on enhanced dynamic graph construction and multi-scale feature perception. Background Technology
[0002] With the rapid development of artificial intelligence, computer vision, and smart agriculture technologies, image-based crop disease detection has become an important means of intelligent agricultural management. Certain important grain crops are susceptible to various diseases during their growth, such as rice blast, brown spot, bacterial leaf blight, and bacterial leaf streak. Failure to detect and control these diseases in a timely manner will affect crop yield, quality, and production stability. Currently, crop disease detection is gradually shifting from manual field inspections and experience-based diagnosis to automatic image detection based on deep learning. By collecting field images and constructing visual models, disease classification can be determined, demonstrating application value in mobile field inspection diagnosis, drone monitoring, and smart agriculture early warning systems.
[0003] In recent years, visual graph neural networks have been increasingly applied to image recognition and crop disease detection tasks due to their excellent performance in modeling complex spatial relationships. These models can map semantic regions of an image to graph nodes and describe spatial relationships between regions through graph connectivity, thereby modeling the relationships between crop leaves, lesions, and the field background. Through dynamic graph construction and graph convolutional propagation, the model can perform feature aggregation and information transfer between nodes and adjacent regions, capturing the spatial distribution of diseases and global topological relationships.
[0004] However, there are still problems with directly applying visual graph neural networks to the detection of real crop diseases in the field: leaves in field images often overlap, entangle, and occlude, and lesions are distributed discretely with significant scale differences. Fixed or single-rule graph connection methods are difficult to accurately express the dynamic spatial relationship between diseased areas and leaf areas. Crop lesions are mostly manifested as fine textures, local color changes, or irregular patches. Traditional feedforward networks have limited ability to perceive multi-scale local disease patterns. At the same time, conventional downsampling is prone to causing the loss of fine-grained lesion information, and background interference such as water bodies, soil, and weeds will also weaken the model's ability to focus on key disease areas.
[0005] Therefore, in view of the shortcomings of existing technologies, how to provide a crop disease detection method and system based on enhanced dynamic graph construction and multi-scale feature perception, which can adaptively construct dynamic graph connections between semantic regions of images in complex field environments, enhance the global spatial topology modeling capability between crop leaves, lesions and background, and effectively extract and fuse local disease features at different scales, while retaining fine-grained lesion information during downsampling, thereby improving the accuracy, stability and applicability of crop disease detection, is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0006] In view of this, the present invention provides a method and system for detecting crop diseases based on enhanced dynamic graph construction and multi-scale feature perception, aiming to solve the problems of severe leaf occlusion in field crop images, significant differences in lesion scale, discrete distribution of disease areas, easy loss of fine-grained lesion information, and insufficient global spatial relationship modeling in the prior art mentioned above.
[0007] To achieve the above objectives, the present invention adopts the following technical solution: a method for detecting crop diseases based on enhanced dynamic graph construction and multi-scale feature perception, comprising: Acquire field images of crops to be detected, and preprocess the field images of crops to obtain standardized input images; Feature extraction is performed on the standardized input image to extract image feature representations corresponding to crop leaf areas, lesion areas, and field background areas; Based on the image feature representation, an enhanced dynamic axis diagram based on quadrant sampling and node distance statistical thresholds is constructed to obtain global spatial relationship features; Based on the global spatial relationship features, multi-scale local disease features under different receptive fields are extracted, and the global spatial relationship features and the multi-scale local disease features are fused to obtain disease feature representation; The disease feature representation is subjected to attention enhancement and spatial context awareness processing, and the context information of spatial dimension and channel dimension is fused to obtain the final disease discrimination feature. The crop disease category detection result is output based on the disease discrimination feature.
[0008] Preferably, an enhanced dynamic axonogram based on quadrant sampling and node distance statistical thresholds is constructed based on the image feature representation to obtain global spatial relationship features, including: The local semantic regions in the image feature representation are mapped to graph nodes. The graph connection relationship is dynamically determined based on the feature distance between graph nodes. Dynamic graph convolution is performed through a dynamic graph structure to aggregate and update the features of adjacent graph nodes and related semantic nodes, thereby obtaining global spatial relationship features.
[0009] Preferably, multi-scale local disease features under different receptive fields are extracted based on the global spatial relationship features, and the global spatial relationship features and the multi-scale local disease features are fused to obtain a disease feature representation, including: The global spatial relationship features are input into a multi-kernel convolutional feedforward network. Multi-scale local disease features under different receptive fields are extracted through multiple convolutional branches with different kernel sizes. The network is then combined with spatial-depth convolution for downsampling to obtain a disease feature representation that integrates global spatial relationship and local disease information.
[0010] Preferably, feature extraction is performed on the standardized input image, and the image feature representations corresponding to the crop leaf area, lesion area, and field background area are extracted, including: The standardized input image is input into a visual graph neural network based on Greedy ViG. The visual graph neural network extracts features from local semantic regions in the standardized input image to obtain image feature representations for graph structure modeling.
[0011] Preferably, local semantic regions in the image feature representation are mapped to graph nodes, graph connectivity is dynamically determined based on feature distances between graph nodes, and dynamic graph convolution is performed through a dynamic graph structure to aggregate and update the features of adjacent graph nodes and related semantic nodes, including: The image feature representation is divided into multiple local semantic regions according to spatial location, and each local semantic region is mapped to a graph node, resulting in a node set composed of multiple graph nodes; Quadrant sampling is performed on the node set, representative node pairs located in different quadrants are selected, and the Euclidean distance between the representative node pairs is calculated; The mean distance μ and standard deviation distance σ are calculated based on the Euclidean distance between the representative node pairs, and the dynamic graph connection threshold is determined based on the mean distance μ and standard deviation distance σ. Calculate the Euclidean distance d(i,j) between any two graph nodes, where i represents the i-th graph node, j represents the j-th graph node, and d(i,j) represents the Euclidean distance between the i-th graph node and the j-th graph node; when d(i,j) < μ-σ, establish a graph connection between the corresponding two graph nodes to generate an enhanced dynamic axis graph; Dynamic graph convolution is performed on the enhanced dynamic axis graph, and the graph nodes are enhanced in position by combining conditional position encoding (CPE). The graph node representation is updated by adjacency node feature aggregation to obtain global spatial relationship features that characterize the spatial topological relationship between crop leaf region, lesion region and field background region.
[0012] Preferably, multi-scale local disease features under different receptive fields are extracted through multiple convolutional branches with different kernel sizes, and downsampling is performed in conjunction with spatial-depth convolution, including: The multi-kernel convolutional feedforward network expands the channels of the global spatial relationship features through pointwise convolution to obtain intermediate features; The intermediate features are divided into multiple parallel feature branches, and each parallel feature branch is convolved using depthwise convolution with different kernel sizes to extract local disease features under different receptive fields. The local disease features are spliced together and channel fusion is performed through point-by-point convolution to obtain multi-scale local enhancement features; The multi-scale local enhancement features are fused with the global spatial relationship features to obtain a disease feature representation that integrates global topological relationships and local lesion details.
[0013] Spatial-depth convolution is used for downsampling between adjacent feature processing stages to rearrange spatial neighborhood features to the channel dimension, and convolution is performed on the rearranged channel features to fuse them, so as to retain fine-grained feature information corresponding to small-scale lesions, scattered lesions and edge lesions while reducing the spatial resolution of the feature map.
[0014] Preferably, the disease feature representation is subjected to attention enhancement and spatial context awareness processing, and contextual information from both the spatial and channel dimensions is fused to obtain the final disease discrimination features, including: The disease feature representation is input into the SimAM attention unit, the attention weight of each feature response is calculated based on the neuron energy function, and the disease feature representation is weighted and enhanced using the attention weight to obtain attention-enhanced features; The attention enhancement features are input into the spatial context awareness module, and context information is extracted from the spatial dimension and the channel dimension respectively to obtain spatial context features and channel context features. The spatial context features and channel context features are fused to obtain the final disease discrimination features used to distinguish different disease categories; The final disease discrimination features are subjected to global pooling and fully connected classification processing to output the crop disease category detection results.
[0015] Preferably, a crop disease detection system based on enhanced dynamic graph construction and multi-scale feature perception includes: The image preprocessing module is used to acquire field images of crops to be detected and to preprocess the field images of crops to obtain standardized input images. The feature extraction module is used to extract features from the standardized input image, extracting image feature representations corresponding to crop leaf areas, lesion areas, and field background areas; An enhanced dynamic graph construction module is used to construct an enhanced dynamic axis graph based on quadrant sampling and node distance statistical thresholds based on the image feature representation, thereby obtaining global spatial relationship features; The multi-scale feature perception module is used to extract multi-scale local disease features under different receptive fields based on the global spatial relationship features, and to fuse the global spatial relationship features and the multi-scale local disease features to obtain a disease feature representation. The attention and spatial context modeling module is used to perform attention enhancement and spatial context awareness processing on the disease feature representation, and to fuse the context information of the spatial dimension and the channel dimension to obtain the final disease discrimination features. The classification output unit is used to output the crop disease category detection results based on the disease discrimination features.
[0016] As can be seen from the above technical solution, compared with the prior art, the present invention discloses a method and system for detecting crop diseases based on enhanced dynamic graph construction and multi-scale feature perception. The present invention has the following beneficial effects: (1) Based on the statistical relationship of feature distance between graph nodes, an enhanced dynamic axis graph is dynamically constructed, which enables adaptive graph connections to be formed between rice leaf area, lesion area and field background area, effectively enhancing the model's ability to express spatial topological relationships in complex field images; (2) Dynamic graph convolution is used to perform feature aggregation and information transmission on adjacent nodes in the enhanced dynamic axis graph, which can capture the long-distance correlation between lesion areas and non-lesion areas, and alleviate the problem that traditional local feature modeling is not adaptable to leaf occlusion and discrete disease distribution scenarios. (3) Introduce a multi-kernel convolutional feedforward network to extract local disease features under different receptive fields through parallel branches with different convolutional kernel sizes, thereby enhancing the model's ability to represent small lesions, edge lesions, irregular lesions and disease areas of different scales. (4) A spatial-to-depth convolutional downsampling mechanism is adopted to rearrange the spatial neighborhood information to the channel dimension and then perform convolutional fusion. This reduces the feature map resolution and computational cost while minimizing the information loss of small-scale and scattered lesions during the downsampling process. (5) The SimAM attention module is used to adaptively weight the disease features, improve the feature response of lesion areas, texture abnormal areas and color abnormal areas, and reduce the interference of complex background areas on the disease category judgment. (6) By jointly modeling the spatial and channel dimensions of context information through the spatial context perception module, the model’s ability to comprehensively express the spatial distribution and semantic features of rice disease areas is enhanced, thereby improving the accuracy, robustness and applicability of rice disease detection in complex field environments. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0018] Figure 1 This is a schematic diagram of a crop disease detection method based on enhanced dynamic graph construction and multi-scale feature perception provided by the present invention.
[0019] Figure 2 This is a schematic diagram illustrating the principle of the enhanced dynamic graph construction and multi-scale feature perception module provided in an embodiment of the present invention. Detailed Implementation
[0020] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0021] This invention discloses a method for detecting crop diseases based on enhanced dynamic graph construction and multi-scale feature perception, such as... Figure 1 As shown, it includes: S100: Obtain field images of crops to be detected, and preprocess the field images of crops to obtain standardized input images; S200. Perform feature extraction on the standardized input image to extract image feature representations corresponding to the crop leaf area, lesion area, and field background area; input the standardized input image into a feature extraction network based on a visual graph neural network (Vision GNN) to extract image feature representations corresponding to the crop leaf area, lesion area, and field background area. S300. Based on the image feature representation, construct an enhanced dynamic axis diagram based on quadrant sampling and node distance statistical thresholds to obtain global spatial relationship features; S400. Extract multi-scale local disease features under different receptive fields based on the global spatial relationship features, and fuse the global spatial relationship features and the multi-scale local disease features to obtain a disease feature representation; S500. The disease feature representation is subjected to attention enhancement and spatial context awareness processing to enhance the feature response of key lesion areas, texture abnormal areas and color abnormal areas, and the context information of spatial dimension and channel dimension is fused to obtain the final disease discrimination feature, and the crop disease category detection result is output according to the disease discrimination feature.
[0022] Specifically, the process involves acquiring field images of crops to be detected and preprocessing these images to obtain standardized input images, including: Acquire crop field images collected under complex field conditions, wherein the crop field images include at least the crop leaf area, the lesion area, and the field background area; The crop field images are subjected to size unification, center cropping, and normalization to obtain standardized input images with fixed resolution.
[0023] Specifically, based on the image feature representation, an enhanced dynamic axonogram based on quadrant sampling and node distance statistical thresholds is constructed to obtain global spatial relationship features, including: The local semantic regions in the image feature representation are mapped to graph nodes. The graph connection relationship is dynamically determined based on the feature distance between graph nodes. Dynamic graph convolution is performed through a dynamic graph structure to aggregate and update the features of adjacent graph nodes and related semantic nodes, thereby obtaining global spatial relationship features.
[0024] Specifically, based on the global spatial relationship features, multi-scale local disease features under different receptive fields are extracted, and the global spatial relationship features and the multi-scale local disease features are fused to obtain a disease feature representation, including: The global spatial relationship features are input into a multi-kernel convolutional feedforward network (MCFN). Multi-scale local disease features under different receptive fields are extracted through multiple convolutional branches with different kernel sizes. The features are then combined with spatial-depth convolution (SPD-Conv) for downsampling to obtain a disease feature representation that integrates global spatial relationship and local disease information.
[0025] Specifically, feature extraction is performed on the standardized input image, and the image feature representations corresponding to the crop leaf area, lesion area, and field background area are extracted, including: The standardized input image is input into a visual graph neural network based on Greedy ViG. The visual graph neural network extracts features from local semantic regions in the standardized input image to obtain image feature representations for graph structure modeling.
[0026] The output includes image feature representations containing leaf texture, lesion morphology, color differences, and background context information, which serve as input for the construction of enhanced dynamic axonograms.
[0027] Specifically, local semantic regions in the image feature representation are mapped to graph nodes. Graph connectivity is dynamically determined based on the feature distance between graph nodes. Dynamic graph convolution is performed through a dynamic graph structure to aggregate and update the features of adjacent graph nodes and related semantic nodes, including: The image feature representation is divided into multiple local semantic regions according to spatial location, and each local semantic region is mapped to a graph node, resulting in a node set composed of multiple graph nodes; Quadrant sampling is performed on the node set, representative node pairs located in different quadrants are selected, and the Euclidean distance between the representative node pairs is calculated; The mean distance μ and standard deviation distance σ are calculated based on the Euclidean distance between the representative node pairs, and the dynamic graph connection threshold is determined based on the mean distance μ and standard deviation distance σ. Calculate the Euclidean distance d(i,j) between any two graph nodes, where i represents the i-th graph node, j represents the j-th graph node, and d(i,j) represents the Euclidean distance between the i-th graph node and the j-th graph node; when d(i,j) < μ-σ, establish a graph connection between the corresponding two graph nodes to generate an enhanced dynamic axis graph; Dynamic graph convolution is performed on the enhanced dynamic axis graph, and the graph nodes are enhanced in position by combining conditional position encoding (CPE). The graph node representation is updated by adjacency node feature aggregation to obtain global spatial relationship features that characterize the spatial topological relationship between crop leaf region, lesion region and field background region.
[0028] Specifically, multi-scale local disease features under different receptive fields are extracted through multiple convolutional branches with different kernel sizes, and downsampling is performed in conjunction with spatial-depth convolution, including: The multi-kernel convolutional feedforward network expands the channels of the global spatial relationship features through pointwise convolution to obtain intermediate features; The intermediate features are divided into multiple parallel feature branches, and each parallel feature branch is convolved using depthwise convolution with different kernel sizes to extract local disease features under different receptive fields. The local disease features are spliced together and channel fusion is performed through point-by-point convolution to obtain multi-scale local enhancement features; The multi-scale local enhancement features are fused with the global spatial relationship features to obtain a disease feature representation that integrates global topological relationships and local lesion details.
[0029] Spatial-depth convolution is used for downsampling between adjacent feature processing stages to rearrange spatial neighborhood features to the channel dimension, and convolution is performed on the rearranged channel features to fuse them, so as to retain fine-grained feature information corresponding to small-scale lesions, scattered lesions and edge lesions while reducing the spatial resolution of the feature map.
[0030] Specifically, the disease feature representation is subjected to attention enhancement and spatial context awareness processing, and contextual information from both the spatial and channel dimensions is fused to obtain the final disease discrimination features, including: The disease feature representation is input into the SimAM attention unit, the attention weight of each feature response is calculated based on the neuron energy function, and the disease feature representation is weighted and enhanced using the attention weight to obtain attention-enhanced features; The attention enhancement features are input into the spatial context awareness module (SCAM) to extract context information from the spatial dimension and the channel dimension, respectively, to obtain spatial context features and channel context features. The spatial context features and channel context features are fused to obtain the final disease discrimination features used to distinguish different disease categories; The final disease discrimination features are subjected to global pooling and fully connected classification processing to output the crop disease category detection results.
[0031] This invention acquires complex field rice images, which are then uniformly sized, cropped, and normalized before being input into a feature extraction network based on a visual graph neural network to obtain leaf, lesion, and background features. Local semantic regions are mapped to graph nodes, and an enhanced dynamic axonogram is constructed based on node Euclidean distance and distance statistical thresholds. Global spatial relationship features are obtained through dynamic graph convolution. A multi-kernel convolutional feedforward network is then used to extract multi-scale local disease features, and spatial-depth convolution is combined to retain fine-grained lesion information. Finally, the discriminative features are fused using the SimAM attention mechanism and the SCAM spatial context awareness module to output the rice disease category. This method can improve the accuracy and robustness of disease detection in complex field environments.
[0032] In one specific embodiment of the present invention, a crop disease detection system based on enhanced dynamic graph construction and multi-scale feature perception includes: The image preprocessing module is used to acquire field images of crops to be detected and to preprocess the field images of crops to obtain standardized input images. The feature extraction module is used to extract features from the standardized input image, extracting image feature representations corresponding to crop leaf areas, lesion areas, and field background areas; An enhanced dynamic graph construction module is used to construct an enhanced dynamic axis graph based on quadrant sampling and node distance statistical thresholds based on the image feature representation, thereby obtaining global spatial relationship features; The multi-scale feature perception module is used to extract multi-scale local disease features under different receptive fields based on the global spatial relationship features, and to fuse the global spatial relationship features and the multi-scale local disease features to obtain a disease feature representation. The attention and spatial context modeling module is used to perform attention enhancement and spatial context awareness processing on the disease feature representation, and to fuse the context information of the spatial dimension and the channel dimension to obtain the final disease discrimination features. The classification output unit is used to output the crop disease category detection results based on the disease discrimination features.
[0033] In one specific embodiment of the present invention, such as Figure 1As shown, this embodiment uses the rice field image to be detected as input. This embodiment aims to solve the problems of overlapping and occlusion of rice leaves, significant differences in the scale of lesion areas, discrete spatial distribution of diseases, easy loss of fine-grained lesion information during downsampling, and difficulty in fully expressing global spatial topological relationships by traditional feature modeling methods in complex field environments.
[0034] Specifically, the rice disease detection method based on enhanced dynamic graph construction and multi-scale feature perception includes the following steps: S1, acquire the rice field image to be detected, preprocess the rice field image, and obtain image feature representation through a feature extraction network based on visual graph neural network.
[0035] Specifically, firstly, rice images collected in complex field environments are acquired. These images include at least rice leaf areas, lesion areas, and a field background area. The field background area may include soil, water bodies, weeds, other leaves, and areas affected by natural light interference. To ensure the images meet the input requirements of subsequent models, the rice field images are subjected to size standardization, center cropping, and normalization to obtain a standardized input image with a fixed resolution. As an optional implementation, the resolution of the standardized input image is set to 224×224 pixels, but the invention is not limited to this specific resolution. Those skilled in the art can adjust the input size according to the model size, detection accuracy requirements, and computing power of the deployed equipment.
[0036] After preprocessing, the standardized input image is input into a visual graph neural network based on Greedy ViG for feature extraction to obtain image feature representation. In this embodiment, the improved visual graph neural network adopts a hierarchical feature extraction structure, including a shallow feature extraction unit, an enhanced dynamic graph convolution unit, a multi-kernel convolutional feedforward network, a spatial-depth convolutional downsampling unit, an attention enhancement unit, and a spatial context-aware unit.
[0037] Specifically, the standardized input image is first downsampled using a convolutional layer with a kernel size of 3×3 and a stride of 2. Then, shallow visual features corresponding to the rice leaf edges, leaf texture, lesion color, and lesion morphology are extracted sequentially through a batch normalization layer and a GELU activation layer. Subsequently, these shallow visual features are input into a hierarchical feature processing stage. Local texture information is extracted using a moving inverse residual convolutional unit, and the SimAM attention unit is used to enhance the feature responses of lesion regions, texture abnormalities, and color abnormalities.
[0038] In the hierarchical feature processing, local semantic regions in image features are mapped as graph nodes. The spatial relationship between rice leaf regions, lesion regions and field background regions is modeled by enhancing dynamic graph convolutional units. At the same time, multi-scale local disease features under different receptive fields are extracted by multi-kernel convolutional feedforward networks, and spatial-depth convolution is used for downsampling between adjacent feature processing stages to reduce the loss of features of small lesions, edge lesions and scattered lesions.
[0039] After the above processing, an image feature representation containing rice leaf texture, lesion morphology, lesion color differences, disease spatial distribution, and field background context information is obtained. This image feature representation is then used as input for subsequent enhanced dynamic axonometric plot construction and disease feature extraction. The specific processing steps for enhanced dynamic plot construction, multi-scale feature extraction, attention enhancement, and spatial context awareness are further explained in S2, S3, and S4, respectively.
[0040] S2: Receive the image feature representation output from step S1, construct an enhanced dynamic axonometric graph based on the image feature representation, and obtain global spatial relationship features through dynamic graph convolution. This embodiment of the invention converts local semantic regions in a rice image into a graph structure and dynamically establishes graph connections based on the feature relationships between nodes. For example... Figure 2 As shown, the specific process includes the following steps: S2.1, Local semantic regions are mapped to graph nodes: The image feature representation obtained in S1 is divided into multiple local semantic regions. Each local semantic region corresponds to a local visual unit in the rice image. The local visual unit may contain leaf texture, lesion morphology, color changes, or background context information. Each local semantic region is mapped to a graph node, resulting in a graph node set. ; in, Represents the set of graph nodes. Indicates the number of nodes in the graph. This represents the feature vector corresponding to the i-th graph node. Through this process, the original image features are transformed into node representations suitable for graph structure modeling.
[0041] S2.2, Quadrant sampling and distance calculation of representative nodes: Specifically, the feature map is divided into four quadrants according to spatial location. Representative node pairs are selected from the diagonal quadrant or the corresponding region obtained by flipping the quadrant, and the Euclidean distance between the representative node pairs is calculated. For any two graph nodes... and Its Euclidean distance is expressed as: ; in, This represents the i-th graph node. This represents the j-th graph node. and These represent the feature vectors of the corresponding nodes. Represents the L2 norm, This represents the Euclidean distance between two graph nodes.
[0042] S2.3, Determining the dynamic connection threshold: Calculate the mean node distance based on the representative node pair distances obtained from quadrant sampling. and standard deviation of node distance .in, Used to characterize the overall level of distance between feature nodes in the current input image. Used to characterize the discreteness of node distance distribution. According to the... and Determine the connection conditions for the dynamic graph: ; When node With nodes When the Euclidean distance between nodes meets the condition, a graph connection is established between the corresponding two graph nodes; otherwise, no graph connection is established. This generates an enhanced dynamic axonogram. This dynamic graph construction method allows different input images to have different numbers and distributions of graph connections, making it more suitable for describing the discrete distribution of lesions and regional associations under leaf shading conditions compared to methods with a fixed number of connections.
[0043] S2.4, Dynamic Graph Convolution Feature Update: After obtaining the enhanced dynamic axis graph, a dynamic graph module is used for node feature updating. The dynamic graph module includes conditional position encoding and dynamic graph convolution operations. For the input features... The dynamic graph convolution update process is represented as: ; in, This represents the node features input to the dynamic graph module. This represents conditional location encoding, used to supplement spatial location information in node features; This represents a dynamic graph convolution operation, used to aggregate information between nodes based on dynamically generated graph connection relationships; and Indicates the weights of the fully connected layer; This represents the GeLU activation function; This represents the features updated after dynamic graph convolution. Through the above processing, the model can transfer feature information between lesion regions, leaf regions, and background regions, obtaining feature representations that include global spatial topological relationships.
[0044] S3, the global spatial relationship features are input into a multi-kernel convolutional feedforward network, and downsampling is performed using spatial-depth convolution to obtain the disease feature representation. This step is used to enhance the model's ability to express local features of lesion regions at different scales, and to preserve fine-grained lesion information as much as possible during the downsampling process.
[0045] S3.1, Multi-scale local disease feature perception: The global spatial relationship features obtained from S2 are input into a multi-kernel convolutional feedforward network. The multi-kernel convolutional feedforward network first expands the input features through pointwise convolution to obtain high-dimensional intermediate features; then, it uses multi-kernel depthwise convolution to divide the intermediate features into multiple feature heads, and uses different sized depthwise convolution kernels in different feature heads to extract multi-scale local information; finally, it reduces the feature dimension to the target number of channels through pointwise convolution, generating multi-scale local enhancement features. This process is represented as: ; in, This represents the features of the input multi-kernel convolutional feedforward network. This indicates a pointwise convolution operation. This indicates a multi-kernel depthwise convolution operation. This represents the GeLU activation function. This represents the output features after multi-scale local enhancement.
[0046] Specifically, the multi-kernel depthwise convolution includes 3×3, 5×5, and 7×7 convolution branches, which are represented as follows: ; ; ; in, This represents the intermediate features after channel expansion. , and These represent depthwise convolution operations with kernel sizes of 3×3, 5×5, and 7×7, respectively. This indicates the characteristics of small-scale, localized diseases. This indicates the characteristics of localized diseases at the mesoscale. This indicates the spatial distribution characteristics of diseases within a larger susceptible field.
[0047] The features extracted from different branches are concatenated and fused through pointwise convolution to obtain multi-scale local enhancement features: ; in, This indicates a feature concatenation operation. This indicates a pointwise convolution operation. This represents the fused multi-scale local enhancement features. The multi-scale local enhancement features are then fused with the global spatial relationship features obtained in S2 to obtain a disease feature representation that integrates global topological relationships and local lesion details.
[0048] S3.2, Spatial-Depth Convolution Downsampling and Fine-Grained Information Preservation: Spatial-depth convolution is used for downsampling between adjacent feature processing stages. For the input feature map... When the scaling factor is 2, the input feature map is divided into four sub-feature maps according to spatial location: ; ; ; ; in, Indicates the spatial size of the input feature map. This indicates that a slice operation is performed based on the spatial index. , , and This represents the four sub-feature maps obtained by rearranging from spatial to depth.
[0049] Subsequently, the four sub-feature maps are concatenated along the channel dimension to obtain the rearranged feature map: ; If the input feature map size is: ; After rearranging from space to depth, we get: ; in, This represents the number of channels in the input feature map. Then, a convolutional layer with a stride of 1 is applied... Perform convolutional fusion to obtain the output features: ; in, This represents the number of output channels after convolutional fusion, and The channel configuration can be set according to the network stage. Since the stride of the convolutional layer is 1, it will not further reduce the spatial resolution. In this way, the model can transfer local neighborhood information to the channel dimension while reducing the feature map resolution, thereby reducing the information loss of small-scale lesions, edge lesions, and scattered lesions during the downsampling process.
[0050] S4, perform attention enhancement and spatial context awareness processing on the disease feature representation, and output the rice disease category detection results.
[0051] S4.1, SimAM Attention Weight Generation and Lesion Feature Enhancement: The disease feature representation is input into the SimAM attention unit. SimAM generates three-dimensional attention weights by calculating the importance of each neuron without introducing additional learnable parameters. Let the target neuron be... The mean and variance of other neurons within the channel in which it resides are expressed as follows: and The regularization coefficient is expressed as The minimum energy corresponding to the target neuron is expressed as: ; in, Represents the target neuron The minimum energy value. A lower energy value indicates a more significant difference between the neuron and its surrounding neurons, thus indicating higher importance. Attention weights are generated based on the energy values of all neurons, and the input features are then weighted for enhancement. ; in, This indicates the characteristics of the input SimAM module. This represents the set of energy consisting of the minimum energy values of all neurons. This represents the Sigmoid activation function. This represents element-wise multiplication. This represents the features enhanced by attention. Through this process, the model is able to enhance the response of lesion areas, texture abnormalities, and color abnormalities.
[0052] S4.2, Spatial Context Awareness and Channel Semantics Fusion: The attention-enhanced features are input into the spatial context-aware module. This module includes a global feature extraction branch, a value branch, and a query-key relationship modeling branch. The global feature extraction branch extracts global context descriptions using global average pooling and global max pooling; the value branch performs a linear transformation on the input features using a 1×1 convolution; and the query-key relationship modeling branch simplifies the calculation of inter-pixel relationships using a 1×1 convolution. Subsequently, the global context branch and the spatial relationship branch are multiplied with the value branch to obtain cross-channel context information and cross-spatial context information, respectively. These are then fused using a broadcast Hadamard product to generate the output features of the spatial context-aware module.
[0053] Let the input feature of the k-th pixel in the j-th level feature map be... The output features are The spatial context awareness process can be represented as: ; in, This represents the output features of the spatial context-aware module. Indicates input features, This represents the channel context weights obtained by global average pooling and global max pooling. This represents the spatial context features obtained from the spatial relationship modeling branch and the Value branch. The channel context weights can be represented in the following form: ; in, Indicates global average pooling. Indicates global max pooling. This indicates the result of combining the two elements. This represents the parameters of a 1×1 convolution or linear projection. This module enables the model to simultaneously capture the contextual relationships of both the channel and spatial dimensions, suppress interference from complex backgrounds such as water bodies, soil, and weeds, and improve the ability to distinguish between diseased and non-disease-affected areas.
[0054] Based on the above processes S1 to S4, this embodiment constructs an end-to-end detection process from inputting rice field images to outputting disease categories.
[0055] In one specific embodiment of the present invention, a rice disease detection system based on enhanced dynamic graph construction and multi-scale feature perception is disclosed, corresponding to a rice disease detection method based on enhanced dynamic graph construction and multi-scale feature perception. The system includes: The image preprocessing module is used to acquire rice field images to be detected, and to perform size unification, center cropping and normalization processing on the rice field images to obtain standardized input images; The feature extraction module is used to input the standardized input image into a feature extraction network based on a visual graph neural network to obtain image feature representations. These image feature representations are used to characterize rice leaf texture, lesion morphology, lesion color differences, and field background context information, providing basic feature inputs for subsequent construction of enhanced dynamic images.
[0056] An enhanced dynamic graph construction module is used to map local semantic regions in the image feature representation to graph nodes, and dynamically determine graph connectivity based on the feature distance between graph nodes to construct an enhanced dynamic axon graph. Specifically, this module includes a local semantic region partitioning unit, a graph node mapping unit, a quadrant sampling unit, a distance statistics unit, a dynamic graph connection generation unit, and a dynamic graph convolution unit. The local semantic region partitioning unit divides the input feature map into multiple local semantic regions; the graph node mapping unit maps each local semantic region to a corresponding graph node; the quadrant sampling unit performs four-quadrant sampling on the graph nodes to select representative node pairs; the distance statistics unit calculates the Euclidean distance between representative node pairs and obtains the mean node distance μ and the standard deviation of node distance σ; the dynamic graph connection generation unit generates graph edge connections based on the connection condition d(i,j) < μ-σ; and the dynamic graph convolution unit combines conditional position coding (CPE) to perform feature aggregation and update on the graph nodes in the enhanced dynamic axon graph to obtain global spatial relationship features.
[0057] A multi-scale feature perception module is used to receive the global spatial relationship features and extract multi-scale local lesion features under different receptive fields through a multi-kernel convolutional feedforward network. This module includes a channel expansion unit, a multi-kernel deep convolution unit, a feature concatenation unit, a channel fusion unit, and a spatial-depth convolutional downsampling module. Specifically, the channel expansion unit expands the input features through pointwise convolution; the multi-kernel deep convolution unit extracts local lesion features under small-scale, medium-scale, and large receptive fields using depth convolutions with different kernel sizes; the feature concatenation unit concatenates the features output from different convolutional branches; the channel fusion unit fuses multi-scale local features through pointwise convolution; and the spatial-depth convolutional downsampling unit rearranges spatial neighborhood features to the channel dimension and performs feature fusion through a convolutional layer with a stride of 1, thereby reducing the spatial resolution of the feature map while preserving fine-grained lesion information.
[0058] The attention and spatial context enhancement module is used to enhance the attention and spatial context awareness of the disease feature representation. This module includes a SimAM attention unit and a spatial context awareness unit. The SimAM attention unit calculates the importance weights of feature responses based on the neuron energy function and weights the features corresponding to lesion areas, texture anomaly areas, and color anomaly areas. The spatial context awareness unit obtains spatial and channel dimension context information through global average pooling, global max pooling, 1×1 convolution, value branch, and query-key relationship modeling branch, and fuses the two to obtain the final disease discrimination features. Through this module, the system can improve its ability to focus on key disease areas and reduce the interference of field background factors such as water bodies, soil, weeds, and light changes on the detection results.
[0059] The classification output module receives the final disease discrimination features, performs global pooling and fully connected classification processing on the final disease discrimination features, and outputs the rice disease category detection results. The rice disease categories can be set according to the actual application scenario and training dataset, including rice blast, brown spot, bacterial leaf blight, bacterial leaf streak, normal category, and other rice leaf disease categories.
[0060] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to the method section.
[0061] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for detecting crop diseases based on enhanced dynamic graph construction and multi-scale feature perception, characterized in that, include: Acquire field images of crops to be detected, and preprocess the field images of crops to obtain standardized input images; Feature extraction is performed on the standardized input image to extract image feature representations corresponding to crop leaf areas, lesion areas, and field background areas; Based on the image feature representation, an enhanced dynamic axis diagram based on quadrant sampling and node distance statistical thresholds is constructed to obtain global spatial relationship features; Based on the global spatial relationship features, multi-scale local disease features under different receptive fields are extracted, and the global spatial relationship features and the multi-scale local disease features are fused to obtain disease feature representation; The disease feature representation is subjected to attention enhancement and spatial context awareness processing, and the context information of spatial dimension and channel dimension is fused to obtain the final disease discrimination feature. The crop disease category detection result is output based on the disease discrimination feature.
2. The crop disease detection method based on enhanced dynamic graph construction and multi-scale feature perception according to claim 1, characterized in that, Based on the image feature representation, an enhanced dynamic axis diagram is constructed based on quadrant sampling and node distance statistical thresholds to obtain global spatial relationship features, including: The local semantic regions in the image feature representation are mapped to graph nodes. The graph connection relationship is dynamically determined based on the feature distance between graph nodes. Dynamic graph convolution is performed through a dynamic graph structure to aggregate and update the features of adjacent graph nodes and related semantic nodes, thereby obtaining global spatial relationship features.
3. The crop disease detection method based on enhanced dynamic graph construction and multi-scale feature perception according to claim 1, characterized in that, Based on the global spatial relationship features, multi-scale local disease features under different receptive fields are extracted, and the global spatial relationship features and the multi-scale local disease features are fused to obtain a disease feature representation, including: The global spatial relationship features are input into a multi-kernel convolutional feedforward network. Multi-scale local disease features under different receptive fields are extracted through multiple convolutional branches with different kernel sizes. The network is then combined with spatial-depth convolution for downsampling to obtain a disease feature representation that integrates global spatial relationship and local disease information.
4. The crop disease detection method based on enhanced dynamic graph construction and multi-scale feature perception according to claim 1, characterized in that, Feature extraction is performed on the standardized input image, and the image feature representations corresponding to the crop leaf area, lesion area, and field background area are extracted, including: The standardized input image is input into a visual graph neural network based on Greedy ViG. The visual graph neural network extracts features from local semantic regions in the standardized input image to obtain image feature representations for graph structure modeling.
5. The crop disease detection method based on enhanced dynamic graph construction and multi-scale feature perception according to claim 2, characterized in that, The local semantic regions in the image feature representation are mapped to graph nodes. Graph connectivity is dynamically determined based on the feature distance between graph nodes. Dynamic graph convolution is performed using a dynamic graph structure to aggregate and update the features of adjacent graph nodes and related semantic nodes, including: The image feature representation is divided into multiple local semantic regions according to spatial location, and each local semantic region is mapped to a graph node, resulting in a node set composed of multiple graph nodes; Quadrant sampling is performed on the node set, representative node pairs located in different quadrants are selected, and the Euclidean distance between the representative node pairs is calculated; The mean distance μ and standard deviation distance σ are calculated based on the Euclidean distance between the representative node pairs, and the dynamic graph connection threshold is determined based on the mean distance μ and standard deviation distance σ. Calculate the Euclidean distance d(i,j) between any two graph nodes, where i represents the i-th graph node, j represents the j-th graph node, and d(i,j) represents the Euclidean distance between the i-th graph node and the j-th graph node; when d(i,j) < μ-σ, establish a graph connection between the corresponding two graph nodes to generate an enhanced dynamic axis graph; Dynamic graph convolution is performed on the enhanced dynamic axis graph, and the graph nodes are enhanced in position by combining conditional position encoding (CPE). The graph node representation is updated by adjacency node feature aggregation to obtain global spatial relationship features that characterize the spatial topological relationship between crop leaf region, lesion region and field background region.
6. The crop disease detection method based on enhanced dynamic graph construction and multi-scale feature perception according to claim 3, characterized in that, Multi-scale local disease features under different receptive fields are extracted through multiple convolutional branches with different kernel sizes, and downsampling is performed by combining spatial-depth convolution, including: The multi-kernel convolutional feedforward network expands the channels of the global spatial relationship features through pointwise convolution to obtain intermediate features; The intermediate features are divided into multiple parallel feature branches, and each parallel feature branch is convolved using depthwise convolution with different kernel sizes to extract local disease features under different receptive fields. The local disease features are spliced together and channel fusion is performed through point-by-point convolution to obtain multi-scale local enhancement features; The multi-scale local enhancement features are fused with the global spatial relationship features to obtain a disease feature representation that integrates global topological relationships and local lesion details.
7. The crop disease detection method based on enhanced dynamic graph construction and multi-scale feature perception according to claim 1, characterized in that, The disease feature representation is subjected to attention enhancement and spatial context awareness processing, and contextual information from both spatial and channel dimensions is fused to obtain the final disease discrimination features, including: The disease feature representation is input into the SimAM attention unit, the attention weight of each feature response is calculated based on the neuron energy function, and the disease feature representation is weighted and enhanced using the attention weight to obtain attention-enhanced features; The attention enhancement features are input into the spatial context awareness module, and context information is extracted from the spatial dimension and the channel dimension respectively to obtain spatial context features and channel context features. The spatial context features and channel context features are fused to obtain the final disease discrimination features used to distinguish different disease categories; The final disease discrimination features are subjected to global pooling and fully connected classification processing to output the crop disease category detection results.
8. A crop disease detection system based on enhanced dynamic graph construction and multi-scale feature perception, employing the crop disease detection method based on enhanced dynamic graph construction and multi-scale feature perception as described in any one of claims 1-7, characterized in that, include: The image preprocessing module is used to acquire field images of crops to be detected and to preprocess the field images of crops to obtain standardized input images. The feature extraction module is used to extract features from the standardized input image, extracting image feature representations corresponding to crop leaf areas, lesion areas, and field background areas; An enhanced dynamic graph construction module is used to construct an enhanced dynamic axis graph based on quadrant sampling and node distance statistical thresholds based on the image feature representation, thereby obtaining global spatial relationship features; The multi-scale feature perception module is used to extract multi-scale local disease features under different receptive fields based on the global spatial relationship features, and to fuse the global spatial relationship features and the multi-scale local disease features to obtain a disease feature representation. The attention and spatial context modeling module is used to perform attention enhancement and spatial context awareness processing on the disease feature representation, and to fuse the context information of the spatial dimension and the channel dimension to obtain the final disease discrimination features. The classification output unit is used to output the crop disease category detection results based on the disease discrimination features.