Walnut tree pest and disease identification method based on image recognition target detection technology

By combining adaptive image enhancement and deep feature extraction with orthogonal decoupling and dynamic gating fusion of shared and discriminative representation branch networks, the problems of background interference and semantic overlap in the identification of walnut leaf diseases and pests are solved, achieving high-precision, robust disease identification and transparent diagnostic logic.

CN122391901APending Publication Date: 2026-07-14SICHUAN FORESTRY RES INST (SICHUAN FORESTRY IND RES & DESIGN INST)

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SICHUAN FORESTRY RES INST (SICHUAN FORESTRY IND RES & DESIGN INST)
Filing Date
2026-06-17
Publication Date
2026-07-14

Smart Images

  • Figure CN122391901A_ABST
    Figure CN122391901A_ABST
Patent Text Reader

Abstract

The application discloses a walnut tree disease and pest identification method based on image recognition target detection technology and relates to the technical field of image recognition and target detection. Deep feature extraction and slice processing are performed through a feature extraction network to generate a candidate disease spot feature unit set. Prototype similarity is calculated, the highest score value is taken, normalization is performed, and spatial filtering is performed to remove background noise. The pure disease spot feature set is respectively input into a pre-constructed shared representation branch network and a discriminative representation branch network, forward propagation feature extraction and orthogonal decoupling solution are performed, Gaussian probability distribution modeling is performed, the shared semantic probability distribution model and the discriminative semantic probability distribution model are adaptively fused through a dynamic gate fusion coefficient, and joint hidden space pathological semantic features are output. After redundant attribute dimensions are removed and filtered through a learnable feature mask, the full connection classification network is input to perform disease diagnosis category decision calculation, and the final walnut tree disease and pest identification result is output.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the technical field of image recognition and target detection, and in particular to a method for identifying walnut tree diseases and pests based on image recognition and target detection technology. Background Technology

[0002] Walnuts are an important economic forest fruit, but they are susceptible to diseases and pests such as anthracnose and brown spot during their growth. Existing disease and pest identification methods mainly rely on traditional convolutional neural networks for end-to-end classification and extraction. However, in complex natural environments, these methods suffer from significant background interference (such as overlapping leaf veins, shadow interference, and uneven lighting) and high semantic overlap between different diseases. Furthermore, existing deep learning architectures for multi-disease diagnosis are often black-box models, lacking transparency in the decision-making process of the entire diagnostic chain and the ability to explicitly explain physical attributes. This makes it difficult to directly and losslessly convert the highly abstract latent features within deep learning into interpretable physical evidence for agricultural pathology. While traditional attribute reduction algorithms based on classical set theory and other theoretical frameworks can eliminate redundant and overlapping indicator attributes in information systems, their inherent discrete computational nature and non-differentiability prevent them from being directly integrated and spliced ​​with modern deep learning multi-layer networks for backpropagation optimization. Therefore, a new cross-disciplinary fusion mechanism is urgently needed to systematically solve the complex problems of significant background interference, high semantic overlap, and opaque decision-making in deep detection and diagnosis.

[0003] Currently, Chinese invention patent CN120318698B discloses a method and system for identifying jujube tree diseases and pests using visual technology. The method includes: extracting the closed edge contours of grayscale images of diseased leaves to obtain the contour skeleton of each closed edge contour; based on the graphic features of each contour skeleton, obtaining the region to be identified; analyzing the distribution of gradient amplitude values ​​of the skeleton contour edges and inner pixels, and the distribution of gradient amplitude values ​​of the outer pixels of the skeleton contour, to obtain the edge transition value of each region to be identified; based on the overall distribution characteristics of the gradient amplitude values ​​of all edge pixels of the skeleton contour of each region to be identified, obtaining the edge energy value of each region to be identified; determining the edge discrimination value of each region to be identified, and obtaining the disease identification result for each region to be identified. This application aims to improve the identification ability of jujube brown spot disease and jujube gray spot disease, and to improve the accuracy of disease detection. However, existing pest and disease image recognition networks are easily affected by various light and shadow effects and physiological background noise when facing the complex outdoor environment of walnut leaves, resulting in a decrease in fine-grained classification accuracy; the semantic features of different types of lesions with highly overlapping characteristics cause extremely serious category semantic collapse at the network extraction end; and due to the lack of an explicit attribute reduction structure with a parsing guidance mechanism, the existing diagnostic architecture suffers from a serious feature dimension redundancy dilemma and cannot see through the core logic of internal diagnostic judgment. Summary of the Invention

[0004] The technical problems solved by this invention are: existing pest and disease image recognition networks are easily affected by various light and shadow effects and physiological background noise when facing the complex outdoor structural environment of walnut leaves, resulting in a decrease in fine-grained classification accuracy; the semantic features of different types of lesions with highly overlapping characteristics cause extremely serious category semantic collapse at the network extraction end; and the lack of an explicit attribute reduction structure with a parsing guidance mechanism results in a serious feature dimension redundancy problem in the existing diagnostic architecture, making it impossible to see through the core logic of internal diagnostic judgment.

[0005] To solve the above-mentioned technical problems, the present invention provides the following technical solution: a method for identifying walnut tree diseases and pests based on image recognition target detection technology, comprising the following steps: Step S1: Obtain the original multi-exposure image sequence containing walnut leaf fragments, perform adaptive image enhancement processing and depth feature extraction and slicing processing, and generate a set of candidate lesion feature units; Step S2: Calculate the prototype similarity between the candidate lesion feature unit set and the prototype feature vector in the disease prototype library, take the highest score value and normalize it, and then perform spatial filtering to extract the pure lesion feature set after removing background noise. Step S3: Input the pure lesion feature set into the pre-constructed shared representation branch network and the identification representation branch network respectively, perform forward propagation feature extraction and orthogonal decoupling solution, model the shared representation features and identification representation features obtained independently from the walnut sample to be tested using Gaussian probability distribution, and calculate the dynamic gating fusion coefficient based on feature information entropy and category overlap prior quantization, and output the joint latent space pathological semantic features based on the dynamic gating fusion coefficient. Step S4 involves transforming the joint latent space pathological semantic features into explicit physical attribute features, filtering out redundant attribute dimensions using learnable feature masks, and then inputting the results into a fully connected classification network to calculate the disease diagnosis category, outputting the final walnut tree disease and pest identification results.

[0006] Preferably, step S1 specifically includes: The original multi-exposure image sequence of walnut leaves is obtained. First, the original multi-exposure image sequence is subjected to exposure fusion, and then illumination adjustment and noise filtering are performed to obtain an enhanced and clean image. The enhanced and clean image is input into a convolutional neural network for feature extraction to obtain a multi-channel semantic feature map. The multi-channel semantic feature map is then sliced ​​into a grid in the spatial dimension. The feature map channel data corresponding to each grid region is unfolded into an independent one-dimensional vector to form a local feature vector. The local feature vectors corresponding to all grid regions are combined to form a set of candidate lesion feature units.

[0007] Preferably, step S2 specifically includes: By extracting typical lesion features of various diseases of walnut trees from big data as anchor points, a disease prototype library is constructed. The cosine similarity values ​​between each local feature vector in the candidate lesion feature unit set and the prototype feature vector of each disease are calculated, and the cosine similarity values ​​are used as the prototype similarity. Extract the highest score among all prototype similarities corresponding to the i-th local feature vector, and use it as the highest spatial matching score corresponding to the i-th local feature vector; The lesion confidence weight is obtained by globally normalizing the highest spatial matching score of all local feature vectors using the normalization exponential function; The confidence weight of the lesion is used as a scaling factor to multiply the corresponding local feature vector to obtain the pure lesion feature vector. All pure lesion feature vectors are combined to form a pure lesion feature set.

