A crop disease diagnosis method fusing spatial multi-scale perception and environment decoupling

By combining large-kernel deep convolution and small-kernel convolution, along with channel attention and adversarial training, environmental information is extracted from disease features, solving the problem of insufficient generalization performance of UAV remote sensing crop disease identification technology under multiple environmental conditions, and achieving stable disease diagnosis and environmental monitoring.

CN122176583APending Publication Date: 2026-06-09SICHUAN SHUSHENG INTELLIGENT TECHNOLOGY CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SICHUAN SHUSHENG INTELLIGENT TECHNOLOGY CO LTD
Filing Date
2026-05-11
Publication Date
2026-06-09

AI Technical Summary

Technical Problem

Existing UAV remote sensing crop disease identification technology has insufficient generalization performance under multi-temporal and multi-environmental conditions, making it difficult to effectively decouple disease features from environmental features in remote sensing images, resulting in a decrease in identification accuracy.

Method used

We adopt a method that integrates spatial multi-scale perception and environmental decoupling. We generate spatial weight maps through large-kernel deep convolution and dynamically generate small-kernel convolution kernels. By combining channel attention modules and adversarial training, we can remove environmental information from disease features. We then use mutual information minimization and counterfactual reinforcement learning to achieve the extraction of environmentally independent disease features.

Benefits of technology

It maintains stable disease diagnosis accuracy under multiple temporal and environmental conditions, improves the model's generalization performance, and provides environmental features for monitoring farmland growth environment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122176583A_ABST
    Figure CN122176583A_ABST
Patent Text Reader

Abstract

This invention discloses a crop disease diagnosis method that integrates spatial multi-scale perception with environmental decoupling, belonging to the field of agricultural remote sensing image processing technology. It utilizes large-kernel deep convolution to perform wide-area spatial perception on remote sensing images, generating a spatial weight map encoding global environmental background information. Subsequently, the spatial weight map is reshaped into a dynamic convolution kernel, driving small-kernel group convolution to perform context-adaptive fine-grained disease texture extraction within local neighborhoods, achieving cross-scale feature collaborative modeling. Deep features are decomposed into disease features and environmental features. Adversarial training using gradient inversion layers forces disease features to be free from environmental interference, and mutual information minimization and counterfactual reinforcement learning eliminate environmental spurious correlations, ultimately obtaining robust disease diagnosis results to environmental changes. This invention effectively solves the problem of insufficient generalization performance of existing technologies under varying environmental conditions and has significant application value in multi-temporal and multi-plot agricultural remote sensing monitoring scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of agricultural remote sensing image processing technology, specifically a crop disease diagnosis method that integrates spatial multi-scale perception and environmental decoupling. Background Technology

[0002] Unmanned aerial vehicle (UAV) remote sensing platforms, with their advantages of high timeliness, high spatial resolution, and flexible deployment, have become an important technical means for crop health monitoring in precision agriculture. In recent years, deep learning-based remote sensing image interpretation methods have made some progress in the field of crop disease identification. However, in actual agricultural applications, the acquisition process of UAV remote sensing data is dynamically affected by multiple environmental factors such as light intensity, imaging time, crop growth stage, soil background, and cloud cover. Changes in environmental conditions can alter the spectral reflectance characteristics, texture distribution, and signal-to-noise ratio of images, leading to uncertain shifts in data distribution depending on the acquisition conditions. Existing models such as convolutional neural networks, recurrent neural networks, and Transformers typically rely on the assumption that the distribution of training and testing data is consistent, resulting in a sharp decline in recognition accuracy under unknown environmental conditions across different time periods and plots.

[0003] The core reason for these problems lies in the fact that existing models struggle to effectively decouple disease features from environmental features in remote sensing images. The disease and environmental information extracted by the models are intertwined, establishing a spurious correlation between disease type and specific environmental conditions. When the acquisition environment changes, this spurious correlation immediately fails, significantly reducing diagnostic performance. Furthermore, crop remote sensing images contain both large-scale spatial background features related to the environment, such as soil texture and overall canopy reflectivity, and fine-grained textures and color spots caused by localized diseases. Traditional convolutional networks, limited by their fixed receptive field, struggle to simultaneously capture cross-scale spatial semantic information. While attention mechanisms can model global dependencies, they suffer from high computational complexity and insufficient sensitivity to subtle local lesions. Moreover, although domain adaptation and transfer learning methods attempt to alleviate cross-environment recognition problems, they often rely on partially labeled data of the target environment or require a high degree of alignment between the source and target domain feature spaces, which presents significant limitations in the dynamic field environment.

[0004] Therefore, how to extract environmentally independent robust disease characteristics from remote sensing images coupled with environmental factors and establish a stable correlation between disease types and image features is a key technical problem that urgently needs to be solved in the field of intelligent agricultural remote sensing diagnosis. Summary of the Invention

[0005] The purpose of this invention is to provide a crop disease diagnosis method that integrates spatial multi-scale perception and environmental decoupling, so as to solve the problem of insufficient generalization performance of existing UAV remote sensing crop disease identification technology under multi-temporal and multi-environmental conditions.