[0008] Preferably, step S3 specifically includes the following sub-steps: Step S31: Construct parallel shared representation branch network and differential representation branch network. Input the pure lesion feature vector into the shared representation branch network and differential representation branch network respectively. Extract the common general representation features shared among multiple diseases and the specific representation features with category specificity. Introduce an orthogonal constraint loss function that forces the general representation feature space and the specific representation feature space to be orthogonal to each other for orthogonal decoupling solution. Step S32: Perform Gaussian probability distribution modeling on the shared characterization features and identification characterization features obtained independently from the walnut sample to be tested, and quantify the shared information entropy and identification information entropy. Step S33: Establish the category overlap matrix, calculate the prior overlap, input the shared information entropy, the discriminative information entropy, the spatial highest matching score and the prior overlap into the multilayer perceptron network, and use the dynamic gating fusion coefficient to perform a weighted summation of the mean vectors of the predicted outputs of the shared representation branch network and the discriminative representation branch network to obtain the joint latent space pathological semantic features.

[0009] Preferably, step S31 specifically includes constructing a structurally symmetric shared representation branch network and a discriminative representation branch network, respectively, and performing forward propagation feature extraction and orthogonal decoupling solution: Using a multilayer perceptron residual architecture with a completely symmetrical physical structure but independent internal weight parameters, a shared representation branch network and a discriminative representation branch network are constructed. The shared representation branch network and the discriminative representation branch network respectively include an input projection layer, a hidden feature transformation layer and an output mapping layer. Through an end-to-end data-driven mechanism, using the backpropagation algorithm and adaptive gradient descent optimization strategy, the hierarchical weight matrices and bias vectors of the shared representation branch network, the discriminative representation branch network and the attribute mapping network are dynamically solved and converged during the model training iteration phase. By using a shared representation branch network and a discriminative representation branch network, general representation features and specific representation features are extracted, respectively. Independent Gaussian parameter solver networks are constructed for general and specific representation features respectively, mapping point features to the mean vector and log-variance vector of Gaussian probability distributions; During the backpropagation solution phase of the network, the partial derivative gradients of the orthogonal constraint loss function with respect to the weight parameters of the shared representation branch network and the discriminative representation branch network are calculated. The adaptive moment estimation optimizer is used to iteratively update the network weight parameters based on the calculated partial derivative gradients, thereby forcibly guiding the shared representation branch network and the discriminative representation branch network to be as orthogonally separated as possible in the feature space, thus achieving decoupling constraints.

[0010] Preferably, step S32 specifically includes: By using a fully connected regression network layer, mean and variance predictions are performed on shared representation features and discriminative representation features respectively, upgrading the deterministic point vector features into a Gaussian probability distribution with random attributes, and obtaining the shared probability distribution function of the pure lesion feature vector on the shared representation branch network and the discriminative probability distribution function of the pure lesion feature vector on the discriminative representation branch network. The feature information entropy values ​​of the shared representation branch network and the discriminative representation branch network for the semantic expression of the current input feature are calculated separately. The current input feature is a variance vector. The output is the shared information entropy used to describe the uncertainty of the shared representation branch network and the discriminative information entropy used to describe the uncertainty of the discriminative representation branch network.

[0011] Preferably, step S33 specifically includes: A matrix consisting of the misclassification and confusion ratios between pairs of various diseases is established, defined as the category overlap matrix. Based on the highest spatial matching score calculated from the current local feature vector, the confusion difficulty of the current sample's category is queried and defined as the prior overlap. The shared information entropy, discriminative information entropy, spatial highest matching score, and prior overlap are input into a multilayer perceptron network. The activation function is used to output dynamic gating fusion coefficients. The mean vectors of the predicted outputs of the shared representation branch network and the discriminative representation branch network are weighted and summed using the dynamic gating fusion coefficients to obtain the joint latent space pathological semantic features.

[0012] Preferably, step S4 specifically includes the following steps: An attribute mapping network is constructed to map the joint latent space pathological semantic features to the explicit physical attribute feature space, resulting in explicit physical attribute feature vectors. A learnable parameter vector with the same dimension as the explicit physical attribute feature vector is defined. A continuous feature soft mask is generated using a Logistic operation with an annealing temperature control constant. The continuous feature soft mask and the explicit physical attribute feature vector are multiplied element-wise at corresponding positions to obtain the core diagnostic attribute feature vector.

[0013] Preferably, step S4 further includes: Based on the continuous feature soft mask, a norm penalty term is defined to achieve attribute removal; The core diagnostic attribute feature vector is input into a fully connected classification diagnostic function, which outputs the predicted probability distribution for each type of disease. Extract the disease category corresponding to the position index of the highest probability component value in the predicted probability distribution column vector as the diagnostic judgment output as the final walnut tree disease and pest identification result.

[0014] Preferably, a multi-objective joint optimization control strategy is adopted during the training iteration phase, and the mathematical expression of the total loss function of the overall architecture is: ; in, The total loss function is a scalar for multi-objective joint optimization. Let cross-entropy be the classification loss function. For orthogonal constraint loss function, For a norm-based penalty term, and This is a constant for the balancing weight hyperparameters.

[0015] The beneficial effects of this invention are as follows: First, this invention uses a spatial filtering module to spatially filter and restrict the input feature map by utilizing the characteristics of the disease prototype. This effectively shields and discards the interference information mixed in by natural background reflections, tree shadows, and normal leaf vein tissue, so that all features extracted by the subsequent network are focused on pure pathological micro signals.

[0016] Secondly, this invention proposes a decoupled identification mechanism for dual-branch probabilistic feature encoding, which combines sharing and identification in multiple directions. It utilizes orthogonal constraint equations designed for the deep tensor matrix to forcibly and thoroughly decouple the common dimensions of similar diseases from the specific indicators unique to each disease. Simultaneously, it innovatively transforms the previously rigid fixed-point feature model into a modeling form containing a Gaussian probability distribution fluctuation domain, achieving deep uncertainty quantification. This enables the decision network not only to know the specific fixed output values ​​of extracted features but also to accurately express the evaluation reference of the confidence probability fluctuations of each set of features.

[0017] Furthermore, this invention pioneered the deployment of an uncertainty dynamic perception gating fusion analysis engine, abandoning fixed model parameters and manual weights. It dynamically combines the system's macroscopic category overlap priors and the local entropy of pest and disease feature information to adaptively fuse and assign feature weights, perfectly overcoming the stubborn bottleneck problem of blinding category semantic fusion collapse caused by the highly similar and overlapping visual features of anthrax and brown spot disease in multi-occurring natural scenarios.

[0018] Finally, this invention innovatively utilizes a network with attribute mapping channel functionality to cleverly transform deep, unobservable, black-box latent features directly into feature vectors containing explicit diagnostic-guided attributes. Combined with the Gumbel-Softmax flexible mask principle and other continuous attribute differentiable reduction mechanisms, it achieves end-to-end continuous dimensionality reduction. While ensuring robust iterative support for unbroken forward propagation and backward penalty gradient transmission within the deep learning computing architecture, it significantly removes meaningless network neuron branches and highly redundant parameter data items from the model's massive diagnostic dimensions, thus outputting a lightweight and highly interpretable diagnostic output with readily identifiable rules. This constructs a novel paradigm for the evolution of recognition systems, transitioning from deep nonlinear representation learning to shallow rule-based explicit attribute extraction and discrimination. It establishes top-tier analytical theoretical, academic, and engineering research value while possessing robust deployment capabilities and accurate detection in highly practical industrial scenarios. Attached Figure Description

[0019] Figure 1 This is a schematic diagram of the basic process of a walnut tree disease and pest identification method based on image recognition target detection technology provided in an embodiment of the present invention; Figure 2 This is a detailed flowchart illustrating a method for identifying walnut tree diseases and pests based on image recognition target detection technology, provided in one embodiment of the present invention. Detailed Implementation

[0020] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments.

[0021] Reference Figure 1 and Figure 2 As an embodiment of the present invention, a method for identifying walnut tree diseases and pests based on image recognition target detection technology is provided, comprising the following steps: Step S1: Obtain the original multi-exposure image sequence containing walnut leaf fragments, perform adaptive image enhancement processing and depth feature extraction and slicing processing, and generate a set of candidate lesion feature units; Step S2: Calculate the prototype similarity between the candidate lesion feature unit set and the prototype feature vector in the disease prototype library, take the highest score value and normalize it, and then perform spatial filtering to extract the pure lesion feature set after removing background noise. Step S3: Input the pure lesion feature set into the pre-constructed shared representation branch network and the identification representation branch network respectively, perform forward propagation feature extraction and orthogonal decoupling solution, model the shared representation features and identification representation features obtained independently from the walnut sample to be tested using Gaussian probability distribution, and calculate the dynamic gating fusion coefficient based on feature information entropy and category overlap prior quantization, and output the joint latent space pathological semantic features based on the dynamic gating fusion coefficient. Step S4 involves transforming the joint latent space pathological semantic features into explicit physical attribute features, filtering out redundant attribute dimensions using learnable feature masks, and then inputting the results into a fully connected classification network to calculate the disease diagnosis category, outputting the final walnut tree disease and pest identification results.

[0022] The detection and analysis chain of this method effectively solves the three major problems in existing disease identification: large background interference, high semantic overlap, and opaque decision-making. It adopts a progressive logic of spatial filtering, semantic decoupling, uncertainty fusion, and explicit attribute reduction.

[0023] Step S1 specifically includes: The original multi-exposure image sequence of walnut leaves is obtained. First, the original multi-exposure image sequence is subjected to exposure fusion, and then illumination adjustment and noise filtering are performed to obtain an enhanced and clean image. The enhanced and clean image is input into a convolutional neural network for feature extraction to obtain a multi-channel semantic feature map. The multi-channel semantic feature map is then sliced ​​into a grid in the spatial dimension. The feature map channel data corresponding to each grid region is unfolded into an independent one-dimensional vector to form a local feature vector. The local feature vectors corresponding to all grid regions are combined to form a set of candidate lesion feature units.