[0006] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows: A method for diagnosing crop diseases that integrates spatial multi-scale perception with environmental decoupling includes the following steps: Step S1: Acquire remote sensing images of the crop to be diagnosed; Step S2: Process the remote sensing image using a feature extraction network. The feature extraction network includes at least one sensing and focusing module, which performs the following operations: Step S201: Perform a large kernel depthwise convolution on the input feature map to generate a spatial weight map; Step S202: Generate a small kernel convolutional kernel that dynamically changes with spatial location based on the spatial weight map; Step S203: Perform grouped convolution on the local neighborhood of the input feature map using dynamically changing small kernel convolution to obtain a refined feature map; Step S204: Decompose the deep features output by the feature extraction network into disease features and environmental features, and maximize the environmental discrimination loss of disease features through adversarial training to obtain environmentally independent disease features. Step S3: Output crop disease categories based on environmentally independent disease characteristics.

[0007] Based on the above technical solution, a spatial weight map is generated by performing a large-kernel depthwise convolution on the input feature map, specifically as follows: Let the input feature map be:

[0008] in This indicates that each element in this tensor is a real number, B is the batch size, C is the number of channels, and H×W is the spatial size; First, the number of channels is compressed to C / 2 using 1×1 pointwise convolution. After batch normalization and activation functions, a kernel size of [missing value] is used. Two-dimensional deep convolution extracts large-scale contextual features. The spatial size of the large convolutional kernel is represented, and then another 1×1 pointwise convolution is used to map the number of channels to D, resulting in a spatial weight map. .

[0009] According to the above technical solution, generating a small-kernel convolutional kernel that dynamically changes with spatial location based on a spatial weight graph includes: reshaping the spatial weight graph W into a dynamic convolutional kernel tensor. Where G is the number of channel groups, Let L = H × W be the kernel size, and W be the total number of spatial locations. For each spatial location P, the corresponding dynamic convolution kernel is... .

[0010] According to the above technical solution, a dynamically changing small kernel convolution is used to perform grouped convolution on the local neighborhood of the input feature map, specifically: Divide the input feature map X into G groups according to channels. For each group... And for each spatial location P, the corresponding dynamic convolution kernel is used. In the local neighborhood of position P Internal convolution operations are performed to extract fine-grained disease texture features.

[0011] According to the above technical solution, the sensing and focusing module also includes: A channel attention module is introduced after the fine feature map to enhance the response of key channels; and the input feature map is added to the output of the channel attention module through residual connection to preserve global context information.

[0012] Based on the above technical solution, the deep features are decomposed into disease features and environmental features, specifically: The deep features F are input into two independent encoders, each consisting of a 1×1 pointwise convolution, a batch normalization layer, and an activation function, and outputting the disease features respectively. and environmental characteristics .

[0013] According to the above technical solution, adversarial training maximizes the environmental discrimination loss of disease characteristics, including: Environmental characteristics Input environment discriminator to predict environment state labels; Disease characteristics The gradient is input into the environment discriminator through the gradient inversion layer. During backpropagation, the gradient inversion layer multiplies the gradient by a negative coefficient, so that the optimization direction of the disease features is to increase the environmental discrimination loss, thereby stripping the environmental information from the disease features.

[0014] According to the above technical solution, mutual information minimization operation is also included: Disease characteristics are calculated using a mutual information estimation network. With environmental characteristics The upper bound of mutual information between them is determined, and this upper bound is minimized during training to enhance the statistical independence between them.

[0015] According to the above technical solution, the training process also includes a counterfactual reinforcement learning step: [This step involves analyzing disease characteristics]. Some channels or spatial locations are randomly masked with probability P. The classification loss is calculated based on the disease features after masking, so as to force the model to learn feature expressions that have causal stability with the disease type.

[0016] Based on the above technical solution, the method uses a joint loss function for optimization during the training phase. The joint loss function is as follows:

[0017] in, For crop disease classification cross-entropy loss, To combat environmental damage, To minimize the loss of mutual information, To exaggerate the damage by counterfactual means, , , To balance the hyperparameters.

[0018] Compared with the prior art, the present invention has the following beneficial effects: This invention uses large-kernel deep convolution to perceive large-scale environmental backgrounds such as canopy structure and illumination, and dynamically generates small-kernel convolution parameters accordingly. This enables cross-scale feature collaborative extraction, capturing both global spatial semantics and focusing on local lesion details, resulting in more complete feature representation.

[0019] Furthermore, the large kernel perception of this invention adopts computationally efficient deep convolution, while the small kernel focusing only operates within a very small neighborhood. Compared with stacking large kernel CNNs or using Transformer, it effectively controls the computational overhead and is suitable for the real-time processing needs of UAV edge computing platforms.

[0020] Furthermore, the environmental decoupling module of this invention removes environmental interference from features through adversarial training and mutual information minimization, and counterfactual reinforcement learning further eliminates spurious correlations, enabling the model to maintain stable diagnostic accuracy under multiple temporal and environmental conditions. Fourth, the environmental features obtained from decoupling can be simultaneously output for monitoring farmland growth environment, providing agronomic interpretation for diagnostic decisions. Attached Figure Description

[0021] Figure 1 This is a flowchart of the crop disease diagnosis method of the present invention; Figure 2 This is a flowchart of the data processing of the feature extraction network of the present invention. Detailed Implementation

[0022] 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.

[0023] Example 1 This embodiment provides a crop disease diagnosis method that integrates spatial multi-scale perception with environmental decoupling. Its overall process is as follows: Figure 1 As shown.

[0024] Step 1: Data Acquisition and Preprocessing. First, raw remote sensing images of crops are acquired using a multispectral sensor mounted on a drone. A RedEdge-MX or similar multispectral sensor can be used, capable of simultaneously acquiring red, green, blue, red-edge, and near-infrared band images, providing rich spectral information for disease identification. This embodiment uses the publicly available PlantPathology dataset for validation. This dataset originates from the FGVC series of competitions and contains high-resolution RGB images of apple leaf diseases, covering healthy apples, black spot disease, rust, and various compound disease categories. The dataset was collected over different seasons and weather conditions, naturally encompassing significant differences in light intensity, shooting angle, and background complexity. Based on the light condition information in the image acquisition metadata, the data is divided into sunny strong light, cloudy diffused light, and overcast weak light groups to construct experimental scenarios with multiple environmental variations, used to verify the model's generalization performance under varying environmental conditions.

[0025] In the preprocessing stage, the original images were uniformly scaled to 256×256 pixels. This size selection comprehensively considered the spatial scale of typical disease spots in UAV remote sensing imagery. Under flight altitude conditions of 30 to 50 meters, a 256×256 pixel patch can cover a ground area of ​​approximately 2 meters × 2 meters to 3 meters × 3 meters, which is sufficient to completely contain the canopy information of single or multiple crops while preserving the texture details of the disease spots. The pixel values ​​of each sample were normalized, linearly mapping the pixel values ​​of each band to the [0,1] interval to eliminate the impact of differences in the numerical range of different bands on the model training convergence speed. Subsequently, a hierarchical random partitioning strategy was adopted, dividing the dataset into training and test sets in a 7:3 ratio to ensure that the distribution ratio of each environmental condition group and each disease category in the training and test sets is consistent, avoiding performance evaluation distortion due to data partitioning bias.

[0026] Step two, construction of the feature extraction network. The feature extraction network consists of multiple stacked perceptual focusing modules. The input feature map size is [B, C, 256, 256], where B is the training batch size and C is the number of input channels. In this embodiment, for RGB image applications, C = 3; if multispectral images are used, C corresponds to the number of bands.

[0027] like Figure 2 As shown, in each perception focusing module, the input feature map is first processed. A large kernel sensing operation is performed. Specifically, the number of channels is compressed to C / 2 using a 1×1 pointwise convolution, which aims to reduce the computational cost of subsequent depthwise convolutions. The compressed feature map is then passed through a batch normalization layer and the GELU activation function. Batch normalization accelerates training convergence and stabilizes gradient propagation, while the GELU activation function provides a smoother gradient response than ReLU while maintaining non-linearity, which is beneficial for training with large kernel convolutions. Subsequently, the kernel size is adjusted. A 2D depthwise convolution is used for channel-wise large-scale spatial scanning. The number of groups in this convolution is equal to the number of input channels, meaning each channel undergoes independent spatial convolution, with only 11×11×C / 2 parameters, far smaller than a standard convolution with the same receptive field. Convolution padding is set to 5 to ensure the spatial resolution of the output feature map matches that of the input. This large-kernel depthwise convolution can cover a receptive field of approximately 11×11 pixels, corresponding to a contextual range about 1.1 times the patch size in the original image, effectively capturing global environmental features driven by vegetation canopy structure, soil background distribution, and lighting conditions. Subsequently, another 1×1 pointwise convolution maps the number of channels to D, generating a spatial weight map. In this embodiment, D=C is chosen so that the number of channels in the output weight map is consistent with that in the input feature map, which facilitates dimension matching for subsequent group convolutions.

[0028] Next, the spatial weight graph W is reshaped into a dynamic convolution kernel tensor. The number of groups G is taken as C / 8, and the small core size is... L = H × W represents the total number of spatial locations. The choice of the number of groups G here strikes a balance between parameter efficiency and feature diversity: a smaller G allows each group to have more dynamic parameters, enhancing local modeling capabilities; a larger G reduces the number of parameters and computational cost. Setting the kernel size to 3 is a typical choice for local texture extraction, capable of suppressing noise interference while maintaining detail sensitivity. After dividing the input feature map X into G groups according to channels, for each group... and each spatial location Using the corresponding dynamic convolution kernel Convolution is performed within a 3×3 local neighborhood of location p. Since each spatial location corresponds to an independent dynamic convolution kernel, this operation adaptively adjusts the local feature aggregation method based on the contextual information provided by the large kernel. In smooth background regions, the convolution kernel tends to perform mean filtering to suppress noise; in lesion edge regions, the convolution kernel exhibits edge enhancement characteristics to highlight texture differences. The outputs are concatenated along the channel dimension to form a refined feature map of the same size as the input feature map.

[0029] Subsequently, a Squeeze-and-Excitation channel attention module is introduced. This module compresses spatial information into channel descriptors through global average pooling. The importance weights of each channel are learned through a two-layer fully connected network, and finally, weighted multiplication enhances the response strength of key channels for disease identification. Building upon this, residual connections are used to element-wise add the original input of the large-kernel perception submodule to the output of the channel attention module. Residual connections allow gradients to be directly backpropagated to shallow layers, alleviating the gradient vanishing problem in deep network training. Furthermore, they explicitly preserve large-scale global contextual information in the module output, ensuring that subsequent layers can still perceive the original environmental background features and avoiding information loss due to layer-by-layer transformations.