[0024] Enhancing the clarity of images eliminates imaging degradation. In this embodiment, a convolutional neural network containing multiple convolutional and pooling layers is constructed as a feature extraction network. An enhanced clean image is input into the feature extraction network, and the deep spatial texture and pathological semantic information of the image are extracted through sliding window operations of the convolutional kernels. A multi-channel semantic feature map is output, the mathematical expression of which is: ; in, The output is a multi-channel semantic feature map with tensor dimension of . , The height dimension of the feature map. The width dimension of the feature map. The channel dimension of the feature map. Forward mapping function of feature extraction network, This refers to the set of all learnable weight parameters in the feature extraction network. For input, an enhanced clean image; The multi-channel semantic feature map is sliced ​​into grids along the spatial dimension. Specifically, this process involves dividing the multi-channel semantic feature map into sections along its height and width dimensions. For each independent grid region, extract all feature response values ​​in the channel dimension and expand them into independent one-dimensional vectors to form local feature vectors. The mathematical expression for this local feature vector is as follows: ; in, Let be the local feature vector corresponding to the i-th grid region, and let its vector dimension be . , Represents the multi-channel semantic feature map F in spatial coordinates ( The feature data extracted along all channel dimensions at position (i) is the index number of the grid region, which is an integer ranging from 1 to N, and N is the total number of grid regions. , ( Let be the two-dimensional spatial coordinates of the i-th grid region in the multi-channel semantic feature map; The local feature vectors corresponding to all grid regions are combined in spatial index order to form a candidate lesion feature unit set. The mathematical expression for the candidate lesion feature unit set is: ; in, A set of candidate lesion feature units. to This represents all local feature vectors corresponding to all grid regions contained within this set.

[0025] It should be noted that, in this field, the technical term "original multi-exposure image sequence" in the steps refers to: a set of matrix data digital arrays captured and saved sequentially using independent photosensitive acquisition devices under various inconsistent environmental conditions and different exposure time underlying acquisition parameter settings, targeting the detailed target structure scene of walnut leaves and diseases. By performing pre-adjustment on the array, the effective extraction of a deep signal tensor base map with pure distortion resistance is achieved, meeting the system's standard limit constraints for input quality control.

[0026] Step S2 specifically includes: By extracting typical lesion features of various diseases of walnut trees from big data as anchor points, a disease prototype library is constructed. The cosine similarity values ​​between each local feature vector in the candidate lesion feature unit set and the prototype feature vector of each disease are calculated, and the cosine similarity values ​​are used as the prototype similarity. Extract the highest score among all prototype similarities corresponding to the i-th local feature vector, and use it as the highest spatial matching score corresponding to the i-th local feature vector; The lesion confidence weight is obtained by globally normalizing the highest spatial matching score of all local feature vectors using the normalization exponential function; The confidence weight of the lesion is used as a scaling factor to multiply the corresponding local feature vector to obtain the pure lesion feature vector. All pure lesion feature vectors are combined to form a pure lesion feature set.

[0027] The mathematical expression for the disease prototype library is: ; in, It serves as a prototype library for diseases. Let K be the prototype feature vector of the i-th walnut tree disease, and K be the total number of walnut tree disease categories. The mathematical expression for prototype similarity is: ; in, Let be the prototype similarity between the i-th local feature vector and the prototype feature vector of the j-th disease. This represents the local feature vector corresponding to the i-th grid region in the set of candidate lesion feature units. Let be the prototype feature vector of the j-th walnut tree disease. It is a 2-norm operator for vectors, which uses prototype similarity to determine the consistency of the spatial orientation direction of the two vectors. The mathematical expression for the confidence weight of lesions is: ; in, The confidence weight of the lesion corresponding to the i-th local feature vector is... It is an exponential function with the natural constant as its base. Let be the spatially highest matching score corresponding to the i-th local feature vector. The total number of local feature vectors is also the total number of grid regions, and k is a natural number from 1 to N; The lesion confidence weight is multiplied by the corresponding local feature vector as a dimensionless control scaling scalar factor, effectively filtering out background clutter components and non-lesion feature interference to obtain a pure lesion feature vector. Its mathematical expression is: ; in, The purified lesion feature vector is generated after filtering the i-th local feature vector.

[0028] It should be noted that the core logic of step S2 is to abandon the over-coupling behavior of traditional methods that bind the output category to the final result at the screening level. By using the UILA spatial screening layer to carry out local filtering judgment calculations based on lesion features, only features of highly overlapping clusters of lesions are allowed to pass through, effectively eliminating interference from non-disease background features such as leaf shadows and reflections, and ensuring the absolute purification of the source information channel for subsequent calculations.

[0029] Step S3 specifically includes the following sub-steps: Step S31: Construct parallel shared representation branch network and differential representation branch network. Input the pure lesion feature vector into the shared representation branch network and differential representation branch network respectively. Extract the common general representation features shared among multiple diseases and the specific representation features with category specificity. Introduce an orthogonal constraint loss function that forces the general representation feature space and the specific representation feature space to be orthogonal to each other for orthogonal decoupling solution. Step S32: Perform Gaussian probability distribution modeling on the shared characterization features and identification characterization features obtained independently from the walnut sample to be tested, and quantify the shared information entropy and identification information entropy. Step S33: Establish the category overlap matrix, calculate the prior overlap, input the shared information entropy, the discriminative information entropy, the spatial highest matching score and the prior overlap into the multilayer perceptron network, and use the dynamic gating fusion coefficient to perform a weighted summation of the mean vectors of the predicted outputs of the shared representation branch network and the discriminative representation branch network to obtain the joint latent space pathological semantic features.

[0030] Step S31 specifically includes constructing a structurally symmetric shared representation branch network and a discriminative representation branch network, respectively, and performing forward propagation feature extraction and orthogonal decoupling solution: By utilizing the physically symmetrical but internally independent weight parameters of the multilayer perceptron residual architecture, a shared representation branch network and a discriminative representation branch network are constructed. The shared representation branch network and the discriminative representation branch network respectively include an input projection layer, a hidden feature transformation layer and an output mapping layer. The first layer is the input projection layer, which is used to perform linear dimensionality reduction mapping on the pure lesion feature vector; The second layer is the hidden feature transformation layer, which is used for layer normalization and non-linear activation; The third layer is the output mapping layer, which is used to output shared representation features; Among them, through an end-to-end data-driven mechanism, the error backpropagation algorithm and adaptive gradient descent optimization strategy are used to dynamically solve and converge the hierarchical weight matrix and bias vector of the shared representation branch network, the discriminative representation branch network and the attribute mapping network during the model training iteration stage. By using a shared representation branch network and a discriminative representation branch network, general representation features and specific representation features are extracted, respectively. Independent Gaussian parameter solver networks are constructed for general and specific representation features respectively, mapping point features to the mean vector and log-variance vector of Gaussian probability distributions; During the backpropagation solution phase of the network, the partial derivative gradients of the orthogonal constraint loss function with respect to the weight parameters of the shared representation branch network and the discriminative representation branch network are calculated. The adaptive moment estimation optimizer is used to iteratively update the network weight parameters based on the calculated partial derivative gradients, thereby forcibly guiding the shared representation branch network and the discriminative representation branch network to be as orthogonally separated as possible in the feature space, thus achieving decoupling constraints.

[0031] The pure lesion feature vector is input into the shared representation branch network, and a forward propagation solution process is performed to extract the shared representation features, specifically including: The mathematical expression for linear dimensionality reduction mapping of the pure lesion feature vector through the input projection layer is as follows: ; in, To share the first layer hidden feature vector of the representation branch network, To share the weight matrix of the input projection layer of the branch network, The bias vector of the input projection layer is used to represent the branch network. The pure lesion feature vector is generated after filtering the i-th local feature vector of the input; The hidden feature transformation layer performs layer normalization and nonlinear activation operations, the mathematical expression of which is: ; in, To share the hidden feature vectors of the second layer of the representation branch network, This is a layer normalization function used to standardize the scale of feature distribution. It is a linear rectified activation function used to introduce nonlinear expressive power; The mathematical expression for the shared representation features output by the output mapping layer is as follows: ; in, To extract the obtained shared representation features, and These are the weight matrix and bias vector of the output mapping layer of the shared representation branch network, respectively.

[0032] Similarly, the pure lesion feature vector is simultaneously input into the differential characterization branch network, and the forward propagation solution process is performed to extract differential characterization features, specifically including: ; ; ; in, and These are the first and second hidden feature vectors of the discrimination representation branch network, respectively. and To identify the weight matrix and bias vector of the input projection layer of the branch network, and To identify the weight matrix and bias vector of the output mapping layer of the characterizing branch network, The extracted identification features are used to identify the characteristics.

[0033] The common representational features refer to the basic pathological visual appearances shared across various walnut tree diseases and pests. These include the necrotic distribution of local tissue structures in leaf areas across different disease types, as well as the accompanying abnormal color dark spots and fading trends. Specifically, the necrotic distribution of local tissue structures in leaf areas across different disease types refers to the rupture of mesophyll cells and necrosis of tissue structures after pathogens or pests infect walnut leaves. In the image feature space, this manifests as continuous areas of texture breakage and structural collapse. The accompanying abnormal color dark spots and fading trends refer to the pigment deposition and chlorosis in damaged leaf areas caused by chlorophyll destruction. On the multi-channel semantic feature map, this is mapped as a gradient matrix of color differences from normal green to brown, black, or yellow. The shared representation branch network extracts these basic pathological visual appearances to establish a benchmark pathological feature space that distinguishes healthy leaf tissue from diseased leaf tissue.

[0034] Specific characterization features refer to unique pathological visual representations that appear only in specific types of walnut tree diseases and pests and can serve as unique identifiers for fine-grained classification. These include the physical closed-loop structure of the outward distribution of unique concentric rings from the disease and pest infestation center, which can be used to specifically distinguish the categories, and the depth information of the depressions in various specific physiological erosion tissues. Specifically, the physical closed-loop structure of the outward distribution of unique concentric rings from the disease and pest infestation center refers to the alternating concentric ring-shaped closed-loop texture radiating outward from the initial infection point during the infection spread of a specific disease. The identification characterization branch network identifies the disease type by capturing the topological edges and curvature changes of this closed-loop texture. The depth information of the depressions in various specific physiological erosion tissues refers to the local three-dimensional physical deformation caused by the different degrees of erosion of the leaf epidermis by different diseases. The identification characterization branch network extracts the shadow pixel gradient and three-dimensional changes in light intensity in local areas of the image to quantify the characteristic values ​​of the depression depth and edge steepness of the lesion area relative to the healthy leaf surface. The identification and characterization branch network extracts the aforementioned specific pathological visual representations to establish an independent feature space for accurately classifying disease categories.

[0035] After acquiring the shared and discriminative representation features, independent Gaussian parameter solver networks are constructed to map the point features to the mean vector and log-variance vector of a Gaussian probability distribution. The mathematical expression for this is: ; ; ; ; in, and These are the Gaussian mean vector and the logarithmic variance vector output from the shared representation branch network, respectively. and To solve for the mapping matrix of the head network to represent the Gaussian parameters of the branch network, and These are the Gaussian mean vector and the logarithmic variance vector, respectively, output from the solution of the discrimination branch network. and To identify the mapping matrix of the Gaussian parameter solver of the branch network, logarithmic variance is used to ensure the non-negativity of the variance value and the stability of numerical calculation during the backpropagation of the network.

[0036] To achieve complete decoupling of shared representation features and discriminative representation features in the latent space, an orthogonal constraint solution process is constructed, which includes: Within a single training batch, the shared and discriminative representation features corresponding to the B samples in that batch are collected and concatenated row-wise to construct a batch feature matrix. The batch feature matrix includes a shared feature matrix and a discriminative feature matrix, and its mathematical expression is: ; ; in, For dimension size Shared feature matrix, For dimension size The discriminant feature matrix is ​​given by B, where B is the total number of samples in a single training batch, and D is the total number of embedding dimensions of the feature vectors. To extract shared representational features from the output, To extract the discriminative features of the output, This represents a matrix construction operation that stacks multiple column vectors by rows and then transposes them. Calculate the inner product of the shared feature matrix and the discriminant feature matrix along the feature dimension, and extract their Frobenius norm as the orthogonal constraint loss function. Its mathematical expression is: ; in, For orthogonal constraint loss function, The calculated dimension size is The characteristic covariance cross matrix, The square operation of the Frobenius norm of a matrix is ​​to extract each data element of the matrix by square, and then sum them up. During the backpropagation solution phase of the network, the partial derivative gradients of the orthogonal constraint loss function with respect to the weight parameters of the shared representation branch network and the weight parameters of the discriminative representation branch network are calculated. The mathematical expression for this is: ; ; in, For the orthogonal constraint loss function, the weight parameter set of the shared representation branch network is... The gradient matrix, The orthogonal constraint loss function represents the set of weight parameters of the discriminative branch network. The gradient matrix; Shared representation branch network weight parameter set The concatenated vector is a one-dimensional vector formed by expanding all weight matrices and bias vectors in the shared representation branch network; Distinguishing the set of weight parameters for the branch network To identify the concatenated vector formed after expanding all weight matrices and bias vectors in the branch network into one-dimensional vectors; In this embodiment, the semantic collapse of the non-technical terminology described herein is interpreted as follows: In the extraction of similar morphological environment information at the spatial architecture level of a multi-channel deep learning model, the latent feature output indicators obtained by different independent networks tend to assimilate and aggregate, becoming similar to each other and losing the ability to separate information and the ability to independently represent classification, resulting in a degraded state of internal system computation.

[0037] It should be noted that, to overcome the ill-conditioned interference of various feature semantic collapse systems inevitably caused by the overlapping and correlation of features extracted by the shared representation branch network and the side branch identification representation branch network in eliminating common channels, this method embeds two sets of spatial matrices of output that are forced to be extracted by the dual branches in the entire process of gradient model optimization iteration. These matrices are then subjected to algebraic vector mapping, and the orthogonal constraint loss function formula is derived by deducing the inner product towards zero to decouple and isolate them. During the end-to-end convergence training and evolution process, the total gradient function is minimized and continuously reduced to lower its numerical value. This ensures that the inner product between the two bidirectional bottom-level logical semantic diagnostic feature expression spatial matrices generated in this layer is strictly decoupled towards zero, and that the constraints of complete and thorough mutual isolation and independence are maintained, along with boundary decoupling, unbinding, and isolation control specifications.

[0038] Step S32 specifically includes: By using a fully connected regression network layer, mean and variance predictions are performed on shared representation features and discriminative representation features respectively, upgrading the deterministic point vector features into a Gaussian probability distribution with random attributes, and obtaining the shared probability distribution function of the pure lesion feature vector on the shared representation branch network and the discriminative probability distribution function of the pure lesion feature vector on the discriminative representation branch network. The feature information entropy values ​​of the shared representation branch network and the discriminative representation branch network for the semantic expression of the current input feature are calculated separately. The current input feature is a variance vector. The output is the shared information entropy used to describe the uncertainty of the shared representation branch network and the discriminative information entropy used to describe the uncertainty of the discriminative representation branch network.

[0039] In this embodiment, the deterministic point features originally confined to Euclidean space are transformed into a Gaussian probability density distribution model through this prediction calculation. This transformed Gaussian probability distribution model not only includes the central location of the features but also quantifies the random fluctuation range and uncertainty of the features through variance. The mathematical expressions for predicting the mean and variance of shared and discriminative features are as follows: ; ; in, Let be the shared probability distribution function of the pure lesion feature vector on the shared representation branch network. The probability density function is a multidimensional Gaussian distribution. To share the mean vector of the predicted output of the branch network, To share the variance vector of the predicted output of the branch network, The operator for converting a vector into a diagonal covariance matrix. Let be the discrimination probability distribution function of the pure lesion feature vector on the discrimination characterization branch network. and These are the mean vector and variance vector of the predicted output of the discrimination branch network, respectively. These are the independent variables of the latent space feature variables; The feature information entropy values ​​of the shared representation branch network and the discriminative representation branch network for the semantic representation of the current input features are calculated separately, and their mathematical expressions are as follows: ; ; in, To describe the degree of uncertainty in a shared information entropy, The discriminative information entropy describes the degree of uncertainty in the discriminative branch network, where D is the total number of embedding dimensions of the feature vectors. The component value of the variance vector of the shared representation branch network in the d-th dimension is the component value truncated from the d-th feature dimension in the set of variance vectors predicted by the shared representation branch network. To identify the component values ​​of the variance vector of the characterizing branch network in the d-th dimension, we need to identify the statistical real values ​​extracted by the characterizing branch network in the d-th dimension of the corresponding predicted variance vector set.

[0040] Step S33 specifically includes: A matrix consisting of the misclassification and confusion ratios between pairs of various diseases is established, defined as the category overlap matrix. Based on the highest spatial matching score calculated from the current local feature vector, the confusion difficulty of the current sample's category is queried and defined as the prior overlap. The shared information entropy, discriminative information entropy, spatial highest matching score, and prior overlap are input into a multilayer perceptron network. The activation function is used to output dynamic gating fusion coefficients. The mean vectors of the predicted outputs of the shared representation branch network and the discriminative representation branch network are weighted and summed using the dynamic gating fusion coefficients to obtain the joint latent space pathological semantic features.

[0041] The mean vector output by the shared representation branch network and the mean vector output by the discriminative representation branch network have the same vector dimension. The mean vector is used to represent the class center feature, and the variance vector is used to characterize the feature uncertainty. Together, they participate in the calculation of the dynamic gating fusion coefficient.

[0042] Based on the statistical results of the validation set, the probability of pairwise misclassification of various walnut tree diseases during the identification process was calculated, such as the cross-misclassification rate between anthracnose and brown spot. These misclassification probabilities were then entered into a... In the square matrix, K represents the total number of walnut tree diseases. A category overlap matrix is ​​constructed. The larger the value of the element in this matrix, the more similar the two diseases are in terms of visual features and the easier it is to confuse them.

[0043] For the currently processed local feature vector, extract its highest spatial matching score calculated during the spatial filtering stage. The system then retrieves the disease category index corresponding to the highest score, performs a table lookup in the category overlap matrix based on this index, and obtains the comprehensive probability assessment value of confusion between this category and all other categories, defining it as the prior overlap. Prior overlap As a priori guiding value, it directly tells the network "whether the current lesion belongs to a category that was historically easily confused with other diseases".

[0044] Shared information entropy Identify information entropy Highest matching score in space and prior overlap Vertical concatenation is performed along the vector dimension to form a one-dimensional state vector. The state vector is input into a multilayer perceptron network (MLP), where the multidimensional state features are reduced to a single real number output through internal linear matrix transformations and nonlinear activations. The single real number output from the multilayer perceptron network (MLP) is fed into the sigmoid activation function, forcing the input to be compressed and mapped to the open interval (0, 1). The output value is then the dynamic gating fusion coefficient. Dynamic gating fusion coefficient This is equivalent to a dynamically allocated percentage weight, a dynamic gating fusion coefficient. The mathematical expression is: ; Using dynamic gating fusion coefficient The Gaussian mean vector predicted by the shared representation branch network And the Gaussian mean vector predicted by the discrimination branch network The mathematical expression for performing a weighted summation is: ; in, These are the joint latent space pathological semantic features generated after bi-branch adaptive fusion.

[0045] It should be noted that the fusion logic of the weighted summation in this step is as follows: if the system determines that the semantic overlap of the current disease is high and the identification features are unreliable (i.e., and (Larger), the network will automatically adjust the speed. The value of makes the fused features It relies more on shared representation features to prevent semantic collapse caused by forcibly extracting specific features; Conversely, if the disease characteristics are clear and not easily confused, the network will be lowered. The value of makes the fused features rely more on the discriminative representation features, thereby achieving high-precision fine-grained classification. The final output This refers to the combined latent spatial pathological semantic features that take into account both commonalities and specificities.

[0046] This dynamic balance allocation mechanism effectively prevents the problems of category semantic fusion and feature collapse caused by the similarity of visual features of diseases in natural scenes with multiple coexisting diseases.

[0047] Step S4 includes the following specific steps: An attribute mapping network is constructed to map the joint latent space pathological semantic features to the explicit physical attribute feature space, resulting in explicit physical attribute feature vectors. A learnable parameter vector with the same dimension as the explicit physical attribute feature vector is defined. A continuous feature soft mask is generated using a Logistic operation with an annealing temperature control constant. The continuous feature soft mask and the explicit physical attribute feature vector are multiplied element-wise at corresponding positions to obtain the core diagnostic attribute feature vector.

[0048] In this embodiment, an attribute mapping network is constructed to map the joint latent space pathological semantic features to the explicit physical attribute feature space. Its mathematical expression is as follows: ; in, It is an explicit physical property feature vector containing multiple independent attribute values. This refers to attribute mapping network operations; The attribute mapping network is built as a multi-layer fully connected feedforward neural network at its underlying architecture. This architecture abandons the convolutional kernel structure used for extracting local spatial features, instead adopting a topology of globally interconnected nodes. Its physical structure is divided into: an input receiving layer, a hidden feature transformation layer, and an explicit attribute output layer. The core design purpose of this architecture is to act as a decoder / translator, forcibly decoupling and projecting the highly entangled, human-incomprehensible black-box features in the deep learning latent space onto a predefined human-defined white-box attribute coordinate system for agricultural pathology.

[0049] Operations of attribute mapping networks The process specifically includes: Step S401: Input the joint latent space pathological semantic feature vector Mapping matrix with hidden layer weights Perform matrix dot product and add the bias vector. After initial dimensionality reduction and coordinate system rotation in the feature space, the result of the linear operation is input into the linear rectified function ReLU to remove negative responses and retain positive activation signals. Its mathematical expression is: ; in, This is the transitional hidden feature vector output after the hidden layer operation; Hidden feature vectors of the transition state Mapping matrix with output layer weights Perform matrix dot product and add the bias column vector. This forces the feature vector dimensions to be precisely aligned to the preset total number of physical attributes. ; The result of the calculation is input into the Sigmoid activation function for normalization. Its mathematical expression is: ; in, This is the explicit physical property feature vector generated by the final calculation.

[0050] After the matrix multiplication, addition, and activation operations described above, the abstract semantics that originally existed in a distributed form in the latent space are transformed. It was precisely disassembled and filled with In each independent dimension. At this time, Each real component in the vector directly represents the score of the current walnut leaf on a specific physical attribute, for example... The first component value is 0.85, which means that the system determines that the clarity of the concentric rings of the lesion is as high as 85%. Each dimension value in this vector corresponds to a specific agricultural pathology diagnostic indicator. For example, the first dimension represents the roughness of the lesion edge, the second dimension represents the clarity of the central concentric rings, and the third dimension represents the depth of tissue depression.

[0051] In the network architecture, a learnable parameter vector with the exact same dimensions as the explicit physical attribute feature vector is defined during initialization. This vector does not depend on the features of a single input image but serves as a benchmark for evaluating the global importance of attributes. It is continuously updated and iterated through the backpropagation algorithm as the entire network is trained, and its internal value represents the system's original bias score regarding whether each physical attribute should be retained.

[0052] To achieve attribute selection and ensure the process is differentiable in the neural network, gradient backpropagation can be performed, introducing a parameter with annealing temperature control. The formula for the Logistic regression analysis is as follows: ; in, For the generated continuous feature soft mask, For learnable parameter vectors, For annealing temperature control parameters; Annealing temperature The control logic is as follows: In the early stages of training, Setting it to a larger value allows the continuous feature soft mask to enable all attribute features to participate in network training in a smooth state. As the number of training iterations increases, As the temperature gradually decreases towards zero according to the preset decay rate, the output of the formula will become polarized. The values ​​in the binary representation are forcibly pushed toward absolute 0 or 1, thus simulating a black-and-white discrete binary selection effect.

[0053] Perform element-wise multiplication of the continuous feature soft mask with the explicit physical attribute feature vector at corresponding positions; If the value of the continuous feature soft mask approaches 0 in a certain dimension, it means that the system considers that the physical attribute does not contribute to the final disease classification and belongs to redundant information. Therefore, after multiplication... The attribute values ​​of the corresponding dimension will be directly cleared to zero and erased. If the value of the continuous feature soft mask approaches 1, the core diagnostic attribute will be completely preserved.

[0054] After the above element-by-element multiplication filtering operation, the output vector is the core diagnostic attribute feature vector that has eliminated invalid and redundant dimensions and retained only the most critical pathological diagnostic basis. This vector is then sent to the final classifier for disease determination.

[0055] Step S4 also includes: Based on the continuous feature soft mask, a norm penalty term is defined to achieve attribute removal; The core diagnostic attribute feature vector is input into a fully connected classification diagnostic function, which outputs the predicted probability distribution for each type of disease. Its mathematical expression is as follows: ; in, This is a column vector containing the final predicted probability distribution for each disease category. and These are the weight mapping matrix and bias constant vector of a fully connected classification and diagnostic network, respectively. Normalized index classification activation function, The core diagnostic attribute feature vector; Extract the disease category corresponding to the position index of the highest probability component value in the predicted probability distribution column vector as the diagnostic judgment output as the final walnut tree disease and pest identification result.

[0056] A norm-1 penalty term is defined to make the continuous feature soft mask tend to be sparse while preserving high precision, thus achieving attribute removal. Its mathematical expression is: ; in, For a norm-based penalty term, A norm extraction function for extracting the absolute values ​​of all independent element components in a vector and summing them; The use of differentiable continuous feature soft masks enables the entire attribute reduction process to support backpropagation and end-to-end optimization.

[0057] During the training iteration phase, a multi-objective joint optimization control strategy is adopted. The mathematical expression for the overall loss function of the architecture is as follows: ; in, The total loss function is a scalar for multi-objective joint optimization. Let cross-entropy be the classification loss function. For orthogonal constraint loss function, For a norm-based penalty term, and This is a constant for the balancing weight hyperparameters.

[0058] In this embodiment, all weight matrices, mapping matrices, weight mapping matrices, and bias vectors in this application are used as core learnable parameters within the deep neural network. Through an end-to-end data-driven mechanism, using the error backpropagation algorithm and adaptive gradient descent optimization strategy, they are dynamically solved and converged during the model training iteration phase. The specific steps of the solution process include: Step S411: At the initial starting point of network model training, using a normal distribution that follows a specific variance scaling rule, all weight matrices in the shared representation branch network, the discriminative representation branch network, and the attribute mapping network constructed in step S4 are initialized using the Kaiming initialization algorithm to ensure that the variance of the activation values ​​of each layer remains consistent during forward propagation, preventing gradient vanishing or gradient explosion. At the same time, all bias vectors are initialized to positive constant vectors with extremely small values. Step S412: Perform forward propagation and construct a global joint loss function. Input batches of walnut leaf images with true disease category labels, and sequentially perform forward matrix multiplication and addition operations according to the aforementioned network architecture, outputting a column vector of predicted probability distributions. Combining the cross-entropy classification loss, orthogonality constraint loss, and L1 penalty term, calculate the scalar of the total loss function for the current training batch, whose mathematical expression is: ; in, The total loss function is a scalar for multi-objective joint optimization. Let cross-entropy be the classification loss function. For orthogonal constraint loss function, For a norm-based penalty term, and To balance the weight hyperparameter constants; The cross-entropy classification loss function is the dominant objective of the entire network for disease identification. It measures the difference between the predicted probability distribution output by the model and the manually labeled real disease tags. At the end of each forward propagation, the system compares the predicted results with the actual results. Its mathematical expression is: ; Where K represents the total number of categories of walnut tree diseases. Let be the probability value that the i-th sample predicted by the network belongs to the c-th disease, i.e. Components in a vector This is the true one-hot encoded label for the sample. If the true class is c, this term is 1; otherwise, it is 0. The smaller the value of this loss function, the more accurate the network's classification prediction.

[0059] The orthogonal constraint loss function is a penalty term artificially introduced to address semantic collapse, derived from the shared feature matrix in step S32. With the discriminant feature matrix The inner product calculation, i.e. Its function is to force the network to ensure that shared features and discriminative features remain perpendicular and orthogonal in multidimensional space and do not interfere with each other when extracting features.

[0060] This is a norm-1 penalty term, a sparsity constraint introduced to achieve attribute reduction. It originates from calculating the norm of the continuous feature soft mask vector m in step S4, i.e. Its function is to continuously compress the values ​​of each item in the mask vector m during the training process, forcing the mask values ​​corresponding to redundant attributes that do not contribute much to the classification to approach zero, thereby achieving physical feature dimension removal.

[0061] This is used to adjust the decoupling strength. If it is set too high, the network may only focus on orthogonality and forget about classification. The weighting used to adjust the severity of attribute removal can lead to excessive sparsity of key diagnostic attributes and information loss if the balancing weights are set too high. In practical engineering, a separate validation set is defined, and multiple different sets are tested using a Bayesian optimization algorithm. and The combinations are then used to select the set of values ​​that yields the highest accuracy in the validation set.

[0062] Step S413: Solve for the partial derivative gradient matrix using the chain rule of calculus, and then use the error backpropagation algorithm to obtain the total loss function scalar. Starting from the first point, the algorithm reverses its direction through each computational layer of the network, calculating the partial derivatives of the total loss function with respect to each independent weight matrix and bias vector layer by layer, generating the corresponding weight gradient matrix and bias gradient vector. The mathematical expression for this is: ; ; in, Generally refers to any weight matrix in a network that needs to be solved. Generally refers to any bias vector in the network that needs to be solved. The weight gradient matrix is ​​the product of the total loss function and the weight matrix. The bias gradient vector is the result of differentiating the total loss function with respect to the bias vector.

[0063] Step S414: Based on the Adam adaptive moment estimation optimization algorithm, parameter update is performed. Using the calculated weight gradient matrix and bias gradient vector, combined with the first-order exponential moving average momentum, second-order exponential moving average momentum, and basic learning rate constant set by the system, algebraic iterative updates are performed on the weight matrix and bias vector. ; ; Where t is the index of the current iteration step. and These are the weight matrices before and after the update, respectively. and These are the bias vectors before and after the update, respectively. The base learning rate constant is used to control the step size of the parameter update. and These are the first-order exponential moving average momentum of the gradient, respectively. and These are the second-order exponential moving average momentum of the gradient, respectively. To prevent extremely small constant factors with a denominator of zero.

[0064] Step S415: Divide the training dataset containing images of walnut tree diseases and pests into several batches, and repeat steps S412 to S414 above. As the number of iterations t increases, the total loss function scalar... The parameters gradually decrease and converge to the global minimum or local optimum. When the scalar of the total loss function no longer decreases significantly over multiple consecutive iterations, the network training is considered converged, and parameter updates are stopped. The weight matrix and bias vector that are currently stored internally within the network are the optimal network parameters obtained from the final solution. These parameters are then directly frozen and applied to the actual walnut disease and pest inference and identification stage.

[0065] Basic learning rate constant This represents the maximum baseline step size that the weight parameters can take in each iteration of the network. It also includes the baseline learning rate constant and the balancing weight hyperparameter constants. and The method for obtaining them is the same.

[0066] First-order exponential moving average momentum This represents the inertia and velocity during gradient descent. In the complex high-dimensional space of deep learning, the gradient direction calculated in a single step contains a large amount of random noise, and directly updating along the single gradient direction can lead to a tortuous optimization path. First-order momentum smooths the gradient oscillation trajectory by weightedly fusing the true gradient of the current step with the cumulative gradient of previous steps, allowing the network to escape local minima traps by relying on historical inertia. Its iterative calculation formula is: ; in, Let be the first-order exponential moving average momentum matrix calculated in the current t-th iteration step. This is the first-order momentum matrix left over from the previous iteration, i.e., the (t-1)th iteration. In the initial step 0, this matrix is ​​strictly initialized to a matrix of all zeros. This is the true weight gradient matrix calculated based on the actual derivative of the total loss function in the current t-th iteration step. It is a first-order decay rate constant, whose value is strictly limited to the open interval between 0 and 1, and is used to control the proportion of historical inertia.

[0067] Second-order exponential moving average momentum This represents the uncentered variance and energy of the historical gradient. Its core function is to provide an adaptive step size scaling for each independent parameter in the network. For parameters that frequently exhibit large gradient values ​​in historical iterations, the second-order momentum accumulates to a very large value, which suppresses the update magnitude in subsequent updates. For parameters that are rarely updated and have weak gradient values, the second-order momentum is very small, which amplifies the update magnitude in subsequent updates, thus effectively capturing sparse features. Its iterative calculation formula is: ; in, Let be the second-order exponential moving average momentum matrix calculated in the current t-th iteration step. The second-order momentum matrix remaining from the (t-1)th iteration step is also strictly initialized to an all-zero matrix in the initial step 0. This indicates that the Hadamard operation is performed on the current true weight gradient matrix, that is, each independent element in the matrix is ​​multiplied by itself. It is the second-order decay rate constant, whose value is strictly limited to the open interval between 0 and 1, and it approaches 1 infinitely.

[0068] Since both first-order and second-order momentum are initially set to all-zero matrices, the calculated momentum values ​​will be severely biased towards zero in the first few iterations of training. To eliminate this systematic error, the adaptive moment estimation optimization algorithm must perform a bias correction calculation on the two momentum matrices before performing the final parameter update. The mathematical expression is as follows: ; ; in, This is the unbiased first-order momentum matrix after bias correction. This is the unbiased second-order momentum matrix after bias correction. and These represent the exponentiation of the first-order decay rate constant and the second-order decay rate constant to the power of t, respectively.

[0069] After completing the deviation correction, the system will have an unbiased first-order momentum matrix. With unbiased second-order momentum matrix Substituting these values ​​into the aforementioned parameter update algebraic iteration formula, and combining them with the basic learning rate constant... Complete the weight matrix The single-step exact evolution solution.

[0070] Similarly, all weight matrices, mapping matrices, weight mapping matrices, and bias vectors in this method can be calculated.

[0071] First, this invention uses a spatial filtering module to spatially filter and restrict the input feature map using the characteristics of the disease prototype. This effectively blocks and discards interference information such as natural background reflections, tree shadows, and normal leaf vein tissue, so that all features extracted by the subsequent network are focused on pure pathological micro signals.

[0072] Secondly, this invention proposes a decoupled identification mechanism for dual-branch probabilistic feature encoding, which combines sharing and identification in multiple directions. It utilizes orthogonal constraint equations designed for the deep tensor matrix to forcibly and thoroughly decouple the common dimensions of similar diseases from the specific indicators unique to each disease. Simultaneously, it innovatively transforms the previously rigid fixed-point feature model into a modeling form containing a Gaussian probability distribution fluctuation domain, achieving deep uncertainty quantification. This enables the decision network not only to know the specific fixed output values ​​of extracted features but also to accurately express the evaluation reference of the confidence probability fluctuations of each set of features.

[0073] Furthermore, this invention pioneered the deployment of an uncertainty dynamic perception gating fusion analysis engine, abandoning fixed model parameters and manual weights. It dynamically combines the system's macroscopic category overlap priors and the local entropy of pest and disease feature information to adaptively fuse and assign feature weights, perfectly overcoming the stubborn bottleneck problem of blinding category semantic fusion collapse caused by the highly similar and overlapping visual features of anthrax and brown spot disease in multi-occurring natural scenarios.

[0074] Finally, this invention innovatively utilizes a network with attribute mapping channel functionality to cleverly transform deep, unobservable, black-box latent features directly into feature vectors containing explicit diagnostic-guided attributes. Combined with the Gumbel-Softmax flexible mask principle and other continuous attribute differentiable reduction mechanisms, it achieves end-to-end continuous dimensionality reduction. While ensuring robust iterative support for unbroken forward propagation and backward penalty gradient transmission within the deep learning computing architecture, it significantly removes meaningless network neuron branches and highly redundant parameter data items from the model's massive diagnostic dimensions, thus outputting a lightweight and highly interpretable diagnostic output with readily identifiable rules. This constructs a novel paradigm for the evolution of recognition systems, transitioning from deep nonlinear representation learning to shallow rule-based explicit attribute extraction and discrimination. It establishes top-tier analytical theoretical, academic, and engineering research value while possessing robust deployment capabilities and accurate detection in highly practical industrial scenarios.

[0075] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product implemented on one or more computer-usable storage media containing computer-usable program code. The storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Red-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0076] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the protection scope of the present invention. All data acquisition actions in this application are carried out in compliance with the relevant data protection laws and policies of the country where the application is located and with the authorization granted by the owner of the corresponding device.

Claims

1. A method for identifying walnut tree diseases and pests based on image recognition target detection technology, characterized in that, Includes the following steps: Step S1: Obtain the original multi-exposure image sequence containing walnut leaf fragments, perform adaptive image enhancement processing and depth feature extraction and slicing processing, and generate a set of candidate lesion feature units; Step S2: Calculate the prototype similarity between the candidate lesion feature unit set and the prototype feature vector in the disease prototype library, take the highest score value and normalize it, and then perform spatial filtering to extract the pure lesion feature set after removing background noise. Step S3: Input the pure lesion feature set into the pre-constructed shared representation branch network and the identification representation branch network respectively, perform forward propagation feature extraction and orthogonal decoupling solution, model the shared representation features and identification representation features obtained independently from the walnut sample to be tested using Gaussian probability distribution, and calculate the dynamic gating fusion coefficient based on feature information entropy and category overlap prior quantization, and output the joint latent space pathological semantic features based on the dynamic gating fusion coefficient. Step S4 involves transforming the joint latent space pathological semantic features into explicit physical attribute features, filtering out redundant attribute dimensions using learnable feature masks, and then inputting the results into a fully connected classification network to calculate the disease diagnosis category, outputting the final walnut tree disease and pest identification results.

2. The method for identifying walnut tree diseases and pests based on image recognition target detection technology as described in claim 1, characterized in that: Step S1 specifically includes: The original multi-exposure image sequence of walnut leaves is obtained. First, the original multi-exposure image sequence is subjected to exposure fusion, and then illumination adjustment and noise filtering are performed to obtain an enhanced and clean image. The enhanced and clean image is input into a convolutional neural network for feature extraction to obtain a multi-channel semantic feature map. The multi-channel semantic feature map is then sliced ​​into a grid in the spatial dimension. The feature map channel data corresponding to each grid region is unfolded into an independent one-dimensional vector to form a local feature vector. The local feature vectors corresponding to all grid regions are combined to form a set of candidate lesion feature units.

3. The method for identifying walnut tree diseases and pests based on image recognition target detection technology as described in claim 2, characterized in that: Step S2 specifically includes: By extracting typical lesion features of various diseases of walnut trees from big data as anchor points, a disease prototype library is constructed. The cosine similarity values ​​between each local feature vector in the candidate lesion feature unit set and the prototype feature vector of each disease are calculated, and the cosine similarity values ​​are used as the prototype similarity. Extract the highest score among all prototype similarities corresponding to the i-th local feature vector, and use it as the highest spatial matching score corresponding to the i-th local feature vector; The lesion confidence weight is obtained by globally normalizing the highest spatial matching score of all local feature vectors using the normalization exponential function; The confidence weight of the lesion is used as a scaling factor to multiply the corresponding local feature vector to obtain the pure lesion feature vector. All pure lesion feature vectors are combined to form a pure lesion feature set.

4. The method for identifying walnut tree diseases and pests based on image recognition target detection technology as described in claim 3, characterized in that: Step S3 specifically includes the following sub-steps: Step S31: Construct parallel shared representation branch network and differential representation branch network. Input the pure lesion feature vector into the shared representation branch network and differential representation branch network respectively. Extract the common general representation features shared among multiple diseases and the specific representation features with category specificity. Introduce an orthogonal constraint loss function that forces the general representation feature space and the specific representation feature space to be orthogonal to each other for orthogonal decoupling solution. Step S32: Perform Gaussian probability distribution modeling on the shared characterization features and identification characterization features obtained independently from the walnut sample to be tested, and quantify the shared information entropy and identification information entropy. Step S33: Establish the category overlap matrix, calculate the prior overlap, input the shared information entropy, the discriminative information entropy, the spatial highest matching score and the prior overlap into the multilayer perceptron network, and use the dynamic gating fusion coefficient to perform a weighted summation of the mean vectors of the predicted outputs of the shared representation branch network and the discriminative representation branch network to obtain the joint latent space pathological semantic features.

5. The method for identifying walnut tree diseases and pests based on image recognition target detection technology as described in claim 4, characterized in that: Step S31 specifically includes constructing a structurally symmetric shared representation branch network and a discriminative representation branch network, respectively, and performing forward propagation feature extraction and orthogonal decoupling solution: Using a multilayer perceptron residual architecture with a completely symmetrical physical structure but independent internal weight parameters, a shared representation branch network and a discriminative representation branch network are constructed. The shared representation branch network and the discriminative representation branch network respectively include an input projection layer, a hidden feature transformation layer and an output mapping layer. Through an end-to-end data-driven mechanism, using the backpropagation algorithm and adaptive gradient descent optimization strategy, the hierarchical weight matrices and bias vectors of the shared representation branch network, the discriminative representation branch network and the attribute mapping network are dynamically solved and converged during the model training iteration phase. By using a shared representation branch network and a discriminative representation branch network, general representation features and specific representation features are extracted respectively. Independent Gaussian parameter solver networks are constructed for general and specific representation features respectively, mapping point features to the mean vector and log-variance vector of Gaussian probability distributions; During the backpropagation solution phase of the network, the partial derivative gradients of the orthogonal constraint loss function with respect to the weight parameters of the shared representation branch network and the discriminative representation branch network are calculated. The adaptive moment estimation optimizer is used to iteratively update the network weight parameters based on the calculated partial derivative gradients, thereby forcibly guiding the shared representation branch network and the discriminative representation branch network to be as orthogonally separated as possible in the feature space, thus achieving decoupling constraints.

6. The method for identifying walnut tree diseases and pests based on image recognition target detection technology as described in claim 5, characterized in that: Step S32 specifically includes: By using a fully connected regression network layer, mean and variance predictions are performed on shared representation features and discriminative representation features respectively, upgrading the deterministic point vector features into a Gaussian probability distribution with random attributes, and obtaining the shared probability distribution function of the pure lesion feature vector on the shared representation branch network and the discriminative probability distribution function of the pure lesion feature vector on the discriminative representation branch network. The feature information entropy values ​​of the shared representation branch network and the discriminative representation branch network for the semantic expression of the current input feature are calculated separately. The current input feature is a variance vector. The output is the shared information entropy used to describe the uncertainty of the shared representation branch network and the discriminative information entropy used to describe the uncertainty of the discriminative representation branch network.

7. The method for identifying walnut tree diseases and pests based on image recognition target detection technology as described in claim 6, characterized in that: Step S33 specifically includes: A matrix consisting of the misclassification and confusion ratios between pairs of various diseases is established, defined as the category overlap matrix. Based on the highest spatial matching score calculated from the current local feature vector, the confusion difficulty of the current sample's category is queried and defined as the prior overlap. The shared information entropy, discriminative information entropy, spatial highest matching score, and prior overlap are input into a multilayer perceptron network. The activation function is used to output dynamic gating fusion coefficients. The mean vectors of the predicted outputs of the shared representation branch network and the discriminative representation branch network are weighted and summed using the dynamic gating fusion coefficients to obtain the joint latent space pathological semantic features.

8. The method for identifying walnut tree diseases and pests based on image recognition target detection technology as described in claim 7, characterized in that: Step S4 includes the following specific steps: An attribute mapping network is constructed to map the joint latent space pathological semantic features to the explicit physical attribute feature space, resulting in explicit physical attribute feature vectors. A learnable parameter vector with the same dimension as the explicit physical attribute feature vector is defined. A continuous feature soft mask is generated using a Logistic operation with an annealing temperature control constant. The continuous feature soft mask and the explicit physical attribute feature vector are multiplied element-wise at corresponding positions to obtain the core diagnostic attribute feature vector.

9. The method for identifying walnut tree diseases and pests based on image recognition target detection technology as described in claim 8, characterized in that: Step S4 also includes: Based on the continuous feature soft mask, a norm penalty term is defined to achieve attribute removal; The core diagnostic attribute feature vector is input into a fully connected classification diagnostic function, which outputs the predicted probability distribution for each type of disease. Extract the disease category corresponding to the position index of the highest probability component value in the predicted probability distribution column vector as the diagnostic judgment output as the final walnut tree disease and pest identification result.

10. The method for identifying walnut tree diseases and pests based on image recognition target detection technology as described in claim 9, characterized in that: During the training iteration phase, a multi-objective joint optimization control strategy is adopted. The mathematical expression for the overall loss function of the architecture is as follows: ; in, The total loss function is a scalar for multi-objective joint optimization. Let cross-entropy be the classification loss function. For orthogonal constraint loss function, For a norm-based penalty term, and This is a constant for the balancing weight hyperparameters.