[0030] In this embodiment, the feature extraction network stacks four of the aforementioned receptive focusing modules. Spatial downsampling is performed between modules using 3×3 convolutions with a stride of 2. Each downsampling halves the spatial resolution and doubles the number of channels, forming a pyramid-shaped, multi-scale hierarchical feature representation. After processing by the four modules, the spatial size of the feature map gradually decreases from 256×256 to 16×16, and the number of channels expands from the initial C to 8C or 16C. The deep feature F possesses rich semantic abstraction and a large receptive field coverage, providing a high-quality feature foundation for subsequent environmental decoupling and disease classification.

[0031] Step 3: Environmental Decoupling and Counterfactual Enhancement. The deep feature F enters the environmental decoupling and counterfactual enhancement module. The goal of this module is to remove environmental interference factors from the coupled deep features and extract feature representations that have a stable causal relationship with the disease type.

[0032] First, F is input into two encoders with identical structures but independent parameters. Each encoder consists of a 1×1 pointwise convolution, a batch normalization layer, and a LeakyReLU activation function. The 1×1 pointwise convolution here plays a dual role in cross-channel information fusion and dimensionality transformation: on the one hand, it integrates the information between channels, and on the other hand, it transforms the original channel dimension C. F Mapped to disease feature dimension d respectively f and environmental feature dimension d e In this embodiment, d is taken. f =d e =256, achieving a balance between feature representation capability and subsequent computational overhead. The combination of batch normalization layer and LeakyReLU activation function ensures the stability of feature distribution and non-linear representation capability. After encoding, disease features are obtained respectively. and environmental characteristics .

[0033] The environment discriminator consists of a three-layer fully connected network with hidden layer dimensions of 128 and 64, respectively. The output layer dimension is equal to the predefined number of environment categories (3 in this embodiment, corresponding to strong light, diffused light, and weak light). This discriminator is based on environmental features. The input is a one-dimensional vector after global average pooling, and the output is the predicted probability distribution of the environment state labels. The cross-entropy loss between the predicted distribution and the actual environment labels is calculated. The discriminator is trained to accurately identify environmental conditions.

[0034] At the same time, in the disease characteristic Z d A gradient reversal layer is inserted along the path to the environment discriminator. During forward propagation, the gradient reversal layer acts as an identity mapping, making no modifications to the input features; during backward propagation, it multiplies the returned gradient by a negative coefficient. This embodiment takes =0.1, this value is chosen to balance the stability and convergence speed of adversarial training: too large a value may lead to training oscillations or even non-convergence, while too small a value may lead to... This makes the adversarial effect insignificant. The effect of gradient inversion is equivalent to reversing the optimization objective of the disease feature encoder from minimizing the environmental discrimination loss to maximizing the environmental discrimination loss, thereby forcing the disease feature encoder to learn to generate representations that cannot be accurately identified by the environmental discriminator, that is, environmental information in the disease features is effectively extracted.

[0035] To further decouple disease characteristics from environmental characteristics, a variational mutual information estimation network based on CLUB (Contrastive Log-ratio Upper Bound) is introduced. This network approximates the upper bound of mutual information between two random variables through an auxiliary neural network; specifically, it minimizes the loss of the upper bound of mutual information. At the statistical distribution level, the disease characteristic Z is penalized. d With environmental characteristics The correlation between them. Compared with traditional adversarial domain adaptation methods, mutual information minimization does not rely on explicit supervision of domain labels, but directly starts from the relationship between the joint probability and marginal probability of the feature distribution for constraint, which has a wider range of applicability in scenarios where the environmental label definition is ambiguous or difficult to label.

[0036] Furthermore, a counterfactual reinforcement learning mechanism is introduced during the training phase. The disease feature Z is trained with a probability P=0.3. d A random masking operation is performed on a portion of the spatial channel dimensions, setting the selected feature elements to zero. This operation simulates the intervention concept in causal inference: in a counterfactual world, if a part of the disease features is missing or destroyed, can the model still make a correct diagnosis based on the remaining features? The masked disease features are then fed into an auxiliary classifier that shares weights with the main classifier to calculate the classification loss. By minimizing this loss, the model is forced to learn a globally consistent representation that is robust to the loss of local features, thereby suppressing overfitting to visual artifacts under specific environmental conditions and strengthening the dependence on the essential morphological features of the disease. The choice of probability P=0.3 strikes a balance between introducing sufficient intervention intensity and maintaining training stability.

[0037] Step four: Disease classification and model training. The classifier consists of a global average pooling layer, a single fully connected layer, and a softmax activation layer, in sequence. Global average pooling compresses the feature map of spatial dimension H×W into a 1×1 channel description vector, significantly reducing the number of parameters in the fully connected layer and providing spatial invariance. The fully connected layer maps the pooled feature vector to the number of disease categories (4 in this example, corresponding to healthy disease, black spot disease, rust disease, and compound diseases). The softmax activation layer normalizes it to a category probability distribution, and the category with the highest probability is taken as the diagnosis result.

[0038] The entire network is trained end-to-end using a joint loss function:

[0039] in, The cross-entropy loss of the main classifier, The cross-entropy loss of the environment discriminator, For the upper limit of mutual information loss, The classification loss is enhanced by counterfactual branches. Hyperparameters. , , The values ​​were set to 0.1, 0.01, and 0.05 respectively. The selection of this set of hyperparameters followed these principles: The intensity of environmental adversarial forces must be controlled; too much will interfere with the main task's learning, while too little will result in insufficient decoupling. The weights for controlling the mutual information constraint are set relatively small, since the mutual information loss and classification loss may differ in magnitude. To prevent it from causing excessive interference with the main task; By controlling the contribution of counterfactual reinforcement, a moderate value can achieve a balance between robustness and fitting ability in the model.

[0040] Training employed the Adam optimizer with an initial learning rate of 0.001, gradually decaying to 0 over 300 training epochs using cosine annealing. A batch size of 32 was used, striking a good balance between single-GPU memory limitations and training stability. During training, the classification accuracy and various loss parameters on both the training and test sets were recorded. An early stopping mechanism was triggered when the validation set accuracy failed to improve for 20 consecutive epochs to prevent overfitting.

[0041] Step 5, Model Deployment and Application. After training, export the feature extraction network and classifier as the inference model. During inference, only forward propagation needs to be performed; there is no need to calculate the environment discrimination loss, mutual information loss, and counterfactual enhancement loss. The gradient inversion layer acts as an identity mapping during forward propagation. The model can be deployed on an UAV-borne edge computing module (such as the NVIDIA Jetson series) or a ground station server. For real-time acquired UAV remote sensing images, after the same preprocessing procedure (scaling to 256×256 pixels and normalizing), the images are input into the model, which directly outputs the disease category and confidence score. Simultaneously, the environment encoder outputs environmental features... After global average pooling, it can serve as a compact representation of environmental information such as farmland light conditions and canopy status, providing an auxiliary reference for agricultural technicians to assess field environmental conditions and enhancing the interpretability of diagnostic results and agronomic guidance value.

[0042] In cross-environment testing on the PlantPathology dataset, the method in this embodiment achieved a macro-average F1 score that was about 12% higher than the baseline model (ResNet-50) in a strong light-weak light cross-domain testing scenario. Moreover, it achieved a significant performance improvement even when using only unlabeled data in the target domain, verifying the superior generalization performance of the present invention under varying environmental conditions.

[0043] Example 2 This embodiment is basically the same as Embodiment 1, except that some structures and parameters are adaptively adjusted for the wheat rust identification scenario. Wheat rust appears as fine dot-like or strip-like lesions in remote sensing images, with a spatial scale smaller than that of apple leaf diseases, and the wheat canopy structure is more uniform with more pronounced row sowing texture.

[0044] Therefore, the kernel size of large kernel depthwise convolution is... Increased to 15. A larger receptive field helps capture the row-seeding structure characteristics of wheat fields and the overall changes in the canopy spectrum caused by large-scale rust infection, providing richer contextual information for subsequent localized focusing. Meanwhile, the small core size... The value was kept at 3 to preserve spatial sensitivity to microrust spore masses and early chlorotic spots. Given that variations in wheat field light conditions have a more significant impact on spectral reflectance, the balance hyperparameter for environmental resistance loss was set to 3. The value was adjusted to 0.15 to moderately enhance the environmental decoupling strength. Furthermore, the input image size was adjusted to 224×224 pixels to match the typical coverage ratio of the wheat canopy within the map patch. The training dataset consisted of multi-temporal UAV remote sensing images of wheat rust collected in the field, covering different growth stages from jointing to grain filling. The remaining network structure, training strategy, and deployment method remained consistent with Example 1. Experimental results show that the adjusted model further improves the generalization performance of the wheat rust cross-growth stage identification task compared to the standard configuration.

[0045] Example 3 This embodiment is essentially the same as Embodiment 1, except for the implementation method of the mutual information estimation network. This embodiment uses MINE (Mutual Information Neural Estimation) instead of CLUB as the mutual information estimator. MINE estimates the lower bound of the mutual information between two random variables through a parameterized neural network, and optimizes this lower bound using gradient descent to approximate the true mutual information value. During training, the mutual information value estimated by MINE is used as the loss term. Minimize the loss function by incorporating a joint loss function.

[0046] In its implementation, the MINE network takes the concatenated disease features and environmental features as input, outputs a scalar value through a two-layer fully connected network (128 hidden layer dimensions), and estimates the lower bound of mutual information by averaging the samples from the training batches. Unlike the CLUB method for estimating the upper bound, the MINE method theoretically helps to more conservatively constrain the mutual information, and both approach the true mutual information from different perspectives. Experiments show that both estimation methods can effectively promote the statistical independence of disease features and environmental features, achieving the expected technical effect of feature decoupling. Those skilled in the art can choose a suitable mutual information estimation method according to the specific application scenario and computing resources, and these substitutions and adjustments should be considered to fall within the protection scope of this invention.

[0047] Example 4 This embodiment illustrates the use of large-kernel perception to guide dynamic small-kernel focusing. Specifically, in remote sensing images of crop diseases, the visual representation of diseases exhibits significant dual-scale characteristics: on the one hand, the occurrence of diseases is spatially correlated with large-scale environmental factors such as crop canopy structure, soil background, and light distribution. For example, rust often breaks out first in areas with dense canopies and poor ventilation, and its spatial distribution shows a certain macroscopic aggregation pattern. On the other hand, the discriminative features of diseases are manifested as local texture variations and pigment deposition on the leaf surface, belonging to pixel-level fine-grained visual patterns. Existing technologies often face a dilemma when processing such dual-scale features: if large convolutional kernels or stacked convolutional layers are used to expand the receptive field, the computational cost increases significantly and the sensitivity to local details decreases; if small convolutional kernels are used to preserve details, the receptive field is limited, and it is impossible to effectively model large-scale contextual relationships.

[0048] In this embodiment, the problem of cross-scale interpretation of remote sensing images is decomposed into the synergy of two basic technical actions: wide-area spatial perception and context-driven local analysis. Its technical essence can be understood as a dynamic adaptive allocation mechanism of the receptive field: instead of using static convolutional kernels with fixed receptive fields to process the entire image indiscriminately, the network first performs a coarse-grained scan of the global spatial structure by computing efficient large-kernel depth convolutions, generating a spatial weight map that encodes where and what patterns should be focused. Subsequently, this spatial weight map is explicitly reshaped into dynamic kernel parameters for local group convolutions, so that the local aggregation operation at each spatial location is adaptively controlled by its macroscopic context.

[0049] From an information processing perspective, this mechanism achieves an explicit feedforward mapping from spatial context information to local operator parameters. Let the output of the big-kernel sensing module be the spatial weight graph. This tensor not only encodes the macroscopic feature distribution within the neighborhood of each spatial location (e.g., whether it is located at the canopy edge, in the shadow region, or in a high-incidence area of ​​disease), but also directly constructs a filter bank for local convolution through a reshaping operation. The key innovation of this design lies in the fact that contextual information no longer acts on the feature map in the implicit, scalar form of feature recalibration (e.g., channel weighting in SENet) or spatial masking (e.g., position weighting in spatial attention) as in traditional attention mechanisms. Instead, it intervenes in local computation as a complete convolutional kernel tensor, thus endowing local operations with a structured response to the context. Specifically, in smooth background regions, dynamically generated convolutional kernels may exhibit a Gaussian-smooth weight distribution to suppress noise and maintain background consistency; in canopy edge regions, convolutional kernels may exhibit an edge enhancement mode along the gradient direction to sharpen structural boundaries; and in lesion regions, convolutional kernels may exhibit Gabor-like filter characteristics consistent with the lesion texture direction to enhance the response intensity of pathological textures. This spatial location-level structured adaptation is something that traditional static convolution and scalar attention mechanisms cannot achieve.

[0050] In this embodiment, the large-kernel depthwise convolution and the small-kernel dynamic focusing achieve gain through collaboration. Traditionally, large and small convolutional kernels are often considered mutually exclusive alternatives—the former excels in global semantics but is computationally expensive, while the latter excels in local details but has a limited receptive field. This invention breaks through this opposing view, revealing a technical path where the two can form complementary gains.

[0051] Specifically, the large-kernel deep convolution performs two key functions: first, as a receptive field expander, it expands the effective receptive field to 11×11 or even larger with extremely low parameter cost (the number of parameters in deep convolution is 1 / C of that in standard convolution), enabling the network to perceive the spatial structure at the crop canopy level; second, as a context encoder, it compresses the perceived large-scale information into a compact spatial weight map, providing a basis for downstream local operations. The small-kernel dynamic focusing then functions as a fine decoder: utilizing the control signals provided by the large-kernel perception, it performs high-fidelity texture extraction with a very small local window (3×3).

[0052] The synergistic gain between the two can be quantified as an improvement in the product of effective receptive field and parameter efficiency. Let the effective receptive field of static little kernel convolution be... Its parameter efficiency (receptive field area per unit parameter coverage) is In this invention, the introduction of large-kernel sensing expands the effective receptive field to The local aggregation of dynamic small kernels retains Spatial precision at scale. Meanwhile, the parameter increase for large-kernel depthwise convolution is... (much smaller than standard convolution) The overall parameter efficiency is significantly better than simply stacking large kernel convolutions or using self-attention mechanisms. This analysis theoretically supports the technical contribution of this invention in achieving a Pareto improvement in computational efficiency and cross-scale modeling capability.

[0053] Furthermore, there is an implicit, unstated but real, technical synergy between the perception focusing module and the environment decoupling module. The global environmental background features captured by the big kernel perception branch are precisely the source of interference information that the subsequent environment decoupling module needs to remove. Since the big kernel perception module explicitly generates a spatial weight map W, this tensor naturally carries spatial distribution information highly correlated with environmental factors such as illumination, canopy structure, and soil background. In a variant implementation (without changing the scope of the claims), the spatial weight map W or its feature vector after global pooling can be used as an auxiliary input to the environment encoder, providing richer contextual priors for environmental discrimination, thereby improving the accuracy of environmental feature decomposition. This implicit correlation explains why introducing big kernel perception and environment decoupling simultaneously in the same network architecture can produce a synergistic effect greater than the sum of its parts. Big kernel perception not only improves the accuracy of local feature extraction but also provides structured input for explicit modeling of environmental information, reducing the coupling degree between disease features and environmental features in deep representation from the source.

[0054] Example 6 This embodiment provides a more in-depth explanation of the intrinsic mechanism of the environment decoupling and counterfactual enhancement module in the technical solution described in Embodiment 1. In the solution described in Embodiment 1, the environment decoupling and counterfactual enhancement module includes three progressively advancing technical components: environment adversarial training, mutual information minimization, and counterfactual enhancement learning. From a surface functional perspective, all three serve the common goal of eliminating environmental interference; however, from a deeper mechanistic analysis, they correspond to different levels of technical requirements in causal inference, forming a complete technical chain from statistical decorrelation to causal invariance. This is precisely the core innovation of this invention.

[0055] Specifically, existing domain generalization methods largely rely on edge alignment or conditional alignment of feature distributions, essentially eliminating inter-domain distributional differences at the statistical level. However, statistical independence does not imply causal invariance; two variables being observationally independent does not mean that the causal mechanism between them has been severed. In crop disease diagnosis scenarios, even if disease features and environmental features are successfully decorrelated on the training set, the model may still learn environment-driven conditional dependencies, such as a specific contrast pattern in lesion texture under strong light conditions. When the light conditions of the deployment environment change, this conditional dependency fails, and diagnostic performance deteriorates accordingly.

[0056] In this invention, environmental adversarial training and mutual information minimization perform the function of statistical decorrelation: the former forces the disease feature encoder to generate representations that cannot be recognized by the environmental discriminator through adversarial signals, while the latter enforces the statistical independence of disease features and environmental features at the mutual information level. Counterfactual reinforcement learning, on the other hand, performs the function of causal invariance mining: by performing random masking intervention on disease features, it simulates whether the prediction can still be stable if some information of the disease features is missing, forcing the model to find consistent minimal predictors in multiple counterfactual worlds. Here, the minimal predictors are the essential morphological features that have a direct causal relationship with the disease type, such as the shape, color, and distribution pattern of lesions, rather than derived visual attributes controlled by ambient lighting or shooting conditions.

[0057] Thus, the three components of this invention constitute a technological advancement path: from removing environmental relevance (adversarial training) to forcing statistical independence (mutual information minimization) and then to mining causal invariant features (counterfactual enhancement), ultimately enabling the diagnostic model to leap from relying on statistical pseudo-correlation to relying on causal representation. The inherent logic of this technological path corresponds structurally to Judea Pearl's causal ladder theory, from correlation to intervention to counterfactual, and is not a simple parallel or arbitrary combination of the three.

[0058] This embodiment also provides an information theory explanation for the gradient inversion layer in disease feature decoupling. In Embodiment 1, the implementation of environment adversarial training relies on inserting a gradient inversion layer into the disease feature branch, causing the disease feature encoder to optimize in the direction of maximizing the environment discrimination loss. The traditional explanation for this technique is to confuse features through adversarial interaction, but this embodiment provides a deeper mechanistic explanation from the perspective of information bottlenecks.

[0059] The environment adversarial training process can be viewed as a minimax game between the disease feature encoder and the environment discriminator. Let the output of the environment discriminator be the predicted distribution of environment labels, and its cross-entropy loss be... Disease characteristics were measured The gradient inversion layer maximizes this loss in the disease feature encoder, which has the information-theoretic equivalent meaning of imposing an information bottleneck constraint on the output representation of the disease feature encoder, limiting the amount of environmental mutual information contained therein. ,in These are environmental variables. Meanwhile, the main classification loss... The disease characteristics must retain sufficient information for disease identification. ,in For disease labeling. The equilibrium point of the two gradient forces corresponds to the optimization objective:

[0060] This formula is entirely consistent with the form of the information bottleneck theory: retain information useful for the task and compress environmental information that is useless to the task but volatile. The gradient reversal layer here does not simply act as an adversarial tool, but rather as an efficient stochastic gradient implementation of the information bottleneck constraint. This perspective clarifies the gradient reversal coefficients. The theoretical implication is that it directly controls the compression intensity of the information bottleneck. The larger the size, the stronger the suppression effect on environmental information in the disease characteristics, but excessively large sizes... It may also compress some weak information related to the disease.

[0061] Furthermore, this implementation also provides an explanation of the essential differences between counterfactual masking and data augmentation.

[0062] In Example 1, counterfactual reinforcement learning constructs counterfactual samples by randomly masking disease features. It should be clearly pointed out that this operation is fundamentally different from conventional data augmentation (such as random pruning, color dithering, and noise injection) in terms of objectives, effects, and mechanisms.

[0063] Conventional data augmentation operates on the input space, expanding the diversity of training samples by applying predefined transformations (such as rotation, flipping, and brightness adjustment) to the original image. Its implicit assumption is that the model's predictions should remain unchanged by these transformations. However, data augmentation has a limitation: it can only simulate known, parameterizable environmental changes, and cannot cover data distribution shifts in unknown environments.

[0064] Counterfactual reinforcement learning operates on the feature space, and its operation objects are the encoded disease features. Instead of the original image, this operation is based on the independent causal mechanism assumption in causal inference: in a true causal graph, intervening in the causal variable (disease type) will change the outcome variable (image appearance); however, intervening in the outcome variable will keep the causal variable unchanged. When random masking is applied to disease features, it is equivalent to externally intervening in the outcome in the feature space, destroying some feature information, and then observing whether the classifier can still make correct inferences based on the remaining core causal features. If the classifier can still predict accurately after masking, it indicates that the features it relies on are robust causal features scattered throughout the representation space; if the prediction drops significantly after masking, it indicates that it relies on locally fragile pseudo-correlated features.

[0065] This mechanism enables counterfactual reinforcement learning to reach generalization dimensions that conventional data augmentation cannot cover: instead of exposing the model to more data, it forces the model to extract causal invariance under adverse conditions of information loss. The effectiveness of this mechanism can be theoretically verified through the analysis of kernel alignment (CKA) similarity of extracted feature centers: without the introduction of counterfactual reinforcement, the deep features extracted by the model in different environments show significant differences; after its introduction, the feature representations in different environments tend to be consistent, retaining only the core dimensions related to disease.

[0066] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "include," "contain," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus.

[0067] Finally, it should be noted that the above descriptions are merely preferred embodiments of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for diagnosing crop diseases that integrates spatial multi-scale perception with environmental decoupling, characterized in that: Includes the following steps: Step S1: Acquire remote sensing images of the crop to be diagnosed; Step S2: Process the remote sensing image using a feature extraction network. The feature extraction network includes at least one sensing and focusing module, which performs the following operations: Step S201: Perform a large kernel depthwise convolution on the input feature map to generate a spatial weight map; Step S202: Generate a small kernel convolutional kernel that dynamically changes with spatial location based on the spatial weight map; Step S203: Perform grouped convolution on the local neighborhood of the input feature map using dynamically changing small kernel convolution to obtain a refined feature map; Step S204: Decompose the deep features output by the feature extraction network into disease features and environmental features, and maximize the environmental discrimination loss of disease features through adversarial training to obtain environmentally independent disease features. Step S3: Output crop disease categories based on environmentally independent disease characteristics.

2. The crop disease diagnosis method according to claim 1, which integrates spatial multi-scale perception and environmental decoupling, is characterized in that: The input feature map is subjected to a large-kernel depthwise convolution to generate a spatial weight map, specifically: Let the input feature map be: ,in This indicates that each element in this tensor is a real number, B is the batch size, C is the number of channels, and H×W is the spatial size; First, the number of channels is compressed to C / 2 using 1×1 pointwise convolution. After batch normalization and activation functions, a kernel size of [missing value] is used. Two-dimensional deep convolution extracts large-scale contextual features. The spatial size of the large convolutional kernel is represented, and then another 1×1 pointwise convolution is used to map the number of channels to D, resulting in a spatial weight map. .

3. The crop disease diagnosis method according to claim 2, which integrates spatial multi-scale perception and environmental decoupling, is characterized in that: Generating small-kernel convolutional kernels that dynamically change with spatial location based on spatial weight graphs, including: Reshape the spatial weight graph into a dynamic convolutional kernel tensor. Where G is the number of channel groups, Let L = H × W be the kernel size, and W be the total number of spatial locations. For each spatial location P, the corresponding dynamic convolution kernel is... .

4. The crop disease diagnosis method according to claim 3, which integrates spatial multi-scale perception and environmental decoupling, is characterized in that: Grouped convolutions are performed on the local neighborhood of the input feature map using dynamically varying small kernels, specifically: The input feature map X is divided into G groups according to channels. For each group g and each spatial location P, the corresponding dynamic convolution kernel is used. In the local neighborhood of position P Internal convolution operations are performed to extract fine-grained disease texture features.

5. The crop disease diagnosis method according to claim 1, which integrates spatial multi-scale perception and environmental decoupling, is characterized in that: The perception focusing module also includes: A channel attention module is introduced after the fine feature map to enhance the response of key channels; and the input feature map is added to the output of the channel attention module through residual connection to preserve global context information.

6. The crop disease diagnosis method according to claim 1, which integrates spatial multi-scale perception and environmental decoupling, is characterized in that: The deep features are decomposed into disease features and environmental features, specifically: The deep features F are input into two independent encoders, each consisting of a 1×1 pointwise convolution, a batch normalization layer, and an activation function, and outputting the disease features respectively. and environmental characteristics .

7. The crop disease diagnosis method according to claim 6, which integrates spatial multi-scale perception and environmental decoupling, is characterized in that: Adversarial training maximizes the environmental discrimination loss of disease characteristics, including: Environmental characteristics Input environment discriminator to predict environment state labels; Disease characteristics The gradient is input into the environment discriminator through the gradient inversion layer. During backpropagation, the gradient inversion layer multiplies the gradient by a negative coefficient, so that the optimization direction of the disease features is to increase the environmental discrimination loss, thereby stripping the environmental information from the disease features.

8. The crop disease diagnosis method according to claim 7, which integrates spatial multi-scale perception and environmental decoupling, is characterized in that: It also includes the mutual information minimization operation: Disease characteristics are calculated using a mutual information estimation network. With environmental characteristics The upper bound of mutual information between them is determined, and this upper bound is minimized during training to enhance the statistical independence between them.

9. The crop disease diagnosis method according to claim 1, which integrates spatial multi-scale perception and environmental decoupling, is characterized in that: The training process also includes counterfactual reinforcement learning steps: Characteristics of the disease Some channels or spatial locations are randomly masked with probability P. The classification loss is calculated based on the disease features after masking, so as to force the model to learn feature expressions that have causal stability with the disease type.

10. A crop disease diagnosis method integrating spatial multi-scale perception and environmental decoupling according to claim 9, characterized in that: The method uses a joint loss function for optimization during the training phase. The joint loss function is: ,in, For crop disease classification cross-entropy loss, To combat environmental damage, To minimize the loss of mutual information, To exaggerate the damage by counterfactual means, , , To balance the hyperparameters.